Closed
Description
My code is printing a device in the method called by on_discovered:
await Discover.discover(target=broadcast_address,on_discovered=self.discover_new_add_device)
Which fails with:
Traceback (most recent call last):
File "/var/polyglot/pg3/ns/000db952c414_2/nodes/Controller.py", line 157, in discover_new_add_device
LOGGER.debug(f'enter: mac={smac} dev={dev}')
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartdevice.py", line 706, in __repr__
return f"<{self._device_type} model {self.model} at {self.host} ({self.alias}), is_on: {self.is_on} - dev specific: {self.state_information}>"
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartdevice.py", line 88, in wrapped
return f(*args, **kwargs)
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartlightstrip.py", line 82, in state_information
info = super().state_information
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartdevice.py", line 88, in wrapped
return f(*args, **kwargs)
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartbulb.py", line 468, in state_information
info["Presets"] = self.presets
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartdevice.py", line 88, in wrapped
return f(*args, **kwargs)
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartbulb.py", line 512, in presets
return [SmartBulbPreset(**vals) for vals in self.sys_info["preferred_state"]]
File "/var/polyglot/.local/lib/python3.9/site-packages/kasa/smartbulb.py", line 512, in <listcomp>
return [SmartBulbPreset(**vals) for vals in self.sys_info["preferred_state"]]
File "/var/polyglot/.local/lib/python3.9/site-packages/pydantic/main.py", line 342, in __init__
raise validation_error
pydantic.error_wrappers.ValidationError: 3 validation errors for SmartBulbPreset
hue
field required (type=value_error.missing)
saturation
field required (type=value_error.missing)
color_temp
field required (type=value_error.missing)