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
pull/35818/head
Tom Harris 2020-05-19 13:38:00 -04:00 committed by GitHub
parent 6c4a6568f5
commit 28db0cebf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 5 deletions

View File

@ -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
)

View File

@ -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]},

View File

@ -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"]
}

View File

@ -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