Fix scene loading issue (#130627)

This commit is contained in:
Alistair Galbraith 2024-11-15 07:08:43 -08:00 committed by Franck Nijhof
parent 8b9c4db2b3
commit 663ebe199d
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

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