From 0d662a856939ab4b02f7e2d8951a1a1088257859 Mon Sep 17 00:00:00 2001 From: wareczek Date: Mon, 9 Sep 2024 00:58:05 +0200 Subject: [PATCH] SNZB-06P has no battery --- custom_components/sonoff/core/devices.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/custom_components/sonoff/core/devices.py b/custom_components/sonoff/core/devices.py index 4d349a8..b3aae87 100644 --- a/custom_components/sonoff/core/devices.py +++ b/custom_components/sonoff/core/devices.py @@ -419,7 +419,7 @@ def spec(cls, base: str = None, enabled: bool = None, **kwargs) -> type: # https://github.com/AlexxIT/SonoffLAN/issues/1398 7004: [XSwitch, ZRSSI], # ZBMINIL2 # https://github.com/AlexxIT/SonoffLAN/issues/1283 - 7006: [XZigbeeCover, spec(XSensor, param="battery")], + 7006: [XZigbeeCover, Battery], # https://github.com/AlexxIT/SonoffLAN/issues/1456 7009: [XZigbeeLight], # CK-BL702-AL-01(7009_Z102LG03-1) 7014: [ @@ -452,6 +452,10 @@ def get_spec(device: dict) -> list: if uiid in [133] and not device["params"].get("HMI_ATCDevice"): classes = [cls for cls in classes if XClimateNS not in cls.__bases__] + # SNZB-06P has no battery + if uiid in [2026] and not device["params"].get("battery"): + classes = [cls for cls in classes if cls != Battery] + if "device_class" in device: classes = get_custom_spec(classes, device["device_class"])