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

Air Conditioning Companion: LED status fixed #272

Merged
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: 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 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