Commit Graph

21571 Commits (59e178df3b86426fe4a0319e32c40af3efa6547d)

Author SHA1 Message Date
Marc Mueller 59e178df3b
Import Generator from typing_extensions (5) (#118993) 2024-06-06 17:33:27 +02:00
epenet 632238a7f9
Move mock_bluetooth* fixtures to decorator (#118846) 2024-06-06 17:31:08 +02:00
Marc Mueller 33ed4fd862
Import Generator from typing_extensions (3) (#118990) 2024-06-06 17:28:59 +02:00
epenet fb51163075
Move socket_enabled fixture to decorator (#118847) 2024-06-06 17:27:38 +02:00
epenet 6de26ca811
Unhide facebook tests (#118867) 2024-06-06 17:24:48 +02:00
Marc Mueller 279483ddb0
Import Generator from typing_extensions (2) (#118989) 2024-06-06 17:24:22 +02:00
Rami Mosleh cab58fa9b2
Check if imap message text has a value instead of checking if its not None (#118901)
* 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
2024-06-06 14:10:03 +02:00
Sebastian Lövdahl a5959cfb83
Address post-merge review comments from Vallox reconfigure support PR (#118903)
Address late review comments from Vallox reconfigure support PR
2024-06-06 12:52:57 +02:00
epenet 622a69447d
Add type hints to hdmi_cec assert_state function (#118940)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-06-06 12:39:24 +02:00
epenet 857b5c9c1b
Fix type hints in google tests (#118941) 2024-06-06 12:19:41 +02:00
epenet 492b158818
Add return type hints in tests (a-i) (#118939) 2024-06-06 12:17:08 +02:00
Mr. Bubbles 6e8d6f5994
Load fixture with decorator to avoid variable not accessed error (#118954)
Use fixture decorator
2024-06-06 12:15:13 +02:00
epenet f425420899
Improve type hints in rainforest_raven tests (#118950) 2024-06-06 12:10:13 +02:00
epenet c373e36995
Centralize duplicate fixtures in rainforest_raven tests (#118945) 2024-06-06 10:44:02 +02:00
epenet 7eda8aafc8
Ignore nested functions when enforcing type hints in tests (#118948) 2024-06-06 10:43:31 +02:00
Mr. Bubbles 093e85d59a
Fix some minor typos in ista EcoTrend integration (#118949)
Fix typos
2024-06-06 10:43:12 +02:00
epenet c7cc465e5c
Add return type hints in tests (k-z) (#118942) 2024-06-06 10:11:29 +02:00
J. Nick Koston f9205cd88d
Avoid additional timestamp conversion to set state (#118885)
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
2024-06-05 23:43:34 -04:00
J. Nick Koston 475c20d529
Always do thread safety check when writing state (#118886)
* 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
2024-06-05 23:41:55 -04:00
Jan-Philipp Benecke 7407995ff1
Fix flaky Google Assistant test (#118914)
* Fix flaky Google Assistant test

* Trigger full ci
2024-06-05 17:37:14 -04:00
Erik Montnemery 8099ea8817
Improve WS command validate_config (#118864)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-05 18:53:44 +02:00
Robert Resch 0562c3085f
Replace slave by meter in v2c (#118893) 2024-06-05 18:21:03 +02:00
r-xyz 0487b38ed3
Add support for sending telegram messages to topics (#112715)
* 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-groups

    Fixes #81888
    Fixes #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>
2024-06-05 17:41:40 +02:00
Robert Svensson 862c04a4b6
Use fixtures in UniFi service tests (#118838)
* Use fixtures in UniFi service tests

* Fix comments
2024-06-05 17:04:28 +02:00
Joost Lekkerkerker c4cfd9adf0
Add entity translations to incomfort (#118876) 2024-06-05 17:03:58 +02:00
Joost Lekkerkerker 60c06732b1
Add state and device class to incomfort (#118877)
* Add state and device class to incomfort

* Add state and device class to incomfort
2024-06-05 16:06:23 +02:00
Josef Zweck d0a036c617
Allow more input params to webhook generate_url helper (#112334)
* allow more params to helper

* switch back to f-string

* add test

* switch to proper method

* add allow_external, internal params

* fx default

* add signature comparison

* remove test, change prefer_external

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-06-05 15:55:37 +02:00
Jan Bouwhuis 066cd6dbef
Improve repair issue when notify service is still being used (#118855)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-06-05 15:41:22 +02:00
Pete Sage 0d1fb1fc9f
Fix Hydrawise sensor availability (#118669)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-05 14:18:41 +02:00
epenet 4b663dbf01
Rename esphome fixture (#118865) 2024-06-05 13:31:59 +02:00
Jan Bouwhuis 9a510cfe32
Add data coordinator to incomfort integration (#118816)
* 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
2024-06-05 10:45:01 +02:00
epenet 9c8aa8456e
Move enable_bluetooth fixture to decorator (#118849) 2024-06-05 09:20:48 +02:00
epenet c7e065c413
Move enable_custom_integrations fixture to decorator (#118844) 2024-06-05 09:20:08 +02:00
Diogo Gomes ba7f82d5e2
Add diagnostic to V2C (#118823)
* add diagnostic platform

* add diagnostic platform

* add diagnostic platform
2024-06-05 08:55:49 +02:00
starkillerOG 8723441227
Add Reolink serial number to device info of IPC camera (#118834)
* Add UID to dev info

* Add camera_uid to test
2024-06-04 21:37:40 -04:00
J. Nick Koston 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 Koston 67b3be8432
Remove useless threading locks in mqtt (#118737) 2024-06-04 14:21:03 -05:00
Robert Svensson b4f6325278
Use fixtures in UniFi switch tests (#118831) 2024-06-04 21:01:03 +02:00
Robert Svensson c2e245f9d4
Use fixtures in UniFi update tests (#118818) 2024-06-04 21:00:50 +02:00
arturyak 513262c0ff
Add missing FAN_ONLY mode to ccm15 (#118804) 2024-06-04 20:58:58 +02:00
Tsvi Mostovicz 98455cbd93
Fix updating options in Jewish Calendar (#118643) 2024-06-04 20:55:38 +02:00
Jan Bouwhuis 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 Koston 72e4aee155
Ensure name of task is logged for unhandled loop exceptions (#118822) 2024-06-04 12:48:29 -04:00
Maciej Bieniek 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
epenet 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 Schoutsen 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
ollo69 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
epenet b09f3eb313
Fix incorrect current_request_with_host type hint (#118809) 2024-06-04 16:26:39 +02:00
epenet 80975d7a63
Move None bluetooth fixtures to decorator (#118802) 2024-06-04 16:26:07 +02:00
epenet f120f55d86
Move enable_bluetooth fixture to decorator (#118803) 2024-06-04 16:20:11 +02:00