Avoid addtional timestamp conversion to set state
Since we already have the timestamp, we can pass it on to the State
object and avoid the additional timestamp conversion which can be as
much as 30% of the state write runtime.
Since datetime objects are limited to microsecond precision, we need
to adjust some tests to account for the additional precision that we
will now be able to get in the database
* Increase websocket peak messages to match max expected entities
During startup the websocket would frequently disconnect if more than
4096 entities were added back to back. Some MQTT setups will have more
than 10000 entities. Match the websocket peak value to the max expected
entities
* coalesce more
* delay more if the backlog gets large
* wait to send if the queue is building rapidly
* tweak
* tweak for chrome since it works great in firefox but chrome cannot handle it
* Revert "tweak for chrome since it works great in firefox but chrome cannot handle it"
This reverts commit 439e2d76b1.
* adjust for chrome
* lower number
* remove code
* fixes
* fast path for bytes
* compact
* adjust test since we see the close right away now on overload
* simplify check
* reduce loop
* tweak
* handle ready right away
* Skip processing websocket_api schema if has no arguments
About 40% of the websocket commands on first connection have
no arguments. We can skip processing the schema for these cases
* cover
* fixes
* allow extra
* Revert "allow extra"
This reverts commit 85d9ec36b3.
* match behavior
* Bump aiohttp to 3.9.4
This is rc0 for now but will be updated when the full release it out
* cleanup cruft
* regen
* fix tests (these changes are fine)
* chunk size is too small to read since boundry is now enforced
* chunk size is too small to read since boundry is now enforced
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>
* Refactor setup time tracking to exclude time waiting on other operations
We now exclude the import time and th time waiting on
base platforms to setup from the setup times
* tweak
* tweak
* tweak
* tweak
* adjust
* fixes
* fixes
* preen
* preen
* tweak
* tweak
* adjust
* tweak
* reduce
* do not count integrtion platforms against their parent integration
* handle legacy tts platforms
* stt as well
* one more wait
* use the same pattern in all the legacy
* fix tts and stt legacy
* fix
* fix
* reduce
* preen
* entity comp does not wait for platforms
* scene blocks as well
* fix test
* test fixes
* coverage
* coverage
* coverage
* fix test
* Update tests/test_setup.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update tests/test_setup.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/setup.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* strip
* strip WAIT_PLATFORM_INTEGRATION
* strip WAIT_PLATFORM_INTEGRATION
* strip WAIT_PLATFORM_INTEGRATION
* strip WAIT_PLATFORM_INTEGRATION
* remove complexity
* Apply suggestions from code review
* no longer works that way
* fixes
* fixes
* fixes
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Refactor integration startup time tracking to reduce overhead
- Use monotonic time for watching integration startup time as it avoids incorrect values if time moves backwards because of ntp during startup and reduces many time conversions since we want durations in seconds and not local time
- Use loop scheduling instead of a task
- Moves all the dispatcher logic into the new _WatchPendingSetups
* websocket as well
* tweaks
* simplify logic
* preserve logic
* preserve logic
* lint
* adjust
* Send localization info on script errors
* Use connection exception hander
* Keep HomeAssistantError is unknown_error
* Move specific exception handling
* Add support for responses to call_service WS cmd
* Revert ServiceNotFound removal and add a parameter for return_response
* fix type
* fix tests
* remove exception handling that was added
* Revert unnecessary modifications
* Use kwargs
* Add ServiceValidationError
* Add translation support
* Extend translation support to HomeAssistantError
* Add translation support for ServiceNotFound exc
* Frontend translation & translation_key from caller
* Improve fallback message
* Set websocket_api as default translation_domain
* Add MQTT ServiceValidationError exception
* Follow up comments
* Revert removing gueard on translation_key
* Revert test changes to fix CI test
* Follow up comments
* Fix CI test
* Follow up
* Improve language
* Follow up comment