mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 11:13:34 +00:00
Add _check_supported
This commit is contained in:
parent
c0f5d5b594
commit
f3ebb02b10
@ -96,3 +96,10 @@ class PowerProtection(SmartModule):
|
|||||||
"protection_power": threshold,
|
"protection_power": threshold,
|
||||||
}
|
}
|
||||||
return await self.call("set_protection_power", params)
|
return await self.call("set_protection_power", params)
|
||||||
|
|
||||||
|
async def _check_supported(self) -> bool:
|
||||||
|
"""Return True if module is supported.
|
||||||
|
|
||||||
|
This is needed, as strips like P304M report the status only for children.
|
||||||
|
"""
|
||||||
|
return "power_protection_status" in self._device.sys_info
|
||||||
|
@ -22,7 +22,7 @@ def _skip_on_unavailable(dev: SmartDevice):
|
|||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
("feature", "prop_name", "type"),
|
("feature", "prop_name", "type"),
|
||||||
[
|
[
|
||||||
("overloaded", "overloaded", bool | None),
|
("overloaded", "overloaded", bool),
|
||||||
("power_protection_enabled", "enabled", bool),
|
("power_protection_enabled", "enabled", bool),
|
||||||
("power_protection_threshold", "protection_threshold", int),
|
("power_protection_threshold", "protection_threshold", int),
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user