Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
* Do not return cached values for state and brightness
* Move building the uncached state dict behind a lru_cache (_build_entity_state_dict)
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* 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
* Withing trigger a call to coordinator after init
* Stop discovery task on STOP event
* Stop dsmr connection task on STOP
* Use autospec in modem_serial tests
close on AioSerial is non async, and should not be mocked as a coroutine
* Make sure responder is specced correctly
tests/components/emulated_hue/test_init.py::test_setup_works
/Users/joakim/src/hass/home-assistant/homeassistant/components/emulated_hue/__init__.py:119: RuntimeWarning: coroutine 'AsyncMockMixin._execute_mock_call' was never awaited
protocol.close()
* Don't assume Pymodbus is the only thing logging
* Use gather instead of wait
```
homeassistant/components/homeassistant/__init__.py:208: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
```
* Increase wait time for automation tests
Assuming exit within 1 seconds is unreasonable on a potentially loaded
test machine.
* Avoid changing app state after startup
* Add basic typing to emulated_hue
* type a few more places
* fixes
* numbers are always stringified
* numbers are always stringified
* coverage
* drop assert
* Add definitions for grouping media players
See https://github.com/home-assistant/architecture/issues/364
* Fix Google Assistant tests
* Define sync versions of async_join_players/async_unjoin
* Don't use async API in synchronous test methods
* Fix tests and make pylint happy
The method name `unjoin` is used by another component, so let's use
`unjoin_player` instead.
* Fix emulated_hue tests
The new media player entity in the `demo` component requires a tiny
adjustment in the emulated_hue tests.
* Use "target:" in service description
* Also use "name:" in service descriptions
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Enable setting XY color and transition time by client
* New test for setting XY color value
* Correct block outdent
* New test for setting transition time value
* Fixed commented out code