Commit graph

31 commits

Author SHA1 Message Date
Wictor
d7375f1a9c
Refactor telegram_bot polling/webhooks platforms and add tests ()
Co-authored-by: Pär Berge <paer.berge@gmail.com>
2022-04-02 20:39:14 -07:00
Ville Skyttä
d8d34fdd3b
Prefer HTTPStatus over int in HA view JSON functions ()
* Prefer HTTPStatus over int in HA view JSON functions

* Update zwave tests to not expect a fixed typo
2021-09-22 21:59:52 +03:00
Joakim Sørensen
4f33679255
Fix url lookup in telegram_bot webhook () 2021-09-02 19:17:33 +02:00
J. Nick Koston
c820dd4cb5
Have pylint warn when user visible log messages do not start with capital letter or end with a period ()
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-03-19 09:26:36 -05:00
J. Nick Koston
9c719beded
Update telegram_bot to use async_add_executor_job () 2020-10-16 13:29:28 +02:00
Franck Nijhof
cc4ebc925c
Improve X-Forwarded-* request headers handling ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2020-08-11 22:57:50 +02:00
Franck Nijhof
e3e3a113e9
async_get_url -> get_url () 2020-05-08 21:53:28 +02:00
Franck Nijhof
2223592486
Add get_url helper, deprecate base_url () 2020-05-08 02:29:47 +02:00
Quentame
bd0403c65e Move imports in telegram_bot component () 2019-10-17 17:19:34 -07:00
Franck Nijhof
ef0e9431b6 Use literal string interpolation in integrations T-W (f-strings) () 2019-09-03 21:12:51 +02:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Diogo Gomes
51508d69ad Bandage telegram bot ()
* Bandage

* lint

* move everything into __init__.py

* fix lint
2019-04-12 14:28:59 -07:00
cgtobi
2c07bfb9e0 Remove dependencies and requirements ()
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2c.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Paulus Schoutsen
4b1de61110
Use relative imports inside integrations ()
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Fabian Affolter
127c55e0c1
Update file header ()
* Update file header

* Update file header

* Update file header

* Update file header

* Update file header

* Fix lint issues
2019-02-13 21:21:14 +01:00
Luca Angemi
0f877711a0 Fixes Telegram webhooks () 2018-10-28 19:39:23 +01:00
cdce8p
3b5e5cbcd6 Async syntax 5, light & lock & remote & scene & telegram & helpers () 2018-10-01 08:56:50 +02:00
ruohan.chen
35bae1eef2 Telegram_bot three platform support proxy_url and proxy_params ()
* telegram_bot three platform support proxy_url and proxy_params

* add telegram_bot._initialize_bot to create the bot instance

* rename _initialize_bot to initialize_bot
2018-03-07 12:44:07 +01:00
Paulus Schoutsen
f32911d036 Cleanup http ()
* Clean up HTTP component

* Clean up HTTP mock

* Remove unused import

* Fix test

* Lint
2018-02-15 22:06:14 +01:00
Eugenio Panadero
cee49f313f Retry set_webhook up to three times, reduce timeout to 5s again () 2017-07-30 11:14:28 +02:00
Paulus Schoutsen
46e030662d Fix pylint 1.7.2 no-else-return issues ()
* Fix pylint 1.7.2 no-else-return issues

* Update tomato.py
2017-07-05 23:30:01 -07:00
Eugenio Panadero
77aa2e940d increase timeout for setWebhook to 10s ()
Add an optional extended description…
2017-06-19 12:03:58 +02:00
Paulus Schoutsen
8461cf2717 Fix telegram_bot () 2017-06-03 10:50:37 +01:00
Pascal Vizeli
2df6aabbf3 Cleanup telegram / Add url to webhook ()
* Cleanup telegram / Add url to webhook

* fix lint

* Fix lint
2017-05-30 06:55:06 +02:00
Brenton Zillins
228fb8c072 Ensure https base_url in telegram bot () 2017-05-23 10:16:54 -07:00
Eugenio Panadero
b30c352e37 Telegram Bot enhancements with callback queries and new notification services ()
* telegram_bot and notify.telegram enhancements:
- Receive callback queries and produce `telegram_callback` events.
- Custom reply_markup (keyboard or inline_keyboard) for every type of message (message, photo, location & document).
- `disable_notification`, `disable_web_page_preview`, `reply_to_message_id` and `parse_mode` optional keyword args.
- Line break between title and message fields: `'{}\n{}'.format(title, message)`
- Move Telegram notification services to `telegram_bot` component and forward service calls from the telegram notify service to the telegram component, so now the `notify.telegram` platform depends of `telegram_bot`, and there is no need for `api_key` in the notifier configuration. The notifier calls the new notification services of the bot component:
	- telegram_bot/send_message
	- telegram_bot/send_photo
	- telegram_bot/send_document
	- telegram_bot/send_location
	- telegram_bot/edit_message
	- telegram_bot/edit_caption
	- telegram_bot/edit_replymarkup
	- telegram_bot/answer_callback_query
- Added descriptions of the new notification services with a services.yaml file.
- CONFIG_SCHEMA instead of PLATFORM_SCHEMA for the `telegram_bot` component, so only one platform is allowed.
- Async component setup.

* telegram_bot and notify.telegram enhancements: change in requirements_all.txt.
2017-05-09 21:42:17 -07:00
Fabian Affolter
4d52b0ecd5 Update docstrings ()
* Update docstrings

* Fix lint issues

* Update docstrings
2017-05-02 22:47:20 +02:00
Fabian Affolter
a4f1f6e724 Update docstrings ()
* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstrings

* Update docstring

* Update docstrings

* Update docstrings

* Fix lint issues

* Update docstrings

* Revert changes in dict
2017-05-02 09:18:47 -07:00
Fabian Affolter
569ea0cc01 Upgrade python-telegram-bot to 5.3.1 () 2017-04-26 10:50:08 +02:00
Martin Hjelmare
0e662c4007 Fix telegram webhooks ()
* Always register the view if a webhook exists.
* Return True if platform is set up succesfully, False otherwise.
* Remove the webhook when home assistant stops. Webhooks and long
  polling are mutually excklusive. If a webhook is left after home
  assistant is stopped, a polling telegram bot is unable to be set up,
  on next start of home assistant.
2017-04-23 23:20:04 -07:00
sander76
7cb8f49d62 Telegram bot component (incl. webhook and polling platform) ()
* first commit.

* removed pointless string statement

* manually removed  # homeassistant.components.telegram_webhooks from requirements_all.txt

* deleted obsolete file.

* coveragerc abc
2017-04-11 21:10:56 -07:00