mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
add heartbeat support to mysensors (#18359)
This commit is contained in:
parent
132bb7902a
commit
e75f9b36f9
@ -15,6 +15,7 @@ ATTR_CHILD_ID = 'child_id'
|
||||
ATTR_DESCRIPTION = 'description'
|
||||
ATTR_DEVICE = 'device'
|
||||
ATTR_NODE_ID = 'node_id'
|
||||
ATTR_HEARTBEAT = 'heartbeat'
|
||||
MYSENSORS_PLATFORM_DEVICES = 'mysensors_devices_{}'
|
||||
|
||||
|
||||
@ -51,6 +52,7 @@ class MySensorsDevice:
|
||||
child = node.children[self.child_id]
|
||||
attr = {
|
||||
ATTR_BATTERY_LEVEL: node.battery_level,
|
||||
ATTR_HEARTBEAT: node.heartbeat,
|
||||
ATTR_CHILD_ID: self.child_id,
|
||||
ATTR_DESCRIPTION: child.description,
|
||||
ATTR_DEVICE: self.gateway.device,
|
||||
|
@ -45,6 +45,12 @@ async def handle_battery_level(hass, hass_config, msg):
|
||||
_handle_node_update(hass, msg)
|
||||
|
||||
|
||||
@HANDLERS.register('I_HEARTBEAT_RESPONSE')
|
||||
async def handle_heartbeat(hass, hass_config, msg):
|
||||
"""Handle an heartbeat."""
|
||||
_handle_node_update(hass, msg)
|
||||
|
||||
|
||||
@HANDLERS.register('I_SKETCH_NAME')
|
||||
async def handle_sketch_name(hass, hass_config, msg):
|
||||
"""Handle an internal sketch name message."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user