From 0f60bc2131db0d1202f40b6e4712dc505564f367 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Mon, 2 Jan 2023 21:01:46 +0100 Subject: [PATCH] Don't delete external_id and data attributes unless they are set --- platypush/plugins/light/hue/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platypush/plugins/light/hue/__init__.py b/platypush/plugins/light/hue/__init__.py index 9a79c7e3aa..8ec8fbbfb5 100644 --- a/platypush/plugins/light/hue/__init__.py +++ b/platypush/plugins/light/hue/__init__.py @@ -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