Add Cover to the Insteon component (#16215)

* Create cover platform

* Create insteon cover platform

* Bump insteonplm to 0.13.0

* Change async_add_devices to async_add_entities

* Missing doc string

* Simplify open and set_position

* Flake8

* Bump insteonplm to 0.13.1

* Code review changes

* Flake8 updates
This commit is contained in:
Tom Harris authored and Martin Hjelmare committed 2018-08-31 23:56:26 +02:00
1 parent fa81385b5c
commit d3791fa45d
3 files changed
+83 -7

No files matched your search

+9 -6
View File
@@ -18,7 +18,7 @@ import homeassistant.helpers.config_validation as cv
from homeassistant.helpers import discovery
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['insteonplm==0.12.3']
REQUIREMENTS = ['insteonplm==0.13.1']
_LOGGER = logging.getLogger(__name__)
@@ -358,6 +358,8 @@ class IPDB:
def __init__(self):
"""Create the INSTEON Product Database (IPDB)."""
from insteonplm.states.cover import Cover
from insteonplm.states.onOff import (OnOffSwitch,
OnOffSwitch_OutletTop,
OnOffSwitch_OutletBottom,
@@ -383,7 +385,9 @@ class IPDB:
X10AllLightsOnSensor,
X10AllLightsOffSensor)
self.states = [State(OnOffSwitch_OutletTop, 'switch'),
self.states = [State(Cover, 'cover'),
State(OnOffSwitch_OutletTop, 'switch'),
State(OnOffSwitch_OutletBottom, 'switch'),
State(OpenClosedRelay, 'switch'),
State(OnOffSwitch, 'switch'),
@@ -470,11 +474,10 @@ class InsteonEntity(Entity):
return attributes
@callback
def async_entity_update(self, deviceid, statename, val):
def async_entity_update(self, deviceid, group, val):
"""Receive notification from transport that new data exists."""
_LOGGER.debug('Received update for device %s group %d statename %s',
self.address, self.group,
self._insteon_device_state.name)
_LOGGER.debug('Received update for device %s group %d value %s',
deviceid.human, group, val)
self.async_schedule_update_ha_state()
@asyncio.coroutine