Run device tracker device registry updates immediately
without the call_soon delay. This listener does not
need a delay and it only adds overhead in this case.
* Defer creating tasks we know are going to wait on the entity platform semaphore
When looking at whats going on with aiomonitor-ng, I noticed
we end up creating a lot of tasks that block waiting for the
executor because of the entity platform parallel_updates semaphore.
When we know the tasks are going to block we now await them
in sequence to avoid feeding the loop a herd of tasks that
will block on the semaphore
* change during iteration fix
* change during iteration fix
* cleanup
* cleanup
* fix vizio test
* Improve performance when serializing small bits of JSON
Making json_bytes a partial reduced the run time to
build the small JSON messages by ~18.75%
We serialize a lot of small messages over the websocket
* typing
* Use httpx instead of requests for mjpeg camera images that need digest
Avoids jump to executor
* Use httpx instead of requests for mjpeg camera images that need digest
Avoids jump to executor
* stream as well
* fix
* fix
* Switch some frequently called call_laters to call_at
call_at is a bit faster than call_later since call_later
is a wrapper around call_at.
We call at lot of these at startup so it helps a bit when
we are resource constrained
* update test
* update test
* Complete migration of persistent notifications
Persistent notifications are no longer stored in
the state machine and no longer fire events
* Complete migration of persistent notifications
Persistent notifications are no longer stored in
the state machine and no longer fire events
* fixes
* fixes
* fixes
* ws test
* update tests
* update tests
* fix more tests
* fix more tests
* more fixes
* fix
* fix person
* fix person
* keep whitelist
* use singleton
* Add additional coverage to history websocket api
related issue #93258
* Add additional coverage to history websocket api
related issue #93258
* Fix results when union query ends up at the end instead of front
* Apply suggestions from code review
* resort
* zero instead
* fix exception
* fix tests
* Fix not retrying on connection reset during nexia config entry setup
fixes
```
2023-05-26 00:15:39.129 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alexander for nexia
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 558, in _request
resp = await req.send(conn)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 670, in send
await writer.write_headers(status_line, self.headers)
File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 130, in write_headers
self._write(buf)
File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 75, in _write
raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/nexia/__init__.py", line 47, in async_setup_entry
await nexia_home.login()
File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 385, in login
request = await self.post_url(self.API_MOBILE_ACCOUNTS_SIGN_IN_URL, payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 157, in post_url
response: aiohttp.ClientResponse = await self.session.post(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 572, in _request
raise ClientOSError(*exc.args) from exc
aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport
```
* coverage
* Significantly speed up recorder event listener
This code is called every time an event happens since it
subscribes to all events. Its our most frequently called
listener out of the box.
It used to have a seperate filter function but it was
later combined after core had some previous refactoring.
It was never optimized after that happened.
This change reduces the run time by ~70%
* decruft
* Move constant values to separate file
* Move constant values to separate file
* Add config flow to lastfm
* Add tests
* Add config flow to lastfm
* Add tests
* Add tests
* Add tests
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add extra form for main user and autofill with friends
* Add OptionsFlow
* Add tests
* Fix feedback
* Fix feedback
* Fix feedback
* Fix feedback
* Fix test
* Apply suggestions from code review
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Update config_flow.py
* Update config_flow.py
* Update config_flow.py
* Update homeassistant/components/lastfm/config_flow.py
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
* Add tests
* Cleanup
* Update config_flow.py
* Update config_flow.py
* Update config_flow.py
* Fix test
* Fix feedback
* Codeowner lastfm
* Fix feedback
* Fix feedback
* Parametrize errors
* Parametrize errors
* Parametrize errors
* Finish tests
---------
Co-authored-by: G Johansson <goran.johansson@shiftit.se>