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: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 4 additions and 2 deletions

View File

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