Commit Graph
21536 Commits
Author SHA1 Message Date
J. Nick KostonandGitHub ed0568c655 Ensure config entries are not unloaded while their platforms are setting up (#118767)
* 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
2024-06-04 21:34:39 -04:00
J. Nick KostonandGitHub 67b3be8432 Remove useless threading locks in mqtt (#118737) 2024-06-04 14:21:03 -05:00
Robert SvenssonandGitHub b4f6325278 Use fixtures in UniFi switch tests (#118831) 2024-06-04 21:01:03 +02:00
Robert SvenssonandGitHub c2e245f9d4 Use fixtures in UniFi update tests (#118818) 2024-06-04 21:00:50 +02:00
arturyakandGitHub 513262c0ff Add missing FAN_ONLY mode to ccm15 (#118804) 2024-06-04 20:58:58 +02:00
Tsvi MostoviczandGitHub 98455cbd93 Fix updating options in Jewish Calendar (#118643) 2024-06-04 20:55:38 +02:00
Jan BouwhuisandGitHub 956623d964 Fix device name not set on all incomfort platforms (#118827)
* 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
2024-06-04 20:51:34 +02:00
J. Nick KostonandGitHub 72e4aee155 Ensure name of task is logged for unhandled loop exceptions (#118822) 2024-06-04 12:48:29 -04:00
709e32a38a Check if Shelly entry.runtime_data is available (#118805)
* Check if runtime_data is available

* Add tests

* Use `is` operator

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-04 18:40:18 +02:00
epenetandGitHub b81f0b600f Move current_request_with_host fixture to decorator (#118810)
* Move current_request_with_host fixture to decorator

* One more
2024-06-04 17:50:22 +02:00
Paulus SchoutsenandGitHub 52ad90a68d Include script description in LLM exposed entities (#118749)
* Include script description in LLM exposed entities

* Fix race in test

* Fix type

* Expose script

* Remove fields
2024-06-04 11:18:07 -04:00
ollo69andGitHub 8610436948 Add remote entity to AndroidTV (#103496)
* Add remote entity to AndroidTV

* Add tests for remote entity

* Requested changes on tests
2024-06-04 17:02:30 +02:00
epenetandGitHub b09f3eb313 Fix incorrect current_request_with_host type hint (#118809) 2024-06-04 16:26:39 +02:00
epenetandGitHub 80975d7a63 Move None bluetooth fixtures to decorator (#118802) 2024-06-04 16:26:07 +02:00
epenetandGitHub f120f55d86 Move enable_bluetooth fixture to decorator (#118803) 2024-06-04 16:20:11 +02:00
epenetandGitHub 3d31af3eb4 Move entity_registry_enabled_by_default to decorator [a-p] (#118794) 2024-06-04 16:18:42 +02:00
epenetandGitHub 089874f818 Move mock_hass_config fixture to decorator (#118807) 2024-06-04 16:05:56 +02:00
Joost LekkerkerkerandGitHub 2ac5f8db06 Set unique id in aladdin connect config flow (#118798) 2024-06-04 16:00:53 +02:00
1eb13b48a2 Add tests for BMW binary_sensor and lock (#118436)
* BMW: Add tests for binary_sensor & lock

* Use entity_registry_enabled_by_default fixture

* Update tests/components/bmw_connected_drive/test_binary_sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Move fixtures to decorator

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Use fixture decorators if possible

* Fix rebase

* Spelling adjustments

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Use snapshot_platform helper

* Spelling

* Remove comment

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-06-04 15:08:15 +02:00
epenetandGitHub 20b5aa3e0e Move entity_registry_enabled_by_default to decorator [q-z] (#118793) 2024-06-04 13:38:32 +02:00
epenetandGitHub 3ac0fa53c8 Cleanup unused FixtureRequest in tests (#118780) 2024-06-04 11:49:21 +02:00
42414d55e0 Azure DevOps build sensor attributes to new sensors (#114948)
* 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>
2024-06-04 10:50:43 +02:00
Mr. BubblesandGitHub 7815840194 Add ista EcoTrend integration (#118360)
* 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
2024-06-04 10:45:53 +02:00
epenetandGitHub b54a68750b Add type hints for FixtureRequest in tests (#118779) 2024-06-04 10:37:54 +02:00
7fb2802910 Allow per-sensor unit conversion on BMW sensors (#110272)
* 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>
2024-06-04 09:06:23 +02:00
J. Nick KostonandGitHub 553311cc7d Add os.walk to asyncio loop blocking detection (#118769) 2024-06-04 06:53:37 +02:00
e799270578 Recover mqtt abbrevations optimizations (#118762)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-04 06:20:18 +02:00
Michael HansenandGitHub 0257aa4839 Clean up exposed domains (#118753)
* Remove lock and script

* Add media player

* Fix tests
2024-06-03 21:26:40 -05:00
J. Nick KostonandGitHub 35a1ecea27 Speed up statistics_during_period websocket api (#118672) 2024-06-03 18:08:46 -05:00
Jan BouwhuisandGitHub 39f5f30ca9 Revert "Allow MQTT device based auto discovery" (#118746)
Revert "Allow MQTT device based auto discovery (#109030)"

This reverts commit 585892f067.
2024-06-03 22:30:37 +02:00
Paulus SchoutsenandGitHub 299c0de968 Update OpenAI prompt on each interaction (#118747) 2024-06-03 22:27:05 +02:00
Joost LekkerkerkerandGitHub 2a92f78453 Require firmware version 3.1.1 for airgradient (#118744) 2024-06-03 21:08:28 +02:00
Jan BouwhuisandGitHub dd1dd4c6a3 Migrate Intergas InComfort/Intouch Lan2RF gateway YAML to config flow (#118642)
* 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
2024-06-03 20:37:48 +02:00
tronikosandGitHub f9dff1632e Use ISO format when passing date to LLMs (#118705) 2024-06-03 19:48:50 +02:00
60bcd27a47 Use snapshot_platform helper for BMW tests (#118735)
* Use snapshot_platform helper

* Remove comments

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-06-03 19:46:04 +02:00
Joost LekkerkerkerandGitHub 16485af7fc Configure device in airgradient config flow (#118699) 2024-06-03 19:23:07 +02:00
Diogo GomesandGitHub 91ca7db02f Address reviews comments in #117147 (#118714) 2024-06-03 19:22:00 +02:00
epenetandGitHub 5d594a509c Add type hints for MockAgent in conversation tests (#118701) 2024-06-03 17:44:13 +02:00
epenetandGitHub f178467b0e Add type hints for TTS test fixtures (#118704) 2024-06-03 17:43:18 +02:00
epenetandGitHub dd90fb15e1 Fix incorrect type hint in dremel_3d_printer tests (#118709) 2024-06-03 17:16:48 +02:00
Erik MontnemeryandGitHub 99e02fe2b2 Remove tag_id from tag store (#118713) 2024-06-03 17:15:57 +02:00
bdcfd93129 Automatically fill in slots based on LLM context (#118619)
* 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>
2024-06-03 10:36:41 -04:00
epenetandGitHub 771ed33b14 Bump renault-api to 0.2.3 (#118718) 2024-06-03 15:53:23 +02:00
Joost LekkerkerkerandGitHub c32eb97ac0 Disable both option in Airgradient select (#118702) 2024-06-03 15:49:51 +02:00
a3b60cb054 Add Monzo config reauth (#117726)
* 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>
2024-06-03 13:18:15 +02:00
ef7c7f1c05 Refactor fixture calling for BMW tests (#118708)
* Refactor BMW tests to use pytest.mark.usefixtures

* Fix freeze_time

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-06-03 13:16:12 +02:00
Erik MontnemeryandGitHub 765114bead Don't store tag_id in tag storage (#118707) 2024-06-03 13:11:00 +02:00
Erik MontnemeryandGitHub 35dcda29b9 Use ULID instead of UUID for config entry id and flow ID (#118677) 2024-06-03 10:34:09 +02:00
epenetandGitHub 6cf7889c38 Add type hints for requests_mock.Mocker in test fixtures (#118678) 2024-06-03 10:30:08 +02:00
epenetandGitHub 9be972b13e Add type hints for list[Device] in test fixtures (#118681) 2024-06-03 10:21:24 +02:00