mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
check if sabotage attr is in device (#23397)
This commit is contained in:
parent
e182b95921
commit
cef7ce11ad
@ -78,7 +78,7 @@ class HomematicipShutterContact(HomematicipGenericDevice, BinarySensorDevice):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if the shutter contact is on/open."""
|
"""Return true if the shutter contact is on/open."""
|
||||||
if self._device.sabotage:
|
if hasattr(self._device, 'sabotage') and self._device.sabotage:
|
||||||
return True
|
return True
|
||||||
if self._device.windowState is None:
|
if self._device.windowState is None:
|
||||||
return None
|
return None
|
||||||
@ -96,7 +96,7 @@ class HomematicipMotionDetector(HomematicipGenericDevice, BinarySensorDevice):
|
|||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
"""Return true if motion is detected."""
|
"""Return true if motion is detected."""
|
||||||
if self._device.sabotage:
|
if hasattr(self._device, 'sabotage') and self._device.sabotage:
|
||||||
return True
|
return True
|
||||||
return self._device.motionDetected
|
return self._device.motionDetected
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user