Exclude __getattr__ for deprecated attributes from type checkers (#1294)

This commit is contained in:
Steven B.
2024-11-21 18:40:13 +00:00
committed by GitHub
parent 652b4e0bd7
commit cae9decb02
10 changed files with 73 additions and 50 deletions

View File

@@ -190,7 +190,7 @@ async def presets_modify(dev: Device, index, brightness, hue, saturation, temper
@click.option("--preset", type=int)
async def turn_on_behavior(dev: Device, type, last, preset):
"""Modify bulb turn-on behavior."""
if not dev.is_bulb or not isinstance(dev, IotBulb):
if dev.device_type is not Device.Type.Bulb or not isinstance(dev, IotBulb):
error("Presets only supported on iot bulbs")
return
settings = await dev.get_turn_on_behavior()