Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions homeassistant/components/mysensors/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
ATTR_DESCRIPTION = 'description'
ATTR_DEVICE = 'device'
ATTR_NODE_ID = 'node_id'
ATTR_HEARTBEAT = 'heartbeat'
MYSENSORS_PLATFORM_DEVICES = 'mysensors_devices_{}'


Expand Down Expand Up @@ -51,6 +52,7 @@ def device_state_attributes(self):
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,
Expand Down
6 changes: 6 additions & 0 deletions homeassistant/components/mysensors/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down