Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion zhaquirks/inovelli/VZM32SN.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
from zigpy.profiles import zha
from zigpy.quirks.v2 import QuirkBuilder

from zhaquirks.inovelli import INOVELLI_AUTOMATION_TRIGGERS, InovelliVZM32SNCluster
from zhaquirks.inovelli import (
INOVELLI_AUTOMATION_TRIGGERS,
InovelliVZM32SNCluster,
InovelliVZM32SNMMWaveCluster,
)

(
QuirkBuilder("Inovelli", "VZM32-SN")
.replaces_endpoint(1, device_type=zha.DeviceType.DIMMABLE_LIGHT)
.replace_cluster_occurrences(InovelliVZM32SNMMWaveCluster)
.replace_cluster_occurrences(InovelliVZM32SNCluster)
.device_automation_triggers(INOVELLI_AUTOMATION_TRIGGERS)
.add_to_registry()
Expand Down
99 changes: 99 additions & 0 deletions zhaquirks/inovelli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,105 @@ class AttributeDefs(InovelliCluster.AttributeDefs):
)


class InovelliVZM32SNMMWaveCluster(CustomCluster):
"""Inovelli VZM32-SN MMWave custom cluster."""

cluster_id = 0xFC32
ep_attribute = "inovelli_vzm32snmmwave_cluster"

class AttributeDefs(BaseAttributeDefs):
"""Attribute definitions."""

mmwave_z_min = ZCLAttributeDef(
id=0x0065,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_z_max = ZCLAttributeDef(
id=0x0066,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_x_min = ZCLAttributeDef(
id=0x0067,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_x_max = ZCLAttributeDef(
id=0x0068,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_y_min = ZCLAttributeDef(
id=0x0069,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_y_max = ZCLAttributeDef(
id=0x006A,
type=t.int16s,
is_manufacturer_specific=True,
)
mmwave_target_info_report = ZCLAttributeDef(
id=0x006B,
type=t.uint8_t,
is_manufacturer_specific=True,
)
mmwave_stay_life = ZCLAttributeDef(
id=0x006C,
type=t.uint32_t,
is_manufacturer_specific=True,
)
mmwave_detect_sensitivity = ZCLAttributeDef(
id=0x0070,
type=t.uint8_t,
is_manufacturer_specific=True,
)
mmwave_detect_trigger = ZCLAttributeDef(
id=0x0071,
type=t.uint8_t,
is_manufacturer_specific=True,
)
mmwave_hold_time = ZCLAttributeDef(
id=0x0072,
type=t.uint32_t,
is_manufacturer_specific=True,
)
mmwave_version = ZCLAttributeDef(
id=0x0073,
type=t.uint32_t,
is_manufacturer_specific=True,
)

class ServerCommandDefs(BaseCommandDefs):
"""Server command definitions."""

mmwave_control_command = ZCLCommandDef(
id=0x00,
schema={
"control_id": t.uint8_t,
},
is_manufacturer_specific=True,
)

def handle_cluster_request(
self,
hdr: ZCLHeader,
args: list[Any],
*,
dst_addressing: Optional[
Union[t.Addressing.Group, t.Addressing.IEEE, t.Addressing.NWK]
] = None,
):
"""Handle a cluster request."""
_LOGGER.debug(
"%s: handle_cluster_request - Command: %s Data: %s",
self.name,
hdr.command_id,
args,
)


class InovelliVZM35SNCluster(InovelliCluster):
"""Inovelli VZM35-SN custom cluster."""

Expand Down
Loading