Understand the StateModelKey type alias
mainThe StateModelKey type represents the specific subset of model keys that the UniFi Protect controller emits realtime deltas for. While many models are reduced into the canonical ProtectState, StateModelKey is restricted to those that the reducer's realtime upsert, patch, or remove paths actually touch.
Key characteristics:
- It is a superset of
DeviceModelKey(includinguserandliveview). - It is a subset of the full
ModelKeyvocabulary. - It includes the devices, the NVR, the user roster, and the liveview collection.
- It excludes models that are only available via bootstrap (e.g.,
ringtones), because the controller does not broadcast realtime packets for them.
type StateModelKey = typeof STATE_MODEL_KEYS[number];