deCONZ - Fix magic cube awake gesture (#31403)

pull/31406/head
FrengerH 2020-02-02 12:54:59 +01:00 committed by GitHub
parent 55a1bf3832
commit 704cfcf235
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -50,7 +50,7 @@ class DeconzEvent(DeconzBase):
CONF_EVENT: self._device.state,
}
if self._device.gesture:
if self._device.gesture is not None:
data[CONF_GESTURE] = self._device.gesture
self.gateway.hass.bus.async_fire(CONF_DECONZ_EVENT, data)

View File

@ -101,7 +101,7 @@ async def test_deconz_events(hass):
mock_listener = Mock()
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()
assert len(mock_listener.mock_calls) == 1
@ -109,7 +109,7 @@ async def test_deconz_events(hass):
"id": "switch_4",
"unique_id": "00:00:00:00:00:00:00:04",
"event": 1000,
"gesture": 2,
"gesture": 0,
}
unsub()