mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-12-16 21:18:25 +00:00
Improve testing harness to allow tests on real devices (#197)
* test_cli: provide return values to patched objects to avoid warning about non-awaited calls
* test_cli: restore alias after testing
* smartstrip: remove internal update() calls for turn_{on,off}, set_led
* Make sure power is always a float
* Fix discovery tests
* Make tests runnable on real devices
* Add a note about running tests on a real device
* test_strip: run update against the parent device
This commit is contained in:
@@ -603,7 +603,7 @@ class SmartDevice:
|
||||
raise SmartDeviceException("Device has no emeter")
|
||||
|
||||
response = EmeterStatus(await self.get_emeter_realtime())
|
||||
return response["power"]
|
||||
return float(response["power"])
|
||||
|
||||
async def reboot(self, delay: int = 1) -> None:
|
||||
"""Reboot the device.
|
||||
@@ -658,7 +658,8 @@ class SmartDevice:
|
||||
def device_id(self) -> str:
|
||||
"""Return unique ID for the device.
|
||||
|
||||
This is the MAC address of the device.
|
||||
If not overridden, this is the MAC address of the device.
|
||||
Individual sockets on strips will override this.
|
||||
"""
|
||||
return self.mac
|
||||
|
||||
|
||||
Reference in New Issue
Block a user