How to use the zigpy.types.enum8 function in zigpy

To help you get started, we’ve selected a few zigpy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zigpy / zigpy / zigpy / zcl / clusters / hvac.py View on Github external
class HeatingSystemType(t.enum8):
    Conventional = 0x00
    Heat_Pump = 0x01


class HeatingFuelSource(t.enum8):
    Electric = 0x00
    Gas = 0x01


class Thermostat(Cluster):
    """An interface for configuring and controlling the
    functionality of a thermostat."""

    class ACCapacityFormat(t.enum8):
        BTUh = 0x00

    class ACCompressorType(t.enum8):
        Reserved = 0x00
        T1_max_working_43C = 0x01
        T2_max_working_35C = 0x02
        T3_max_working_52C = 0x03

    class ACType(t.enum8):
        Reserved = 0x00
        Cooling_fixed_speed = 0x01
        Heat_Pump_fixed_speed = 0x02
        Cooling_Inverter = 0x03
        Heat_Pump_Inverter = 0x04

    class ACRefrigerantType(t.enum8):
github zigpy / zigpy / zigpy / zcl / clusters / hvac.py View on Github external
all_local = 0x00
        local_temperature_sensed_remotely = 0x01
        outdoor_temperature_sensed_remotely = 0x02
        occupancy_sensed_remotely = 0x04

    class SetpointChangeSource(t.enum8):
        Manual = 0x00
        Schedule = 0x01
        External = 0x02

    class SetpointMode(t.enum8):
        Heat = 0x00
        Cool = 0x01
        Both = 0x02

    class StartOfWeek(t.enum8):
        Sunday = 0x00
        Monday = 0x01
        Tuesday = 0x02
        Wednesday = 0x03
        Thursday = 0x04
        Friday = 0x05
        Saturday = 0x06

    class SystemMode(t.enum8):
        Off = 0x00
        Auto = 0x01
        Cool = 0x03
        Heat = 0x04
        Emergency_Heating = 0x05
        Pre_cooling = 0x06
        Fan_only = 0x07
github zigpy / zigpy / zigpy / zcl / clusters / hvac.py View on Github external
server_commands = {}
    client_commands = {}


class Dehumidification(Cluster):
    """An interface for controlling dehumidification."""

    class RelativeHumidityMode(t.enum8):
        RH_measured_locally = 0x00
        RH_measured_remotely = 0x01

    class DehumidificationLockout(t.enum8):
        Dehumidification_not_allowed = 0x00
        Dehumidification_is_allowed = 0x01

    class RelativeHumidityDisplay(t.enum8):
        RH_not_displayed = 0x00
        RH_is_displayed = 0x01

    cluster_id = 0x0203
    ep_attribute = "dehumidification"
    attributes = {
        # Dehumidification Information
        0x0000: ("relative_humidity", t.uint8_t),
        0x0001: ("dehumid_cooling", t.uint8_t),
        # Dehumidification Settings
        0x0010: ("rh_dehumid_setpoint", t.uint8_t),
        0x0011: ("relative_humidity_mode", RelativeHumidityMode),
        0x0012: ("dehumid_lockout", DehumidificationLockout),
        0x0013: ("dehumid_hysteresis", t.uint8_t),
        0x0014: ("dehumid_max_cool", t.uint8_t),
        0x0015: ("relative_humid_display", RelativeHumidityDisplay),
github zigpy / zigpy / zigpy / zcl / clusters / protocol.py View on Github external
}
    server_commands = {}
    client_commands = {}


class MultistateValueExtended(Cluster):
    cluster_id = 0x0613
    ep_attribute = "bacnet_extended_multistate_value"
    attributes = {
        0x0000: ("acked_transitions", t.bitmap8),
        0x0006: ("alarm_value", t.uint16_t),
        0x0011: ("notification_class", t.uint16_t),
        0x0023: ("event_enable", t.bitmap8),
        0x0024: ("event_state", t.enum8),
        0x0025: ("fault_values", t.uint16_t),
        0x0048: ("notify_type", t.enum8),
        0x0071: ("time_delay", t.uint8_t),
        # 0x0082: ('event_time_stamps', TODO.array),  # Array[3] of (16-bit unsigned
        # integer, time of day, or structure of (date, time of day))
    }
    server_commands = {}
    client_commands = {}
github zigpy / zigpy / zigpy / zcl / clusters / security.py View on Github external
0x0000: ("enroll_response", (EnrollResponse, t.uint8_t), True),
        0x0001: ("init_normal_op_mode", (), False),
        0x0002: ("init_test_mode", (t.uint8_t, t.uint8_t), False),
    }
    client_commands = {
        0x0000: (
            "status_change_notification",
            (ZoneStatus, t.bitmap8, t.uint8_t, t.uint16_t),
            False,
        ),
        0x0001: ("enroll", (ZoneType, t.uint16_t), False),
    }


class IasAce(Cluster):
    class AlarmStatus(t.enum8):
        """IAS ACE alarm status enum."""

        No_Alarm = 0x00
        Burglar = 0x01
        Fire = 0x02
        Emergency = 0x03
        Police_Panic = 0x04
        Fire_Panic = 0x05
        Emergency_Panic = 0x06

    class ArmMode(t.enum8):
        """IAS ACE arm mode enum."""

        Disarm = 0x00
        Arm_Day_Home_Only = 0x01
        Arm_Night_Sleep_Only = 0x02
