Skip to content

Commit

Permalink
Air Conditioning Companion: LED status fixed (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi authored Mar 18, 2018
1 parent 5d87415 commit 67591ab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions miio/airconditioningcompanion.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ def air_condition_model(self) -> str:
@property
def power(self) -> str:
"""Current power state."""
return 'on' if (self.data[1][2:3] == '1') else 'off'
return 'on' if (int(self.data[1][2:3]) == Power.On.value) else 'off'

@property
def led(self) -> str:
"""Current LED state."""
return 'on' if (self.data[1][8:9] == '1') else 'off'
return 'on' if (int(self.data[1][8:9]) == Led.On.value) else 'off'

@property
def is_on(self) -> bool:
Expand All @@ -121,7 +121,7 @@ def target_temperature(self) -> Optional[int]:
@property
def swing_mode(self) -> bool:
"""True if swing mode is enabled."""
return self.data[1][5:6] == '0'
return int(self.data[1][5:6]) == SwingMode.On.value

@property
def fan_speed(self) -> Optional[FanSpeed]:
Expand Down

0 comments on commit 67591ab

Please sign in to comment.