Skip to content

Commit

Permalink
Merge pull request #1484 from wareczek/snzb-06p-has-no-battery
Browse files Browse the repository at this point in the history
SNZB-06P has no battery
  • Loading branch information
AlexxIT authored Sep 17, 2024
2 parents 95f3ae2 + 0d662a8 commit bfda5ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/sonoff/core/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand Down Expand Up @@ -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"])

Expand Down

0 comments on commit bfda5ea

Please sign in to comment.