From ece7b498ed22583cd298b84bf6331af6cda6aa18 Mon Sep 17 00:00:00 2001 From: Sebastian Muszynski Date: Sat, 8 Dec 2018 08:28:39 +0100 Subject: [PATCH] Fix the Xiaomi Aqara Cube rotate event of the LAN protocol 2.0 (Closes: #18199) (#19104) --- homeassistant/components/binary_sensor/xiaomi_aqara.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/homeassistant/components/binary_sensor/xiaomi_aqara.py b/homeassistant/components/binary_sensor/xiaomi_aqara.py index 550bdaac172..584d56c2e68 100644 --- a/homeassistant/components/binary_sensor/xiaomi_aqara.py +++ b/homeassistant/components/binary_sensor/xiaomi_aqara.py @@ -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