mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Exclude __getattr__ for deprecated attributes from type checkers (#1294)
This commit is contained in:
@@ -207,6 +207,8 @@ class Light(IotModule, LightInterface):
|
||||
# iot protocol Dimmers and smart protocol devices do not support
|
||||
# brightness of 0 so 0 will turn off all devices for consistency
|
||||
if (bulb := self._get_bulb_device()) is None: # Dimmer
|
||||
if TYPE_CHECKING:
|
||||
assert isinstance(self._device, IotDimmer)
|
||||
if state.brightness == 0 or state.light_on is False:
|
||||
return await self._device.turn_off(transition=state.transition)
|
||||
elif state.brightness:
|
||||
|
Reference in New Issue
Block a user