Fix the Xiaomi Aqara Cube rotate event of the LAN protocol 2.0 (Closes: #18199) (#19104)

This commit is contained in:
Sebastian Muszynski 2018-12-08 08:28:39 +01:00 committed by Daniel Høyer Iversen
parent 65c2a25736
commit ece7b498ed

View File

@ -467,4 +467,12 @@ class XiaomiCube(XiaomiBinarySensor):
})
self._last_action = 'rotate'
if 'rotate_degree' in data:
self._hass.bus.fire('xiaomi_aqara.cube_action', {
'entity_id': self.entity_id,
'action_type': 'rotate',
'action_value': float(data['rotate_degree'].replace(",", "."))
})
self._last_action = 'rotate'
return True