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

SNZB-06P has no battery #1484

Merged
merged 1 commit into from
Sep 17, 2024
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
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
Loading