If the entity is already registered, avoid trying to work
out the suggested_entity_id and suggested_object_id as
async_get_or_create will discard them anyways.
* Add a tool for fetching todo list items
* Simplify the todo list interface by adding an "all" status
* Update prompt to improve performance on smaller models
* Move state length validation to StateMachine async_set method
We call validate_state to make sure we do not allow any states
into the state machine that have a length>255 so we do not break
the recorder. Since async_set_internal already requires callers
to pre-validate the state, we can move the check to async_set
instead of at State object creation time to avoid needing to
check it twice in the hot path (entity write state)
* move check in async_set_internal so it only happens on state change
* no need to check if same_state
* Reduce ref counting in _async_write_ha_state
It no longer makes sense to keep a temp reference
to entity_id and hass since the function was
refactored and there are very few accesses now.
* one more place we can reduce ref counts
async_add_entities would return early if no entities
were passed but its a bit cleaner to not create the
task in the first place. I noticed in py-spy that
tplink was passing empty lists frequently
which made a task and than did nothing.
* Fix a bug parsing a streaming response with no json
* Remove debug lines
* Fix quality loss for LLM conversation agent question answering
* Update tests
* Update ollama to allow selecting mutiple LLM APIs
* Update homeassistant/helpers/llm.py
* Avoid gather since these don't do I/O
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Remove unnecessary imports of http integration
* Check reason for test failures
* Revert "Check reason for test failures"
This reverts commit 5ccf356ab0.
* Update tests
* Improve handling of empty iterable in async_add_entities
We had two checks here because we were doing an empty
iterable check. If its a list we can check it directly
but if its not we need to convert it to a list to know
if its empty.
* tweaks
* tasks never used
* fix: two minor LLM changes to speed up prefill
- moved the current date/time to the end of the prompt
- started sorting all entities by last_changed
* addressed PR comments
* fixed tests
* reduced scope of try/catch in LLM prompt
* addressed more PR comments
* fixed Anthropic test
* addressed another PR comment
* fixed remainder of tests
Remove some calls to internal functions that
are now available directly on the devices
and deleted_devices objects
Remove internal functions that are no
longer used
* Add possibility to get area by alias
* Add ability to get floor by alias
* Moved alias lookup to separate function, adjusted templates.
* Changed registry to return all areas/floors with given alias
* Use normalize_name from normalized_name_base_registry
* add sensor platform to backup integration
* adjust namings, remove system integration flag
* add first simple test
* apply review comments
* fix test
* add sensor tests
* adjustements to use backup helper
* remove obsolet async_get_manager from init
* unsubscribe from events on entry unload
* add configuration_url
* fix doc string
* fix sensor tests
* mark async_unsubscribe as callback
* set integration_type service
* extend sensor test
* set integration_type on correct integration :)
* fix after online conflict resolution
* add sensor update tests
* simplify the sensor update tests
* avoid io during tests
* Add comment
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Update config_entry_oauth2_flow.py
* Specify type on request_data
* Added LocalOAuth2ImplementationWithPkce
* LocalOAuth2ImplementationWithPkce works more like specs
* fix: Adding tests for pkce flow and feedback applied
* fix last test for pkce
* Clean test_abort_if_oauth_with_pkce_rejected
* Improve assertion of code verifier and code challenge
* Break long docstrings
* Shorten docstring
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Improve tool descriptions for brightness and volume percentage
* Address lint errors
* Update intent.py to revert of a light
* Create explicit types to make intent slots more future proof
* Remove comments about slot type
---------
Co-authored-by: Franck Nijhof <git@frenck.dev>
* Make helpers.frame.report_usage work when called from any thread
* Address review comments, update tests
* Add test
* Update test
* Update recorder test
* Update tests