Commit Graph

31 Commits (7e11fec761dcdc108cd8e355c4f19d1a79d50270)

Author SHA1 Message Date
Marc Mueller 7d6251ca08
Add empty line after module docstring [tests q-s] (#112711) 2024-03-08 14:47:22 +01:00
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
Erik Montnemery 25bea91683
Use modern platform path when reporting platform config errors (#104238)
* Use modern platform path when reporting platform config errors

* Update tests

* Address review comment

* Explicitly pass platform domain to log helpers

* Revert overly complicated changes

* Try a simpler solution
2023-12-05 15:06:13 +01:00
Erik Montnemery 80813e992d
Improve formatting of component errors (#104081)
* Improve formatting of component errors

* Update tests
2023-11-17 23:01:00 +01:00
Erik Montnemery dd7670cacf
Improve errors for component configuration with missing keys (#103982) 2023-11-15 10:47:05 +01: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
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
Allen Porter 12129e9d21
Update service call return values and error handling (#94657)
* Update return signature of service calls

* Add timeout error handling in websocket api for service calls

* Update recorder tests to remove assertion on service call

* Remove timeout behavior and update callers that depend on it today

* Fix tests

* Add missing else

* await coro directly

* Fix more tests

* Update the intent task to use wait instead of timeout

* Remove script service call limits and limit constants

* Update tests that depend on service call limits

* Use wait instead of wait_for and add test

* Update homeassistant/helpers/intent.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-06-16 07:01:40 -07:00
epenet 802e907a35
Migrate rest switch to httpx (#90768) 2023-05-05 14:43:39 +02:00
epenet f24634e198
Use domain constants in rest tests (#90765) 2023-04-04 14:33:41 +02:00
epenet 934cec9778
Modernize rest switch tests (#81306)
* Adjust rest switch tests to use schema validation

* Simplify

* Use async_setup_component in tests

* Rewrite tests

* Add patch

* Remove patch

* Adjust mock
2022-11-07 13:08:05 +01:00
epenet a0ed91e30c
Add type hints to rest tests (#81304) 2022-10-31 15:30:29 +01:00
Erik Montnemery 146ff83a16
Migrate rest binary_sensor and switch to TemplateEntity (#73307) 2022-06-28 13:53:38 -07:00
Simone Chemelli 969930b9c9
Remove debug print (#63460) 2022-01-05 15:34:33 +01:00
Robert Hillis d9788c2447
Use platform enums in rest tests (#62564) 2021-12-22 07:31:55 -05:00
Robert Hillis 1bd904b5b5
Use enums for rest tests (#62197)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-12-19 18:01:33 +01:00
Chris Browet b1b782419b
Add REST sensor/binary_sensor/switch templated headers & params (#54426) 2021-10-29 16:36:47 -05:00
Chris Browet 1867d24b18
Add state_class support to Rest (#58026) 2021-10-22 13:48:13 -07:00
Ville Skyttä 2730a27fd0
Use HTTPStatus instead of HTTP_* constants in various test mocks (#56543) 2021-10-01 15:52:45 -07:00
Franck Nijhof 5a2b5fe7c5
Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
J. Nick Koston 2f3c2f5f4d
Add support for using a single endpoint for rest data (#46711) 2021-02-19 21:44:15 -08: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
Julian Engelhardt 5230ff6640
Rest test style (#42032) 2020-10-22 10:00:48 +02:00
springstan 6a7caad8dc
Use content type json constant (#40312) 2020-09-23 20:21:55 +02:00
jjlawren f01a0f9151
Allow separate URL for REST switch state (#39557) 2020-09-04 16:58:40 +02:00
springstan fb8f8133a0
Use HTTP_INTERNAL_SERVER_ERROR constant (#33832) 2020-04-08 23:20:03 +02:00
Bas Nijholt 04225ba802 Sort imports according to PEP8 for rest (#29674) 2019-12-09 12:09:49 +01:00
Pascal Vizeli c1851a2d94
Cleanup coroutine threadsafe (#27080)
* Cleanup coroutine threadsafe

* fix lint

* Fix typing

* Fix tests

* Fix black
2019-10-01 16:59:06 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07: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