-
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
19 changed files
with
662 additions
and
50 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
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.99" | ||
VERSION = "0.0.100" | ||
|
||
|
||
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
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,106 @@ | ||
"""Develco smart plugs.""" | ||
from zigpy.profiles import zha | ||
from zigpy.quirks import CustomCluster, CustomDevice | ||
from zigpy.zcl.clusters.general import ( | ||
Alarms, | ||
Basic, | ||
DeviceTemperature, | ||
Groups, | ||
Identify, | ||
OnOff, | ||
Ota, | ||
Scenes, | ||
Time, | ||
) | ||
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement | ||
from zigpy.zcl.clusters.measurement import OccupancySensing | ||
from zigpy.zcl.clusters.smartenergy import Metering | ||
|
||
from zhaquirks.const import ( | ||
DEVICE_TYPE, | ||
ENDPOINTS, | ||
INPUT_CLUSTERS, | ||
MODELS_INFO, | ||
OUTPUT_CLUSTERS, | ||
PROFILE_ID, | ||
) | ||
from zhaquirks.develco import DEVELCO | ||
|
||
DEV_TEMP_ID = DeviceTemperature.attributes_by_name["current_temperature"].id | ||
|
||
|
||
class DevelcoDeviceTemperature(CustomCluster, DeviceTemperature): | ||
"""Custom device temperature cluster to multiply the temperature by 100.""" | ||
|
||
def _update_attribute(self, attrid, value): | ||
if attrid == DEV_TEMP_ID: | ||
value = value * 100 | ||
super()._update_attribute(attrid, value) | ||
|
||
|
||
class SPLZB131(CustomDevice): | ||
"""Custom device Develco smart plug device.""" | ||
|
||
signature = { | ||
MODELS_INFO: [(DEVELCO, "SPLZB-131")], | ||
ENDPOINTS: { | ||
1: { | ||
PROFILE_ID: 0xC0C9, | ||
DEVICE_TYPE: 1, | ||
INPUT_CLUSTERS: [ | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [], | ||
}, | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.SMART_PLUG, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
DeviceTemperature.cluster_id, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
Alarms.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Time.cluster_id, | ||
Ota.cluster_id, | ||
OccupancySensing.cluster_id, | ||
], | ||
}, | ||
}, | ||
} | ||
|
||
replacement = { | ||
ENDPOINTS: { | ||
2: { | ||
PROFILE_ID: zha.PROFILE_ID, | ||
DEVICE_TYPE: zha.DeviceType.SMART_PLUG, | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
DevelcoDeviceTemperature, | ||
Identify.cluster_id, | ||
Groups.cluster_id, | ||
Scenes.cluster_id, | ||
OnOff.cluster_id, | ||
Alarms.cluster_id, | ||
Metering.cluster_id, | ||
ElectricalMeasurement.cluster_id, | ||
], | ||
OUTPUT_CLUSTERS: [ | ||
Basic.cluster_id, | ||
Identify.cluster_id, | ||
Time.cluster_id, | ||
Ota.cluster_id, | ||
OccupancySensing.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 |
---|---|---|
@@ -1,2 +1,30 @@ | ||
"""Module for Legrand devices.""" | ||
|
||
from zigpy.quirks import CustomCluster | ||
import zigpy.types as t | ||
from zigpy.zcl.clusters.manufacturer_specific import ManufacturerSpecificCluster | ||
|
||
from zhaquirks import PowerConfigurationCluster | ||
|
||
LEGRAND = "Legrand" | ||
MANUFACTURER_SPECIFIC_CLUSTER_ID = 0xFC01 # decimal = 64513 | ||
|
||
|
||
class LegrandCluster(CustomCluster, ManufacturerSpecificCluster): | ||
"""LegrandCluster.""" | ||
|
||
cluster_id = MANUFACTURER_SPECIFIC_CLUSTER_ID | ||
name = "LegrandCluster" | ||
ep_attribute = "legrand_cluster" | ||
attributes = { | ||
0x0000: ("dimmer", t.data16, True), | ||
0x0001: ("led_dark", t.Bool, True), | ||
0x0002: ("led_on", t.Bool, True), | ||
} | ||
|
||
|
||
class LegrandPowerConfigurationCluster(PowerConfigurationCluster): | ||
"""PowerConfiguration conversor 'V --> %' for Legrand devices.""" | ||
|
||
MIN_VOLTS = 2.5 | ||
MAX_VOLTS = 3.0 |
Oops, something went wrong.