def test_status(self): self.device._reset_state() assert repr(self.state()) == repr(FanStatus(self.device.start_state)) assert self.is_on() is True assert self.state().angle == self.device.start_state["angle"] assert self.state().speed == self.device.start_state["speed"] assert (self.state().delay_off_countdown == self.device.start_state["poweroff_time"]) assert self.state().ac_power is (self.device.start_state["ac_power"] == "on") assert self.state().oscillate is ( self.device.start_state["angle_enable"] == "on") assert self.state( ).direct_speed == self.device.start_state["speed_level"] assert self.state( ).natural_speed == self.device.start_state["natural_level"] assert self.state().child_lock is ( self.device.start_state["child_lock"] == "on") assert self.state().buzzer is (self.device.start_state["buzzer"] == "on") assert self.state().led_brightness == LedBrightness( self.device.start_state["led_b"]) assert self.state().led is None assert self.state().use_time == self.device.start_state["use_time"]
def test_status(self): self.device._reset_state() assert repr(self.state()) == repr(FanStatus(self.device.start_state)) assert self.is_on() is True assert self.state().temperature == self.device.start_state["temp_dec"] / 10.0 assert self.state().humidity == self.device.start_state["humidity"] assert self.state().angle == self.device.start_state["angle"] assert self.state().speed == self.device.start_state["speed"] assert ( self.state().delay_off_countdown == self.device.start_state["poweroff_time"] ) assert self.state().ac_power is (self.device.start_state["ac_power"] == "on") assert self.state().battery == self.device.start_state["battery"] assert self.state().oscillate is ( self.device.start_state["angle_enable"] == "on" ) assert self.state().direct_speed == self.device.start_state["speed_level"] assert self.state().natural_speed == self.device.start_state["natural_level"] assert self.state().child_lock is ( self.device.start_state["child_lock"] == "on" ) assert self.state().buzzer is (self.device.start_state["buzzer"] == "on") assert self.state().led_brightness == LedBrightness( self.device.start_state["led_b"] ) assert self.state().led is (self.device.start_state["led"] == "on") assert self.state().use_time == self.device.start_state["use_time"] assert self.state().battery_charge == self.device.start_state["bat_charge"] assert self.state().battery_state == self.device.start_state["bat_state"] assert self.state().button_pressed == self.device.start_state["button_pressed"]