Don't delete external_id and data attributes unless they are set

This commit is contained in:
Fabio Manganiello 2023-01-02 21:01:46 +01:00
parent b0671354ea
commit 0f60bc2131
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -1177,8 +1177,10 @@ class LightHuePlugin(RunnablePlugin, LightPlugin):
for attr, value in (light.data or {}).items(): for attr, value in (light.data or {}).items():
setattr(light, attr, value) setattr(light, attr, value)
del light.external_id if light.external_id is not None:
del light.data del light.external_id
if light.data is not None:
del light.data
return lights return lights