2024-04-24 21:49:22 +00:00
|
|
|
"""TS011F plug."""
|
|
|
|
|
|
|
|
from zigpy.profiles import zgp, zha
|
2024-04-24 22:13:03 +00:00
|
|
|
from zigpy.quirks import CustomDevice
|
2024-04-24 21:49:22 +00:00
|
|
|
from zigpy.zcl.clusters.general import (
|
|
|
|
Basic,
|
|
|
|
GreenPowerProxy,
|
|
|
|
Groups,
|
|
|
|
Identify,
|
|
|
|
OnOff,
|
|
|
|
Ota,
|
|
|
|
Scenes,
|
|
|
|
Time,
|
|
|
|
)
|
|
|
|
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
|
|
|
|
from zigpy.zcl.clusters.lightlink import LightLink
|
2024-04-24 22:13:03 +00:00
|
|
|
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
|
2024-04-24 21:49:22 +00:00
|
|
|
from zigpy.zcl.clusters.smartenergy import Metering
|
|
|
|
|
|
|
|
from zhaquirks.const import (
|
|
|
|
DEVICE_TYPE,
|
|
|
|
ENDPOINTS,
|
|
|
|
INPUT_CLUSTERS,
|
|
|
|
MODEL,
|
|
|
|
MODELS_INFO,
|
|
|
|
OUTPUT_CLUSTERS,
|
|
|
|
PROFILE_ID,
|
|
|
|
)
|
2024-04-24 22:13:03 +00:00
|
|
|
from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF
|
2024-04-24 21:49:22 +00:00
|
|
|
from zhaquirks.tuya import (
|
2024-04-24 22:13:03 +00:00
|
|
|
EnchantedDevice,
|
|
|
|
TuyaNewManufCluster,
|
|
|
|
TuyaZB1888Cluster,
|
2024-04-24 21:49:22 +00:00
|
|
|
TuyaZBE000Cluster,
|
|
|
|
TuyaZBElectricalMeasurement,
|
2024-04-24 22:13:03 +00:00
|
|
|
TuyaZBExternalSwitchTypeCluster,
|
|
|
|
TuyaZBMeteringCluster,
|
2024-04-24 21:49:22 +00:00
|
|
|
TuyaZBMeteringClusterWithUnit,
|
|
|
|
TuyaZBOnOffAttributeCluster,
|
|
|
|
)
|
|
|
|
|
2024-04-24 22:13:03 +00:00
|
|
|
class Plug_v2l(EnchantedDevice):
|
|
|
|
"""Another TS011F Tuya plug. First one using this definition is _TZ3000_okaz9tjs."""
|
2024-04-24 21:49:22 +00:00
|
|
|
|
2024-04-24 22:13:03 +00:00
|
|
|
quirk_id = TUYA_PLUG_ONOFF
|
2024-04-24 21:49:22 +00:00
|
|
|
|
|
|
|
signature = {
|
|
|
|
MODEL: "TS011F",
|
|
|
|
ENDPOINTS: {
|
2024-04-24 22:13:03 +00:00
|
|
|
# "profile_id": 260,
|
|
|
|
# "device_type": "0x0100",
|
|
|
|
# "in_clusters": ["0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0702", "0x0b04", "0xe001"],
|
|
|
|
# "in_clusters": ["0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x000a", "0x0702", "0x0b04", "0x1000", "0xe000", "0xe001"],
|
|
|
|
# "out_clusters": []
|
2024-04-24 21:49:22 +00:00
|
|
|
1: {
|
|
|
|
PROFILE_ID: zha.PROFILE_ID,
|
2024-04-24 22:13:03 +00:00
|
|
|
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
|
2024-04-24 21:49:22 +00:00
|
|
|
INPUT_CLUSTERS: [
|
|
|
|
Basic.cluster_id,
|
|
|
|
Identify.cluster_id,
|
|
|
|
Groups.cluster_id,
|
|
|
|
Scenes.cluster_id,
|
|
|
|
OnOff.cluster_id,
|
|
|
|
Time.cluster_id,
|
|
|
|
Metering.cluster_id,
|
|
|
|
ElectricalMeasurement.cluster_id,
|
|
|
|
LightLink.cluster_id,
|
|
|
|
TuyaZBE000Cluster.cluster_id,
|
2024-04-24 22:13:03 +00:00
|
|
|
TuyaZBExternalSwitchTypeCluster.cluster_id,
|
2024-04-24 21:49:22 +00:00
|
|
|
],
|
2024-04-24 22:13:03 +00:00
|
|
|
OUTPUT_CLUSTERS: [],
|
2024-04-24 21:49:22 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
replacement = {
|
|
|
|
ENDPOINTS: {
|
|
|
|
1: {
|
|
|
|
PROFILE_ID: zha.PROFILE_ID,
|
|
|
|
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
|
|
|
|
INPUT_CLUSTERS: [
|
|
|
|
Basic.cluster_id,
|
|
|
|
Identify.cluster_id,
|
|
|
|
Groups.cluster_id,
|
|
|
|
Scenes.cluster_id,
|
|
|
|
TuyaZBOnOffAttributeCluster,
|
|
|
|
Time.cluster_id,
|
|
|
|
TuyaZBMeteringClusterWithUnit,
|
|
|
|
TuyaZBElectricalMeasurement,
|
|
|
|
LightLink.cluster_id,
|
2024-04-24 22:13:03 +00:00
|
|
|
TuyaZBE000Cluster.cluster_id,
|
|
|
|
TuyaZBExternalSwitchTypeCluster,
|
2024-04-24 21:49:22 +00:00
|
|
|
],
|
2024-04-24 22:13:03 +00:00
|
|
|
OUTPUT_CLUSTERS: [],
|
2024-04-24 21:49:22 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|