mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
deCONZ - Fix magic cube awake gesture (#31403)
This commit is contained in:
parent
5b7a65c5ea
commit
a54d5f0bc4
@ -50,7 +50,7 @@ class DeconzEvent(DeconzBase):
|
|||||||
CONF_EVENT: self._device.state,
|
CONF_EVENT: self._device.state,
|
||||||
}
|
}
|
||||||
|
|
||||||
if self._device.gesture:
|
if self._device.gesture is not None:
|
||||||
data[CONF_GESTURE] = self._device.gesture
|
data[CONF_GESTURE] = self._device.gesture
|
||||||
|
|
||||||
self.gateway.hass.bus.async_fire(CONF_DECONZ_EVENT, data)
|
self.gateway.hass.bus.async_fire(CONF_DECONZ_EVENT, data)
|
||||||
|
@ -101,7 +101,7 @@ async def test_deconz_events(hass):
|
|||||||
mock_listener = Mock()
|
mock_listener = Mock()
|
||||||
unsub = hass.bus.async_listen(CONF_DECONZ_EVENT, mock_listener)
|
unsub = hass.bus.async_listen(CONF_DECONZ_EVENT, mock_listener)
|
||||||
|
|
||||||
gateway.api.sensors["4"].async_update({"state": {"gesture": 2}})
|
gateway.api.sensors["4"].async_update({"state": {"gesture": 0}})
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
assert len(mock_listener.mock_calls) == 1
|
assert len(mock_listener.mock_calls) == 1
|
||||||
@ -109,7 +109,7 @@ async def test_deconz_events(hass):
|
|||||||
"id": "switch_4",
|
"id": "switch_4",
|
||||||
"unique_id": "00:00:00:00:00:00:00:04",
|
"unique_id": "00:00:00:00:00:00:00:04",
|
||||||
"event": 1000,
|
"event": 1000,
|
||||||
"gesture": 2,
|
"gesture": 0,
|
||||||
}
|
}
|
||||||
|
|
||||||
unsub()
|
unsub()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user