Skip to content

Commit

Permalink
Air Conditioning Companion led property fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed May 8, 2018
1 parent e8b6489 commit 3aaa896
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions miio/airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Power(enum.Enum):

class Led(enum.Enum):
On = '0'
Off = 'a'
Off = 'A'


STORAGE_SLOT_ID = 30
Expand Down Expand Up @@ -107,7 +107,7 @@ def power(self) -> str:
@property
def led(self) -> str:
"""Current LED state."""
return 'on' if (int(self.data[1][8:9]) == Led.On.value) else 'off'
return 'on' if (self.data[1][8:9] == Led.On.value) else 'off'

@property
def is_on(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion miio/tests/test_airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class DummyAirConditioningCompanion(AirConditioningCompanion):
def __init__(self, *args, **kwargs):
self.state = ['010500978022222102', '010201190280222221', '2']
self.state = ['010500978022222102', '01020119A280222221', '2']

self.return_values = {
'get_model_and_state': self._get_state,
Expand Down

0 comments on commit 3aaa896

Please sign in to comment.