* Add service for getting a weather forecast
* Fix translations
* Improve service description
* Improve error handling
* Adjust typing
* Adjust typing
* Adjust service response format
* Improve handling of unrecoverable storage corruption
fixes#96574
If something in storage gets corrupted core can boot loop
or if its integration specific, the integration will fail to
start.
We now complainly loudly in the log, move away the corrupt data
and start fresh to allow startup to proceed so the user can
get to the UI and restore from backup without having to attach
a console (or otherwise login to the OS and manually modify files).
* test for corruption
* ensure OSError is still fatal
* one more case
* create an issue for corrupt storage
* fix key
* persist
* feedback
* feedback
* better to give the full path
* tweaks
* grammar
* add time
* feedback
* adjust
* try to get issue_domain from storage key
* coverage
* tweak wording some more
* Significantly speed up single entity/response service calls
Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather
* Significantly speed up single entity/response service calls
Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather
* revert
* cannot be inside pytest.raises
* one more
* Update homeassistant/helpers/service.py
* Ensure async_get_system_info does not fail if supervisor is unavailable
fixes#96470
* fix i/o in the event loop
* fix tests
* handle some more failure cases
* more I/O here
* coverage
* coverage
* Update homeassistant/helpers/system_info.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* remove supervisor detection fallback
* Update tests/helpers/test_system_info.py
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Differentiate between device info types
* Update allowed fields
* Update homeassistant/helpers/entity_platform.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Split up message in 2 lines
* Use dict for device info types
* Extract device info function and test error checking
* Simplify parsing device info
* move checks around
* Simplify more
* Move error checking around
* Fix order
* fallback config entry title to domain
* Remove fallback for name to config entry domain
* Ensure mocked configuration URLs are strings
* one more test case
* Apply suggestions from code review
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Mark scripts as response optional, make it always return a response if return_response is set
* Update test_init.py
* Revert "Update test_init.py"
This reverts commit 8e113e54db.
* Split + add test
* Tune keep alives for polling integrations
aiohttp closes the connection after 15s by default,
and httpx closes the connection after 5s by default.
We have a lot of integrations that poll every 10-60s
which create and tear down connections over and over.
Set the keep alive time to 65s to maximize connection
reuse and avoid tls negotiation overhead
* Apply suggestions from code review
* adjust
* Update log message when referenced entity not found
* Update homeassistant/helpers/service.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update test
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Allow returning a script variable from a script
* Don't allow returning a template result
* Raise if response variable is undefined
* Add test
* Update homeassistant/helpers/script.py
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Format code
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add image platform to the template integration
* Set a default name
* Fix typo
* Add tests
* Improve test coverage
* Derive content-type from fetched image
* Add service response data for listing calendar events
Add the capability of response data for for the entity component.
* Rename input arguments and add service description
* Improve list events to be more user friendly
Allow the end date to be determined based on a relative time duration. Make the start time optional and set to "now". Add additional test coverage. Update demo calendar to actually perform date range checks.
* Wrap docstrings properly.
* Increase test coverage
* Update to use new API calls
* Readability improvements
* Wrap docstrings
* Require at least one of end or duration
* Check for multiple entity matches earlier in the request
* Update documentation strings
* Improve service response data APIs
Make the API naming more consistent, and require registration that a
service supports response data so that we can better integrate with
the UI and avoid user confusion with better error messages.
* Improve test coverage
* Add an enum for registering response values
* Assign enum values
* Convert SupportsResponse to StrEnum
* Update service call test docstrings
* Add tiny missing full stop in comment
---------
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
* Allow scripts service actions to save return values
* Simplify script service response data
* Rename result_variable to response_variable based on feedback
* Speed up entity service calls
- Avoid permissions check if the caller is an admin
- Use set intersection instead of linear search of entity platforms to find entities
* tweak
* fix light test to not use an admin user
* Update return signature of service calls
* Add timeout error handling in websocket api for service calls
* Update recorder tests to remove assertion on service call
* Remove timeout behavior and update callers that depend on it today
* Fix tests
* Add missing else
* await coro directly
* Fix more tests
* Update the intent task to use wait instead of timeout
* Remove script service call limits and limit constants
* Update tests that depend on service call limits
* Use wait instead of wait_for and add test
* Update homeassistant/helpers/intent.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Name unnamed binary sensors by their device class
* Update type annotations
* Fix loading of entity component translations
* Add test
* Update integrations
* Set abode and rfxtrx binary_sensor name to None
* Revert changes in homekit_controller
* Remove unneeded checks for Entity.platform
* Update tests
* Prevent breaking integrations without an EntityComponent
* Warn when entity has no platform
* support live reload of intent_script
* add services.yaml
* update tesls for full code coverage
* Update based on feedback
* fix intent_script reload when no intent_script config
* Update homeassistant/helpers/intent.py
* update tests to handle no_existing better
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>