| 
 | 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 | +from zigpy.quirks.v2.homeassistant import UnitOfTime  | 
 | 10 | + | 
 | 11 | + | 
 | 12 | + | 
 | 13 | +class THIRD_REALITY_Switch_CLUSTER(CustomCluster):  | 
 | 14 | +    """Third Reality's Switch private cluster."""  | 
 | 15 | + | 
 | 16 | +    cluster_id = 0xFF02  | 
 | 17 | + | 
 | 18 | +    class AttributeDefs(BaseAttributeDefs):  | 
 | 19 | +        """Define the attributes of a private cluster."""  | 
 | 20 | +		  | 
 | 21 | +          | 
 | 22 | +        on_to_off_delay: Final = ZCLAttributeDef(  | 
 | 23 | +            id=0x0001,  | 
 | 24 | +            type=t.uint16_t,  | 
 | 25 | +            is_manufacturer_specific=True,  | 
 | 26 | +        )  | 
 | 27 | +            | 
 | 28 | +        off_to_on_delay: Final = ZCLAttributeDef(  | 
 | 29 | +            id=0x0002,  | 
 | 30 | +            type=t.uint16_t,  | 
 | 31 | +            is_manufacturer_specific=True,  | 
 | 32 | +        )  | 
 | 33 | + | 
 | 34 | + | 
 | 35 | +(  | 
 | 36 | +    QuirkBuilder("Third Reality, Inc", "3RSS009Z")  | 
 | 37 | +    .replaces(THIRD_REALITY_Switch_CLUSTER)  | 
 | 38 | +    .number(  | 
 | 39 | +        attribute_name=THIRD_REALITY_Switch_CLUSTER.AttributeDefs.on_to_off_delay.name,  | 
 | 40 | +        cluster_id=THIRD_REALITY_Switch_CLUSTER.cluster_id,  | 
 | 41 | +        endpoint_id=1,  | 
 | 42 | +        min_value=0,  | 
 | 43 | +        max_value=65535,  | 
 | 44 | +        unit=UnitOfTime.SECONDS,  | 
 | 45 | +        step=1,  | 
 | 46 | +        translation_key="on_to_off_delay",  | 
 | 47 | +        fallback_name="on_to_off_delay",  | 
 | 48 | +    )  | 
 | 49 | +    .number(  | 
 | 50 | +        attribute_name=THIRD_REALITY_Switch_CLUSTER.AttributeDefs.off_to_on_delay.name,  | 
 | 51 | +        cluster_id=THIRD_REALITY_Switch_CLUSTER.cluster_id,  | 
 | 52 | +        endpoint_id=1,  | 
 | 53 | +        min_value=0,  | 
 | 54 | +        max_value=65535,  | 
 | 55 | +        unit=UnitOfTime.SECONDS,  | 
 | 56 | +        step=1,  | 
 | 57 | +        translation_key="off_to_on_delay",  | 
 | 58 | +        fallback_name="off_to_on_delay",  | 
 | 59 | +    )  | 
 | 60 | +    .add_to_registry()  | 
 | 61 | +)  | 
0 commit comments