* add previous track intent
* add stop and clear playlist
* Remove clear_playlist and stop
* Remove clear_playlist and stop
* Use extra constraints
---------
Co-authored-by: Michael Hansen <mike@rhasspy.org>
* Check exposure in climate intent
* Check exposure in todo list
* Check exposure for weather
* Check exposure in humidity intents
* Add extra checks to weather tests
* Add more checks to todo intent test
* Move climate intents to async_match_targets
* Update test_intent.py
* Update test_intent.py
* Remove patch
* Initial commit
* Support changed API
Change sensor entity descriptions
* Fix sensor not handling coordinator update
* Implement re-authentication flow and handle token expiry
* Bump aioaquacell
* Bump aioaquacell
* Cleanup and initial tests
* Fixes for config flow tests
* Cleanup
* Fixes
* Formatted
* Use config entry runtime
Use icon translations
Removed reauth
Removed last updated sensor
Changed lid in place to binary sensor
Cleanup
* Remove reauth strings
* Removed binary_sensor platform
Fixed sensors not updating properly
* Remove reauth tests
Bump aioaquacell
* Moved softener property to entity class
Inlined validate_input method
Renaming of entities
Do a single async_add_entities call to add all entities
Reduced code in try blocks
* Made tests parameterized and use test fixture for api
Cleaned up unused code
Removed traces of reauth
* Add check if refresh token is expired
Add tests
* Add missing unique_id to config entry mock
Inlined _update_config_entry_refresh_token method
Fix incorrect test method name and comment
* Add snapshot test
Changed WiFi level to WiFi strength
* Bump aioaquacell to 0.1.7
* Move test_coordinator tests to test_init
Add test for duplicate config entry
* Check if message_text has a value instead of checking if its not None
* Strip message_text to ensure that its actually empty or not
* Add test with multipart payload having empty plain text
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
* Always do thread safety check when writing state
Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.
Previously the check was limited to custom components
because they were the most common source of thread
safety issues.
* Always do thread safety check when writing state
Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.
Previously the check was limited to custom components
because they were the most common source of thread
safety issues.
* async_fire is more common than expected with ccs
* fix mock
* fix hass mocking
* Add support for sending telegram messages to topics
Based on original PR #104059 by [jgresty](https://github.com/jgresty).
Did not manage to merge conflicts, so I remade the changes from scratch, including suggestions from previous PR reviews.
Topics were added to telegram groups in November 2022, and to the
telegram-bot library in version 20.0. They are a purely additive change
that is exposed by a single parameter `message_thread_id`. Not passing
this parameter will not change the behaviour from current.
This same parameter is used to send messages to threads and messages to
topics inside groups.
https://telegram.org/blog/topics-in-groups-collectible-usernames/it?setln=en#topics-in-groupsFixes#81888Fixes#91750
* telegram_bot: add tests for threads feature.
* telegram_bot: fixed tests for threads.
* telegram_bot: fixed wrong line.
* Update test_telegram_bot.py
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Add data coordinator to incomfort integration
* Remove unused code and redundant comment, move entity class
* Use freezer
* Cleanup snapshot
* Use entry.runtime_data
* Use freezer, use mock_config_entry
* Use tick
* Use ConfigEntryError while we do not yet support a re-auth flow, update tests
* Use tick with async_fire_time_changed
* Report non-awaited/non-locked config entry platform forwards
Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.
In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.
If config platform forwards are happening during setup, they should be awaited
If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup
* Report non-awaited/non-locked config entry platform forwards
Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.
In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.
If config platform forwards are happening during setup, they should be awaited
If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup
* run with error on to find them
* cert_exp, hold lock
* cert_exp, hold lock
* shelly async_late_forward_entry_setups
* compact
* compact
* found another
* patch up mobileapp
* patch up hue tests
* patch up smartthings
* fix mqtt
* fix esphome
* zwave_js
* mqtt
* rework
* fixes
* fix mocking
* fix mocking
* do not call async_forward_entry_setup directly
* docstrings
* docstrings
* docstrings
* add comments
* doc strings
* fixed all in core, turn off strict
* coverage
* coverage
* missing
* coverage
* Prelimenary tests for incomfort integration
* Use snapshot_platform
* Use helper
* Ensure the device name is set in device info
* Move snapshot tests to platform test modules
* Move unused snapshot file
* Naming and docstr
* update snapshots
* cleanup snapshots
* Add water heater tests
* Setup for split
* Adjust to allow for None
* Create
* Add missing
* Fix datetime parsing in Azure DevOps sensor
* Remove definition id and name
These aren't needed and will never change
* Add tests for each sensor
* Add tests for edge cases
* Rename translations
* Update
* Use base sensor descriptions
* Remove
* Drop status
using this later for an event entity
* Switch to timestamp
* Switch to timestamp
* Merge
* Update snapshot
* Improvements from @joostlek
* Update homeassistant/components/azure_devops/sensor.py
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Add ista EcoTrend integration
* move code out of try
* Use account owners name as entry title
* update config flow tests
* add tests for init
* Add reauth flow
* Add tests for sensors
* add translations for reauth
* trigger statistics import on first refresh
* Move statistics and reauth flow to other PR
* Fix tests
* some changes
* draft_final_final
* remove unnecessary icons
* changed tests
* move device_registry test to init
* add text selectors
* Update BMW sensors to use device_class
* Test adjustments
* Trigger CI
* Remove unneeded cast
* Set suggested_display_precision to 0
* Rebase for climate_status
* Change charging_status to ENUM device class
* Add test for Enum translations
* Pin Enum sensor values
* Use snapshot_platform helper
* Remove translation tests
* Formatting
* Remove comment
* Use const.STATE_UNKOWN
* Fix typo
* Update strings
* Loop through Enum sensors
* Revert enum sensor changes
---------
Co-authored-by: Richard <rikroe@users.noreply.github.com>
* Add config flow
* Make sure the device is polled - refactor
* Fix
* Add tests config flow
* Update test requirements
* Ensure dispatcher has a unique signal per heater
* Followup on review
* Follow up comments
* One more docstr
* Make specific try blocks and refactoring
* Handle import exceptions
* Restore removed lines
* Move initial heater update in try block
* Raise issue failed import
* Update test codeowners
* Remove entity device info
* Remove entity device info
* Appy suggestions from code review
* Remove broad exception handling from entry setup
* Test coverage
* Automatically fill in slots from LLM context
* Add tests
* Apply suggestions from code review
Co-authored-by: Allen Porter <allen@thebends.org>
---------
Co-authored-by: Allen Porter <allen@thebends.org>
* Add reauth config flow
* Trigger reauth on Monzo AuthorisaionExpiredError
* Add missing abort strings
* Use FlowResultType enum
* One extra == swapped for is
* Use helper in reauth
* Patch correct function in reauth test
* Remove unecessary **
* Swap patch and calls check for access token checks
* Do reauth trigger test without patch
* Remove unnecessary str() on user_id - always str anyway
* Update tests/components/monzo/test_config_flow.py
---------
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
* Google Generative AI Conversation: Add variables to the system prompt
* User name and llm_context
* test for template variables
* test for template variables
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* OpenAI Conversation: Add variables to the system prompt
* User name and llm_context
* test for user name
* test for user id
---------
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
* typing for client and consequences
* Update homeassistant/components/openai_conversation/conversation.py
---------
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
* Ignore deprecated open and close cover intents for LLMs
* Fix LLMs asking which area when there is only one device
* remove unrelated changed
* remove unrelated changes
* Schedule max dt for Riemann Integral sensor
* Simplify validation. Dont integrate on change if either old or new state is not numeric.
* Add validation to integration methods. Rollback requirement for both states to be always numeric.
* Use 0 max_dt for disabling time based updates.
* Use docstring instead of pass keyword in abstract methods.
* Use time_period config validation for max_dt
* Use new_state for scheduling max_dt. Only schedule if new state is numeric.
* Use default 0 (None) for max_dt.
* Rename max_dt to max_age.
* Rollback accidental renaming of different file
* Remove unnecessary and nonsensical max value.
* Improve new config description
* Use DurationSelector in config flow
* Rename new config to max_sub_interval
* Simplify by checking once for the integration strategy
* Use positive time period validation of sub interval in platform schema
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Remove return keyword
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Simplify scheduling of interval exceeded callback
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Improve documentation
* Be more clear about when time based integration is disabled.
* Update homeassistant/components/integration/config_flow.py
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Initial commit
* Fix updating of unique id
* Add testing to check the unique id is being updated correctly
* Reload the config entry and confirm the unique id has not been changed
* Move updating unique_id to __init__.py as suggested
* Change the config_entry variable's name back from config to config_entry
* Move the loop into the update_unique_ids method
* Move test from test_config_flow to test_init
* Try an early optimization to check if we need to update the unique ids
* Mention the correct version
* Implement suggestions
* Ensure all entities are migrated correctly
* Just to be sure keep the previous assertion as well
* Add configuration option positive to DurationSelector
* Rename to allow_negative in conjunction with a deprecation notice
Co-authored-by: Erik Montnemery <erik@montnemery.com>
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Add XML support to RESTful binary sensor
* Add test for binary sensor with XML input data
* Address mypy validation results by handling None returns
* Use proper incorrect XML instead of blank
* Change failure condition to match the behavior of the library method
* Change error handling for bad XML to expect ExpatError
* Parametrize bad XML test to catch both empty and invalid XML
* Move exception handling out of the shared method
---------
Co-authored-by: Erik Montnemery <erik@montnemery.com>
* Fix special case in pylint type hint plugin
* Simplify
* Simplify
* Simplify
* Apply
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
---------
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
* Add MQTT device based auto discovery
* Respect override of component options over shared ones
* Add state_topic, command_topic, qos and encoding as shared options
* Add shared option test
* Rename device.py to schemas.py
* Remove unused legacy `platform` attribute to avoid confusion
* Split validation device and origin info
* Require `origin` info on device based discovery
* Log origin info for only once for device discovery
* Fix tests and linters
* ruff
* speed up _replace_all_abbreviations
* Fix imports and merging errors - add slots attr
* Fix unrelated const changes
* More unrelated changes
* join string
* fix merge
* Undo move
* Adjust logger statement
* fix task storm to load platforms
* Revert "fix task storm to load platforms"
This reverts commit 8f12a5f251.
* bail if logging is disabled
* Correct mixup object_id and node_id
* Auto migrate entities to device discovery
* Add device discovery test for device_trigger
* Add migration support for non entity platforms
* Use helper to remove discovery payload
* Fix tests after update branch
* Add discovery migration test
* Refactor
* Repair after rebase
* Fix discovery is broken after migration
* Improve comments
* More comment improvements
* Split long lines
* Add comment to indicate payload dict can be empty
* typo
* Add walrus and update comment
* Add tag to migration test
* Join try blocks
* Refactor
* Cleanup not used attribute
* Refactor
* Move _replace_all_abbreviations out of try block
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Reduce number of calls to last_reported_timestamp
When a state is created, last_update is always the same
as last_reported, and we only update it later if it changes
so we can pre-set the cached property to avoid it being
run when the recorder accesses it later.
* fix cache not being overridden
* coverage
* 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
* LLM Assist API to ignore timer intents if device doesn't support it
* Refactor to use API instances
* Extract ToolContext class
* Limit exposed intents based on exposed entities
* Enforce namespace use for import conventions
* Include all registries
* Only apply to functions
* Use blacklist
* Rephrase comment
* Add async_entries_for_config_entry
* Typo
* Improve
* More core files
* Revert "More core files"
This reverts commit 9978b93706.
* Revert diagnostics amends
* Include category/floor/label registries
* Performance
* Adjust text
* Add virtualization field fo system info
* Add ntp sync and host connectivity
* Prevent nonetype errors
* Add supervisor_connectivity and fix tests
* Add mock of network info to other fixtures
* Update more fixtures with network/info mock