mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
deCONZ - Retry on BridgeBusy errors (#23436)
This commit is contained in:
parent
df9a9a1fec
commit
6e34015420
@ -88,9 +88,11 @@ class DeconzCover(DeconzDevice, CoverDevice):
|
|||||||
"""Move the cover to a specific position."""
|
"""Move the cover to a specific position."""
|
||||||
position = kwargs[ATTR_POSITION]
|
position = kwargs[ATTR_POSITION]
|
||||||
data = {'on': False}
|
data = {'on': False}
|
||||||
|
|
||||||
if position > 0:
|
if position > 0:
|
||||||
data['on'] = True
|
data['on'] = True
|
||||||
data['bri'] = int(position / 100 * 255)
|
data['bri'] = int(position / 100 * 255)
|
||||||
|
|
||||||
await self._device.async_set_state(data)
|
await self._device.async_set_state(data)
|
||||||
|
|
||||||
async def async_open_cover(self, **kwargs):
|
async def async_open_cover(self, **kwargs):
|
||||||
@ -126,7 +128,9 @@ class DeconzCoverZigbeeSpec(DeconzCover):
|
|||||||
"""Move the cover to a specific position."""
|
"""Move the cover to a specific position."""
|
||||||
position = kwargs[ATTR_POSITION]
|
position = kwargs[ATTR_POSITION]
|
||||||
data = {'on': False}
|
data = {'on': False}
|
||||||
|
|
||||||
if position < 100:
|
if position < 100:
|
||||||
data['on'] = True
|
data['on'] = True
|
||||||
data['bri'] = 255 - int(position / 100 * 255)
|
data['bri'] = 255 - int(position / 100 * 255)
|
||||||
|
|
||||||
await self._device.async_set_state(data)
|
await self._device.async_set_state(data)
|
||||||
|
@ -61,8 +61,10 @@ class DeconzDevice(Entity):
|
|||||||
if (self._device.uniqueid is None or
|
if (self._device.uniqueid is None or
|
||||||
self._device.uniqueid.count(':') != 7):
|
self._device.uniqueid.count(':') != 7):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
serial = self._device.uniqueid.split('-', 1)[0]
|
serial = self._device.uniqueid.split('-', 1)[0]
|
||||||
bridgeid = self.gateway.api.config.bridgeid
|
bridgeid = self.gateway.api.config.bridgeid
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'connections': {(CONNECTION_ZIGBEE, serial)},
|
'connections': {(CONNECTION_ZIGBEE, serial)},
|
||||||
'identifiers': {(DECONZ_DOMAIN, serial)},
|
'identifiers': {(DECONZ_DOMAIN, serial)},
|
||||||
|
@ -165,6 +165,8 @@ class DeconzLight(DeconzDevice, Light):
|
|||||||
"""Return the device state attributes."""
|
"""Return the device state attributes."""
|
||||||
attributes = {}
|
attributes = {}
|
||||||
attributes['is_deconz_group'] = self._device.type == 'LightGroup'
|
attributes['is_deconz_group'] = self._device.type == 'LightGroup'
|
||||||
|
|
||||||
if self._device.type == 'LightGroup':
|
if self._device.type == 'LightGroup':
|
||||||
attributes['all_on'] = self._device.all_on
|
attributes['all_on'] = self._device.all_on
|
||||||
|
|
||||||
return attributes
|
return attributes
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"name": "Deconz",
|
"name": "Deconz",
|
||||||
"documentation": "https://www.home-assistant.io/components/deconz",
|
"documentation": "https://www.home-assistant.io/components/deconz",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"pydeconz==55"
|
"pydeconz==58"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
|
@ -1018,7 +1018,7 @@ pydaikin==1.4.0
|
|||||||
pydanfossair==0.1.0
|
pydanfossair==0.1.0
|
||||||
|
|
||||||
# homeassistant.components.deconz
|
# homeassistant.components.deconz
|
||||||
pydeconz==55
|
pydeconz==58
|
||||||
|
|
||||||
# homeassistant.components.zwave
|
# homeassistant.components.zwave
|
||||||
pydispatcher==2.0.5
|
pydispatcher==2.0.5
|
||||||
|
@ -223,7 +223,7 @@ pyHS100==0.3.5
|
|||||||
pyblackbird==0.5
|
pyblackbird==0.5
|
||||||
|
|
||||||
# homeassistant.components.deconz
|
# homeassistant.components.deconz
|
||||||
pydeconz==55
|
pydeconz==58
|
||||||
|
|
||||||
# homeassistant.components.zwave
|
# homeassistant.components.zwave
|
||||||
pydispatcher==2.0.5
|
pydispatcher==2.0.5
|
||||||
|
Loading…
x
Reference in New Issue
Block a user