Commit graph

34 commits

Author SHA1 Message Date
vexofp
c5a3e58994
Pass timeout to httpx in RESTful Switch (#105364)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-12-19 10:47:42 -10:00
vexofp
327016eaeb
Accept HTTP 200 through 206 as success for RESTful Switch (#105358) 2023-12-09 12:45:33 -10:00
G Johansson
61c17291fb
Move TemplateEntity to template (#98957)
* Move TemplateEntity to template

* Rename template_entity in helpers
2023-08-24 15:37:04 +02:00
Marc Mueller
063ce9159d
Use asyncio.timeout [o-s] (#98451) 2023-08-15 17:21:49 +02:00
G Johansson
ed18c6a013
Refactor Rest Switch with ManualTriggerEntity (#97403)
* Refactor Rest Switch with ManualTriggerEntity

* Fix test

* Fix 2

* review comments

* remove async_added_to_hass

* update on startup
2023-08-15 11:43:47 +02:00
Marc Mueller
91a83e1ad2
Fix httpx DeprecationWarning (#97625) 2023-08-02 20:29:36 +02:00
Franck Nijhof
3e85a29b86
Move overlapping pylint rules to ruff, disable mypy overlap (#94359) 2023-06-27 17:42:46 +02:00
epenet
802e907a35
Migrate rest switch to httpx (#90768) 2023-05-05 14:43:39 +02:00
nono
9cab05c4b9
Fix Rest switch init was not retrying if unreachable at setup (#90627)
* Fix Rest switch init was not retrying if unreachable at setup

* pass error log to platformnotready
prevents spamming the same message in logs.
2023-04-01 17:45:24 +02:00
epenet
f479b2385e
Add type hints to rest switch (#81307) 2022-11-07 14:02:49 +01:00
epenet
fee3898f64
Use _attr_is_on in rest (#81305) 2022-10-31 15:36:43 +01:00
epenet
6f564e4f51
Improve entity type hints [r] (#77874) 2022-09-06 09:47:35 +02:00
Erik Montnemery
146ff83a16
Migrate rest binary_sensor and switch to TemplateEntity (#73307) 2022-06-28 13:53:38 -07:00
epenet
64e7e62aa0
Add setup type hints [r] (#63472)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2022-01-05 16:37:47 +01:00
Paulus Schoutsen
17cf53677c
Rest fixes (#61296) 2021-12-08 14:35:50 -08:00
Paulus Schoutsen
3223332c1e
Use correct template parameter in Rest template rendering (#61269) 2021-12-08 12:19:22 -08:00
J. Nick Koston
10d6247fee
Bump to aiohttp 3.8.0 (#58974) 2021-11-04 10:07:50 -05:00
Chris Browet
b1b782419b
Add REST sensor/binary_sensor/switch templated headers & params (#54426) 2021-10-29 16:36:47 -05:00
Ville Skyttä
5626cc4524
Use http.HTTPStatus in components/r* (#58288) 2021-10-23 20:53:39 +02:00
Chris Browet
1867d24b18
Add state_class support to Rest (#58026) 2021-10-22 13:48:13 -07:00
J. Nick Koston
2f3c2f5f4d
Add support for using a single endpoint for rest data (#46711) 2021-02-19 21:44:15 -08:00
Aleksander Żarczyński
bc3610c8e1
Add patch method to rest switch component (#45663) 2021-01-29 16:03:00 +01:00
Moritz Schmitz von Hülst
434d39a5ea
Add initial rest query params (#42198)
* add initial rest query params

* of course I didn't run black

* fix tests

* fix tests

* add test

* reformat

* add binary sensor test

* fix tests

* add one more test and fix switch

* should not have touched that

* if you don't pay attention once
2020-11-11 09:03:55 -10:00
Franck Nijhof
0e98bc5ea2
Skip template result parsing in several places (#42408)
* Skip template result parsing in several places

* Adjust alert integration

* Adjust Alexa integration

* Adjust apns integration

* Adjust arest integration

* Adjust dialogflow integration

* Adjust generic camera integration

* Adjust imap email content  integration

* Adjust InfluxDB integration

* Adjust intent integration

* Adjust logbook integration

* Adjust HP ILO integration

* Adjust manual alarm control panel integration

* Adjust manual mqtt alarm control panel integration

* Adjust minio integration

* Adjust mqtt integration

* Adjust notify integration

* Adjust persistent notification integration

* Adjust rest integration

* Adjust rss feed template integration

* Adjust slack integration

* Adjust Xiaomi integration

* Adjust TCP integration

* Adjust Telegram Bot integration

* Bump CI cache version

* Revert "Bump CI cache version"

This reverts commit 875efe58cf.

* Adjust demo tests
2020-10-26 19:29:10 +01:00
jjlawren
f01a0f9151
Allow separate URL for REST switch state (#39557) 2020-09-04 16:58:40 +02:00
J. Nick Koston
5018e53b33
Add the ability to reload the rest platforms from yaml (#39257)
* Add the ability to reload rest platforms from yaml

* Revert changes to notify as these will be done in another pass
2020-08-25 19:05:29 -05:00
Erik Montnemery
066e921a8b
Rename SwitchDevice to SwitchEntity (#34673) 2020-04-26 18:50:37 +02:00
springstan
4c38e6cfa5
Use HTTP_BAD_REQUEST constant (#33797) 2020-04-09 21:43:42 +02:00
springstan
8d61893c39
Use HTTP_OK constant (#33798)
* Use http ok constant

* Remove incorrect use

* Run isort

* Fix pylint by adding missing imports

* Fix pylint by fixing one import
2020-04-08 11:47:38 -05:00
Bas Nijholt
04225ba802 Sort imports according to PEP8 for rest (#29674) 2019-12-09 12:09:49 +01:00
Paulus Schoutsen
4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen
f995ab9d54
Don't pass in loop (#23984)
* Don't pass in loop

* Revert some changes

* Lint + Axis revert

* reinstate loop

* Fix a test

* Set loop

* Update camera.py

* Lint
2019-05-22 21:09:59 -07:00
Tobias Sauerwein
048b100eea Clean up docstrings (#22679)
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Penny Wood
f195ecca4b Consolidate all platforms that have tests (#22109)
* Moved climate components with tests into platform dirs.

* Updated tests from climate component.

* Moved binary_sensor components with tests into platform dirs.

* Updated tests from binary_sensor component.

* Moved calendar components with tests into platform dirs.

* Updated tests from calendar component.

* Moved camera components with tests into platform dirs.

* Updated tests from camera component.

* Moved cover components with tests into platform dirs.

* Updated tests from cover component.

* Moved device_tracker components with tests into platform dirs.

* Updated tests from device_tracker component.

* Moved fan components with tests into platform dirs.

* Updated tests from fan component.

* Moved geo_location components with tests into platform dirs.

* Updated tests from geo_location component.

* Moved image_processing components with tests into platform dirs.

* Updated tests from image_processing component.

* Moved light components with tests into platform dirs.

* Updated tests from light component.

* Moved lock components with tests into platform dirs.

* Moved media_player components with tests into platform dirs.

* Updated tests from media_player component.

* Moved scene components with tests into platform dirs.

* Moved sensor components with tests into platform dirs.

* Updated tests from sensor component.

* Moved switch components with tests into platform dirs.

* Updated tests from sensor component.

* Moved vacuum components with tests into platform dirs.

* Updated tests from vacuum component.

* Moved weather components with tests into platform dirs.

* Fixed __init__.py files

* Fixes for stuff moved as part of this branch.

* Fix stuff needed to merge with balloob's branch.

* Formatting issues.

* Missing __init__.py files.

* Fix-ups

* Fixup

* Regenerated requirements.

* Linting errors fixed.

* Fixed more broken tests.

* Missing init files.

* Fix broken tests.

* More broken tests

* There seems to be a thread race condition.
I suspect the logger stuff is running in another thread, which means waiting until the aio loop is done is missing the log messages.
Used sleep instead because that allows the logger thread to run. I think the api_streams sensor might not be thread safe.

* Disabled tests, will remove sensor in #22147

* Updated coverage and codeowners.
2019-03-18 23:07:39 -07:00
Renamed from homeassistant/components/switch/rest.py (Browse further)