Fix xiaomi aqara cube with lumi.acpartner.v3 gateway (#22130)
parent
ed93c3b2c1
commit
89f8203163
|
@ -476,18 +476,24 @@ class XiaomiCube(XiaomiBinarySensor):
|
|||
self._last_action = data[self._data_key]
|
||||
|
||||
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', {
|
||||
'entity_id': self.entity_id,
|
||||
'action_type': 'rotate',
|
||||
'action_value': float(data['rotate'].replace(",", "."))
|
||||
'action_value': action_value
|
||||
})
|
||||
self._last_action = 'rotate'
|
||||
|
||||
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', {
|
||||
'entity_id': self.entity_id,
|
||||
'action_type': 'rotate',
|
||||
'action_value': float(data['rotate_degree'].replace(",", "."))
|
||||
'action_value': action_value
|
||||
})
|
||||
self._last_action = 'rotate'
|
||||
|
||||
|
|
Loading…
Reference in New Issue