Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 1CH mini Smart Switch Model FS-02ZE _TS000F_xkap8wtb #2613

Merged
merged 23 commits into from
Oct 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 99 additions & 0 deletions zhaquirks/tuya/ts000f_switch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
"""tuya TS000F xkap8wtb On/Off In-line Switches with metering support."""

from zigpy.profiles import zgp, zha
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
Identify,
OnOff,
Ota,
Scenes,
Time,
)
from zigpy.zcl.clusters.lightlink import LightLink

from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODEL,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
TuyaZB1888Cluster,
TuyaZBE000Cluster,
TuyaZBElectricalMeasurement,
TuyaZBMeteringCluster,
TuyaZBOnOffAttributeCluster,
)
from zhaquirks.tuya.mcu import EnchantedDevice


class Tuya_1G_Wall_Switch_Metering(EnchantedDevice):
"""Tuya 1 gang wall switch with metering and restore power state support."""

signature = {
MODEL: "TS000F",
ENDPOINTS: {
# SizePrefixedSimpleDescriptor(endpoint=242, profile=41440, device_type=97, device_version=0, input_clusters=[], output_clusters=[33])
# input_clusters=["0x0000","0x0003","0x0004","0x0005","0x0006", "0x000a", "0x0702","0x0b04","0x1000","0x1888","0xe000"]
# output_clusters=["0x0019"]>
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
Time.cluster_id,
TuyaZBMeteringCluster.cluster_id,
TuyaZBElectricalMeasurement.cluster_id,
LightLink.cluster_id,
TuyaZB1888Cluster.cluster_id,
TuyaZBE000Cluster.cluster_id,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
# <SimpleDescriptor endpoint=242 profile=41440 device_type=97
# input_clusters=[]
# output_clusters=["0x0021"]>
242: {
arsenyspb marked this conversation as resolved.
Show resolved Hide resolved
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
Groups.cluster_id,
Scenes.cluster_id,
TuyaZBOnOffAttributeCluster,
Time.cluster_id,
TuyaZBMeteringCluster,
TuyaZBElectricalMeasurement,
LightLink.cluster_id,
TuyaZB1888Cluster,
TuyaZBE000Cluster,
],
OUTPUT_CLUSTERS: [Ota.cluster_id],
},
arsenyspb marked this conversation as resolved.
Show resolved Hide resolved
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
Loading