Skip to content

Commit

Permalink
Merge branch 'release/0.0.92'
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Jan 26, 2023
2 parents ccf990a + 59179a7 commit b9bf8f6
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from setuptools import find_packages, setup

VERSION = "0.0.91"
VERSION = "0.0.92"


setup(
Expand Down
78 changes: 78 additions & 0 deletions zhaquirks/linkind/motion.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"""Linkind Motion Sensors."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
Identify,
Ota,
PollControl,
PowerConfiguration,
)
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.security import IasZone

from zhaquirks import MotionWithReset
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.linkind import LinkindBasicCluster

LINKIND_CLUSTER_ID = 0xFC81


class MotionClusterLinkind(MotionWithReset):
"""Motion cluster."""

reset_s: int = 60


class LinkindD0003(CustomDevice):
"""Linkind ZB-MotionSensor-D0003."""

signature = {
MODELS_INFO: [("lk", "ZB-MotionSensor-D0003")],
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026
# device_version=1
# input_clusters=[0, 1, 3, 32, 1280, 2821, 64641]
# output_clusters=[25]>
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
INPUT_CLUSTERS: [
Basic.cluster_id,
PowerConfiguration.cluster_id,
Identify.cluster_id,
PollControl.cluster_id,
IasZone.cluster_id,
Diagnostic.cluster_id,
LINKIND_CLUSTER_ID,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
}
},
}

replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
INPUT_CLUSTERS: [
LinkindBasicCluster,
PowerConfiguration.cluster_id,
Identify.cluster_id,
PollControl.cluster_id,
MotionClusterLinkind,
Diagnostic.cluster_id,
LINKIND_CLUSTER_ID,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
}
},
}
97 changes: 97 additions & 0 deletions zhaquirks/mli/tintE14rgbcct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
"""Tint E14 RGB CCT."""
from zigpy.profiles import zha
from zigpy.quirks import CustomCluster, CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
Identify,
LevelControl,
OnOff,
Ota,
Scenes,
)
from zigpy.zcl.clusters.lighting import Color
from zigpy.zcl.clusters.lightlink import LightLink

from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)


class TintManufacturerSpecificCluster(CustomCluster):
"""Tint manufacturer specific cluster."""

cluster_id = 0x100F # not inside the manufacturer specific cluster range


class TintRGBCCTColorCluster(CustomCluster, Color):
"""Tint RGB+CCT Lighting custom cluster."""

# Set correct capabilities to ct, xy, hs
# Tint bulbs do not correctly report this attribute
_CONSTANT_ATTRIBUTES = {0x400A: 0b11110}


class TintRGBCCTLight(CustomDevice):
"""Tint E14 RGB+CCT Lighting device."""

signature = {
MODELS_INFO: [("MLI", "tint-ExtendedColor")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
Color.cluster_id,
LightLink.cluster_id,
TintManufacturerSpecificCluster.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}

replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.EXTENDED_COLOR_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
LevelControl.cluster_id,
TintRGBCCTColorCluster,
LightLink.cluster_id,
TintManufacturerSpecificCluster,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
242: {
PROFILE_ID: 41440,
DEVICE_TYPE: 97,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
}
}
2 changes: 2 additions & 0 deletions zhaquirks/tuya/ts0601_trv_sas.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def __init__(self, *args, **kwargs):
("_TYST11_yw7cahqs", "w7cahqs"),
("_TYST11_9gvruqf5", "gvruqf5"),
("_TYST11_zuhszj9s", "uhszj9s"),
("_TYST11_caj4jz0i", "aj4jz0i"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=0
Expand Down Expand Up @@ -282,6 +283,7 @@ def __init__(self, *args, **kwargs):
("_TZE200_h4cgnbzg", "TS0601"),
("_TZE200_exfrnlow", "TS0601"),
("_TZE200_9m4kmbfu", "TS0601"),
("_TZE200_3yp57tby", "TS0601"),
],
ENDPOINTS: {
# <SimpleDescriptor endpoint=1 profile=260 device_type=81
Expand Down
1 change: 1 addition & 0 deletions zhaquirks/universalelectronics/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Module for Universal Electronics devices."""
71 changes: 71 additions & 0 deletions zhaquirks/universalelectronics/contact_sensor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
"""XHS2-UE Door/Window Sensor."""
from zigpy.profiles import zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import Basic, Identify, Ota, PollControl
from zigpy.zcl.clusters.homeautomation import Diagnostic
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.security import IasZone

from zhaquirks import PowerConfigurationCluster
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)


class CustomPowerConfigurationCluster(PowerConfigurationCluster):
"""Custom PowerConfigurationCluster."""

cluster_id = PowerConfigurationCluster.cluster_id
MIN_VOLTS = 2.1
MAX_VOLTS = 3.0


class ContactSensor(CustomDevice):
"""XHS2-UE Door/Window Sensor."""

signature = {
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026
# device_version=0
# input_clusters=[0, 1, 3, 1026, 1280, 32, 2821]
# output_clusters=[25]>
MODELS_INFO: [("Universal Electronics Inc", "URC4460BC0-X-R")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.IAS_ZONE,
INPUT_CLUSTERS: [
Basic.cluster_id,
CustomPowerConfigurationCluster.cluster_id,
Identify.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
PollControl.cluster_id,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
}
},
}

replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
INPUT_CLUSTERS: [
Basic.cluster_id,
CustomPowerConfigurationCluster,
Identify.cluster_id,
TemperatureMeasurement.cluster_id,
IasZone.cluster_id,
PollControl.cluster_id,
Diagnostic.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
}
}
}
7 changes: 7 additions & 0 deletions zhaquirks/xiaomi/aqara/plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@ def __init__(self, *args, **kwargs):
class Plug2(XiaomiCustomDevice):
"""lumi.plug with alternative signature."""

def __init__(self, *args, **kwargs):
"""Init."""
self.voltage_bus = Bus()
self.consumption_bus = Bus()
self.power_bus = Bus()
super().__init__(*args, **kwargs)

signature = {
MODELS_INFO: Plug.signature[MODELS_INFO],
ENDPOINTS: {
Expand Down

0 comments on commit b9bf8f6

Please sign in to comment.