|
| 1 | +"""Third Reality Blind Gen2 devices.""" |
| 2 | + |
| 3 | +from typing import Final |
| 4 | + |
| 5 | +from zigpy.quirks import CustomCluster |
| 6 | +from zigpy.quirks.v2 import QuirkBuilder |
| 7 | +import zigpy.types as t |
| 8 | +from zigpy.zcl.foundation import BaseAttributeDefs, ZCLAttributeDef |
| 9 | + |
| 10 | + |
| 11 | +class THIRD_REALITY_Blind_Gen2_CLUSTER(CustomCluster): |
| 12 | + """Third Reality's Blind Gen2 private cluster.""" |
| 13 | + |
| 14 | + cluster_id = 0xFFF1 |
| 15 | + |
| 16 | + class AttributeDefs(BaseAttributeDefs): |
| 17 | + """Define the attributes of a private cluster.""" |
| 18 | + |
| 19 | + enable_disable_pir_remote: Final = ZCLAttributeDef( |
| 20 | + id=0x0000, |
| 21 | + type=t.uint8_t, |
| 22 | + is_manufacturer_specific=True, |
| 23 | + ) |
| 24 | + |
| 25 | + compensation_speed: Final = ZCLAttributeDef( |
| 26 | + id=0x0001, |
| 27 | + type=t.int8s, |
| 28 | + is_manufacturer_specific=True, |
| 29 | + ) |
| 30 | + |
| 31 | + limit_position: Final = ZCLAttributeDef( |
| 32 | + id=0x0002, |
| 33 | + type=t.uint16_t, |
| 34 | + is_manufacturer_specific=True, |
| 35 | + ) |
| 36 | + |
| 37 | + |
| 38 | +( |
| 39 | + QuirkBuilder("Third Reality, Inc", "3RSB02015Z") |
| 40 | + .replaces(THIRD_REALITY_Blind_Gen2_CLUSTER, endpoint_id=1) |
| 41 | + .switch( |
| 42 | + attribute_name=THIRD_REALITY_Blind_Gen2_CLUSTER.AttributeDefs.enable_disable_pir_remote.name, |
| 43 | + cluster_id=THIRD_REALITY_Blind_Gen2_CLUSTER.cluster_id, |
| 44 | + force_inverted=True, |
| 45 | + translation_key="enable_pir_mode", |
| 46 | + fallback_name="Enable PIR remote", |
| 47 | + ) |
| 48 | + .number( |
| 49 | + attribute_name=THIRD_REALITY_Blind_Gen2_CLUSTER.AttributeDefs.compensation_speed.name, |
| 50 | + cluster_id=THIRD_REALITY_Blind_Gen2_CLUSTER.cluster_id, |
| 51 | + endpoint_id=1, |
| 52 | + min_value=-100, |
| 53 | + max_value=100, |
| 54 | + step=1, |
| 55 | + mode="box", |
| 56 | + translation_key="compensation_speed", |
| 57 | + fallback_name="Compensation speed", |
| 58 | + ) |
| 59 | + .number( |
| 60 | + attribute_name=THIRD_REALITY_Blind_Gen2_CLUSTER.AttributeDefs.limit_position.name, |
| 61 | + cluster_id=THIRD_REALITY_Blind_Gen2_CLUSTER.cluster_id, |
| 62 | + endpoint_id=1, |
| 63 | + min_value=0, |
| 64 | + max_value=3800, |
| 65 | + step=1, |
| 66 | + translation_key="limit_position", |
| 67 | + fallback_name="Limit position", |
| 68 | + ) |
| 69 | + .add_to_registry() |
| 70 | +) |
0 commit comments