-
Notifications
You must be signed in to change notification settings - Fork 687
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
11 changed files
with
457 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
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.40" | ||
VERSION = "0.0.41" | ||
|
||
|
||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
"""Module for Phillips quirks implementations.""" | ||
PHILLIPS = "Philips" |
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,115 @@ | ||
"""Quirk for Phillips SML002.""" | ||
from zigpy.profiles import zha, zll | ||
from zigpy.quirks import CustomCluster, CustomDevice | ||
import zigpy.types as t | ||
from zigpy.zcl.clusters.general import ( | ||
Basic, | ||
Groups, | ||
Identify, | ||
LevelControl, | ||
OnOff, | ||
Ota, | ||
PowerConfiguration, | ||
Scenes, | ||
) | ||
from zigpy.zcl.clusters.lighting import Color | ||
from zigpy.zcl.clusters.measurement import ( | ||
IlluminanceMeasurement, | ||
OccupancySensing, | ||
TemperatureMeasurement, | ||
) | ||
|
||
from . import PHILLIPS | ||
from ..const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
|
||
|
||
class OccupancyCluster(CustomCluster, OccupancySensing): | ||
"""Phillips occupancy cluster.""" | ||
|
||
attributes = OccupancySensing.attributes.copy() | ||
attributes.update({0x0030: ("sensitivity", t.uint8_t)}) | ||
attributes.update({0x0031: ("sensitivity_max", t.uint8_t)}) | ||
|
||
|
||
class PhilipsSML002(CustomDevice): | ||
"""Phillips SML002 device.""" | ||
|
||
signature = { | ||
MODELS_INFO: [(PHILLIPS, "SML002")], | ||
ENDPOINTS: { | ||
# <SimpleDescriptor endpoint=1 profile=49246 device_type=0x0850 | ||
# device_version=? | ||
# input_clusters=[0] | ||
# output_clusters=[0, 3, 4, 5, 6, 8, 768]> | ||
1: { | ||
PROFILE_ID: zll.PROFILE_ID, | ||
DEVICE_TYPE: zll.DeviceType.ON_OFF_SENSOR, | ||
INPUT_CLUSTERS: [Basic.cluster_id], | ||
OUTPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Color.cluster_id, | ||
], | ||
}, | ||
# <SimpleDescriptor endpoint=2 profile=260 device_type=0x0107 | ||
# device_version=? | ||
# input_clusters=[0, 1, 3, 1024, 1026, 1030] | ||
# output_clusters=[25]> | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.OCCUPANCY_SENSOR, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
PowerConfiguration.cluster_id, | ||
Identify.cluster_id, | ||
IlluminanceMeasurement.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
OccupancySensing.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zll.PROFILE_ID, | ||
DEVICE_TYPE: zll.DeviceType.ON_OFF_SENSOR, | ||
INPUT_CLUSTERS: [Basic.cluster_id], | ||
OUTPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
LevelControl.cluster_id, | ||
Color.cluster_id, | ||
], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.OCCUPANCY_SENSOR, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
PowerConfiguration.cluster_id, | ||
Identify.cluster_id, | ||
IlluminanceMeasurement.cluster_id, | ||
TemperatureMeasurement.cluster_id, | ||
OccupancyCluster, | ||
], | ||
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
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,59 @@ | ||
"""SmartThings SmartSense Multi Sensor quirk.""" | ||
from zigpy.profiles import zha | ||
from zigpy.quirks import CustomDevice | ||
from zigpy.zcl.clusters.general import Basic, Ota | ||
|
||
from ..const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
from . import SMART_THINGS, SmartThingsIasZone | ||
|
||
SMARTSENSE_MULTI_DEVICE_TYPE = 0x0139 # decimal = 313 | ||
|
||
|
||
class IasZoneContactSwitchCluster(SmartThingsIasZone): | ||
"""Custom IasZone cluster.""" | ||
|
||
ZONE_TYPE = 0x0001 | ||
CONTACT_SWITCH_TYPE = 0x0015 | ||
_CONSTANT_ATTRIBUTES = {ZONE_TYPE: CONTACT_SWITCH_TYPE} | ||
|
||
|
||
class SmartthingsSmartSenseMultiSensor(CustomDevice): | ||
"""Multipurpose sensor.""" | ||
|
||
signature = { | ||
# <SimpleDescriptor endpoint=1 profile=260 device_type=313 | ||
# device_version=0 input_clusters=[0] output_clusters=[25]> | ||
MODELS_INFO: [(SMART_THINGS, "PGC313")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: SMARTSENSE_MULTI_DEVICE_TYPE, | ||
INPUT_CLUSTERS: [Basic.cluster_id], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
# <SimpleDescriptor endpoint=2 profile=64513 device_type=313 | ||
# device_version=0 input_clusters=[] output_clusters=[]> | ||
2: { | ||
PROFILE_ID: 0xFC01, # decimal = 64513 | ||
DEVICE_TYPE: SMARTSENSE_MULTI_DEVICE_TYPE, | ||
INPUT_CLUSTERS: [], | ||
OUTPUT_CLUSTERS: [], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
INPUT_CLUSTERS: [Basic.cluster_id, IasZoneContactSwitchCluster], | ||
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,59 @@ | ||
"""SmartThings SmartSense Motion quirk.""" | ||
from zigpy.profiles import zha | ||
from zigpy.quirks import CustomDevice | ||
from zigpy.zcl.clusters.general import Basic, Ota | ||
|
||
from ..const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
from . import SMART_THINGS, SmartThingsIasZone | ||
|
||
SMARTSENSE_MOTION_DEVICE_TYPE = 0x013A # decimal = 314 | ||
|
||
|
||
class IasZoneMotionCluster(SmartThingsIasZone): | ||
"""Custom IasZone cluster.""" | ||
|
||
ZONE_TYPE = 0x0001 | ||
MOTION_TYPE = 0x000D | ||
_CONSTANT_ATTRIBUTES = {ZONE_TYPE: MOTION_TYPE} | ||
|
||
|
||
class SmartthingsSmartSenseMotionSensor(CustomDevice): | ||
"""SmartSense Motion Sensor.""" | ||
|
||
signature = { | ||
# <SimpleDescriptor endpoint=1 profile=260 device_type=314 | ||
# device_version=0 input_clusters=[0] output_clusters=[25]> | ||
MODELS_INFO: [(SMART_THINGS, "PGC314")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: SMARTSENSE_MOTION_DEVICE_TYPE, | ||
INPUT_CLUSTERS: [Basic.cluster_id], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
}, | ||
# <SimpleDescriptor endpoint=2 profile=64513 device_type=314 | ||
# device_version=0 input_clusters=[] output_clusters=[]> | ||
2: { | ||
PROFILE_ID: 0xFC01, # decimal = 64513 | ||
DEVICE_TYPE: SMARTSENSE_MOTION_DEVICE_TYPE, | ||
INPUT_CLUSTERS: [], | ||
OUTPUT_CLUSTERS: [], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
1: { | ||
INPUT_CLUSTERS: [Basic.cluster_id, IasZoneMotionCluster], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], | ||
} | ||
} | ||
} |
Oops, something went wrong.