Fix scene loading issue (#130627)

This commit is contained in:
Alistair Galbraith 2024-11-15 07:08:43 -08:00 committed by GitHub
parent 9a07f58890
commit cd79a606d7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -130,10 +130,15 @@ class HueSceneEntity(HueSceneEntityBase):
@property
def is_dynamic(self) -> bool:
"""Return if this scene has a dynamic color palette."""
if self.resource.palette.color and len(self.resource.palette.color) > 1:
if (
self.resource.palette
and self.resource.palette.color
and len(self.resource.palette.color) > 1
):
return True
if (
self.resource.palette.color_temperature
self.resource.palette
and self.resource.palette.color_temperature
and len(self.resource.palette.color_temperature) > 1
):
return True