Commit Graph

39 Commits (b07e9df308a2fec26d76ee0ae046c5699d0546d1)

Author SHA1 Message Date
Jan-Philipp Benecke 68698cacac
Remove deprecated YAML support from litejet (#107884) 2024-01-12 16:50:15 -05:00
Jon Caruana 45fde2db4e
Remove hardcoded bits from LiteJet integration (#106281)
Use the new properties from pylitejet v0.6.0.
2023-12-27 15:43:00 +01:00
Jan-Philipp Benecke 0eafc8f2cd
Update k-l* tests to use entity & device registry fixtures (#103929) 2023-11-13 20:02:33 +01:00
G Johansson fb56dd0615
Fix LiteJet import config issue (#97679) 2023-08-21 12:20:48 +02:00
Jan Bouwhuis ec98e22330
Add type hints for stub_blueprint_populate fixture (#93568)
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Erik Montnemery 3cca338c6e
Improve blueprint test fixtures (#93519) 2023-05-25 13:45:19 +02:00
Jon Caruana e69091c6db
Use strict typing for LiteJet integration (#88629)
* Strict typing for LiteJet.

* Add test for new check.

* PR feedback.

* PR feedback.
2023-02-24 17:51:48 +01:00
Jon Caruana d41facf750
Add devices to LiteJet (#88406) 2023-02-22 12:08:11 -06:00
epenet ec5c3d6330
Add type hints to integration tests (#88476) 2023-02-20 11:43:51 +01:00
Jon Caruana e5e551f4ea
Code quality/test improvement to available attributes of LiteJet (#86683)
* PR feedback, and add related tests.

* PR feedback.

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-02-18 12:43:32 +01:00
epenet ea11a30a35
Add type hints to integration tests (part 13) (#87998) 2023-02-13 14:38:37 +01:00
epenet f75ac17554
Add type hints to integration tests (j-m) (#87704) 2023-02-08 19:06:59 +01:00
Jon Caruana bbed1099d5
Add diagnostics to LiteJet (#86600) 2023-01-25 16:41:59 +01:00
Jon Caruana 65c4e63e30
Bump pylitejet to 0.4.6 (now with async!) (#85493) 2023-01-17 16:53:16 +01:00
Joakim Plate c576a68d33
Upgrade pytest-aiohttp (#82475)
* Upgrade pytest-aiohttp

* Make sure executors, tasks and timers are closed

Some test will trigger warnings on garbage collect, these warnings
spills over into next test.

Some test trigger tasks that raise errors on shutdown, these spill
over into next test.

This is to mimic older pytest-aiohttp and it's behaviour on test
cleanup.

Discussions on similar changes for pytest-aiohttp are here:
https://github.com/pytest-dev/pytest-asyncio/pull/309

* Replace loop with event_loop

* Make sure time is frozen for tests

* Make sure the ConditionType is not async

  /home-assistant/homeassistant/helpers/template.py:2082: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
    def wrapper(*args, **kwargs):
  Enable tracemalloc to get traceback where the object was allocated.
  See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

* Increase litejet press tests with a factor 10

The times are simulated anyway, and we can't stop the normal
event from occuring.

* Use async handlers for aiohttp

tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_still_image_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_get_stream_from_camera
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
tests/components/motioneye/test_camera.py::test_camera_option_stream_url_template
  /Users/joakim/src/hass/home-assistant/venv/lib/python3.9/site-packages/aiohttp/web_urldispatcher.py:189: DeprecationWarning: Bare functions are deprecated, use async ones
    warnings.warn(

* Switch to freezegun in modbus tests

The tests allowed clock to tick in between steps

* Make sure skybell object are fully mocked

Old tests would trigger attempts to post to could services:

```
DEBUG:aioskybell:HTTP post https://cloud.myskybell.com/api/v3/login/ Request with headers: {'content-type': 'application/json', 'accept': '*/*', 'x-skybell-app-id': 'd2b542c7-a7e4-4e1e-b77d-2b76911c7c46', 'x-skybell-client-id': '1f36a3c0-6dee-4997-a6db-4e1c67338e57'}
```

* Fix sorting that broke after rebase
2022-11-29 22:36:36 +01:00
J. Nick Koston 1c6b4967cf
Fix litejet tests (#82324)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2022-11-18 08:19:38 -06:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Ville Skyttä 5bf67cac66
Use RegistryEntryDisabler (#60436) 2021-12-15 23:25:40 +02:00
Robert Hillis 488a636aec
Clean up unused loggers (#57662) 2021-10-14 10:03:38 -07:00
Jon Caruana 72a3860361
Add transition to LiteJet (#47657) 2021-07-24 12:43:10 +02:00
Ville Skyttä 153d6e891e
Use config_entries.SOURCE_* constants (#49631) 2021-04-25 11:27:40 +02:00
Ville Skyttä a396619251
Use disabled_by constants (#49584)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-04-23 09:56:42 +02:00
Erik Montnemery b26779a27a
Add id to automation triggers (#48464) 2021-03-31 14:56:04 +02:00
Erik Montnemery 84226da404
Update tests i-o to use async_get() instead of async_get_registry() (#47653) 2021-03-09 14:32:08 +01:00
Ville Skyttä dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Jon Caruana 6a8b5ee51b
LiteJet is now configured using config_flow (#44409)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-02-23 14:20:58 -06:00
tkdrob a5a45f29e2
Cleanup unused loggers (#46510) 2021-02-14 13:46:58 +01:00
Paulus Schoutsen b3be708db6
Add default config if not there (#43321)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
2020-11-25 15:10:04 +01:00
Paulus Schoutsen 5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
J. Nick Koston 6f113e981b
Update litejet and zwave tests to use async_add_executor_job (#41927)
* Update litejet and zwave tests to use async_add_executor_job

* await
2020-10-16 13:08:04 +02:00
Phil Bruckner ca9dd0c833
Reorganize trigger code (#38655) 2020-08-17 11:54:56 -05:00
springstan eae21be5b9
Improve string formatting v6 (#33698) 2020-04-07 23:14:28 +02:00
Ville Skyttä 5e2ba2eb77
Enable some more bandit checks (#30857)
* Enable B108 (hardcoded tmp dir), address findings

* Enable B602 (subprocess popen with shell), address findings

* Enable B604 (start process with shell), address findings

* Enable B306 (mktemp), B307 (eval), and B325 (tempnam), no issues to address
2020-01-20 18:44:55 +02:00
Bas Nijholt 1dea0c9e34 Sort imports according to PEP8 for components starting with "L" (#29771) 2019-12-09 14:22:30 +01:00
Paulus Schoutsen 41440d4f1b Fix litejet tests 2019-12-04 21:47:35 -08:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Ville Skyttä 71346760d0 Upgrade pytest to 4.6.3 (#24782)
* Upgrade pytest to 4.6.3

https://docs.pytest.org/en/latest/changelog.html#pytest-4-6-2-2019-06-03
https://docs.pytest.org/en/latest/changelog.html#pytest-4-6-3-2019-06-11

* Make litejet switch test work with pytest 4.6.3

Essentially reverts the corresponing change that was made for pytest
4.2 compatibility.
2019-06-26 20:01:03 -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
Paulus Schoutsen b8cc547fa3
Move components to folders (#20774)
* Move all components into folders

* Move component tests into folders

* Fix init moving

* Move tests

* Lint

* Update coverage

* Fix service descriptions

* Update CODEOWNERS
2019-02-05 19:31:15 -08:00