From 28db0cebf08e2a5f2445923a0ab3c89e180d866f Mon Sep 17 00:00:00 2001 From: Tom Harris Date: Tue, 19 May 2020 13:38:00 -0400 Subject: [PATCH] Fix Insteon cover and smoke detector entities (#35810) * Bump pyinsteon to 1.0.1 * Fix cover open/close calls * Add smokebridge sensors * trigger tests * trigger tests --- homeassistant/components/insteon/cover.py | 8 ++++++-- homeassistant/components/insteon/ipdb.py | 2 +- homeassistant/components/insteon/manifest.json | 2 +- requirements_all.txt | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/insteon/cover.py b/homeassistant/components/insteon/cover.py index 75c336822d7..4f6fbd80dce 100644 --- a/homeassistant/components/insteon/cover.py +++ b/homeassistant/components/insteon/cover.py @@ -32,7 +32,11 @@ class InsteonCoverEntity(InsteonEntity, CoverEntity): @property def current_cover_position(self): """Return the current cover position.""" - return int(math.ceil(self._insteon_device_group.value * 100 / 255)) + if self._insteon_device_group.value is not None: + pos = self._insteon_device_group.value + else: + pos = 0 + return int(math.ceil(pos * 100 / 255)) @property def supported_features(self): @@ -59,5 +63,5 @@ class InsteonCoverEntity(InsteonEntity, CoverEntity): await self._insteon_device.async_close() else: await self._insteon_device.async_open( - position=position, group=self._insteon_device_group.group + open_level=position, group=self._insteon_device_group.group ) diff --git a/homeassistant/components/insteon/ipdb.py b/homeassistant/components/insteon/ipdb.py index 5d0913185b1..aa3c0932919 100644 --- a/homeassistant/components/insteon/ipdb.py +++ b/homeassistant/components/insteon/ipdb.py @@ -77,7 +77,7 @@ DEVICE_PLATFORM = { SecurityHealthSafety_LeakSensor: {BINARY_SENSOR: [2, 4]}, SecurityHealthSafety_MotionSensor: {BINARY_SENSOR: [1, 2, 3], ON_OFF_EVENTS: [1]}, SecurityHealthSafety_OpenCloseSensor: {BINARY_SENSOR: [1]}, - SecurityHealthSafety_Smokebridge: {BINARY_SENSOR: [1]}, + SecurityHealthSafety_Smokebridge: {BINARY_SENSOR: [1, 2, 3, 4, 6, 7]}, SensorsActuators_IOLink: {SWITCH: [1], BINARY_SENSOR: [2], ON_OFF_EVENTS: [1, 2]}, SwitchedLightingControl: {SWITCH: [1], ON_OFF_EVENTS: [1]}, SwitchedLightingControl_ApplianceLinc: {SWITCH: [1], ON_OFF_EVENTS: [1]}, diff --git a/homeassistant/components/insteon/manifest.json b/homeassistant/components/insteon/manifest.json index 87ad80047d8..f342cd02291 100644 --- a/homeassistant/components/insteon/manifest.json +++ b/homeassistant/components/insteon/manifest.json @@ -2,6 +2,6 @@ "domain": "insteon", "name": "Insteon", "documentation": "https://www.home-assistant.io/integrations/insteon", - "requirements": ["pyinsteon==1.0.0"], + "requirements": ["pyinsteon==1.0.1"], "codeowners": ["@teharris1"] } \ No newline at end of file diff --git a/requirements_all.txt b/requirements_all.txt index e633cc63d15..e5364311843 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1375,7 +1375,7 @@ pyialarm==0.3 pyicloud==0.9.7 # homeassistant.components.insteon -pyinsteon==1.0.0 +pyinsteon==1.0.1 # homeassistant.components.intesishome pyintesishome==1.7.4