1
0
mirror of https://github.com/home-assistant/core.git synced 2025-08-12 23:10:05 +00:00
Commit Graph

86 Commits

Author SHA1 Message Date
Erik Montnemery
cf4033b1bc Simplify time zone setting in tests ()
* Simplify timezone setting in tests

* Fix typo

* Adjust caldav tests

* Adjust input_datetime tests

* Adjust time_date tests

* Adjust tod tests

* Adjust helper tests

* Adjust recorder tests

* Adjust risco tests

* Adjust aemet tests

* Adjust flux tests

* Adjust forecast_solar tests

* Revert unnecessary change in forecast_solar test

* Adjust climacell tests

* Adjust google tests

* Adjust sensor tests

* Adjust sonarr tests

* Adjust template tests

* Adjust zodiac tests

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-20 10:25:15 +01:00
Erik Montnemery
d360ac91ca Disable recorder nightly jobs in tests () 2022-03-15 09:23:52 -07:00
Erik Montnemery
98982c86e4 Add MQTT diagnostics ()
* Add MQTT diagnostics

* Redact device tracker location

* Adjust tests

* Address comments from code review
2022-02-18 09:28:49 +01:00
Erik Montnemery
fe38e6ba87 Drop MQTT import flow ()
* Drop MQTT import flow

* Reload manually configured MQTT entities when config entry is setup

* Address review comments

* Actually remove the import flow
2022-02-10 21:09:57 +01:00
Paulus Schoutsen
63f8e437ed Add Home Assistant Content user () 2022-01-21 10:06:39 -08:00
Stefan Agner
a13ae85982 Introduce only_supervisor for @websocket_api.ws_require_user() () 2021-12-08 16:49:35 -08:00
epenet
c05eca1c82 Remove log flooding prevention logic from discovery info ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
J. Nick Koston
347c4ea137 Bump zeroconf to 0.37.0 () 2021-11-18 20:23:20 -08:00
Simone Chemelli
5fc51130ea Replace util.get_local_ip in favor of components.network.async_get_source_ip() - part 4 ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-11-15 09:18:57 -08:00
Erik Montnemery
30f7bc0f18 Use freezegun in DST tests () 2021-11-02 18:11:39 +01:00
Paulus Schoutsen
f51e1fcb67 Check for uncaught service not found exceptions () 2021-11-01 14:33:09 +01:00
Erik Montnemery
f6682ba99d Block tests from opening sockets () 2021-10-05 14:46:09 -10:00
Erik Montnemery
8c5efafdd8 Add 5-minute statistics for sensors ()
* Add 5-minute statistics for sensors

* Address pylint issues

* Black

* Apply suggestion from code review

* Apply suggestions from code review

* Improve tests
2021-09-16 10:57:15 +02:00
Erik Montnemery
7dbe8070f7 Mock out network.util.async_get_source_ip in tests () 2021-09-02 20:44:50 +02:00
Erik Montnemery
cdaba62d2c Add test fixture for unauthenticated HTTP client ()
* Add test fixture for unauthenticated HTTP client

* Remove things from the future
2021-09-02 13:09:16 +02:00
Erik Montnemery
7dbd0e5274 Fix zeroconf mock and use it in CI group 1's tests ()
* Fix zeroconf mock and use it in CI group 1's tests

* Mock HaAsyncServiceBrowser
2021-09-01 22:38:00 +02:00
Erik Montnemery
e541bcd54d Update statistics meta data on entity_id change () 2021-07-14 13:23:11 +02:00
Erik Montnemery
e16a8063a5 Compile statistics for energy sensors ()
* Compile statistics for energy sensors

* Update tests

* Rename abs_value to state

* Tweak

* Recreate statistics table

* Pylint

* Try to fix test

* Fix statistics for multiple energy sensors

* Fix energy statistics when last_reset is not set
2021-05-20 13:05:15 +02:00
J. Nick Koston
909a20b36d Use async zeroconf registration functions () 2021-05-11 11:03:36 -05:00
Erik Montnemery
ed31cc363b Wait for registries to load at startup ()
* Wait for registries to load at startup

* Don't decorate new functions with @bind_hass

* Fix typing errors in zwave_js

* Load registries in async_test_home_assistant

* Tweak

* Typo

* Tweak

* Explicitly silence mypy errors

* Fix tests

* Fix more tests

* Fix test

* Improve docstring

* Wait for registries to load
2021-02-11 17:36:19 +01:00
Joakim Plate
d4f186078c During tests we can run with lowest rounds () 2021-01-29 19:57:14 +01:00
Joakim Plate
af68d5fb41 Use a fully mocked credential () 2021-01-29 17:58:25 +01:00
Joakim Plate
38d2cacf7a Support blocking trusted network from new ip ()
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-01-28 12:06:20 +01:00
Franck Nijhof
65cf2fcb6f Drop asynctest () 2021-01-01 22:31:56 +01:00
Erik Montnemery
5e6f5fca90 Don't send MQTT birth message in tests () 2020-12-04 04:39:49 +01:00
Paulus Schoutsen
ea55051161 Stub finding custom integrations in tests () 2020-11-27 12:53:16 +01:00
Paulus Schoutsen
f9fa24950b OAuth2 to use current request header () 2020-11-27 08:55:34 +01:00
Tom Parker-Shemilt
2b151209b2 Don't try and store exceptions when the key is missing () 2020-10-16 10:01:58 +02:00
Erik Montnemery
392d5c673a Cache matching MQTT subscriptions () 2020-10-08 08:52:23 +02:00
J. Nick Koston
9e1461da62 Determine how to run listeners at setup time instead of execution time () 2020-10-07 16:51:50 +02:00
Erik Montnemery
06e9489fc7 Add Tasmota integration ()
* Add Tasmota integration

