Fix Hue motion sensor state if sensor is disabled ()

pull/63001/head
Marcel van der Veldt 2021-12-29 17:54:53 +01:00 committed by GitHub
parent a8fe9f2eff
commit f28c66ce19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions
homeassistant/components/hue/v2

View File

@ -84,6 +84,9 @@ class HueMotionSensor(HueBinarySensorBase):
@property
def is_on(self) -> bool | None:
"""Return true if the binary sensor is on."""
if not self.resource.enabled:
# Force None (unknown) if the sensor is set to disabled in Hue
return None
return self.resource.motion.motion
@property