Commit Graph
45 Commits
Author SHA1 Message Date
Artur PragaczandGitHub b1511a66be Do not set a device on YAML threshold entities (#177598) 2026-07-30 08:47:49 +02:00
8e7deee967 Add pylint checker to check for using registries as fixture (#172455)
Co-authored-by: Markus Tuominen <3738613+Markus98@users.noreply.github.com>
2026-07-22 09:56:23 +03:00
Erik MontnemeryandGitHub 1d885bd073 Restrict device registry entries to a single config entry and subentry (#175785) 2026-07-16 22:10:10 +02:00
Franck NijhofandGitHub 67c1930c6f Fix threshold preview crash when hysteresis is not provided (#171009) 2026-05-17 16:48:36 -04:00
epenetandGitHub 6bbe80da72 Fix incorrect use of Platform enum in threshold tests (#163154) 2026-02-16 13:56:28 +01:00
epenetandGitHub 3f8807d063 Remove outdated device registry cleanup in threshold (#161866) 2026-01-31 15:13:54 +01:00
Artur PragaczandGitHub c6064f40d2 Use same code path for friendly name as for entity ID (#161250) 2026-01-27 00:13:53 +01:00
epenetandGitHub dbfdaf6a2e Use is over == comparison for FlowResultType in flow tests (#159158) 2025-12-16 09:48:45 +01:00
G JohanssonandGitHub 868ded141f Use automatic reload options flow in threshold (#152684) 2025-09-22 11:48:37 +02:00
Erik MontnemeryandGitHub 7df0016fab Do not add threshold config entry to source device (#148732) 2025-07-14 20:05:20 +02:00
Erik MontnemeryandGitHub 51b0642789 Handle changes to source entity in threshold helper (#146524) 2025-06-11 15:17:34 +02:00
Simone ChemelliandGitHub 484a547758 Fix pylance warning on SnapshotAssertion import (#145206) 2025-05-19 13:55:48 +02:00
epenetandGitHub a3605921c9 De-duplicate test helper function (#143437)
* De-duplicate test helper function

* One more
2025-04-22 12:04:12 +02:00
G JohanssonandGitHub d11012b2b7 Move check thresholds valid to platform schema in threshold (#129540) 2024-11-09 10:50:11 +01:00
Adam GoodeandGitHub 71f6537846 Add additional test cases to Threshold (#126469)
There are still some bugs to be fixed, but for now this adds some
additional test cases for things that are already correct.
2024-09-23 12:51:29 +02:00
Adam GoodeandGitHub 647017d18c Take a list of values for testing Threshold (#125705)
When parameterizing these tests, I forgot that hysteresis tests are
sensitive to all previous values rather than just the previous one.

This change should restore behavior to the pre-parameterization version
by replaying all value histories.

Subsequent changes will add new test cases.
2024-09-11 13:00:57 +02:00
Adam GoodeandGitHub 72d546d6c2 Move constants in Threshold (#125683) 2024-09-10 17:51:23 +02:00
Adam GoodeandGitHub a361c01ed6 Parameterize many of the threshold tests (#125521)
threshold: Parameterize many of the tests

This simplfies the structure of the basic threshold tests,
making it easier to subsequently update or add missing test cases.

Except for a few removals of an inconsistenly applied assertions on
`state.attributes["sensor_value"]`, there are no changes to the existing
tests intended. All previous tests are expected to run identically.

A few extra test cases for None are added.
2024-09-10 16:16:45 +02:00
dougiteixeiraandGitHub 61931d15cd Use the new device helpers in Threshold (#120158) 2024-06-22 15:38:58 +02:00
1c2aa9a49b Add preview to Threshold config & option flow (#117181)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-06-22 13:19:57 +02:00
epenetandGitHub 3d1165519d Fix broad-exception-raised in component tests (#119467) 2024-06-12 17:53:42 +02:00
Joakim PlateandGitHub 958a456275 Allow source sensor to be changed in threshold helper (#119157)
* Allow source sensor to be changed in threshold helper

* Make sure old device link is removed on entry change

* Add test case for changed association
2024-06-11 06:41:29 +02:00
epenetandGitHub 2545b7d3bb Use registry fixtures in tests (t-u) (#118297) 2024-05-28 14:23:01 +02:00
Joost LekkerkerkerandGitHub ee66f6ec8c Use is in enum comparison in config flow tests P-T (#114675) 2024-04-02 11:21:50 -10:00
00ec7f11f0 Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc MuellerandGitHub 32f3f46542 Add empty line after module docstring (2) [tests.components] (#112737) 2024-03-08 19:16:21 +01:00
Marc MuellerandGitHub 87165c0d6e Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
Erik MontnemeryandGitHub 8813140ed5 Adjust threshold tests which create devices (#98208) 2023-08-10 18:24:36 +02:00
dougiteixeiraandGitHub c472ead4fd Fix device source for Threshold (#95623)
Fix Device Source
2023-06-30 14:48:36 -04:00
dougiteixeiraandGitHub 26016b29f7 Add the device of the source entity in the helper entities for Threshold (#94753) 2023-06-26 18:05:11 +02:00
Erik MontnemeryandGitHub 586471b5a9 Improve threshold binary sensor (#88978)
Improve threshold sensor
2023-03-28 09:11:13 +02:00
G JohanssonandGitHub e932139721 Strict typing threshold (#82786) 2023-03-12 17:10:00 +01:00
Erik MontnemeryandGitHub 3818e318db Improve threshold binary sensor tests (#88972) 2023-03-01 16:53:42 +01:00
Franck NijhofandGitHub ed79265843 Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Franck NijhofandGitHub 9030ca05b1 Enable Ruff SIM118 (#87772) 2023-02-15 12:39:12 +01:00
epenetandGitHub 278050a73f Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
MichaelandGitHub 9709391b52 Replace the usage of unit constants by enumerations in Tests [s-u] (#85937) 2023-01-16 09:00:27 +01:00
Franck NijhofandGitHub a6244eea28 Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
b5d2c6e43a Add config flow for threshold binary sensor (#68238)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2022-03-22 11:32:19 +01:00
Franck NijhofandGitHub b496469a2f Fix unavailable entity capable of triggering non-numerical warning in Threshold sensor (#52563) 2021-07-06 09:33:00 +02:00
Franck NijhofandGitHub 5a2b5fe7c5 Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
dd26ab6b4e Rewrite threshold unittest tests to pytest style test functions (#41141)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-10-04 21:38:21 +02:00
Bas NijholtandFranck Nijhof de915e1bf0 Sort imports according to PEP8 for components starting with "T" (#29778) 2019-12-09 14:41:48 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Penny WoodandPaulus Schoutsen 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