-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Fix send telegram notification to multiple chats #144922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
what happens if both chat bots have the same chat ids? |
This comment was marked as outdated.
This comment was marked as outdated.
@hanwg, The message will go out in the first one. There is a test for this: |
This comment was marked as outdated.
This comment was marked as outdated.
It has never worked to configure more than one platform so this isn't a critical fix. |
I'll close here now. |
@saippuakauppias The config flow PR for the telegram bot integration has been merged. You're welcome to adapt this branch to work with config entries. We can use the chat ID to look up the config entry by iterating the config entries for the telegram bot domain and their subentries. Each config subentry corresponds to one chat ID. |
Proposed change
This PR fixes an issue with the Telegram Bot integration when multiple bots are configured. Previously, when multiple telegram_bot entries were set up in configuration.yaml, messages were always sent through the last initialized bot, regardless of the specified target chat_id.
The fix maintains a list of all notification services and selects the appropriate one based on the target chat ID when sending messages. This ensures messages are routed through the correct bot.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)To help with the load of incoming pull requests: