Skip to content

Commit

Permalink
Property use_time already implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
syssi committed Mar 7, 2018
1 parent 3921386 commit 0acd855
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 1 addition & 6 deletions miio/airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,6 @@ def auto_detect(self) -> Optional[bool]:

return None

@property
def use_time(self) -> Optional[int]:
"""How long the device has been active in seconds."""
return self.data["use_time"]

@property
def button_pressed(self) -> Optional[str]:
"""Last pressed button."""
Expand Down Expand Up @@ -351,7 +346,7 @@ def status(self) -> AirPurifierStatus:
'led_b', 'bright', 'buzzer', 'child_lock', 'volume',
'rfid_product_id', 'rfid_tag', 'act_sleep', 'sleep_mode',
'sleep_time', 'sleep_data_num', 'app_extra', 'act_det',
'use_time', 'button_pressed']
'button_pressed']

# A single request is limited to 16 properties. Therefore the
# properties are divided into multiple requests
Expand Down
2 changes: 0 additions & 2 deletions miio/tests/test_airpurifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def __init__(self, *args, **kwargs):
'sleep_data_num': 22,
'app_extra': 1,
'act_det': 'off',
'use_time': '4862700',
'button_pressed': 'power',
}
self.return_values = {
Expand Down Expand Up @@ -122,7 +121,6 @@ def test_status(self):
assert self.state().extra_features == self.device.start_state["app_extra"]
assert self.state().turbo_mode_supported == (self.device.start_state["app_extra"] == 1)
assert self.state().auto_detect == (self.device.start_state["act_det"] == 'on')
assert self.state().use_time == self.device.start_state["use_time"]
assert self.state().button_pressed == self.device.start_state["button_pressed"]

def test_set_mode(self):
Expand Down

0 comments on commit 0acd855

Please sign in to comment.