Prefix all xiaomi_aqara events (#17354)

This commit is contained in:
Sebastian Muszynski 2018-11-19 20:55:08 +01:00 committed by GitHub
parent f86083cf52
commit 14ad7428ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,7 +209,7 @@ class XiaomiMotionSensor(XiaomiBinarySensor):
else:
self._should_poll = True
if self.entity_id is not None:
self._hass.bus.fire('motion', {
self._hass.bus.fire('xiaomi_aqara.motion', {
'entity_id': self.entity_id
})
@ -417,7 +417,7 @@ class XiaomiButton(XiaomiBinarySensor):
_LOGGER.warning("Unsupported click_type detected: %s", value)
return False
self._hass.bus.fire('click', {
self._hass.bus.fire('xiaomi_aqara.click', {
'entity_id': self.entity_id,
'click_type': click_type
})
@ -453,14 +453,14 @@ class XiaomiCube(XiaomiBinarySensor):
def parse_data(self, data, raw_data):
"""Parse data sent by gateway."""
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,
'action_type': data[self._data_key]
})
self._last_action = data[self._data_key]
if 'rotate' in data:
self._hass.bus.fire('cube_action', {
self._hass.bus.fire('xiaomi_aqara.cube_action', {
'entity_id': self.entity_id,
'action_type': 'rotate',
'action_value': float(data['rotate'].replace(",", "."))