Skip to content

Commit

Permalink
chuangmi.plug.v3: Fixed power state status for updated firmware (#665)
Browse files Browse the repository at this point in the history
* fixed power state status for updated firmware

* add spaces for linter

* comparison to True

* Update miio/chuangmi_plug.py

Co-Authored-By: Teemu R. <tpr@iki.fi>

Co-authored-by: Teemu R. <tpr@iki.fi>
  • Loading branch information
ad and rytilahti authored Apr 13, 2020
1 parent 093b6b1 commit d661953
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miio/chuangmi_plug.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, data: Dict[str, Any]) -> None:
def power(self) -> bool:
"""Current power state."""
if "on" in self.data:
return self.data["on"]
return self.data["on"] is True or self.data["on"] == "on"
if "power" in self.data:
return self.data["power"] == "on"

Expand Down

0 comments on commit d661953

Please sign in to comment.