-
Notifications
You must be signed in to change notification settings - Fork 725
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
257 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
|
||
from setuptools import find_packages, setup | ||
|
||
VERSION = "0.0.91" | ||
VERSION = "0.0.92" | ||
|
||
|
||
setup( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], | ||
} | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Module for Universal Electronics devices.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters