shack/glados: use working quirk for ts011f

source: https://github.com/zigpy/zha-device-handlers/issues/1764#issuecomment-1946842958
This commit is contained in:
makefu 2024-04-25 00:13:03 +02:00
parent 2e6cdf158d
commit 406b902255
No known key found for this signature in database
GPG Key ID: 36F7711F3FC0F225
2 changed files with 23 additions and 34 deletions

View File

@ -10,9 +10,6 @@ in {
image = "homeassistant/home-assistant:latest";
environment = {
TZ = "Europe/Berlin";
# TODO create unique users
PUID = toString config.users.users.news_container.uid;
PGID = toString config.users.groups.news_container.gid;
UMASK = "007";
};
extraOptions = ["--net=host" "--device=/dev/zigbee" ];
@ -25,7 +22,7 @@ in {
systemd.tmpfiles.rules = [
#"f ${confdir}/docker-run 0770 kiosk kiosk - -"
# TODO:
"d ${confdir} 0770 news_container news_container - -"
"d ${confdir} 0770 root root - -"
];
services.nginx.virtualHosts."hass.shack" = {

View File

@ -1,6 +1,7 @@
"""TS011F plug."""
from zigpy.profiles import zgp, zha
from zigpy.quirks import CustomDevice
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
@ -13,6 +14,7 @@ from zigpy.zcl.clusters.general import (
)
from zigpy.zcl.clusters.homeautomation import ElectricalMeasurement
from zigpy.zcl.clusters.lightlink import LightLink
from zigpy.zcl.clusters.measurement import TemperatureMeasurement
from zigpy.zcl.clusters.smartenergy import Metering
from zhaquirks.const import (
@ -24,24 +26,35 @@ from zhaquirks.const import (
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.quirk_ids import TUYA_PLUG_ONOFF
from zhaquirks.tuya import (
EnchantedDevice,
TuyaNewManufCluster,
TuyaZB1888Cluster,
TuyaZBE000Cluster,
TuyaZBElectricalMeasurement,
TuyaZBExternalSwitchTypeCluster,
TuyaZBMeteringCluster,
TuyaZBMeteringClusterWithUnit,
TuyaZBOnOffAttributeCluster,
)
from zhaquirks.tuya.mcu import EnchantedDevice
class Plug_v2l(EnchantedDevice):
"""Another TS011F Tuya plug. First one using this definition is _TZ3000_okaz9tjs."""
class Plug_v3(EnchantedDevice):
"""Tuya TS011F plug. One plug is _Tz3000_0Zfrhq4I."""
quirk_id = TUYA_PLUG_ONOFF
signature = {
MODEL: "TS011F",
ENDPOINTS: {
# "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": []
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.SMART_PLUG,
DEVICE_TYPE: zha.DeviceType.ON_OFF_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
Identify.cluster_id,
@ -52,24 +65,13 @@ class Plug_v3(EnchantedDevice):
Metering.cluster_id,
ElectricalMeasurement.cluster_id,
LightLink.cluster_id,
0x1888,
TuyaZBE000Cluster.cluster_id,
TuyaZBExternalSwitchTypeCluster.cluster_id,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
],
OUTPUT_CLUSTERS: [],
},
},
}
replacement = {
ENDPOINTS: {
1: {
@ -85,20 +87,10 @@ class Plug_v3(EnchantedDevice):
TuyaZBMeteringClusterWithUnit,
TuyaZBElectricalMeasurement,
LightLink.cluster_id,
0x1888,
TuyaZBE000Cluster,
],
OUTPUT_CLUSTERS: [
Ota.cluster_id,
],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [
GreenPowerProxy.cluster_id,
TuyaZBE000Cluster.cluster_id,
TuyaZBExternalSwitchTypeCluster,
],
OUTPUT_CLUSTERS: [],
},
},
}