github zigpy / zigpy / zigpy / zcl / clusters / hvac.py View on Github external
Supply_voltage_too_low = 0x0001
        Supply_voltage_too_high = 0x0002
        Power_missing_phase = 0x0004
        System_pressure_too_low = 0x0008
        System_pressure_too_high = 0x0010
        Dry_running = 0x0020
        Motor_temperature_too_high = 0x0040
        Pump_motor_has_fatal_failure = 0x0080
        Electronic_temperature_too_high = 0x0100
        Pump_blocked = 0x0200
        Sensor_failure = 0x0400
        Electronic_non_fatal_failure = 0x0800
        Electronic_fatal_failure = 0x1000
        General_fault = 0x2000

    class ControlMode(t.enum8):
        Constant_speed = 0x00
        Constant_pressure = 0x01
        Proportional_pressure = 0x02
        Constant_flow = 0x03
        Constant_temperature = 0x05
        Automatic = 0x07

    class OperationMode(t.enum8):
        Normal = 0x00
        Minimum = 0x01
        Maximum = 0x02
        Local = 0x03

    class PumpStatus(t.bitmap16):
        Device_fault = 0x0001
        Supply_fault = 0x0002
github zigpy / zigpy / zigpy / zcl / clusters / security.py View on Github external
Burglar = 0x01
        Fire = 0x02
        Emergency = 0x03
        Police_Panic = 0x04
        Fire_Panic = 0x05
        Emergency_Panic = 0x06

    class ArmMode(t.enum8):
        """IAS ACE arm mode enum."""

        Disarm = 0x00
        Arm_Day_Home_Only = 0x01
        Arm_Night_Sleep_Only = 0x02
        Arm_All_Zones = 0x03

    class ArmNotification(t.enum8):
        """IAS ACE arm notification enum."""

        All_Zones_Disarmed = 0x00
        Only_Day_Home_Zones_Armed = 0x01
        Only_Night_Sleep_Zones_Armed = 0x02
        All_Zones_Armed = 0x03
        Invalid_Arm_Disarm_Code = 0x04
        Not_Ready_To_Arm = 0x05
        Already_Disarmed = 0x06

    class AudibleNotification(t.enum_factory(t.uint8_t, "manufacturer_specific")):
        """IAS ACE audible notification enum."""

        Mute = 0x00
        Default_Sound = 0x01
github zigpy / zigpy / zigpy / zcl / clusters / closures.py View on Github external
ScheduleLock = 0x0B
        ScheduleUnlock = 0x0C
        Manual_Lock = 0x0D
        Manual_Unlock = 0x0E
        Non_Access_User_Operational_Event = 0x0F

    class ProgrammingEvent(t.enum8):
        UnknownOrMfgSpecific = 0x00
        MasterCodeChanged = 0x01
        PINCodeAdded = 0x02
        PINCodeDeleted = 0x03
        PINCodeChanges = 0x04
        RFIDCodeAdded = 0x05
        RFIDCodeDeleted = 0x06

    class UserStatus(t.enum8):
        Available = 0x00
        Enabled = 0x01
        Disabled = 0x03
        Not_Supported = 0xFF

    class UserType(t.enum8):
        Unrestricted = 0x00
        Year_Day_Schedule_User = 0x01
        Week_Day_Schedule_User = 0x02
        Master_User = 0x03
        Non_Access_User = 0x04
        Not_Supported = 0xFF

    class DayMask(t.bitmap8):
        Sun = 0x01
        Mon = 0x02
github zigpy / zigpy / zigpy / zcl / clusters / hvac.py View on Github external
Fan_Failure = 0x00000010

    class ACLouverPosition(t.enum8):
        Closed = 0x01
        Open = 0x02
        Qurter_Open = 0x03
        Half_Open = 0x04
        Three_Quarters_Open = 0x05

    class AlarmMask(t.bitmap8):
        No_Alarms = 0x00
        Initialization_failure = 0x01
        Hardware_failure = 0x02
        Self_calibration_failure = 0x04

    class ControlSequenceOfOperation(t.enum8):
        Cooling_Only = 0x00
        Cooling_With_Reheat = 0x01
        Heating_Only = 0x02
        Heating_With_Reheat = 0x03
        Cooling_and_Heating = 0x04
        Cooling_and_Heating_with_Reheat = 0x05

    class SeqDayOfWeek(t.bitmap8):
        Sunday = 0x01
        Monday = 0x02
        Tuesday = 0x04
        Wednesday = 0x08
        Thursday = 0x10
        Friday = 0x20
        Saturday = 0x40
        Away = 0x80
github zigpy / zigpy / zigpy / zcl / clusters / security.py View on Github external
@strobe.setter
        def strobe(self, strobe: "Strobe") -> None:
            self.value = (self.value & 0xF7) | ((strobe & 0x01) << 2)

        @property
        def level(self) -> "SirenLevel":
            return self.SirenLevel(self.value & 0x03)

        @level.setter
        def level(self, level: SirenLevel) -> None:
            self.value = (self.value & 0xFC) | (level & 0x03)

    class Squawk(_SquawkOrWarningCommand):
        Strobe = Strobe

        class SquawkLevel(t.enum8):
            Low_level_sound = 0x00
            Medium_level_sound = 0x01
            High_level_sound = 0x02
            Very_high_level_sound = 0x03

        class SquawkMode(t.enum8):
            Armed = 0x00
            Disarmed = 0x01

        @property
        def mode(self) -> "SquawkMode":
            return self.SquawkMode((self.value >> 4) & 0x0F)

        @mode.setter
        def mode(self, mode: SquawkMode) -> None:
            self.value = (self.value & 0xF) | ((mode & 0x0F) << 4)