asSceneItemStateEvent method Null safety

  1. @deprecated
SceneItemStateEvent asSceneItemStateEvent()

returns a SceneItemStateEvent object or an Exception if BaseEvent type can't be resolved.

Implementation

@deprecated
SceneItemStateEvent asSceneItemStateEvent() {
  switch (updateType) {
    case 'SceneItemVisibilityChanged':
    case 'SceneItemLockChanged':
      return SceneItemStateEvent.fromJson(rawEvent, updateType);
  }
  throw exception;
}