From eee391ee6fe73f197cdb837ee72ebc2cb5a8d358 Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Mon, 3 Aug 2026 14:54:40 +0200 Subject: [PATCH] Adapt telegram_bot to set via_device_id in DeviceInfo (#178080) --- homeassistant/components/telegram_bot/notify.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/telegram_bot/notify.py b/homeassistant/components/telegram_bot/notify.py index e95cf2de681e..1eb9f4dc513e 100644 --- a/homeassistant/components/telegram_bot/notify.py +++ b/homeassistant/components/telegram_bot/notify.py @@ -9,6 +9,7 @@ from homeassistant.components.notify import ( ) from homeassistant.config_entries import ConfigSubentry from homeassistant.core import HomeAssistant +from homeassistant.helpers import device_registry as dr from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import TelegramBotConfigEntry @@ -51,7 +52,11 @@ class TelegramBotNotifyEntity(TelegramBotEntity, NotifyEntity): assert device_info is not None device_info["identifiers"] = {(DOMAIN, f"{self.bot_id}_{self.chat_id}")} device_info["name"] = subentry.title - device_info["via_device"] = (DOMAIN, f"{self.bot_id}") + device_info["via_device_id"] = dr.async_get_device_id_by_identifier( + config_entry.runtime_data.hass, + (DOMAIN, f"{self.bot_id}"), + config_entry_id=config_entry.entry_id, + ) @override async def async_send_message(self, message: str, title: str | None = None) -> None: