deCONZ - Retry on BridgeBusy errors (#23436)

pull/23662/head
Robert Svensson 2019-05-03 17:55:42 +02:00 committed by GitHub
parent df9a9a1fec
commit 6e34015420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 3 deletions

View File

@ -88,9 +88,11 @@ class DeconzCover(DeconzDevice, CoverDevice):
"""Move the cover to a specific position."""
position = kwargs[ATTR_POSITION]
data = {'on': False}
if position > 0:
data['on'] = True
data['bri'] = int(position / 100 * 255)
await self._device.async_set_state(data)
async def async_open_cover(self, **kwargs):
@ -126,7 +128,9 @@ class DeconzCoverZigbeeSpec(DeconzCover):
"""Move the cover to a specific position."""
position = kwargs[ATTR_POSITION]
data = {'on': False}
if position < 100:
data['on'] = True
data['bri'] = 255 - int(position / 100 * 255)
await self._device.async_set_state(data)

View File

@ -61,8 +61,10 @@ class DeconzDevice(Entity):
if (self._device.uniqueid is None or
self._device.uniqueid.count(':') != 7):
return None
serial = self._device.uniqueid.split('-', 1)[0]
bridgeid = self.gateway.api.config.bridgeid
return {
'connections': {(CONNECTION_ZIGBEE, serial)},
'identifiers': {(DECONZ_DOMAIN, serial)},

View File

@ -165,6 +165,8 @@ class DeconzLight(DeconzDevice, Light):
"""Return the device state attributes."""
attributes = {}
attributes['is_deconz_group'] = self._device.type == 'LightGroup'
if self._device.type == 'LightGroup':
attributes['all_on'] = self._device.all_on
return attributes

View File

@ -3,7 +3,7 @@
"name": "Deconz",
"documentation": "https://www.home-assistant.io/components/deconz",
"requirements": [
"pydeconz==55"
"pydeconz==58"
],
"dependencies": [],
"codeowners": [

View File

@ -1018,7 +1018,7 @@ pydaikin==1.4.0
pydanfossair==0.1.0
# homeassistant.components.deconz
pydeconz==55
pydeconz==58
# homeassistant.components.zwave
pydispatcher==2.0.5

View File

@ -223,7 +223,7 @@ pyHS100==0.3.5
pyblackbird==0.5
# homeassistant.components.deconz
pydeconz==55
pydeconz==58
# homeassistant.components.zwave
pydispatcher==2.0.5