id
int64
0
843k
repository_name
stringlengths
7
55
file_path
stringlengths
9
332
class_name
stringlengths
3
290
human_written_code
stringlengths
12
4.36M
class_skeleton
stringlengths
19
2.2M
total_program_units
int64
1
9.57k
total_doc_str
int64
0
4.2k
AvgCountLine
float64
0
7.89k
AvgCountLineBlank
float64
0
300
AvgCountLineCode
float64
0
7.89k
AvgCountLineComment
float64
0
7.89k
AvgCyclomatic
float64
0
130
CommentToCodeRatio
float64
0
176
CountClassBase
float64
0
48
CountClassCoupled
float64
0
589
CountClassCoupledModified
float64
0
581
CountClassDerived
float64
0
5.37k
CountDeclInstanceMethod
float64
0
4.2k
CountDeclInstanceVariable
float64
0
299
CountDeclMethod
float64
0
4.2k
CountDeclMethodAll
float64
0
4.2k
CountLine
float64
1
115k
CountLineBlank
float64
0
9.01k
CountLineCode
float64
0
94.4k
CountLineCodeDecl
float64
0
46.1k
CountLineCodeExe
float64
0
91.3k
CountLineComment
float64
0
27k
CountStmt
float64
1
93.2k
CountStmtDecl
float64
0
46.1k
CountStmtExe
float64
0
90.2k
MaxCyclomatic
float64
0
759
MaxInheritanceTree
float64
0
16
MaxNesting
float64
0
34
SumCyclomatic
float64
0
6k
141,648
Kane610/deconz
pydeconz/interfaces/sensors.py
pydeconz.interfaces.sensors.SensorResourceManager
class SensorResourceManager(GroupedAPIHandler[SensorResources]): """Represent deCONZ sensors.""" resource_group = ResourceGroup.SENSOR def __init__(self, gateway: DeconzSession) -> None: """Initialize sensor manager.""" self.air_purifier = AirPurifierHandler(gateway, grouped=True) self.air_quality = AirQualityHandler(gateway, grouped=True) self.alarm = AlarmHandler(gateway, grouped=True) self.ancillary_control = AncillaryControlHandler(gateway, grouped=True) self.battery = BatteryHandler(gateway, grouped=True) self.carbon_dioxide = CarbonDioxideHandler(gateway, grouped=True) self.carbon_monoxide = CarbonMonoxideHandler(gateway, grouped=True) self.consumption = ConsumptionHandler(gateway, grouped=True) self.daylight = DaylightHandler(gateway, grouped=True) self.door_lock = DoorLockHandler(gateway, grouped=True) self.fire = FireHandler(gateway, grouped=True) self.formaldehyde = FormaldehydeHandler(gateway, grouped=True) self.generic_flag = GenericFlagHandler(gateway, grouped=True) self.generic_status = GenericStatusHandler(gateway, grouped=True) self.humidity = HumidityHandler(gateway, grouped=True) self.light_level = LightLevelHandler(gateway, grouped=True) self.open_close = OpenCloseHandler(gateway, grouped=True) self.moisture = MoistureHandler(gateway, grouped=True) self.particulate_matter = ParticulateMatterHandler(gateway, grouped=True) self.power = PowerHandler(gateway, grouped=True) self.presence = PresenceHandler(gateway, grouped=True) self.pressure = PressureHandler(gateway, grouped=True) self.relative_rotary = RelativeRotaryHandler(gateway, grouped=True) self.switch = SwitchHandler(gateway, grouped=True) self.temperature = TemperatureHandler(gateway, grouped=True) self.thermostat = ThermostatHandler(gateway, grouped=True) self.time = TimeHandler(gateway, grouped=True) self.vibration = VibrationHandler(gateway, grouped=True) self.water = WaterHandler(gateway, grouped=True) handlers: list[APIHandler[Any]] = [ self.air_purifier, self.air_quality, self.alarm, self.ancillary_control, self.battery, self.carbon_dioxide, self.carbon_monoxide, self.consumption, self.daylight, self.door_lock, self.fire, self.formaldehyde, self.generic_flag, self.generic_status, self.humidity, self.light_level, self.moisture, self.open_close, self.particulate_matter, self.power, self.presence, self.pressure, self.relative_rotary, self.switch, self.temperature, self.thermostat, self.time, self.vibration, self.water, ] super().__init__(gateway, handlers)
class SensorResourceManager(GroupedAPIHandler[SensorResources]): '''Represent deCONZ sensors.''' def __init__(self, gateway: DeconzSession) -> None: '''Initialize sensor manager.''' pass
2
2
65
2
62
1
1
0.03
1
33
30
0
1
29
1
15
70
4
64
33
62
2
34
33
32
1
2
0
1
141,649
Kane610/deconz
pydeconz/interfaces/sensors.py
pydeconz.interfaces.sensors.WaterHandler
class WaterHandler(APIHandler[Water]): """Handler for water sensor.""" resource_group = ResourceGroup.SENSOR resource_type = ResourceType.ZHA_WATER item_cls = Water
class WaterHandler(APIHandler[Water]): '''Handler for water sensor.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
15
6
1
4
4
3
1
4
4
3
0
2
0
0
141,650
Kane610/deconz
pydeconz/models/alarm_system.py
pydeconz.models.alarm_system.TypedAlarmSystemConfig
class TypedAlarmSystemConfig(TypedDict): """Alarm system config type definition.""" armmode: Literal["armed_away", "armed_night", "armed_stay", "disarmed"] configured: bool disarmed_entry_delay: int disarmed_exit_delay: int armed_away_entry_delay: int armed_away_exit_delay: int armed_away_trigger_duration: int armed_stay_entry_delay: int armed_stay_exit_delay: int armed_stay_trigger_duration: int armed_night_entry_delay: int armed_night_exit_delay: int armed_night_trigger_duration: int
class TypedAlarmSystemConfig(TypedDict): '''Alarm system config type definition.'''
1
1
0
0
0
0
0
0.07
1
0
0
0
0
0
0
0
16
1
14
1
13
1
14
1
13
0
1
0
0
141,651
Kane610/deconz
pydeconz/models/alarm_system.py
pydeconz.models.alarm_system.TypedAlarmSystemDevices
class TypedAlarmSystemDevices(TypedDict): """Alarm system device type definition.""" armmask: str trigger: str
class TypedAlarmSystemDevices(TypedDict): '''Alarm system device type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,652
Kane610/deconz
pydeconz/models/alarm_system.py
pydeconz.models.alarm_system.TypedAlarmSystemState
class TypedAlarmSystemState(TypedDict): """Alarm system state type definition.""" armstate: Literal[ "armed_away", "armed_night", "armed_stay", "arming_away", "arming_night", "arming_stay", "disarmed", "entry_delay", "exit_delay", "in_alarm", ] seconds_remaining: int
class TypedAlarmSystemState(TypedDict): '''Alarm system state type definition.'''
1
1
0
0
0
0
0
0.07
1
0
0
0
0
0
0
0
16
1
14
1
13
1
3
1
2
0
1
0
0
141,653
Kane610/deconz
pydeconz/models/light/cover.py
pydeconz.models.light.cover.TypedCoverState
class TypedCoverState(TypedDict): """Cover state type definition.""" bri: int lift: NotRequired[int] open: NotRequired[bool] sat: NotRequired[int] tilt: NotRequired[int]
class TypedCoverState(TypedDict): '''Cover state type definition.'''
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,654
Kane610/deconz
pydeconz/models/light/cover.py
pydeconz.models.light.cover.TypedCover
class TypedCover(TypedDict): """Cover type definition.""" state: TypedCoverState
class TypedCover(TypedDict): '''Cover type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,655
Kane610/deconz
pydeconz/models/light/cover.py
pydeconz.models.light.cover.CoverAction
class CoverAction(enum.StrEnum): """Possible cover actions.""" CLOSE = enum.auto() OPEN = enum.auto() STOP = enum.auto()
class CoverAction(enum.StrEnum): '''Possible cover actions.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
68
6
1
4
4
3
1
4
4
3
0
3
0
0
141,656
Kane610/deconz
pydeconz/models/light/cover.py
pydeconz.models.light.cover.Cover
class Cover(LightBase): """Cover and Damper class.""" raw: TypedCover @property def is_open(self) -> bool: """Is cover open.""" if "open" not in self.raw["state"]: # Legacy support return self.state is False return self.raw["state"]["open"] @property def lift(self) -> int: """Amount of closed position. Supported values: 0-100 - 0 is open / 100 is closed """ if "lift" not in self.raw["state"]: # Legacy support return int(self.raw["state"]["bri"] / 2.54) return self.raw["state"]["lift"] @property def tilt(self) -> int | None: """Amount of tilt. Supported values: 0-100 - 0 is open / 100 is closed """ if "tilt" in self.raw["state"]: return self.raw["state"]["tilt"] elif "sat" in self.raw["state"]: # Legacy support return int(self.raw["state"]["sat"] / 2.54) return None @property def supports_tilt(self) -> bool: """Supports tilt.""" return "tilt" in self.raw["state"]
class Cover(LightBase): '''Cover and Damper class.''' @property def is_open(self) -> bool: '''Is cover open.''' pass @property def lift(self) -> int: '''Amount of closed position. Supported values: 0-100 - 0 is open / 100 is closed ''' pass @property def tilt(self) -> int | None: '''Amount of tilt. Supported values: 0-100 - 0 is open / 100 is closed ''' pass @property def supports_tilt(self) -> bool: '''Supports tilt.''' pass
9
5
7
1
4
3
2
0.64
1
2
0
0
4
0
4
19
40
7
22
9
13
14
17
5
12
3
3
1
8
141,657
Kane610/deconz
pydeconz/models/light/configuration_tool.py
pydeconz.models.light.configuration_tool.ConfigurationTool
class ConfigurationTool(LightBase): """deCONZ hardware antenna."""
class ConfigurationTool(LightBase): '''deCONZ hardware antenna.''' pass
1
1
0
0
0
0
0
1
1
0
0
0
0
0
0
15
2
0
1
1
0
1
1
1
0
0
3
0
0
141,658
Kane610/deconz
pydeconz/models/light/__init__.py
pydeconz.models.light.LightBase
class LightBase(DeconzDevice): """deCONZ light representation. Dresden Elektroniks documentation of lights in deCONZ http://dresden-elektronik.github.io/deconz-rest-doc/lights/ """ resource_group = ResourceGroup.LIGHT @property def state(self) -> bool | None: """Device state.""" raw: dict[str, bool] = self.raw["state"] return raw.get("on") @property def reachable(self) -> bool: """Is light reachable.""" raw: dict[str, bool] = self.raw["state"] return raw["reachable"]
class LightBase(DeconzDevice): '''deCONZ light representation. Dresden Elektroniks documentation of lights in deCONZ http://dresden-elektronik.github.io/deconz-rest-doc/lights/ ''' @property def state(self) -> bool | None: '''Device state.''' pass @property def reachable(self) -> bool: '''Is light reachable.''' pass
5
3
4
0
3
1
1
0.6
1
3
0
6
2
0
2
15
20
4
10
8
5
6
8
6
5
1
2
0
2
141,659
Kane610/deconz
pydeconz/models/group.py
pydeconz.models.group.TypedGroupState
class TypedGroupState(TypedDict): """Group state type definition.""" all_on: bool any_on: bool
class TypedGroupState(TypedDict): '''Group state type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,660
Kane610/deconz
pydeconz/models/group.py
pydeconz.models.group.TypedGroupAction
class TypedGroupAction(TypedDict): """Group action type definition.""" bri: int colormode: NotRequired[Literal["ct", "hs", "xy"]] ct: int effect: NotRequired[Literal["colorloop", "none"]] hue: int on: bool sat: int xy: tuple[float, float]
class TypedGroupAction(TypedDict): '''Group action type definition.'''
1
1
0
0
0
0
0
0.11
1
0
0
0
0
0
0
0
11
1
9
1
8
1
9
1
8
0
1
0
0
141,661
Kane610/deconz
pydeconz/models/group.py
pydeconz.models.group.TypedGroup
class TypedGroup(TypedDict): """Group type definition.""" action: TypedGroupAction devicemembership: list[str] hidden: bool id: str lights: list[str] lightsequence: list[str] multideviceids: list[str] name: str scenes: list[TypedScene] state: TypedGroupState type: str
class TypedGroup(TypedDict): '''Group type definition.'''
1
1
0
0
0
0
0
0.08
1
0
0
0
0
0
0
0
14
1
12
1
11
1
12
1
11
0
1
0
0
141,662
Kane610/deconz
pydeconz/models/group.py
pydeconz.models.group.Group
class Group(DeconzDevice): """deCONZ light group representation. Dresden Elektroniks documentation of light groups in deCONZ http://dresden-elektronik.github.io/deconz-rest-doc/groups/ """ raw: TypedGroup resource_group = ResourceGroup.GROUP @property def state(self) -> bool | None: """Is any light in light group on.""" return self.any_on @property def brightness(self) -> int | None: """Brightness of the light. Depending on the light type 0 might not mean visible "off" but minimum brightness. """ return self.raw["action"].get("bri") @property def color_temp(self) -> int | None: """Mired color temperature of the light. (2000K - 6500K).""" return self.raw["action"].get("ct") @property def hue(self) -> int | None: """Color hue of the light. The hue parameter in the HSV color model is between 0°-360° and is mapped to 0..65535 to get 16-bit resolution. """ return self.raw["action"].get("hue") @property def saturation(self) -> int | None: """Color saturation of the light. There 0 means no color at all and 255 is the greatest saturation of the color. """ return self.raw["action"].get("sat") @property def xy(self) -> tuple[float, float] | None: """CIE xy color space coordinates as array [x, y] of real values (0..1).""" x, y = self.raw["action"].get("xy", (None, None)) if x is None or y is None: return None if x > 1: x = x / 65555 if y > 1: y = y / 65555 return (x, y) @property def color_mode(self) -> LightColorMode | None: """Color mode of group.""" if "colormode" in self.raw["action"]: return LightColorMode(self.raw["action"]["colormode"]) return None @property def effect(self) -> LightEffect | None: """Effect of the group.""" if "effect" in self.raw["action"]: return LightEffect(self.raw["action"]["effect"]) return None @property def reachable(self) -> bool: """Is group reachable.""" return True @property def all_on(self) -> bool: """Is all lights in light group on.""" return self.raw["state"].get("all_on") is True @property def any_on(self) -> bool: """Is any lights in light group on.""" return self.raw["state"].get("any_on") is True @property def device_membership(self) -> list[str] | None: """List of device ids (sensors) when group was created by a device.""" return self.raw.get("devicemembership") @property def hidden(self) -> bool | None: """Indicate the hidden status of the group. Has no effect at the gateway but apps can uses this to hide groups. """ return self.raw.get("hidden") @property def id(self) -> str | None: """Group ID.""" return self.raw.get("id") @property def lights(self) -> list[str]: """List of all light IDs in group. Sequence is defined by the gateway. """ return self.raw.get("lights", []) @property def light_sequence(self) -> list[str] | None: """List of light IDs in group that can be sorted by the user. Need not to contain all light ids of this group. """ return self.raw.get("lightsequence") @property def multi_device_ids(self) -> list[str] | None: """List of light IDs in group. Subsequent ids from multidevices with multiple endpoints. """ return self.raw.get("multideviceids")
class Group(DeconzDevice): '''deCONZ light group representation. Dresden Elektroniks documentation of light groups in deCONZ http://dresden-elektronik.github.io/deconz-rest-doc/groups/ ''' @property def state(self) -> bool | None: '''Is any light in light group on.''' pass @property def brightness(self) -> int | None: '''Brightness of the light. Depending on the light type 0 might not mean visible "off" but minimum brightness. ''' pass @property def color_temp(self) -> int | None: '''Mired color temperature of the light. (2000K - 6500K).''' pass @property def hue(self) -> int | None: '''Color hue of the light. The hue parameter in the HSV color model is between 0°-360° and is mapped to 0..65535 to get 16-bit resolution. ''' pass @property def saturation(self) -> int | None: '''Color saturation of the light. There 0 means no color at all and 255 is the greatest saturation of the color. ''' pass @property def xy(self) -> tuple[float, float] | None: '''CIE xy color space coordinates as array [x, y] of real values (0..1).''' pass @property def color_mode(self) -> LightColorMode | None: '''Color mode of group.''' pass @property def effect(self) -> LightEffect | None: '''Effect of the group.''' pass @property def reachable(self) -> bool: '''Is group reachable.''' pass @property def all_on(self) -> bool: '''Is all lights in light group on.''' pass @property def any_on(self) -> bool: '''Is any lights in light group on.''' pass @property def device_membership(self) -> list[str] | None: '''List of device ids (sensors) when group was created by a device.''' pass @property def hidden(self) -> bool | None: '''Indicate the hidden status of the group. Has no effect at the gateway but apps can uses this to hide groups. ''' pass @property def id(self) -> str | None: '''Group ID.''' pass @property def lights(self) -> list[str]: '''List of all light IDs in group. Sequence is defined by the gateway. ''' pass @property def light_sequence(self) -> list[str] | None: '''List of light IDs in group that can be sorted by the user. Need not to contain all light ids of this group. ''' pass @property def multi_device_ids(self) -> list[str] | None: '''List of light IDs in group. Subsequent ids from multidevices with multiple endpoints. ''' pass
35
18
5
1
3
2
1
0.58
1
8
2
0
17
0
17
30
133
30
65
37
30
38
48
20
30
4
2
1
22
141,663
Kane610/deconz
pydeconz/models/event.py
pydeconz.models.event.EventType
class EventType(enum.StrEnum): """The event type of the message.""" ADDED = "added" CHANGED = "changed" DELETED = "deleted" SCENE_CALLED = "scene-called"
class EventType(enum.StrEnum): '''The event type of the message.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
68
7
1
5
5
4
1
5
5
4
0
3
0
0
141,664
Kane610/deconz
pydeconz/models/event.py
pydeconz.models.event.EventKey
class EventKey(enum.StrEnum): """Event keys.""" TYPE = "t" EVENT = "e" RESOURCE = "r" ID = "id" GROUP_ID = "gid" SCENE_ID = "scid" ATTRIBUTE = "attr" CONFIG = "config" NAME = "name" STATE = "state" UNIQUE_ID = "uniqueid" ALARM = "alarmsystem" GROUP = "group" LIGHT = "light" SENSOR = "sensor"
class EventKey(enum.StrEnum): '''Event keys.''' pass
1
1
0
0
0
0
0
0.06
1
0
0
0
0
0
0
68
21
4
16
16
15
1
16
16
15
0
3
0
0
141,665
Kane610/deconz
pydeconz/models/event.py
pydeconz.models.event.Event
class Event: """Event data from deCONZ websocket.""" id: str data: dict[str, Any] resource: ResourceGroup type: EventType # Only for "scene-called" events group_id: str scene_id: str @property def added_data(self) -> dict[str, Any]: """Full device resource. Only for "added" events. """ data: dict[str, Any] = {} for key in (EventKey.SENSOR, EventKey.LIGHT, EventKey.ALARM, EventKey.GROUP): if key in self.data: data = self.data[key] break return data @property def changed_data(self) -> dict[str, Any]: """Altered device data. Only for "changed" events. Ignores "attr" events. """ data: dict[str, Any] = {} for key in (EventKey.STATE, EventKey.CONFIG, EventKey.NAME): if (value := self.data.get(key)) is not None: data[key] = value return data @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: """Create event instance from dict.""" return cls( id=data.get(EventKey.ID, ""), group_id=data.get(EventKey.GROUP_ID, ""), scene_id=data.get(EventKey.SCENE_ID, ""), resource=ResourceGroup(data[EventKey.RESOURCE]), type=EventType(data[EventKey.EVENT]), data=data, )
class Event: '''Event data from deCONZ websocket.''' @property def added_data(self) -> dict[str, Any]: '''Full device resource. Only for "added" events. ''' pass @property def changed_data(self) -> dict[str, Any]: '''Altered device data. Only for "changed" events. Ignores "attr" events. ''' pass @classmethod def from_dict(cls, data: dict[str, Any]) -> Self: '''Create event instance from dict.''' pass
7
4
12
2
7
3
2
0.31
0
6
3
0
2
0
3
3
53
11
32
12
25
10
22
8
18
3
0
2
7
141,666
Kane610/deconz
pydeconz/models/deconz_device.py
pydeconz.models.deconz_device.DeconzDevice
class DeconzDevice(APIItem): """deCONZ resource base representation. Dresden Elektroniks REST API documentation http://dresden-elektronik.github.io/deconz-rest-doc/ """ @property def etag(self) -> str: """HTTP etag change on any action to the device.""" raw: dict[str, str] = self.raw return raw.get("etag") or "" @property def manufacturer(self) -> str: """Device manufacturer.""" raw: dict[str, str] = self.raw return raw.get("manufacturername") or "" @property def model_id(self) -> str: """Device model.""" raw: dict[str, str] = self.raw return raw.get("modelid") or "" @property def name(self) -> str: """Name of the device.""" raw: dict[str, str] = self.raw return raw.get("name") or "" @property def software_version(self) -> str: """Firmware version.""" raw: dict[str, str] = self.raw return raw.get("swversion") or "" @property def type(self) -> str: """Human readable type of the device.""" raw: dict[str, str] = self.raw return raw.get("type") or "" @property def unique_id(self) -> str: """Id for unique device identification.""" raw: dict[str, str] = self.raw return raw.get("uniqueid") or ""
class DeconzDevice(APIItem): '''deCONZ resource base representation. Dresden Elektroniks REST API documentation http://dresden-elektronik.github.io/deconz-rest-doc/ ''' @property def etag(self) -> str: '''HTTP etag change on any action to the device.''' pass @property def manufacturer(self) -> str: '''Device manufacturer.''' pass @property def model_id(self) -> str: '''Device model.''' pass @property def name(self) -> str: '''Name of the device.''' pass @property def software_version(self) -> str: '''Firmware version.''' pass @property def type(self) -> str: '''Human readable type of the device.''' pass @property def unique_id(self) -> str: '''Id for unique device identification.''' pass
15
8
4
0
3
1
1
0.38
1
2
0
3
7
0
7
13
48
8
29
22
14
11
22
15
14
1
1
0
7
141,667
Kane610/deconz
pydeconz/models/api.py
pydeconz.models.api.APIItem
class APIItem: """Base class for a deCONZ API item.""" resource_group: ResourceGroup def __init__(self, resource_id: str, raw: Any) -> None: """Initialize API item.""" self.resource_id = resource_id self.raw = raw self.changed_keys: set[str] = set() self._callbacks: list[SubscriptionType] = [] self._subscribers: list[SubscriptionType] = [] @property def deconz_id(self) -> str: """Id to call device over API e.g. /sensors/1.""" return f"/{self.resource_group}/{self.resource_id}" def register_callback(self, callback: SubscriptionType) -> None: """Register callback for signalling.""" self._callbacks.append(callback) def remove_callback(self, callback: SubscriptionType) -> None: """Remove callback previously registered.""" if callback in self._callbacks: self._callbacks.remove(callback) def subscribe(self, callback: SubscriptionType) -> UnsubscribeType: """Subscribe to events. Return function to unsubscribe. """ self._subscribers.append(callback) def unsubscribe() -> None: """Unsubscribe callback.""" self._subscribers.remove(callback) return unsubscribe def update(self, raw: dict[str, dict[str, Any]]) -> None: """Update input attr in self. Store a set of keys with changed values. """ changed_keys = set() for k, v in raw.items(): changed_keys.add(k) if isinstance(self.raw.get(k), dict) and isinstance(v, dict): changed_keys.update(set(v.keys())) self.raw[k].update(v) else: self.raw[k] = v self.changed_keys = changed_keys for callback in self._callbacks + self._subscribers: callback()
class APIItem: '''Base class for a deCONZ API item.''' def __init__(self, resource_id: str, raw: Any) -> None: '''Initialize API item.''' pass @property def deconz_id(self) -> str: '''Id to call device over API e.g. /sensors/1.''' pass def register_callback(self, callback: SubscriptionType) -> None: '''Register callback for signalling.''' pass def remove_callback(self, callback: SubscriptionType) -> None: '''Remove callback previously registered.''' pass def subscribe(self, callback: SubscriptionType) -> UnsubscribeType: '''Subscribe to events. Return function to unsubscribe. ''' pass def unsubscribe() -> None: '''Unsubscribe callback.''' pass def update(self, raw: dict[str, dict[str, Any]]) -> None: '''Update input attr in self. Store a set of keys with changed values. ''' pass
9
8
8
2
5
2
2
0.36
0
5
0
3
6
5
6
6
63
18
33
17
24
12
31
16
23
4
0
2
11
141,668
Kane610/deconz
pydeconz/models/light/light.py
pydeconz.models.light.light.LightAlert
class LightAlert(enum.StrEnum): """Temporary alert effect. Supported values: - "none" — light is not performing an alert. - "lselect" — light is blinking a longer time. - "select" — light is blinking a short time. - "blink" - "breathe" - "channelchange" - "finish" - "okay" - "stop" """ NONE = "none" LONG = "lselect" SHORT = "select" # Specific to Hue color bulbs BLINK = "blink" BREATHE = "breathe" CHANNEL_CHANGE = "channelchange" FINISH = "finish" OKAY = "okay" STOP = "stop" UNKNOWN = "unknown" @classmethod def _missing_(cls, value: object) -> LightAlert: """Set default enum member if an unknown value is provided.""" LOGGER.warning("Unexpected light alert type %s", value) return cls.UNKNOWN
class LightAlert(enum.StrEnum): '''Temporary alert effect. Supported values: - "none" — light is not performing an alert. - "lselect" — light is blinking a longer time. - "select" — light is blinking a short time. - "blink" - "breathe" - "channelchange" - "finish" - "okay" - "stop" ''' @classmethod def _missing_(cls, value: object) -> LightAlert: '''Set default enum member if an unknown value is provided.''' pass
3
2
4
0
3
1
1
0.93
1
0
0
0
0
0
1
69
35
6
15
13
12
14
14
12
12
1
3
0
1
141,669
Kane610/deconz
pydeconz/interfaces/sensors.py
pydeconz.interfaces.sensors.RelativeRotaryHandler
class RelativeRotaryHandler(APIHandler[RelativeRotary]): """Handler for relative rotary sensor.""" resource_group = ResourceGroup.SENSOR resource_type = ResourceType.ZHA_RELATIVE_ROTARY item_cls = RelativeRotary
class RelativeRotaryHandler(APIHandler[RelativeRotary]): '''Handler for relative rotary sensor.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
15
6
1
4
4
3
1
4
4
3
0
2
0
0
141,670
Kane610/deconz
pydeconz/models/sensor/battery.py
pydeconz.models.sensor.battery.TypedBattery
class TypedBattery(TypedDict): """Battery type definition.""" state: TypedBatteryState
class TypedBattery(TypedDict): '''Battery type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,671
Kane610/deconz
pydeconz/models/sensor/carbon_dioxide.py
pydeconz.models.sensor.carbon_dioxide.CarbonDioxide
class CarbonDioxide(SensorBase): """Carbon dioxide sensor.""" raw: TypedCarbonDioxide @property def carbon_dioxide(self) -> int: """Carbon dioxide detected.""" return self.raw["state"]["measured_value"]
class CarbonDioxide(SensorBase): '''Carbon dioxide sensor.''' @property def carbon_dioxide(self) -> int: '''Carbon dioxide detected.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,672
Kane610/deconz
pydeconz/models/sensor/particulate_matter.py
pydeconz.models.sensor.particulate_matter.TypedParticulateMatterCapabilities
class TypedParticulateMatterCapabilities(TypedDict): """Particulate matter capabilities type definition.""" max: int min: int quantity: Literal["density"] substance: Literal["PM2.5"] unit: Literal["ug/m^3"]
class TypedParticulateMatterCapabilities(TypedDict): '''Particulate matter capabilities type definition.'''
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,673
Kane610/deconz
pydeconz/models/sensor/switch.py
pydeconz.models.sensor.switch.Switch
class Switch(SensorBase): """Switch sensor.""" raw: TypedSwitch @property def button_event(self) -> int | None: """Button press.""" return self.raw["state"].get("buttonevent") @property def gesture(self) -> int | None: """Gesture used for Xiaomi magic cube.""" return self.raw["state"].get("gesture") @property def angle(self) -> int | None: """Angle representing color on a tint remote color wheel.""" return self.raw["state"].get("angle") @property def xy(self) -> tuple[float, float] | None: """X/Y color coordinates selected on a tint remote color wheel.""" return self.raw["state"].get("xy") @property def event_duration(self) -> int | None: """Duration of a push button event for the Hue wall switch module. Increased with 8 for each x001, and they are issued pretty much every 800ms. """ return self.raw["state"].get("eventduration") @property def device_mode(self) -> SwitchDeviceMode | None: """Different modes for the Hue wall switch module. Behavior as rocker: Issues a x000/x002 each time you flip the rocker (to either position). The event duration for the x002 is 1 (for 100ms), but lastupdated suggests it follows the x000 faster than that. Behavior as pushbutton: Issues a x000/x002 sequence on press/release. Issues a x000/x001/.../x001/x003 on press/hold/release. Similar to Hue remotes. """ if "devicemode" in self.raw["config"]: return SwitchDeviceMode(self.raw["config"]["devicemode"]) return None @property def mode(self) -> SwitchMode | None: """For Ubisys S1/S2, operation mode of the switch.""" if "mode" in self.raw["config"]: return SwitchMode(self.raw["config"]["mode"]) return None @property def window_covering_type(self) -> SwitchWindowCoveringType | None: """Set the covering type and starts calibration for Ubisys J1.""" if "windowcoveringtype" in self.raw["config"]: return SwitchWindowCoveringType(self.raw["config"]["windowcoveringtype"]) return None
class Switch(SensorBase): '''Switch sensor.''' @property def button_event(self) -> int | None: '''Button press.''' pass @property def gesture(self) -> int | None: '''Gesture used for Xiaomi magic cube.''' pass @property def angle(self) -> int | None: '''Angle representing color on a tint remote color wheel.''' pass @property def xy(self) -> tuple[float, float] | None: '''X/Y color coordinates selected on a tint remote color wheel.''' pass @property def event_duration(self) -> int | None: '''Duration of a push button event for the Hue wall switch module. Increased with 8 for each x001, and they are issued pretty much every 800ms. ''' pass @property def device_mode(self) -> SwitchDeviceMode | None: '''Different modes for the Hue wall switch module. Behavior as rocker: Issues a x000/x002 each time you flip the rocker (to either position). The event duration for the x002 is 1 (for 100ms), but lastupdated suggests it follows the x000 faster than that. Behavior as pushbutton: Issues a x000/x002 sequence on press/release. Issues a x000/x001/.../x001/x003 on press/hold/release. Similar to Hue remotes. ''' pass @property def mode(self) -> SwitchMode | None: '''For Ubisys S1/S2, operation mode of the switch.''' pass @property def window_covering_type(self) -> SwitchWindowCoveringType | None: '''Set the covering type and starts calibration for Ubisys J1.''' pass
17
9
6
0
3
2
1
0.63
1
6
3
0
8
0
8
28
64
12
32
17
15
20
24
9
15
2
3
1
11
141,674
Kane610/deconz
pydeconz/models/sensor/particulate_matter.py
pydeconz.models.sensor.particulate_matter.TypedParticulateMatter
class TypedParticulateMatter(TypedDict): """Particulate matter type definition.""" capabilities: dict[Literal["measured_value"], TypedParticulateMatterCapabilities] state: TypedParticulateMatterState
class TypedParticulateMatter(TypedDict): '''Particulate matter type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,675
Kane610/deconz
pydeconz/models/sensor/particulate_matter.py
pydeconz.models.sensor.particulate_matter.ParticulateMatter
class ParticulateMatter(SensorBase): """Particulate matter sensor.""" raw: TypedParticulateMatter @property def measured_value(self) -> int: """Measured value.""" return self.raw["state"]["measured_value"] @property def capabilities(self) -> Capabilities: """Sensor capabilities.""" return Capabilities(**self.raw["capabilities"]["measured_value"])
class ParticulateMatter(SensorBase): '''Particulate matter sensor.''' @property def measured_value(self) -> int: '''Measured value.''' pass @property def capabilities(self) -> Capabilities: '''Sensor capabilities.''' pass
5
3
3
0
2
1
1
0.38
1
2
1
0
2
0
2
22
14
3
8
5
3
3
6
3
3
1
3
0
2
141,676
Kane610/deconz
pydeconz/models/sensor/particulate_matter.py
pydeconz.models.sensor.particulate_matter.Capabilities
class Capabilities: """Capabilities description.""" max: int min: int quantity: Literal["density"] substance: Literal["PM2.5"] unit: Literal["ug/m^3"]
class Capabilities: '''Capabilities description.''' pass
1
1
0
0
0
0
0
0.17
0
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
0
0
0
141,677
Kane610/deconz
pydeconz/models/sensor/open_close.py
pydeconz.models.sensor.open_close.TypedOpenCloseState
class TypedOpenCloseState(TypedDict): """Open close state type definition.""" open: bool
class TypedOpenCloseState(TypedDict): '''Open close state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,678
Kane610/deconz
pydeconz/models/sensor/particulate_matter.py
pydeconz.models.sensor.particulate_matter.TypedParticulateMatterState
class TypedParticulateMatterState(TypedDict): """Particulate matter state type definition.""" measured_value: int
class TypedParticulateMatterState(TypedDict): '''Particulate matter state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,679
Kane610/deconz
pydeconz/models/sensor/open_close.py
pydeconz.models.sensor.open_close.TypedOpenClose
class TypedOpenClose(TypedDict): """Open close type definition.""" state: TypedOpenCloseState
class TypedOpenClose(TypedDict): '''Open close type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,680
Kane610/deconz
pydeconz/models/sensor/moisture.py
pydeconz.models.sensor.moisture.TypedMoistureState
class TypedMoistureState(TypedDict): """Moisture state type definition.""" moisture: int
class TypedMoistureState(TypedDict): '''Moisture state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,681
Kane610/deconz
pydeconz/models/sensor/moisture.py
pydeconz.models.sensor.moisture.TypedMoistureConfig
class TypedMoistureConfig(TypedDict): """Moisture config type definition.""" offset: int
class TypedMoistureConfig(TypedDict): '''Moisture config type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,682
Kane610/deconz
pydeconz/models/sensor/moisture.py
pydeconz.models.sensor.moisture.TypedMoisture
class TypedMoisture(TypedDict): """Moisture type definition.""" config: TypedMoistureConfig state: TypedMoistureState
class TypedMoisture(TypedDict): '''Moisture type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,683
Kane610/deconz
pydeconz/models/sensor/moisture.py
pydeconz.models.sensor.moisture.Moisture
class Moisture(SensorBase): """Moisture sensor.""" raw: TypedMoisture @property def moisture(self) -> int: """Moisture level. 0-100 in percent. """ return self.raw["state"]["moisture"] @property def scaled_moisture(self) -> float: """Scaled moisture level.""" return self.moisture / 100 @property def offset(self) -> int | None: """Signed offset value to measured state values. Values send by the REST-API are already amended by the offset. """ return self.raw["config"].get("offset")
class Moisture(SensorBase): '''Moisture sensor.''' @property def moisture(self) -> int: '''Moisture level. 0-100 in percent. ''' pass @property def scaled_moisture(self) -> float: '''Scaled moisture level.''' pass @property def offset(self) -> int | None: '''Signed offset value to measured state values. Values send by the REST-API are already amended by the offset. ''' pass
7
4
5
1
2
2
1
0.73
1
2
0
0
3
0
3
23
25
6
11
7
4
8
8
4
4
1
3
0
3
141,684
Kane610/deconz
pydeconz/models/sensor/light_level.py
pydeconz.models.sensor.light_level.TypedLightLevelState
class TypedLightLevelState(TypedDict): """Light level state type definition.""" dark: bool daylight: bool lightlevel: int lux: int
class TypedLightLevelState(TypedDict): '''Light level state type definition.'''
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
0
7
1
5
1
4
1
5
1
4
0
1
0
0
141,685
Kane610/deconz
pydeconz/models/sensor/switch.py
pydeconz.models.sensor.switch.SwitchDeviceMode
class SwitchDeviceMode(enum.StrEnum): """Different modes for the Hue wall switch module.""" SINGLE_ROCKER = "singlerocker" SINGLE_PUSH_BUTTON = "singlepushbutton" DUAL_ROCKER = "dualrocker" DUAL_PUSH_BUTTON = "dualpushbutton"
class SwitchDeviceMode(enum.StrEnum): '''Different modes for the Hue wall switch module.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
68
7
1
5
5
4
1
5
5
4
0
3
0
0
141,686
Kane610/deconz
pydeconz/models/sensor/open_close.py
pydeconz.models.sensor.open_close.OpenClose
class OpenClose(SensorBase): """Door/Window sensor.""" raw: TypedOpenClose @property def open(self) -> bool: """Door open.""" return self.raw["state"]["open"]
class OpenClose(SensorBase): '''Door/Window sensor.''' @property def open(self) -> bool: '''Door open.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,687
Kane610/deconz
pydeconz/models/sensor/power.py
pydeconz.models.sensor.power.Power
class Power(SensorBase): """Power sensor.""" raw: TypedPower @property def current(self) -> int | None: """Ampere load of device.""" return self.raw["state"].get("current") @property def power(self) -> int: """Power load of device.""" return self.raw["state"]["power"] @property def voltage(self) -> int | None: """Voltage draw of device.""" return self.raw["state"].get("voltage")
class Power(SensorBase): '''Power sensor.''' @property def current(self) -> int | None: '''Ampere load of device.''' pass @property def power(self) -> int: '''Power load of device.''' pass @property def voltage(self) -> int | None: '''Voltage draw of device.''' pass
7
4
3
0
2
1
1
0.36
1
1
0
0
3
0
3
23
19
4
11
7
4
4
8
4
4
1
3
0
3
141,688
Kane610/deconz
pydeconz/models/sensor/power.py
pydeconz.models.sensor.power.TypedPower
class TypedPower(TypedDict): """Power type definition.""" state: TypedPowerState
class TypedPower(TypedDict): '''Power type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,689
Kane610/deconz
pydeconz/models/sensor/power.py
pydeconz.models.sensor.power.TypedPowerState
class TypedPowerState(TypedDict): """Power state type definition.""" current: int power: int voltage: int
class TypedPowerState(TypedDict): '''Power state type definition.'''
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
141,690
Kane610/deconz
pydeconz/models/sensor/relative_rotary.py
pydeconz.models.sensor.relative_rotary.TypedRelativeRotaryState
class TypedRelativeRotaryState(TypedDict): """Relative rotary state type definition.""" expectedeventduration: int expectedrotation: int rotaryevent: int
class TypedRelativeRotaryState(TypedDict): '''Relative rotary state type definition.'''
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
141,691
Kane610/deconz
pydeconz/models/sensor/relative_rotary.py
pydeconz.models.sensor.relative_rotary.TypedRelativeRotary
class TypedRelativeRotary(TypedDict): """Relative rotary type definition.""" state: TypedRelativeRotaryState
class TypedRelativeRotary(TypedDict): '''Relative rotary type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,692
Kane610/deconz
pydeconz/models/sensor/relative_rotary.py
pydeconz.models.sensor.relative_rotary.RelativeRotaryEvent
class RelativeRotaryEvent(enum.IntEnum): """Rotary event. Supported values: - 1 - new movements (start) - 2 - repeat movements """ NEW = 1 REPEAT = 2
class RelativeRotaryEvent(enum.IntEnum): '''Rotary event. Supported values: - 1 - new movements (start) - 2 - repeat movements ''' pass
1
1
0
0
0
0
0
1.67
1
0
0
0
0
0
0
55
10
2
3
3
2
5
3
3
2
0
3
0
0
141,693
Kane610/deconz
pydeconz/models/sensor/relative_rotary.py
pydeconz.models.sensor.relative_rotary.RelativeRotary
class RelativeRotary(SensorBase): """Relative rotary sensor.""" raw: TypedRelativeRotary @property def expected_event_duration(self) -> int: """Event duration to expect. Interval [ms] which rotary events will be emit. """ return self.raw["state"]["expectedeventduration"] @property def expected_rotation(self) -> int: """Rotation to expect. Report angle - positive for clockwise - negative for counter-clockwise """ return self.raw["state"]["expectedrotation"] @property def rotary_event(self) -> RelativeRotaryEvent: """Rotary event. - 1 for new movements (start) - 2 for repeat movements """ return RelativeRotaryEvent(self.raw["state"]["rotaryevent"])
class RelativeRotary(SensorBase): '''Relative rotary sensor.''' @property def expected_event_duration(self) -> int: '''Event duration to expect. Interval [ms] which rotary events will be emit. ''' pass @property def expected_rotation(self) -> int: '''Rotation to expect. Report angle - positive for clockwise - negative for counter-clockwise ''' pass @property def rotary_event(self) -> RelativeRotaryEvent: '''Rotary event. - 1 for new movements (start) - 2 for repeat movements ''' pass
7
4
7
1
2
4
1
1.18
1
2
1
0
3
0
3
23
31
7
11
7
4
13
8
4
4
1
3
0
3
141,694
Kane610/deconz
pydeconz/models/sensor/pressure.py
pydeconz.models.sensor.pressure.TypedPressureState
class TypedPressureState(TypedDict): """Pressure state type definition.""" pressure: int
class TypedPressureState(TypedDict): '''Pressure state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,695
Kane610/deconz
pydeconz/models/sensor/pressure.py
pydeconz.models.sensor.pressure.TypedPressure
class TypedPressure(TypedDict): """Pressure type definition.""" state: TypedPressureState
class TypedPressure(TypedDict): '''Pressure type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,696
Kane610/deconz
pydeconz/models/sensor/pressure.py
pydeconz.models.sensor.pressure.Pressure
class Pressure(SensorBase): """Pressure sensor.""" raw: TypedPressure @property def pressure(self) -> int: """Pressure.""" return self.raw["state"]["pressure"]
class Pressure(SensorBase): '''Pressure sensor.''' @property def pressure(self) -> int: '''Pressure.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,697
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.TypedPresenceState
class TypedPresenceState(TypedDict): """Presence state type definition.""" dark: bool presence: bool presenceevent: NotRequired[ Literal[ "enter", "leave", "enterleft", "rightleave", "enterright", "leftleave", "approaching", "absenting", "8", "9", ] ]
class TypedPresenceState(TypedDict): '''Presence state type definition.'''
1
1
0
0
0
0
0
0.06
1
0
0
0
0
0
0
0
19
1
17
1
16
1
4
1
3
0
1
0
0
141,698
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.TypedPresenceConfig
class TypedPresenceConfig(TypedDict): """Presence config type definition.""" delay: int detectionarea: str devicemode: NotRequired[Literal["leftright", "undirected"]] duration: int resetpresence: bool sensitivity: int sensitivitymax: int triggerdistance: NotRequired[Literal["far", "medium", "near"]]
class TypedPresenceConfig(TypedDict): '''Presence config type definition.'''
1
1
0
0
0
0
0
0.11
1
0
0
0
0
0
0
0
11
1
9
1
8
1
9
1
8
0
1
0
0
141,699
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.TypedPresence
class TypedPresence(TypedDict): """Presence type definition.""" config: TypedPresenceConfig state: TypedPresenceState
class TypedPresence(TypedDict): '''Presence type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,700
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.PresenceStatePresenceEvent
class PresenceStatePresenceEvent(enum.StrEnum): """Current activity associated with current presence state. Supported values: - enter - leave - enterleft - rightleave - enterright - leftleave - approaching - absenting - 8 - 9 """ ENTER = "enter" LEAVE = "leave" ENTER_LEFT = "enterleft" RIGHT_LEAVE = "rightleave" ENTER_RIGHT = "enterright" LEFT_LEAVE = "leftleave" APPROACHING = "approaching" ABSENTING = "absenting" EIGHT = "8" NINE = "9"
class PresenceStatePresenceEvent(enum.StrEnum): '''Current activity associated with current presence state. Supported values: - enter - leave - enterleft - rightleave - enterright - leftleave - approaching - absenting - 8 - 9 ''' pass
1
1
0
0
0
0
0
1.18
1
0
0
0
0
0
0
68
26
2
11
11
10
13
11
11
10
0
3
0
0
141,701
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.PresenceConfigTriggerDistance
class PresenceConfigTriggerDistance(enum.StrEnum): """Trigger distance. Supported values: - far - Someone approaching is detected on high distance - medium - Someone approaching is detected on medium distance - near - Someone approaching is detected on low distance """ FAR = "far" MEDIUM = "medium" NEAR = "near" # Trigger distance in meters ONE = "1" TWO = "2" THREE = "3" FOUR = "4" FIVE = "5" SIX = "6" SEVEN = "7" EIGHT = "8" NINE = "9"
class PresenceConfigTriggerDistance(enum.StrEnum): '''Trigger distance. Supported values: - far - Someone approaching is detected on high distance - medium - Someone approaching is detected on medium distance - near - Someone approaching is detected on low distance ''' pass
1
1
0
0
0
0
0
0.54
1
0
0
0
0
0
0
68
23
3
13
13
12
7
13
13
12
0
3
0
0
141,702
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.PresenceConfigSensitivity
class PresenceConfigSensitivity(enum.IntEnum): """Device sensitivity. Supported values: - 1 - Low - 2 - Medium - 3 - High """ LOW = 1 MEDIUM = 2 HIGH = 3
class PresenceConfigSensitivity(enum.IntEnum): '''Device sensitivity. Supported values: - 1 - Low - 2 - Medium - 3 - High ''' pass
1
1
0
0
0
0
0
1.5
1
0
0
0
0
0
0
55
12
2
4
4
3
6
4
4
3
0
3
0
0
141,703
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.PresenceConfigDeviceMode
class PresenceConfigDeviceMode(enum.StrEnum): """Device mode. Supported values: - leftright - left and right - undirected """ LEFT_AND_RIGHT = "leftright" UNDIRECTED = "undirected"
class PresenceConfigDeviceMode(enum.StrEnum): '''Device mode. Supported values: - leftright - left and right - undirected ''' pass
1
1
0
0
0
0
0
1.67
1
0
0
0
0
0
0
68
10
2
3
3
2
5
3
3
2
0
3
0
0
141,704
Kane610/deconz
pydeconz/models/sensor/presence.py
pydeconz.models.sensor.presence.Presence
class Presence(SensorBase): """Presence detector.""" raw: TypedPresence @property def dark(self) -> bool | None: """If the area near the sensor is light or not.""" return self.raw["state"].get("dark") @property def delay(self) -> int | None: """Occupied to unoccupied delay in seconds.""" return self.raw["config"].get("delay") @property def device_mode(self) -> PresenceConfigDeviceMode | None: """Trigger distance.""" if "devicemode" in self.raw["config"]: return PresenceConfigDeviceMode(self.raw["config"]["devicemode"]) return None @property def duration(self) -> int | None: """Minimum duration which presence will be true.""" return self.raw["config"].get("duration") @property def presence(self) -> bool: """Motion detected.""" return self.raw["state"]["presence"] @property def presence_event(self) -> PresenceStatePresenceEvent | None: """Activity associated with current presence state.""" if "presenceevent" in self.raw["state"]: return PresenceStatePresenceEvent(self.raw["state"]["presenceevent"]) return None @property def sensitivity(self) -> int | None: """Sensitivity setting for Philips Hue motion sensor. Supported values: - 0-[sensitivitymax] """ return self.raw["config"].get("sensitivity") @property def max_sensitivity(self) -> int | None: """Maximum sensitivity value.""" return self.raw["config"].get("sensitivitymax") @property def trigger_distance(self) -> PresenceConfigTriggerDistance | None: """Device specific distance setting.""" if "triggerdistance" in self.raw["config"]: return PresenceConfigTriggerDistance(self.raw["config"]["triggerdistance"]) return None
class Presence(SensorBase): '''Presence detector.''' @property def dark(self) -> bool | None: '''If the area near the sensor is light or not.''' pass @property def delay(self) -> int | None: '''Occupied to unoccupied delay in seconds.''' pass @property def device_mode(self) -> PresenceConfigDeviceMode | None: '''Trigger distance.''' pass @property def duration(self) -> int | None: '''Minimum duration which presence will be true.''' pass @property def presence(self) -> bool: '''Motion detected.''' pass @property def presence_event(self) -> PresenceStatePresenceEvent | None: '''Activity associated with current presence state.''' pass @property def sensitivity(self) -> int | None: '''Sensitivity setting for Philips Hue motion sensor. Supported values: - 0-[sensitivitymax] ''' pass @property def max_sensitivity(self) -> int | None: '''Maximum sensitivity value.''' pass @property def trigger_distance(self) -> PresenceConfigTriggerDistance | None: '''Device specific distance setting.''' pass
19
10
4
0
3
1
1
0.37
1
5
3
0
9
0
9
29
59
11
35
19
16
13
26
10
16
2
3
1
12
141,705
Kane610/deconz
pydeconz/models/sensor/light_level.py
pydeconz.models.sensor.light_level.TypedLightLevelConfig
class TypedLightLevelConfig(TypedDict): """Light level config type definition.""" tholddark: int tholdoffset: int
class TypedLightLevelConfig(TypedDict): '''Light level config type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,706
Kane610/deconz
pydeconz/models/sensor/battery.py
pydeconz.models.sensor.battery.TypedBatteryState
class TypedBatteryState(TypedDict): """Battery state type definition.""" battery: int
class TypedBatteryState(TypedDict): '''Battery state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,707
Kane610/deconz
pydeconz/models/sensor/light_level.py
pydeconz.models.sensor.light_level.TypedLightLevel
class TypedLightLevel(TypedDict): """Light level type definition.""" config: TypedLightLevelConfig state: TypedLightLevelState
class TypedLightLevel(TypedDict): '''Light level type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,708
Kane610/deconz
pydeconz/models/sensor/humidity.py
pydeconz.models.sensor.humidity.TypedHumidityState
class TypedHumidityState(TypedDict): """Humidity state type definition.""" humidity: int
class TypedHumidityState(TypedDict): '''Humidity state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,709
Kane610/deconz
pydeconz/models/sensor/door_lock.py
pydeconz.models.sensor.door_lock.DoorLock
class DoorLock(SensorBase): """Door lock sensor.""" raw: TypedDoorLock @property def is_locked(self) -> bool: """Return True if lock is locked.""" return self.lock_state == DoorLockLockState.LOCKED @property def lock_state(self) -> DoorLockLockState: """State the lock is in.""" return DoorLockLockState(self.raw["state"]["lockstate"]) @property def lock_configuration(self) -> bool: """Lock configuration.""" return self.raw["config"]["lock"]
class DoorLock(SensorBase): '''Door lock sensor.''' @property def is_locked(self) -> bool: '''Return True if lock is locked.''' pass @property def lock_state(self) -> DoorLockLockState: '''State the lock is in.''' pass @property def lock_configuration(self) -> bool: '''Lock configuration.''' pass
7
4
3
0
2
1
1
0.36
1
2
1
0
3
0
3
23
19
4
11
7
4
4
8
4
4
1
3
0
3
141,710
Kane610/deconz
pydeconz/models/sensor/daylight.py
pydeconz.models.sensor.daylight.TypedDaylightState
class TypedDaylightState(TypedDict): """Daylight state type definition.""" dark: bool daylight: bool status: int sunrise: str sunset: str
class TypedDaylightState(TypedDict): '''Daylight state type definition.'''
1
1
0
0
0
0
0
0.17
1
0
0
0
0
0
0
0
8
1
6
1
5
1
6
1
5
0
1
0
0
141,711
Kane610/deconz
pydeconz/models/sensor/daylight.py
pydeconz.models.sensor.daylight.TypedDaylightConfig
class TypedDaylightConfig(TypedDict): """Daylight config type definition.""" configured: bool sunriseoffset: int sunsetoffset: int
class TypedDaylightConfig(TypedDict): '''Daylight config type definition.'''
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
0
6
1
4
1
3
1
4
1
3
0
1
0
0
141,712
Kane610/deconz
pydeconz/models/sensor/daylight.py
pydeconz.models.sensor.daylight.TypedDaylight
class TypedDaylight(TypedDict): """Daylight type definition.""" config: TypedDaylightConfig state: TypedDaylightState
class TypedDaylight(TypedDict): '''Daylight type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,713
Kane610/deconz
pydeconz/models/sensor/daylight.py
pydeconz.models.sensor.daylight.Daylight
class Daylight(SensorBase): """Daylight sensor built into deCONZ software.""" raw: TypedDaylight @property def configured(self) -> bool: """Is daylight sensor configured.""" return self.raw["config"]["configured"] @property def dark(self) -> bool: """Is dark.""" return self.raw["state"]["dark"] @property def daylight(self) -> bool: """Is daylight.""" return self.raw["state"]["daylight"] @property def daylight_status(self) -> DayLightStatus: """Return the daylight status string.""" return DayLightStatus(self.raw["state"]["status"]) @property def status(self) -> str: """Return the daylight status string.""" return DAYLIGHT_STATUS[DayLightStatus(self.raw["state"]["status"])] @property def sunrise(self) -> str: """Sunrise.""" return self.raw["state"]["sunrise"] @property def sunrise_offset(self) -> int: """Sunrise offset. -120 to 120. """ return self.raw["config"]["sunriseoffset"] @property def sunset(self) -> str: """Sunset.""" return self.raw["state"]["sunset"] @property def sunset_offset(self) -> int: """Sunset offset. -120 to 120. """ return self.raw["config"]["sunsetoffset"]
class Daylight(SensorBase): '''Daylight sensor built into deCONZ software.''' @property def configured(self) -> bool: '''Is daylight sensor configured.''' pass @property def dark(self) -> bool: '''Is dark.''' pass @property def daylight(self) -> bool: '''Is daylight.''' pass @property def daylight_status(self) -> DayLightStatus: '''Return the daylight status string.''' pass @property def status(self) -> str: '''Return the daylight status string.''' pass @property def sunrise(self) -> str: '''Sunrise.''' pass @property def sunrise_offset(self) -> int: '''Sunrise offset. -120 to 120. ''' pass @property def sunset(self) -> str: '''Sunset.''' pass @property def sunset_offset(self) -> int: '''Sunset offset. -120 to 120. ''' pass
19
10
4
0
2
1
1
0.48
1
4
1
0
9
0
9
29
55
12
29
19
10
14
20
10
10
1
3
0
9
141,714
Kane610/deconz
pydeconz/models/sensor/daylight.py
pydeconz.models.sensor.daylight.DayLightStatus
class DayLightStatus(enum.IntEnum): """Day light status.""" NADIR = 100 NIGHT_END = 110 NAUTICAL_DAWN = 120 DAWN = 130 SUNRISE_START = 140 SUNRISE_END = 150 GOLDEN_HOUR_1 = 160 SOLAR_NOON = 170 GOLDEN_HOUR_2 = 180 SUNSET_START = 190 SUNSET_END = 200 DUSK = 210 NAUTICAL_DUSK = 220 NIGHT_START = 230 UNKNOWN = 666 @classmethod def _missing_(cls, value: object) -> DayLightStatus: """Set default enum member if an unknown value is provided.""" LOGGER.warning("Unexpected day light value %s", value) return cls.UNKNOWN
class DayLightStatus(enum.IntEnum): '''Day light status.''' @classmethod def _missing_(cls, value: object) -> DayLightStatus: '''Set default enum member if an unknown value is provided.''' pass
3
2
4
0
3
1
1
0.1
1
0
0
0
0
0
1
56
25
3
20
18
17
2
19
17
17
1
3
0
1
141,715
Kane610/deconz
pydeconz/models/sensor/door_lock.py
pydeconz.models.sensor.door_lock.DoorLockLockState
class DoorLockLockState(enum.StrEnum): """State the lock is in.""" LOCKED = "locked" UNLOCKED = "unlocked" UNDEFINED = "undefined" NOT_FULLY_LOCKED = "not fully locked"
class DoorLockLockState(enum.StrEnum): '''State the lock is in.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
68
7
1
5
5
4
1
5
5
4
0
3
0
0
141,716
Kane610/deconz
pydeconz/models/sensor/consumption.py
pydeconz.models.sensor.consumption.TypedConsumptionState
class TypedConsumptionState(TypedDict): """Consumption state type definition.""" consumption: int power: int
class TypedConsumptionState(TypedDict): '''Consumption state type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,717
Kane610/deconz
pydeconz/models/sensor/consumption.py
pydeconz.models.sensor.consumption.Consumption
class Consumption(SensorBase): """Power consumption sensor.""" raw: TypedConsumption @property def consumption(self) -> int: """Consumption.""" return self.raw["state"]["consumption"] @property def scaled_consumption(self) -> float: """State of sensor.""" return self.consumption / 1000 @property def power(self) -> int | None: """Power.""" return self.raw["state"].get("power")
class Consumption(SensorBase): '''Power consumption sensor.''' @property def consumption(self) -> int: '''Consumption.''' pass @property def scaled_consumption(self) -> float: '''State of sensor.''' pass @property def power(self) -> int | None: '''Power.''' pass
7
4
3
0
2
1
1
0.36
1
2
0
0
3
0
3
23
19
4
11
7
4
4
8
4
4
1
3
0
3
141,718
Kane610/deconz
pydeconz/models/sensor/carbon_monoxide.py
pydeconz.models.sensor.carbon_monoxide.TypedCarbonMonoxideState
class TypedCarbonMonoxideState(TypedDict): """Carbon monoxide state type definition.""" carbonmonoxide: bool
class TypedCarbonMonoxideState(TypedDict): '''Carbon monoxide state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,719
Kane610/deconz
pydeconz/models/sensor/carbon_monoxide.py
pydeconz.models.sensor.carbon_monoxide.TypedCarbonMonoxide
class TypedCarbonMonoxide(TypedDict): """Carbon monoxide type definition.""" state: TypedCarbonMonoxideState
class TypedCarbonMonoxide(TypedDict): '''Carbon monoxide type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,720
Kane610/deconz
pydeconz/models/sensor/carbon_monoxide.py
pydeconz.models.sensor.carbon_monoxide.CarbonMonoxide
class CarbonMonoxide(SensorBase): """Carbon monoxide sensor.""" raw: TypedCarbonMonoxide @property def carbon_monoxide(self) -> bool: """Carbon monoxide detected.""" return self.raw["state"]["carbonmonoxide"]
class CarbonMonoxide(SensorBase): '''Carbon monoxide sensor.''' @property def carbon_monoxide(self) -> bool: '''Carbon monoxide detected.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,721
Kane610/deconz
pydeconz/models/sensor/carbon_dioxide.py
pydeconz.models.sensor.carbon_dioxide.TypedCarbonDioxideState
class TypedCarbonDioxideState(TypedDict): """Carbon dioxide state type definition.""" measured_value: int
class TypedCarbonDioxideState(TypedDict): '''Carbon dioxide state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,722
Kane610/deconz
pydeconz/models/sensor/carbon_dioxide.py
pydeconz.models.sensor.carbon_dioxide.TypedCarbonDioxide
class TypedCarbonDioxide(TypedDict): """Carbon dioxide type definition.""" state: TypedCarbonDioxideState
class TypedCarbonDioxide(TypedDict): '''Carbon dioxide type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,723
Kane610/deconz
pydeconz/models/sensor/consumption.py
pydeconz.models.sensor.consumption.TypedConsumption
class TypedConsumption(TypedDict): """Consumption type definition.""" state: TypedConsumptionState
class TypedConsumption(TypedDict): '''Consumption type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,724
Kane610/deconz
pydeconz/models/sensor/door_lock.py
pydeconz.models.sensor.door_lock.TypedDoorLock
class TypedDoorLock(TypedDict): """Door lock type definition.""" config: TypedDoorLockConfig state: TypedDoorLockState
class TypedDoorLock(TypedDict): '''Door lock type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,725
Kane610/deconz
pydeconz/models/sensor/door_lock.py
pydeconz.models.sensor.door_lock.TypedDoorLockConfig
class TypedDoorLockConfig(TypedDict): """Door lock config type definition.""" lock: bool
class TypedDoorLockConfig(TypedDict): '''Door lock config type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,726
Kane610/deconz
pydeconz/models/sensor/door_lock.py
pydeconz.models.sensor.door_lock.TypedDoorLockState
class TypedDoorLockState(TypedDict): """Door lock state type definition.""" lockstate: Literal["locked", "unlocked", "undefined", "not fully locked"]
class TypedDoorLockState(TypedDict): '''Door lock state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,727
Kane610/deconz
pydeconz/models/sensor/humidity.py
pydeconz.models.sensor.humidity.TypedHumidityConfig
class TypedHumidityConfig(TypedDict): """Humidity config type definition.""" offset: int
class TypedHumidityConfig(TypedDict): '''Humidity config type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,728
Kane610/deconz
pydeconz/models/sensor/humidity.py
pydeconz.models.sensor.humidity.TypedHumidity
class TypedHumidity(TypedDict): """Humidity type definition.""" config: TypedHumidityConfig state: TypedHumidityState
class TypedHumidity(TypedDict): '''Humidity type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,729
Kane610/deconz
pydeconz/models/sensor/humidity.py
pydeconz.models.sensor.humidity.Humidity
class Humidity(SensorBase): """Humidity sensor.""" raw: TypedHumidity @property def humidity(self) -> int: """Humidity level.""" return self.raw["state"]["humidity"] @property def scaled_humidity(self) -> float: """Scaled humidity level.""" return self.humidity / 100 @property def offset(self) -> int | None: """Signed offset value to measured state values. Values send by the REST-API are already amended by the offset. """ return self.raw["config"].get("offset")
class Humidity(SensorBase): '''Humidity sensor.''' @property def humidity(self) -> int: '''Humidity level.''' pass @property def scaled_humidity(self) -> float: '''Scaled humidity level.''' pass @property def offset(self) -> int | None: '''Signed offset value to measured state values. Values send by the REST-API are already amended by the offset. ''' pass
7
4
4
0
2
2
1
0.55
1
2
0
0
3
0
3
23
22
5
11
7
4
6
8
4
4
1
3
0
3
141,730
Kane610/deconz
pydeconz/models/sensor/generic_status.py
pydeconz.models.sensor.generic_status.TypedGenericStatusState
class TypedGenericStatusState(TypedDict): """Generic status state type definition.""" status: str
class TypedGenericStatusState(TypedDict): '''Generic status state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,731
Kane610/deconz
pydeconz/models/sensor/generic_status.py
pydeconz.models.sensor.generic_status.TypedGenericStatus
class TypedGenericStatus(TypedDict): """Generic status type definition.""" state: TypedGenericStatusState
class TypedGenericStatus(TypedDict): '''Generic status type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,732
Kane610/deconz
pydeconz/models/sensor/generic_status.py
pydeconz.models.sensor.generic_status.GenericStatus
class GenericStatus(SensorBase): """Generic status sensor.""" raw: TypedGenericStatus @property def status(self) -> str: """Status.""" return self.raw["state"]["status"]
class GenericStatus(SensorBase): '''Generic status sensor.''' @property def status(self) -> str: '''Status.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,733
Kane610/deconz
pydeconz/models/sensor/generic_flag.py
pydeconz.models.sensor.generic_flag.TypedGenericFlagState
class TypedGenericFlagState(TypedDict): """Generic flag state type definition.""" flag: bool
class TypedGenericFlagState(TypedDict): '''Generic flag state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,734
Kane610/deconz
pydeconz/models/sensor/generic_flag.py
pydeconz.models.sensor.generic_flag.TypedGenericFlag
class TypedGenericFlag(TypedDict): """Generic flag type definition.""" state: TypedGenericFlagState
class TypedGenericFlag(TypedDict): '''Generic flag type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,735
Kane610/deconz
pydeconz/models/sensor/generic_flag.py
pydeconz.models.sensor.generic_flag.GenericFlag
class GenericFlag(SensorBase): """Generic flag sensor.""" raw: TypedGenericFlag @property def flag(self) -> bool: """Flag status.""" return self.raw["state"]["flag"]
class GenericFlag(SensorBase): '''Generic flag sensor.''' @property def flag(self) -> bool: '''Flag status.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,736
Kane610/deconz
pydeconz/models/sensor/formaldehyde.py
pydeconz.models.sensor.formaldehyde.TypedFormaldehydeState
class TypedFormaldehydeState(TypedDict): """Formaldehyde state type definition.""" measured_value: int
class TypedFormaldehydeState(TypedDict): '''Formaldehyde state type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,737
Kane610/deconz
pydeconz/models/sensor/formaldehyde.py
pydeconz.models.sensor.formaldehyde.TypedFormaldehyde
class TypedFormaldehyde(TypedDict): """Formaldehyde type definition.""" state: TypedFormaldehydeState
class TypedFormaldehyde(TypedDict): '''Formaldehyde type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,738
Kane610/deconz
pydeconz/models/sensor/formaldehyde.py
pydeconz.models.sensor.formaldehyde.Formaldehyde
class Formaldehyde(SensorBase): """Formaldehyde sensor.""" raw: TypedFormaldehyde @property def formaldehyde(self) -> int: """Formaldehyde detected.""" return self.raw["state"]["measured_value"]
class Formaldehyde(SensorBase): '''Formaldehyde sensor.''' @property def formaldehyde(self) -> int: '''Formaldehyde detected.''' pass
3
2
3
0
2
1
1
0.4
1
1
0
0
1
0
1
21
9
2
5
3
2
2
4
2
2
1
3
0
1
141,739
Kane610/deconz
pydeconz/models/sensor/fire.py
pydeconz.models.sensor.fire.TypedFireState
class TypedFireState(TypedDict): """Fire state type definition.""" fire: bool test: bool
class TypedFireState(TypedDict): '''Fire state type definition.'''
1
1
0
0
0
0
0
0.33
1
0
0
0
0
0
0
0
5
1
3
1
2
1
3
1
2
0
1
0
0
141,740
Kane610/deconz
pydeconz/models/sensor/fire.py
pydeconz.models.sensor.fire.TypedFire
class TypedFire(TypedDict): """Fire type definition.""" state: TypedFireState
class TypedFire(TypedDict): '''Fire type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0
141,741
Kane610/deconz
pydeconz/models/sensor/fire.py
pydeconz.models.sensor.fire.Fire
class Fire(SensorBase): """Fire sensor.""" raw: TypedFire @property def fire(self) -> bool: """Fire detected.""" return self.raw["state"]["fire"] @property def in_test_mode(self) -> bool: """Sensor is in test mode.""" return self.raw["state"].get("test", False)
class Fire(SensorBase): '''Fire sensor.''' @property def fire(self) -> bool: '''Fire detected.''' pass @property def in_test_mode(self) -> bool: '''Sensor is in test mode.''' pass
5
3
3
0
2
1
1
0.38
1
1
0
0
2
0
2
22
14
3
8
5
3
3
6
3
3
1
3
0
2
141,742
Kane610/deconz
pydeconz/models/sensor/light_level.py
pydeconz.models.sensor.light_level.LightLevel
class LightLevel(SensorBase): """Light level sensor.""" raw: TypedLightLevel @property def dark(self) -> bool | None: """If the area near the sensor is light or not.""" return self.raw["state"].get("dark") @property def daylight(self) -> bool | None: """Daylight.""" return self.raw["state"].get("daylight") @property def light_level(self) -> int: """Light level.""" return self.raw["state"]["lightlevel"] @property def scaled_light_level(self) -> float: """Scaled light level.""" return round(math.pow(10, (self.light_level - 1) / 10000), 1) @property def lux(self) -> int | None: """Lux.""" return self.raw["state"].get("lux") @property def threshold_dark(self) -> int | None: """Threshold to hold dark.""" return self.raw["config"].get("tholddark") @property def threshold_offset(self) -> int | None: """Offset for threshold to hold dark.""" return self.raw["config"].get("tholdoffset")
class LightLevel(SensorBase): '''Light level sensor.''' @property def dark(self) -> bool | None: '''If the area near the sensor is light or not.''' pass @property def daylight(self) -> bool | None: '''Daylight.''' pass @property def light_level(self) -> int: '''Light level.''' pass @property def scaled_light_level(self) -> float: '''Scaled light level.''' pass @property def lux(self) -> int | None: '''Lux.''' pass @property def threshold_dark(self) -> int | None: '''Threshold to hold dark.''' pass @property def threshold_offset(self) -> int | None: '''Offset for threshold to hold dark.''' pass
15
8
3
0
2
1
1
0.35
1
3
0
0
7
0
7
27
39
8
23
15
8
8
16
8
8
1
3
0
7
141,743
Kane610/deconz
pydeconz/interfaces/sensors.py
pydeconz.interfaces.sensors.PressureHandler
class PressureHandler(APIHandler[Pressure]): """Handler for pressure sensor.""" resource_group = ResourceGroup.SENSOR resource_types = { ResourceType.ZHA_PRESSURE, ResourceType.CLIP_PRESSURE, } item_cls = Pressure
class PressureHandler(APIHandler[Pressure]): '''Handler for pressure sensor.''' pass
1
1
0
0
0
0
0
0.14
1
0
0
0
0
0
0
15
9
1
7
4
6
1
4
4
3
0
2
0
0
141,744
Kane610/deconz
pydeconz/models/alarm_system.py
pydeconz.models.alarm_system.AlarmSystemArmAction
class AlarmSystemArmAction(enum.StrEnum): """Explicit url path to arm and disarm.""" AWAY = "arm_away" NIGHT = "arm_night" STAY = "arm_stay" DISARM = "disarm"
class AlarmSystemArmAction(enum.StrEnum): '''Explicit url path to arm and disarm.''' pass
1
1
0
0
0
0
0
0.2
1
0
0
0
0
0
0
68
7
1
5
5
4
1
5
5
4
0
3
0
0
141,745
Kane610/deconz
pydeconz/interfaces/sensors.py
pydeconz.interfaces.sensors.PowerHandler
class PowerHandler(APIHandler[Power]): """Handler for power sensor.""" resource_group = ResourceGroup.SENSOR resource_type = ResourceType.ZHA_POWER item_cls = Power
class PowerHandler(APIHandler[Power]): '''Handler for power sensor.''' pass
1
1
0
0
0
0
0
0.25
1
0
0
0
0
0
0
15
6
1
4
4
3
1
4
4
3
0
2
0
0
141,746
Kane610/deconz
pydeconz/models/sensor/vibration.py
pydeconz.models.sensor.vibration.Vibration
class Vibration(SensorBase): """Vibration sensor.""" raw: TypedVibration @property def orientation(self) -> list[str] | None: """Orientation.""" return self.raw["state"].get("orientation") @property def sensitivity(self) -> int | None: """Vibration sensitivity.""" return self.raw["config"].get("sensitivity") @property def max_sensitivity(self) -> int | None: """Vibration max sensitivity.""" return self.raw["config"].get("sensitivitymax") @property def tilt_angle(self) -> int | None: """Tilt angle.""" return self.raw["state"].get("tiltangle") @property def vibration(self) -> bool: """Vibration.""" return self.raw["state"]["vibration"] @property def vibration_strength(self) -> int | None: """Strength of vibration.""" return self.raw["state"].get("vibrationstrength")
class Vibration(SensorBase): '''Vibration sensor.''' @property def orientation(self) -> list[str] | None: '''Orientation.''' pass @property def sensitivity(self) -> int | None: '''Vibration sensitivity.''' pass @property def max_sensitivity(self) -> int | None: '''Vibration max sensitivity.''' pass @property def tilt_angle(self) -> int | None: '''Tilt angle.''' pass @property def vibration(self) -> bool: '''Vibration.''' pass @property def vibration_strength(self) -> int | None: '''Strength of vibration.''' pass
13
7
3
0
2
1
1
0.35
1
4
0
0
6
0
6
26
34
7
20
13
7
7
14
7
7
1
3
0
6
141,747
Kane610/deconz
pydeconz/models/sensor/water.py
pydeconz.models.sensor.water.TypedWater
class TypedWater(TypedDict): """Water type definition.""" state: TypedWaterState
class TypedWater(TypedDict): '''Water type definition.'''
1
1
0
0
0
0
0
0.5
1
0
0
0
0
0
0
0
4
1
2
1
1
1
2
1
1
0
1
0
0