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 support for Broadlink SP4L-UK (0x7587) #561

Merged
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions broadlink/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
0x756F: (sp4, "MCB1", "Broadlink"),
0x7579: (sp4, "SP4L-EU", "Broadlink"),
0x7583: (sp4, "SP mini 3", "Broadlink"),
0x7587: (sp4, "SP4L-UK", "Broadlink"),
0x7D11: (sp4, "SP mini 3", "Broadlink"),
0xA56A: (sp4, "MCB1", "Broadlink"),
0xA589: (sp4, "SP4L-UK", "Broadlink"),
Expand Down
4 changes: 2 additions & 2 deletions broadlink/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,12 @@ def set_state(
def check_power(self) -> bool:
"""Return the power state of the device."""
state = self.get_state()
return state["pwr"]
return bool(state["pwr"])

def check_nightlight(self) -> bool:
"""Return the state of the night light."""
state = self.get_state()
return state["ntlight"]
return bool(state["ntlight"])

def get_state(self) -> dict:
"""Get full state of device."""
Expand Down