From 680f7fac1c4db89cb8d442e8c863c2b7a315b178 Mon Sep 17 00:00:00 2001 From: Jochen Friedrich Date: Wed, 18 Feb 2026 14:29:47 +0100 Subject: [PATCH] Fix MySensors battery sensors attachment to correct gateway (#151167) Co-authored-by: Martin Hjelmare --- homeassistant/components/mysensors/const.py | 2 +- homeassistant/components/mysensors/helpers.py | 2 +- homeassistant/components/mysensors/sensor.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/mysensors/const.py b/homeassistant/components/mysensors/const.py index a87b78b549e..05e19d452a2 100644 --- a/homeassistant/components/mysensors/const.py +++ b/homeassistant/components/mysensors/const.py @@ -33,7 +33,7 @@ SCHEMA: Final = "schema" CHILD_CALLBACK: str = "mysensors_child_callback_{}_{}_{}_{}" NODE_CALLBACK: str = "mysensors_node_callback_{}_{}" MYSENSORS_DISCOVERY: str = "mysensors_discovery_{}_{}" -MYSENSORS_NODE_DISCOVERY: str = "mysensors_node_discovery" +MYSENSORS_NODE_DISCOVERY: str = "mysensors_node_discovery_{}" TYPE: Final = "type" UPDATE_DELAY: float = 0.1 diff --git a/homeassistant/components/mysensors/helpers.py b/homeassistant/components/mysensors/helpers.py index 9ed41dfe4e9..3c9b841bdb3 100644 --- a/homeassistant/components/mysensors/helpers.py +++ b/homeassistant/components/mysensors/helpers.py @@ -70,7 +70,7 @@ def discover_mysensors_node( discovered_nodes.add(node_id) async_dispatcher_send( hass, - MYSENSORS_NODE_DISCOVERY, + MYSENSORS_NODE_DISCOVERY.format(gateway_id), { ATTR_GATEWAY_ID: gateway_id, ATTR_NODE_ID: node_id, diff --git a/homeassistant/components/mysensors/sensor.py b/homeassistant/components/mysensors/sensor.py index 3793bed8af2..c6fee7ba52a 100644 --- a/homeassistant/components/mysensors/sensor.py +++ b/homeassistant/components/mysensors/sensor.py @@ -244,7 +244,7 @@ async def async_setup_entry( config_entry.async_on_unload( async_dispatcher_connect( hass, - MYSENSORS_NODE_DISCOVERY, + MYSENSORS_NODE_DISCOVERY.format(config_entry.entry_id), async_node_discover, ), )