* initial commit
* Undo prompt chenges
* Move format_tool out of the class
* Only catch HomeAssistantError and vol.Invalid
* Add config flow option
* Fix type
* Add translation
* Allow changing API access from options flow
* Allow model picking
* Remove allowing HASS Access in main flow
* Move model to the top in options flow
* Make prompt conditional based on API access
* convert only once to dict
* Reduce debug logging
* Update title
* re-order models
* Address comments
* Move things
* Update labels
* Add tool call tests
* coverage
* Use LLM APIs
* Fixes
* Address comments
* Reinstate the title to not break entity name
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* Add llm helper
* break out Tool.specification as class members
* Format state output
* Fix intent tests
* Removed auto initialization of intents - let conversation platforms do that
* Handle DynamicServiceIntentHandler.extra_slots
* Add optional description to IntentTool init
* Add device_id and conversation_id parameters
* intent tests
* Add LLM tools tests
* coverage
* add agent_id parameter
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Fix tests
* Fix intent schema
* Allow a Python function to be registered as am LLM tool
* Add IntentHandler.effective_slot_schema
* Ensure IntentHandler.slot_schema to be vol.Schema
* Raise meaningful error on tool not found
* Move this change to a separate PR
* Update todo integration intent
* Remove Tool constructor
* Move IntentTool to intent helper
* Convert custom serializer into class method
* Remove tool_input from FunctionTool auto arguments to avoid recursion
* Remove conversion into Open API format
* Apply suggestions from code review
* Fix tests
* Use HassKey for helpers (see #117012)
* Add support for functions with typed lists, dicts, and sets as type hints
* Remove FunctionTool
* Added API to get registered intents
* Move IntentTool to the llm library
* Return only handlers in intents.async.get
* Removed llm tool registration from intent library
* Removed tool registration
* Add bind_hass back for now
* removed area and floor resolving
* fix test
* Apply suggestions from code review
* Improve coverage
* Fix intent_type type
* Temporary disable HassClimateGetTemperature intent
* Remove bind_hass
* Fix usage of slot schema
* Fix test
* Revert some test changes
* Don't mutate tool_input
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* First pass at timers
* Move to separate file
* Refactor to using events
* Add pause/unpause/status
* Add ordinal
* Add test for timed Assist command
* Fix name matching
* Fix IntentHandleError
* Fix again
* Refactor to callbacks
* is_paused -> is_active
* Rename "set timer" to "start timer"
* Move tasks to timer manager
* More fixes
* Remove assist command
* Remove cancel by ordinal
* More tests
* Remove async on callbacks
* Export async_register_timer_handler
* Allow templates for enabling automation triggers
* Test exception for non-limited template
* Use `cv.template` instead of `cv.template_complex`
* skip trigger with invalid enable template
instead of returning and thus not evaluating other triggers
* Import and cache supported feature enum flags only when needed
* Add comment aboud being loaded from executor.
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
Use a dictcomp to reconstruct DeviceInfo
a dictcomp is faster than many sets on the dict by at least
25%
We call this for nearly every device in the registry at
startup
* Small speed up to setting up integration and config entries
When profiling tests, I noticed many calls to get_running_loop. In the places
where we are already in a coro, pass the existing loop so it does not have to
be looked up. I did not do this for places were we are not in a coro since there
is risk that an integration could be doing a non-thread-safe call and its better
that the code raises when trying to fetch the running loop vs the performance
improvement for these cases.
* fix merge
* missed some
* Addition of add filter
This change adds an `add` filter, the addition equivalent of the existing `multiply` filter.
* Test for add filter
* Update test_template.py
* Update tests/helpers/test_template.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Turn on thread safety checks in async_dispatcher_send
We keep seeing issues where async_dispatcher_send is called from
a thread which means we call the callback function on the other
side in the thread as well which usually leads to a crash
* Turn on thread safety checks in async_dispatcher_send
We keep seeing issues where async_dispatcher_send is called from
a thread which means we call the callback function on the other
side in the thread as well which usually leads to a crash
* adjust
* Refactor entity_platform polling to avoid double time fetch
Replace async_track_time_interval with loop.call_later
to avoid the useless time fetch every time the listener
fired since we always throw it away
* fix test
* Add title feature to notify entity platform
* Add overload variants
* Remove overloads, update signatures
* Improve test coverage
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Do not use const
* fix typo
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* missed one
* Update homeassistant/core.py
* fix mocks
* one more internal
* more places where internal can be used
* more places where internal can be used
* more places where internal can be used
* internal one more place since this is high volume and was already eager_start
It turns out we have custom components that are writing to the area registry using the async APIs from threads. We now catch it at the point async_fire is called. Instead we should check sooner and use async_fire_internal so we catch the unsafe operation before it can corrupt the registry.
* Move thread safety check in entity_registry sooner
It turns out we have a lot of custom components that are writing
to the entity registry using the async APIs from threads. We now
catch it at the point async_fire is called. Instread we should check
sooner and use async_fire_internal so we catch the unsafe operation
before it can corrupt the registry.
* coverage
* Apply suggestions from code review
It turns out we have custom components that are writing to the device registry using the async APIs from threads. We now catch it at the point async_fire is called. Instead we should check sooner and use async_fire_internal so we catch the unsafe operation before it can corrupt the registry.
* Fix lying docstring for relative_time template function
* Update homeassistant/helpers/template.py
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Make release channel a hardcoded enum rather than a free form string
* Update enum comparison to remove equality and us identity comparison
* Fix comparison condition to match the previous implementation
* Update tests to use Enum instead of string
* Keep track of top level components
Currently we have to do a set comp for icons, translations,
and integration platforms every time to split the top level
components from the platforms. Keep track of the top level
components in a seperate set so avoid having to do the setcomp
every time.
* remove impossible paths
* remove unused code
* preen
* preen
* fix
* coverage and fixes
* Update homeassistant/core.py
* Update homeassistant/core.py
* Update tests/test_core.py
* Remove unused state translations
There have been replaced with entity translations
https://github.com/home-assistant/developers.home-assistant/pull/1557https://github.com/home-assistant/core/pull/82701
* nothing does merging anymore
* useless dispatch
* remove
* remove platform code from hassfest
* preen
* Update homeassistant/helpers/translation.py
* ruff
* fix merge
* check is impossible now since we already know if translations exist or not
* keep the function for now
* remove unreachable code since we filter out `.` before now
* reduce
* reduce
* fix merge conflict (again)
* Fix race in TimestampDataUpdateCoordinator
The last_update_success_time value was being set after the listeners
were fired which could lead to a loop because the listener may
re-trigger an update because it thinks the data is stale
* coverage
* docstring
* Add notify entity component
* Device classes, restore state, icons
* Add icons file
* Add tests for kitchen_sink
* Remove notify from no_entity_platforms in hassfest icons, translation link
* ruff
* Remove `data` feature
* Only message support
* Complete initial device classes
* mypy pylint
* Remove device_class implementation
* format
* Follow up comments
* Remove _attr_supported_features
* Use setup_test_component_platform
* User helper at other places
* last comment
* Add entry unload test and non async test
* Avoid default mutable object in constructor
* Avoid checking for polling if an entity fails to add
* no need to do protected access
* no need to do protected access
* no need to do protected access
* no need to do protected access
* coverage
* fix test
* fix
* broken one must be first
* Bump aiodns to 3.2.0
changelog: https://github.com/saghul/aiodns/compare/v3.1.1...v3.2.0
* Switch to using the AsyncResolver with aiohttp
This avoids creating executor jobs to do DNS resolution
AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available
This is a backport of https://github.com/aio-libs/aiohttp/pull/8270
* Switch to using the AsyncResolver with aiohttp
This avoids creating executor jobs to do DNS resolution
AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available
This is a backport of https://github.com/aio-libs/aiohttp/pull/8270
* Switch to using the AsyncResolver with aiohttp
This avoids creating executor jobs to do DNS resolution
AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available
This is a backport of https://github.com/aio-libs/aiohttp/pull/8270
* Switch to using the AsyncResolver with aiohttp
This avoids creating executor jobs to do DNS resolution
AsyncResolver was not usable before https://github.com/aio-libs/aiohttp/pull/8270
because it did not fallback to fallback to A records and only returned AAAA records
in most cases when IPv6 was available
This is a backport of https://github.com/aio-libs/aiohttp/pull/8270
* fixes
* fix mocking in next_dns
* fix unmocked calls in blink
* more mocking fixes
* more fixes
* more fixes
* Fix missing mocking in nextdns tests
extracted from #114539
* extract from context
* DNM: Make run_immediately the default for listeners
This is a test to see how much progress we have made twords this goal
https://github.com/home-assistant/core/pull/113727#issuecomment-2004587947
* fix shutdown
* Revert "fix shutdown"
This reverts commit a8969d7db9.
* set false since it break utility meter tests
* one more
* fix rfxtrx test
* test needs to be explict now
* fix matrix
* fail sooner
* Adjust async_load_platform comment
Its likely the deadlock here has been fixed for a long time, however
we should still do these in a task because it has to wait for base
components if they are not loaded yet.
* Adjust async_load_platform comment
Its likely the deadlock here has been fixed for a long time, however
we should still do these in a task because it has to wait for base
components if they are not loaded yet.
* Add missing platforms_exist guard to check_config
related issue #112811
When the exception hits, the config will end up being saved in the traceback
so the memory is never released.
This matches the check_config code to homeassistant.config to avoid having
the exception thrown.
* patch
* merge branch