mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Prefix all xiaomi_aqara events (#17354)
This commit is contained in:
parent
f86083cf52
commit
14ad7428ea
@ -209,7 +209,7 @@ class XiaomiMotionSensor(XiaomiBinarySensor):
|
|||||||
else:
|
else:
|
||||||
self._should_poll = True
|
self._should_poll = True
|
||||||
if self.entity_id is not None:
|
if self.entity_id is not None:
|
||||||
self._hass.bus.fire('motion', {
|
self._hass.bus.fire('xiaomi_aqara.motion', {
|
||||||
'entity_id': self.entity_id
|
'entity_id': self.entity_id
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -417,7 +417,7 @@ class XiaomiButton(XiaomiBinarySensor):
|
|||||||
_LOGGER.warning("Unsupported click_type detected: %s", value)
|
_LOGGER.warning("Unsupported click_type detected: %s", value)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
self._hass.bus.fire('click', {
|
self._hass.bus.fire('xiaomi_aqara.click', {
|
||||||
'entity_id': self.entity_id,
|
'entity_id': self.entity_id,
|
||||||
'click_type': click_type
|
'click_type': click_type
|
||||||
})
|
})
|
||||||
@ -453,14 +453,14 @@ class XiaomiCube(XiaomiBinarySensor):
|
|||||||
def parse_data(self, data, raw_data):
|
def parse_data(self, data, raw_data):
|
||||||
"""Parse data sent by gateway."""
|
"""Parse data sent by gateway."""
|
||||||
if self._data_key in data:
|
if self._data_key in data:
|
||||||
self._hass.bus.fire('cube_action', {
|
self._hass.bus.fire('xiaomi_aqara.cube_action', {
|
||||||
'entity_id': self.entity_id,
|
'entity_id': self.entity_id,
|
||||||
'action_type': data[self._data_key]
|
'action_type': data[self._data_key]
|
||||||
})
|
})
|
||||||
self._last_action = data[self._data_key]
|
self._last_action = data[self._data_key]
|
||||||
|
|
||||||
if 'rotate' in data:
|
if 'rotate' in data:
|
||||||
self._hass.bus.fire('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': float(data['rotate'].replace(",", "."))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user