Added HttpDigestAuth ability to Telegram when sending photos#7396
Added HttpDigestAuth ability to Telegram when sending photos#7396tchellomello wants to merge 2 commits into
Conversation
|
@tchellomello, thanks for your PR! By analyzing the history of the files in this pull request, we identified @pvizeli, @fabaff and @icovada to be potential reviewers. |
pvizeli
left a comment
There was a problem hiding this comment.
Please do it in same way as we do it inside generic camer
…when sending photos
|
Let's put this PR on hold for now until #7294 gets merged |
method to use. Currently methods supported are: 'digest' and 'basic'.
|
@pvizeli since the If you agree with that, I'll go ahead and modify the documentation explaining the new configuration: send_snapshot:
alias: 'send snapshot'
sequence:
- service: notify.telegramBot
data:
title: 'Snapshot Cam'
message: 'Sending snap from cam'
data:
photo:
- url: !secret amcrest_url
caption: "Snapshot Amcrest"
authentication: "digest"
username: !secret amcrest_username
password: !secret amcrest_passwordIf |
|
Yeah, don't do that global, make it per request and default Basic 👍 |
|
Alright, closing this one for now then |
…as, variable templating, digest auth (#7771) * fix double template rendering when messages come from notify.telegram * fix 'chat' information not present in callback queries * better inline keyboards with yaml To make a row of InlineKeyboardButtons you pass: - a list of tuples like: `[(text_b1, data_callback_b1), (text_b2, data_callback_b2), ...] - a string like: `/cmd1, /cmd2, /cmd3` - or a string like: `text_b1:/cmd1, text_b2:/cmd2` Example: ```yaml data: message: 'TV is off' disable_notification: true inline_keyboard: - TV ON:/service_call switch.turn_on switch.tv, Other:/othercmd - /help, /init ``` * fix send file to multiple targets * fix message templating, multiple file targets, HA cameras - Allow templating for caption, url, file, longitude and latitude fields - Fix send a file to multiple targets - Load data with some retrying for HA cameras, which return 500 one or two times sometimes (generic cams, always!). - Doc in services for new inline keyboards yaml syntax: `Text button:/command` * HttpDigest authentication as proposed in #7396 * review changes - Don't use `file` as variable name. - For loop - Simplify filter allowed `chat_id`s. * Don't use `file` as variable name! * make params outside the while loop * fix chat_id validation when editing sent messages
Description:
When creating an automation/script using notify/Telegram with URL photo support, it will not work if the webserver requires an HTTPDigestAuth.
For example, the new Amcrest firmware requires a HttpDigestAuth to download the camera snapshot.
Related issue (if applicable): fixes #7395
Example entry for
configuration.yaml(if applicable):Checklist:
If the code does not interact with devices:
toxrun successfully. Your PR cannot be merged unless tests pass