Add Philips Hue motion sensor config entities to ZHA (#79923)
* Add Hue trigger LED config switch * Add Hue sensitivity config select * Use existing consts for channel names * Add friendly names to config entities * Follow HA capitalization conventions * Move Hue motion sensor check to a helper method * Move helper method to a new helpers file in channels folder
This commit is contained in:
parent
5eb69f38aa
commit
00b0fa6cdf
5 changed files with 104 additions and 1 deletions
|
@ -22,6 +22,7 @@ from .core import discovery
|
|||
from .core.const import (
|
||||
CHANNEL_IAS_WD,
|
||||
CHANNEL_INOVELLI,
|
||||
CHANNEL_OCCUPANCY,
|
||||
CHANNEL_ON_OFF,
|
||||
DATA_ZHA,
|
||||
SIGNAL_ADD_ENTITIES,
|
||||
|
@ -259,13 +260,57 @@ class AqaraMotionSensitivities(types.enum8):
|
|||
channel_names="opple_cluster", models={"lumi.motion.ac01", "lumi.motion.ac02"}
|
||||
)
|
||||
class AqaraMotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
|
||||
"""Representation of a ZHA on off transition time configuration entity."""
|
||||
"""Representation of a ZHA motion sensitivity configuration entity."""
|
||||
|
||||
_select_attr = "motion_sensitivity"
|
||||
_enum = AqaraMotionSensitivities
|
||||
_attr_name = "Motion sensitivity"
|
||||
|
||||
|
||||
class HueV1MotionSensitivities(types.enum8):
|
||||
"""Hue v1 motion sensitivities."""
|
||||
|
||||
Low = 0x00
|
||||
Medium = 0x01
|
||||
High = 0x02
|
||||
|
||||
|
||||
@CONFIG_DIAGNOSTIC_MATCH(
|
||||
channel_names=CHANNEL_OCCUPANCY,
|
||||
manufacturers={"Philips", "Signify Netherlands B.V."},
|
||||
models={"SML001"},
|
||||
)
|
||||
class HueV1MotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
|
||||
"""Representation of a ZHA motion sensitivity configuration entity."""
|
||||
|
||||
_select_attr = "sensitivity"
|
||||
_attr_name = "Hue motion sensitivity"
|
||||
_enum = HueV1MotionSensitivities
|
||||
|
||||
|
||||
class HueV2MotionSensitivities(types.enum8):
|
||||
"""Hue v2 motion sensitivities."""
|
||||
|
||||
Lowest = 0x00
|
||||
Low = 0x01
|
||||
Medium = 0x02
|
||||
High = 0x03
|
||||
Highest = 0x04
|
||||
|
||||
|
||||
@CONFIG_DIAGNOSTIC_MATCH(
|
||||
channel_names=CHANNEL_OCCUPANCY,
|
||||
manufacturers={"Philips", "Signify Netherlands B.V."},
|
||||
models={"SML002", "SML003", "SML004"},
|
||||
)
|
||||
class HueV2MotionSensitivity(ZCLEnumSelectEntity, id_suffix="motion_sensitivity"):
|
||||
"""Representation of a ZHA motion sensitivity configuration entity."""
|
||||
|
||||
_select_attr = "sensitivity"
|
||||
_attr_name = "Hue motion sensitivity"
|
||||
_enum = HueV2MotionSensitivities
|
||||
|
||||
|
||||
class AqaraMonitoringModess(types.enum8):
|
||||
"""Aqara monitoring modes."""
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue