MCPcopy
hub / github.com/rytilahti/python-miio / test_status

Method test_status

miio/tests/test_chuangmi_plug.py:139–151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

137 assert self.is_on() is False
138
139 def test_status(self):
140 self.device._reset_state()
141
142 load_power = float(self.device._get_load_power().pop(0) * 0.01)
143
144 start_state_extended = self.device.start_state.copy()
145 start_state_extended["load_power"] = load_power
146 assert repr(self.state()) == repr(ChuangmiPlugStatus(start_state_extended))
147
148 assert self.is_on() is True
149 assert self.state().usb_power is True
150 assert self.state().temperature == self.device.start_state["temperature"]
151 assert self.state().load_power == load_power
152
153 def test_usb_on(self):
154 self.device.usb_off() # ensure off

Callers

nothing calls this directly

Calls 5

stateMethod · 0.95
is_onMethod · 0.95
ChuangmiPlugStatusClass · 0.90
_get_load_powerMethod · 0.80
_reset_stateMethod · 0.45

Tested by

no test coverage detected