Fix minor homematicip cloud binary sensor issues (#20398)

* fix for smoke detection

* a tilted window is now considered as "open"/on

* changed comparison to enum

* line length

* insert brackets for line length and comparison

* indentation should now be ok for hound
changed api version to 0.10.4

* indentation should now be ok for hound
changed api version to 0.10.4

* updating requirement files

* satisfy lint
This commit is contained in:
coreGreenberet authored and Martin Hjelmare committed 2019-01-25 19:00:37 +01:00
1 parent d6c12e47f4
commit 4518e6bdf7
4 files changed
+7 -7

No files matched your search

@@ -15,8 +15,6 @@ DEPENDENCIES = ['homematicip_cloud']
_LOGGER = logging.getLogger(__name__)
STATE_SMOKE_OFF = 'IDLE_OFF'
async def async_setup_platform(
hass, config, async_add_entities, discovery_info=None):
@@ -65,7 +63,7 @@ class HomematicipShutterContact(HomematicipGenericDevice, BinarySensorDevice):
return True
if self._device.windowState is None:
return None
return self._device.windowState == WindowState.OPEN
return self._device.windowState != WindowState.CLOSED
class HomematicipMotionDetector(HomematicipGenericDevice, BinarySensorDevice):
@@ -95,7 +93,9 @@ class HomematicipSmokeDetector(HomematicipGenericDevice, BinarySensorDevice):
@property
def is_on(self):
"""Return true if smoke is detected."""
return self._device.smokeDetectorAlarmType != STATE_SMOKE_OFF
from homematicip.base.enums import SmokeDetectorAlarmType
return (self._device.smokeDetectorAlarmType
!= SmokeDetectorAlarmType.IDLE_OFF)
class HomematicipWaterDetector(HomematicipGenericDevice, BinarySensorDevice):