Commit Graph

24 Commits (b07e9df308a2fec26d76ee0ae046c5699d0546d1)

Author SHA1 Message Date
epenet 807c69f621
Add type hints to integration tests (b-c) (#87698) 2023-02-08 18:08:43 +01:00
Franck Nijhof ca1a12898c
Enable Ruff D212 (#87347) 2023-02-03 23:08:48 +01:00
Franck Nijhof 24fdd588fd
Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
HarvsG fe7402375d
Bayesian - support `unique_id:` (#79879)
* support unique_id

* adds test for unique_ids
2022-10-25 12:42:59 +02:00
HarvsG f645965172
Add repair for missing Bayesian `prob_given_false` (#79303) 2022-09-29 13:24:06 -04:00
HarvsG 768b83139f
Add to issue registry if user has mirrored entries for breaking in #67631 (#79208)
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
2022-09-28 21:39:15 -04:00
HarvsG 49eeeae51d
Fix Bayesian sensor to use negative observations (#67631)
Co-authored-by: Diogo Gomes <diogogomes@gmail.com>
2022-09-25 22:02:35 -04:00
Franck Nijhof 8f4caf4141
Clean up accessing event helpers via hass (#72011) 2022-05-17 19:36:29 +02:00
epenet 831e2ace9c
Prettify yaml (tests) (#68891) 2022-03-30 11:26:08 +02:00
Paulus Schoutsen 31153ac155
Move fixtures part 1 (#58902) 2021-11-01 20:47:05 -07:00
Franck Nijhof 5a2b5fe7c5
Yoda assertion style removed is (#48142) 2021-03-20 13:55:10 +01:00
Franck Nijhof 65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
thaohtp aabf26bbc8
Rewrite bayesian unittest tests to pytest style test functions. (#41740) 2020-10-16 13:10:48 +02:00
J. Nick Koston 44952a94cf
Add missing conext preservation to bayesian and universal (#40178)
We already do this for template sensors, but it was
missing for bayesian and universal
2020-09-17 16:47:23 +02:00
J. Nick Koston a495946eeb
Add the ability to reload bayesian platforms from yaml (#39771) 2020-09-08 09:41:17 +02:00
J. Nick Koston b68c5cec94
Convert bayesian binary_sensor to use async_track_template_result (#39174)
Add coverage to reach 100% line coverage
2020-08-23 09:59:26 +02:00
Paulus Schoutsen 276f3afb00
Do async_setup_platform in background (#36244)
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-31 22:18:30 -07:00
Jeff McGehee dcf51e5a14
Fix Bayesian Binary JSON Serialization (#34540) 2020-04-22 11:25:14 -07:00
Jeff McGehee dd1608db0d
Best effort state initialization of bayesian binary sensor (#30962)
* Best effort state initialization of bayesian binary sensor.

Why:

* https://github.com/home-assistant/home-assistant/issues/30119

This change addresses the need by:

* Running the main update logic eagerly for each entity being observed
  on `async_added_to_hass`.
* Test of the new behavior.

* Refactor in order to reduce number of methods with side effects that
mutate instance attributes.

* Improve test coverage

Why:

* Because for some reason my commits decreased test coverage.

This change addresses the need by:

* Adding coverage for the case where a device returns `STATE_UNKNOWN`
* Adding coverage for configurations with templates

* rebase and ensure upstream tests passed

* Delete commented code from addressing merge conflict.
2020-03-31 10:41:29 -06:00
paolog89 0e6a48c688
Add observed entities to bayesian sensor (#27721)
* Add observed entities to bayesian sensor

* Update binary_sensor.py to comply with style guidelines and test_binary_sensor.py to verify the entity_id

* Update binary_sensor.py and test_binary_sensor.py to include an additional attribute for observed entities

* Use of ATTR_ENTITY_ID and numeric key of observed entity

* Update binary_sensor.py

* Update test_binary_sensor.py to verify behavior

* Update to return a list without duplicates in the state attribute

* Update binary_sensor.py: rename of ATTR_ENTITY_ID into ATTR_OBSERVED_ENTITIES

* Rename new attribute into ATTR_OCCURRED_OBSERVATION_ENTITIES and fix test
2020-02-24 21:27:59 -08:00
Christian Clauss df7d2b3aeb
Fix typos found by codespell (#31243)
* Fix typos found by codespell

* Fix typos found by codespell

* codespell: Furture  ==> Future

* Update test_config_flow.py

* Update __init__.py

* Spellcheck: successfull  ==> successful

* Codespell: unsuccesful  ==> unsuccessful

* Codespell: cant  ==> can't

* Codespell: firware ==> firmware

* Codespell: mimick  ==> mimic
2020-01-31 08:33:00 -08:00
Bas Nijholt 73de69896b Sort imports according to PEP8 for components starting with "B" (#29762) 2019-12-09 13:52:18 +01: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