-
Notifications
You must be signed in to change notification settings - Fork 721
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
13 changed files
with
262 additions
and
30 deletions.
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 |
---|---|---|
|
@@ -6,5 +6,4 @@ cd "$(dirname "$0")/.." | |
black \ | ||
--check \ | ||
--fast \ | ||
--quiet \ | ||
zhaquirks tests script *.py |
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
from setuptools import find_packages, setup | ||
|
||
VERSION = "0.0.26" | ||
VERSION = "0.0.27" | ||
|
||
|
||
def readme(): | ||
|
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
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
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,76 @@ | ||
"""Device handler for smartthings moistureV4 sensor.""" | ||
from zigpy.profiles import zha | ||
from zigpy.quirks import CustomDevice | ||
from zigpy.zcl.clusters.general import Basic, BinaryInput, Identify, Ota, PollControl | ||
from zigpy.zcl.clusters.measurement import TemperatureMeasurement | ||
from zigpy.zcl.clusters.security import IasZone | ||
|
||
from zhaquirks.centralite import PowerConfigurationCluster | ||
|
||
from . import SMART_THINGS | ||
from ..const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
|
||
|
||
class CustomIasZone(IasZone): | ||
"""Custom IasZone cluster.""" | ||
|
||
MOISTURE_TYPE = 0x002A | ||
ZONE_TYPE = 0x0001 | ||
|
||
def _update_attribute(self, attrid, value): | ||
if attrid == self.ZONE_TYPE: | ||
super()._update_attribute(attrid, self.MOISTURE_TYPE) | ||
else: | ||
super()._update_attribute(attrid, value) | ||
|
||
|
||
class SmartThingsMoistureV4(CustomDevice): | ||
"""SmartThingsMoistureV4.""" | ||
|
||
signature = { | ||
# <SimpleDescriptor endpoint=1 profile=260 device_type=1026 | ||
# device_version=0 | ||
# input_clusters=[0, 1, 3, 15, 1026, 1280, 32] | ||
# output_clusters=[25]> | ||
MODELS_INFO: [(SMART_THINGS, "moisturev4")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.IAS_ZONE, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
PowerConfigurationCluster.cluster_id, | ||
Identify.cluster_id, | ||
BinaryInput.cluster_id, | ||
PollControl.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
IasZone.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
} | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
PowerConfigurationCluster, | ||
Identify.cluster_id, | ||
BinaryInput.cluster_id, | ||
PollControl.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
CustomIasZone, | ||
], | ||
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
Oops, something went wrong.