def test_status(self): self.device._reset_state() assert repr(self.state()) == repr(ChuangmiPlugStatus(self.device.start_state)) assert self.is_on() is True assert self.state().temperature == self.device.start_state["temperature"]
def test_status(self): self.device._reset_state() load_power = float(self.device._get_load_power().pop(0) * 0.01) start_state_extended = self.device.start_state.copy() start_state_extended["load_power"] = load_power assert repr(self.state()) == repr(ChuangmiPlugStatus(start_state_extended)) assert self.is_on() is True assert self.state().usb_power is True assert self.state().temperature == self.device.start_state["temperature"] assert self.state().load_power == load_power