mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 23:07:09 +00:00
Fix xiaomi aqara cube with lumi.acpartner.v3 gateway (#22130)
This commit is contained in:
parent
ed93c3b2c1
commit
89f8203163
@ -476,18 +476,24 @@ class XiaomiCube(XiaomiBinarySensor):
|
|||||||
self._last_action = data[self._data_key]
|
self._last_action = data[self._data_key]
|
||||||
|
|
||||||
if 'rotate' in data:
|
if 'rotate' in data:
|
||||||
|
action_value = float(data['rotate']
|
||||||
|
if isinstance(data['rotate'], int)
|
||||||
|
else data['rotate'].replace(",", "."))
|
||||||
self._hass.bus.fire('xiaomi_aqara.cube_action', {
|
self._hass.bus.fire('xiaomi_aqara.cube_action', {
|
||||||
'entity_id': self.entity_id,
|
'entity_id': self.entity_id,
|
||||||
'action_type': 'rotate',
|
'action_type': 'rotate',
|
||||||
'action_value': float(data['rotate'].replace(",", "."))
|
'action_value': action_value
|
||||||
})
|
})
|
||||||
self._last_action = 'rotate'
|
self._last_action = 'rotate'
|
||||||
|
|
||||||
if 'rotate_degree' in data:
|
if 'rotate_degree' in data:
|
||||||
|
action_value = float(data['rotate_degree']
|
||||||
|
if isinstance(data['rotate_degree'], int)
|
||||||
|
else data['rotate_degree'].replace(",", "."))
|
||||||
self._hass.bus.fire('xiaomi_aqara.cube_action', {
|
self._hass.bus.fire('xiaomi_aqara.cube_action', {
|
||||||
'entity_id': self.entity_id,
|
'entity_id': self.entity_id,
|
||||||
'action_type': 'rotate',
|
'action_type': 'rotate',
|
||||||
'action_value': float(data['rotate_degree'].replace(",", "."))
|
'action_value': action_value
|
||||||
})
|
})
|
||||||
self._last_action = 'rotate'
|
self._last_action = 'rotate'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user