-
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
1 changed file
with
63 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,63 @@ | ||
"""Schneider Electric thermostats quirks.""" | ||
|
||
from typing import Final | ||
|
||
from zigpy.quirks import CustomCluster | ||
from zigpy.quirks.v2 import QuirkBuilder | ||
import zigpy.types as t | ||
from zigpy.zcl import foundation | ||
from zigpy.zcl.clusters.measurement import TemperatureMeasurement | ||
from zigpy.zcl.clusters.smartenergy import Metering | ||
|
||
from zhaquirks.schneiderelectric import SE_MANUF_NAME | ||
|
||
|
||
class SETemperatureSensorType(t.enum8): | ||
"""Temperature sensor connected to thermostat.""" | ||
|
||
Sensor2kOhm = 0x01 | ||
Sensor10kOhm = 0x02 | ||
Sensor12kOhm = 0x03 | ||
Sensor15kOhm = 0x04 | ||
Sensor33kOhm = 0x05 | ||
Sensor47kOhm = 0x06 | ||
SensorAbsent = 0xFF | ||
|
||
|
||
class SEMetering(CustomCluster, Metering): | ||
""" Schneider Electric Metering cluster. """ | ||
|
||
class AttributeDefs(Metering.AttributeDefs): | ||
""" Schneider Electric Metering cluster attributes. """ | ||
|
||
# This attribute specifies the demand of a switched load when it is energised | ||
fixed_load_demand: Final = foundation.ZCLAttributeDef( | ||
id=0x4510, | ||
type=t.uint24_t, | ||
access="rw", | ||
is_manufacturer_specific=True, | ||
) | ||
|
||
|
||
class SETemperatureMeasurementExternal(CustomCluster, TemperatureMeasurement): | ||
""" Schneider Electric Temperature Measurement cluster for external (floor) temperature input. """ | ||
|
||
class AttributeDefs(TemperatureMeasurement.AttributeDefs): | ||
""" Schneider Electric Temperature Measurement cluster attributes. """ | ||
|
||
temperature_sensor_type: Final = foundation.ZCLAttributeDef( | ||
id=0xE021, | ||
type=SETemperatureSensorType, | ||
access="rw", | ||
is_manufacturer_specific=True, | ||
) | ||
|
||
|
||
( | ||
QuirkBuilder(SE_MANUF_NAME, "EKO07259") | ||
.also_applies_to(SE_MANUF_NAME, "WDE002497") | ||
.also_applies_to(SE_MANUF_NAME, "WDE011680") | ||
.replaces(SEMetering, endpoint_id=5) | ||
.replaces(SETemperatureMeasurementExternal, endpoint_id=3) | ||
.add_to_registry() | ||
) |