* Refactor

* Add tests, small improvements

* isort

* Attempt to fix tests failing with Python 3.8

* Revert "Attempt to fix tests failing with Python 3.8"

This reverts commit 11454f8a00136f068ea27204183fa3e62f3cd263.

* Fix tests failing with Python 3.8

* Cleanup tests

* Address review comments

* Address review comments

* Address review comments

* Use MAC address for device identification

* Bump hatasmota

* Bump hatasmota

* Apply suggestions from code review

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

* Fix indentation

* Remove preparation for device remove WS API

* Address review comments

* Remove useless try-except

* Tweak

* Improve tests

* Tweak

* Address review comments

* Correct test

* Update manifest.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-10-06 14:51:58 +02:00
J. Nick Koston
7b016063ca Refactor zeroconf setup to be async ()
* Refactor zeroconf setup to be async

Most of the setup was calling back to async because
we were setting up listeners.  Since we only need
to jump into the executor to create the zeroconf
instance, its much faster to setup in async.

In testing this cut the setup time in half
or better.

* partial revert to after_deps
2020-09-13 18:06:19 -05:00
Erik Montnemery
ee043d8614 Wait for broker to ACK MQTT operations ()
* Wait for broker to ACK MQTT operations

* Deduplicate new code

* Fix tests

* Improve test

* Don't hold PAHO lock when waiting for ACK

* Fix tests

* Add constant for ACK timeout
2020-08-21 17:00:13 +02:00
Franck Nijhof
755761867d Use current request context in OAuth redirect () 2020-08-15 15:26:54 +02:00
J. Nick Koston
60009ec2f9 Use event loop scheduling for tracking time patterns ()
* Use event loop scheduling for tracking time patterns

* make patching of time targetable

* patch time tests since time can tick to match during the test

* fix more tests

* time can only move forward

* time can only move forward

* back to 100% coverage

* simplify since the event loop time cannot move backwards

* simplify some more

* revert simplify

* Revert "revert simplify"

This reverts commit bd42f232f6.

* Revert "simplify some more"

This reverts commit 2a6c57d514.

* Revert "simplify since the event loop time cannot move backwards"

This reverts commit 3b13714ef4.

* Attempt another simplify

* time does not move backwards in the last two

* remove next_time <= now check

* fix previous merge error
2020-07-20 20:18:31 -10:00
Joakim Plate
bcd604eec2 Detect lingering threads after tests ()
* Detect lingering threads after tests

* Make sure cast is setup before checking state

* Make sure we ask executors of old hass to shutdown

We are not waiting here, just hoping for the best

* Make sure all instances of hass and executors is stopped.

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* Also apply hass stopping to scripts

* Adjust to changes how we set up executor

* Add new CoreState.stopped

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-07-09 16:15:14 +02:00
Paulus Schoutsen
f49ce5d1b4 Protect loop set default executor ()
Co-authored-by: J. Nick Koston <nick@koston.org>
2020-07-06 15:58:53 -07:00
J. Nick Koston
89a9634d35 Use eventloop for scheduling ()
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2020-06-29 09:39:24 -07:00
Erik Montnemery
747490ab34 Support reconfiguring MQTT config entry () 2020-06-22 17:49:01 -07:00
Erik Montnemery
280f49540e Drop use of async_mock_mqtt_component () 2020-06-22 23:59:50 +02:00
Erik Montnemery
f1ecac92df Fail tests if wrapped callbacks or coroutines throw () 2020-05-06 14:14:57 -07:00
Paulus Schoutsen
ec47216388 Use built-in test helpers on 3.8 () 2020-04-30 13:29:50 -07:00
Paulus Schoutsen
0d700f6a63 Fix tests for Python 3.8 () 2020-04-25 14:32:55 -07:00
Ziv
1259979204 Fix uncaught exception in local_file ()
* remove ignore from localfile

* added mock_registry

* since there are no more exceptions, infra to ignore them is redundant
2020-04-17 13:10:48 +02:00
Paulus Schoutsen
bea354b82a Allow WS queue to temporarily peak ()
* Allow WS queue to temporarily peak

* Remove unused code
2020-04-13 18:50:36 -07:00
David F. Mulcahey
8b0a0ee521 Don't write storage to disk while stopping ()
* Don't write storage to disk while stopping

* rework change

* lint

* remove delay save and schedule final write at stop

* update tests

* fix test component using private methods

* cleanup

* always listen

* use stop in restore state again

* whitelist JSON exceptions for later

* review comment

* make zwave tests use mock storage
2020-04-02 10:25:28 -07:00
Ziv
ff391e538a Fail tests with uncaught exceptions ()
* initial implementation and ignore file

* updated ignore list for the tests in the most recent dev branch
2020-03-27 21:36:06 -07:00
Martin Hjelmare
e3adbc336d Fix check_real location guard () 2020-02-16 15:33:09 -08:00
Ville Skyttä
5216477353 Be consistent with Home Assistant and Hass.io spelling ()
* Be consistent with Home Assistant spelling

* Be consistent with Hass.io spelling
2020-01-05 14:09:17 +02:00
Paulus Schoutsen
b9aba30a6e Extract Collection helper from Person integration ()
* Add CRUD foundation

* Use collection helper in person integration

* Lint/pytest

* Add tests

* Lint

* Create notification
2020-01-03 21:37:11 +01:00