Compare commits

..

1585 Commits

Author SHA1 Message Date
Franck Nijhof
394dafd980 2024.6.3 (#119742) 2024-06-15 21:05:26 +02:00
Franck Nijhof
eba429dc54 Temporary pin CI to Python 3.12.3 (#119261) 2024-06-15 20:36:35 +02:00
Franck Nijhof
89ce8478de Bump version to 2024.6.3 2024-06-15 18:23:39 +02:00
Franck Nijhof
a4a8315376 Ensure workday issues are not persistent (#119732) 2024-06-15 18:23:29 +02:00
Franck Nijhof
3a705fd668 Ensure UniFi Protect EA warning is not persistent (#119730) 2024-06-15 18:23:25 +02:00
TheJulianJES
dc0fc318b8 Bump ZHA dependencies (#119713)
* Bump bellows to 0.39.1

* Bump zigpy to 0.64.1
2024-06-15 18:23:22 +02:00
J. Nick Koston
5ceb8537eb Bump uiprotect to 1.7.2 (#119705)
changelog: https://github.com/uilibs/uiprotect/compare/v1.7.1...v1.7.2
2024-06-15 18:23:19 +02:00
J. Nick Koston
d7d7782a69 Bump uiprotect to 1.7.1 (#119694)
changelog: https://github.com/uilibs/uiprotect/compare/v1.6.0...v1.7.0
2024-06-15 18:23:16 +02:00
G Johansson
2d4176d581 Fix alarm default code in concord232 (#119691) 2024-06-15 18:23:12 +02:00
J. Nick Koston
204e9a79c5 Bump uiprotect to 1.6.0 (#119661) 2024-06-15 18:23:09 +02:00
J. Nick Koston
ace7da2328 Bump uiprotect to 1.4.1 (#119653) 2024-06-15 18:21:52 +02:00
mletenay
dfe25ff804 Bump goodwe to 0.3.6 (#119646) 2024-06-15 18:21:49 +02:00
J. Nick Koston
2b44cf898e Soften unifiprotect EA channel message (#119641) 2024-06-15 18:21:45 +02:00
Paul Bottein
c77ed921de Update frontend to 20240610.1 (#119634) 2024-06-15 18:21:03 +02:00
Jan Bouwhuis
78e13d138f Fix group enabled platforms are preloaded if they have alternative states (#119621) 2024-06-15 18:20:05 +02:00
J. Nick Koston
4e394597bd Bump uiprotect to 1.2.1 (#119620)
* Bump uiprotect to 1.2.0

changelog: https://github.com/uilibs/uiprotect/compare/v1.1.0...v1.2.0

* bump
2024-06-15 18:20:02 +02:00
starkillerOG
78c2dc708c Fix error for Reolink snapshot streams (#119572) 2024-06-15 18:19:58 +02:00
Ethem Cem Özkan
4c1d2e7ac8 Revert "Revert Use integration fallback configuration for tado water fallback" (#119526)
* Revert "Revert Use integration fallback configuration for tado water heater fallback (#119466)"

This reverts commit ade936e6d5.

* add decide method for duration

* add repair issue to let users know

* test module for repairs

* Update strings.json

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* repair issue should not be persistent

* use issue_registery fixture instead of mocking

* fix comment

* parameterize repair issue created test case

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-06-15 18:19:55 +02:00
Jan-Philipp Benecke
7b809a8e55 Partially revert "Add more debug logging to Ping integration" (#119487) 2024-06-15 18:19:52 +02:00
Erwin Douna
4eea448f9d Revert Use integration fallback configuration for tado water heater fallback (#119466) 2024-06-15 18:19:48 +02:00
Joakim Plate
f58882c878 Add loggers to gardena bluetooth (#119460) 2024-06-15 18:19:45 +02:00
J. Nick Koston
4e6e9f35b5 Bump uiprotect to 1.1.0 (#119449) 2024-06-15 18:19:42 +02:00
Sebastian Goscik
d5e9976b2c Bump uiprotect to v1.0.1 (#119436) 2024-06-15 18:19:39 +02:00
MJJ
8d547d4599 Bump buieradar to 1.0.6 (#119433) 2024-06-15 18:19:32 +02:00
J. Nick Koston
94d79440a0 Fix incorrect key name in unifiprotect options strings (#119417) 2024-06-15 18:19:29 +02:00
J. Nick Koston
d602b7d19b Bump uiprotect to 1.0.0 (#119415) 2024-06-15 18:19:26 +02:00
J. Nick Koston
fb5de55c3e Bump uiprotect to 0.13.0 (#119344) 2024-06-15 18:19:23 +02:00
J. Nick Koston
5cf0ee936d Bump uiprotect to 0.10.1 (#119327)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-06-15 18:19:19 +02:00
tronikos
7443878333 Make remaining time of timers available to LLMs (#118696)
* Include speech_slots in IntentResponse.as_dict

* Populate speech_slots only if available

* fix typo

* Add test

* test all fields

* Fix another test

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-06-15 18:19:16 +02:00
Franck Nijhof
090d296135 2024.6.2 (#119376) 2024-06-11 14:41:12 +02:00
Franck Nijhof
415bfb40a7 Bump version to 2024.6.2 2024-06-11 11:21:51 +02:00
Maciej Bieniek
7ced4e981e Bump imgw-pib backend library to version 1.0.5 (#119360)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-11 11:17:29 +02:00
swcloudgenie
b656ef4d4f Fix AladdinConnect OAuth domain (#119336)
fix aladdin connect oauth domain
2024-06-11 11:17:26 +02:00
Erik Montnemery
6ea18a7b24 Fix statistic_during_period after core restart (#119323) 2024-06-11 11:17:22 +02:00
Bram Kragten
a0ac9fe6c9 Update frontend to 20240610.0 (#119320) 2024-06-11 11:16:04 +02:00
Jan-Philipp Benecke
135735126a Add more debug logging to Ping integration (#119318) 2024-06-11 11:10:36 +02:00
J. Nick Koston
3bc6cf666a Bump uiprotect to 0.4.1 (#119308) 2024-06-11 11:10:33 +02:00
Franck Nijhof
1929e103c0 Fix persistence on OpenWeatherMap raised repair issue (#119289) 2024-06-11 11:10:30 +02:00
J. Nick Koston
74b49556f9 Improve workday test coverage (#119259) 2024-06-11 11:10:27 +02:00
J. Nick Koston
8d40f4d39f Bump uiprotect to 0.4.0 (#119256) 2024-06-11 11:10:24 +02:00
Allen Porter
eed126c6d4 Bump google-nest-sdm to 4.0.5 (#119255) 2024-06-11 11:10:21 +02:00
J. Nick Koston
38cd84fa5f Fix climate on/off in nexia (#119254) 2024-06-11 11:10:18 +02:00
Abílio Costa
a28f5baeeb Fix wrong arg name in Idasen Desk config flow (#119247) 2024-06-11 11:10:14 +02:00
J. Nick Koston
f9352dfe8f Switch unifiprotect lib to use uiprotect (#119243) 2024-06-11 11:09:20 +02:00
J. Nick Koston
5beff34069 Remove myself as codeowner for unifiprotect (#118824) 2024-06-11 10:59:51 +02:00
Joakim Plate
119d4c2316 Always provide a currentArmLevel in Google assistant (#119238) 2024-06-11 10:29:34 +02:00
epenet
1e7ab07d9e Revert SamsungTV migration (#119234) 2024-06-11 10:29:31 +02:00
Ethem Cem Özkan
7896e7675c Bump python-roborock to 2.3.0 (#119228) 2024-06-11 10:29:28 +02:00
wittypluck
8b415a0376 Fix Glances v4 network and container issues (glances-api 0.8.0) (#119226) 2024-06-11 10:29:25 +02:00
Angel Nunez Mencias
6a656c5d49 Fixes crashes when receiving malformed decoded payloads (#119216)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-06-11 10:29:21 +02:00
G Johansson
8d094bf12e Fix envisalink alarm (#119212) 2024-06-11 10:29:18 +02:00
Sid
c71b6bdac9 Add fallback to entry_id when no mac address is retrieved in enigma2 (#119185) 2024-06-11 10:29:15 +02:00
tronikos
57cc1f841b Bump opower to 0.4.7 (#119183) 2024-06-11 10:29:12 +02:00
Quentin
d8f3778d77 Fix elgato light color detection (#119177) 2024-06-11 10:29:08 +02:00
Shay Levy
9a8e3ad5cc Handle Shelly BLE errors during connect and disconnect (#119174) 2024-06-11 10:29:05 +02:00
Michael
019d33c06c Use more conservative timeout values in Synology DSM (#119169)
use ClientTimeout object
2024-06-11 10:29:02 +02:00
Michael
40ebf3b2a9 Bump py-synologydsm-api to 2.4.4 (#119156)
bump py-synologydsm-api to 2.4.4
2024-06-11 10:28:58 +02:00
Tom Brien
7912c9e95c Fix workday timezone (#119148) 2024-06-11 10:28:55 +02:00
Paulus Schoutsen
4bb1ea1da1 Ensure intent tools have safe names (#119144) 2024-06-11 10:28:51 +02:00
Joost Lekkerkerker
a696ea18d3 Bump aiowaqi to 3.1.0 (#119124) 2024-06-11 10:28:48 +02:00
Shay Levy
df96b94985 Bump aioshelly to 10.0.1 (#119123) 2024-06-11 10:28:45 +02:00
tronikos
0f8ed4e73d Catch GoogleAPICallError in Google Generative AI (#119118) 2024-06-11 10:28:41 +02:00
tronikos
34477d3559 Properly handle escaped unicode characters passed to tools in Google Generative AI (#119117) 2024-06-11 10:28:38 +02:00
Austin Drummond
96ac566032 Fix control 4 on os 2 (#119104) 2024-06-11 10:28:35 +02:00
J. Nick Koston
87f48b15d1 Ensure multiple executions of a restart automation in the same event loop iteration are allowed (#119100)
* Add test for restarting automation

related issue #119097

* fix

* add a delay since restart is an infinite loop

* tests
2024-06-11 10:28:31 +02:00
kaareseras
a1f2140ed7 Fix Azure data explorer (#119089)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-11 10:28:28 +02:00
tronikos
db7a9321be Bump google-generativeai to 0.6.0 (#119062) 2024-06-11 10:28:24 +02:00
G Johansson
ebb0a453f4 Calculate attributes when entity information available in Group sensor (#119021) 2024-06-11 10:28:21 +02:00
Joakim Plate
7da10794a8 Update gardena library to 1.4.2 (#119010) 2024-06-11 10:28:18 +02:00
Ruben Bokobza
461f0865af Bump pyElectra to 1.2.1 (#118958) 2024-06-11 10:28:15 +02:00
karwosts
fc83bb1737 Fix statistic_during_period wrongly prioritizing ST statistics over LT (#115291)
* Fix statistic_during_period wrongly prioritizing ST statistics over LT

* comment

* start of a test

* more testcases

* fix sts insertion range

* update from review

* remove unneeded comments

* update logic

* min/mean/max testing
2024-06-11 10:28:09 +02:00
Franck Nijhof
b28cdcfc49 2024.6.1 (#119096) 2024-06-07 21:20:44 +02:00
Franck Nijhof
3f70e2b6f0 Bump version to 2024.6.1 2024-06-07 20:26:53 +02:00
Joost Lekkerkerker
ed22e98861 Fix Azure Data Explorer strings (#119067) 2024-06-07 20:24:03 +02:00
Marc Mueller
093f07c04e Add type ignore comments (#119052) 2024-06-07 20:24:00 +02:00
Joost Lekkerkerker
b5693ca604 Fix AirGradient name (#119046) 2024-06-07 20:23:57 +02:00
J. Nick Koston
20b77aa15f Fix remember_the_milk calling configurator async api from the wrong thread (#119029) 2024-06-07 20:23:53 +02:00
J. Nick Koston
1cbd3ab930 Fix refactoring error in snmp switch (#119028) 2024-06-07 20:23:50 +02:00
Matthias Alphart
31b44b7846 Fix KNX climate.set_hvac_mode not turning on (#119012) 2024-06-07 20:23:47 +02:00
Matthias Alphart
de3a0841d8 Increase test coverage for KNX Climate (#117903)
* Increase test coverage fro KNX Climate

* fix test type annotation
2024-06-07 20:23:40 +02:00
Mike Degatano
581fb2f9f4 Always have addon url in detached_addon_missing (#119011) 2024-06-07 20:21:25 +02:00
Shay Levy
5bb4e4f5d9 Hold connection lock in Shelly RPC reconnect (#119009) 2024-06-07 20:21:22 +02:00
J. Nick Koston
cfa619b67e Remove isal from after_dependencies in http (#119000) 2024-06-07 20:21:18 +02:00
Michael Hansen
56db7fc7dc Fix exposure checks on some intents (#118988)
* 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
2024-06-07 20:20:41 +02:00
Joost Lekkerkerker
1f6be7b4d1 Fix unit of measurement for airgradient sensor (#118981) 2024-06-07 20:18:45 +02:00
Maciej Bieniek
52d1432d81 Bump imgw-pib library to version 1.0.4 (#118978)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-07 20:18:41 +02:00
David Knowles
14da1e9b23 Bump pydrawise to 2024.6.3 (#118977) 2024-06-07 20:18:38 +02:00
G Johansson
d6e1d05e87 Bump python-holidays to 0.50 (#118965) 2024-06-07 20:18:35 +02:00
G Johansson
62f73cfcca Fix Alarm control panel not require code in several integrations (#118961) 2024-06-07 20:18:32 +02:00
Maciej Bieniek
6e9a53d02e Bump imgw-pib backend library to version 1.0.2 (#118953)
Bump imgw-pib to version 1.0.2

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-07 20:18:28 +02:00
J. Nick Koston
394c13af1d Revert "Bump orjson to 3.10.3 (#116945)" (#118920)
This reverts commit dc50095d06.
2024-06-07 20:17:01 +02:00
Jan-Philipp Benecke
86b13e8ae3 Fix flaky Google Assistant test (#118914)
* Fix flaky Google Assistant test

* Trigger full ci
2024-06-07 20:16:58 +02:00
Rami Mosleh
5a7332a135 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-07 20:16:55 +02:00
Michael Hansen
0f9a91d369 Prioritize literal text with name slots in sentence matching (#118900)
Prioritize literal text with name slots
2024-06-07 20:16:52 +02:00
Marc Mueller
00dd86fb4b Update requests to 2.32.3 (#118868)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-07 20:16:47 +02:00
Franck Nijhof
460909a7f6 2024.6.0 (#118400) 2024-06-05 20:06:01 +02:00
Franck Nijhof
21fd012447 Bump version to 2024.6.0 2024-06-05 19:00:08 +02:00
Robert Resch
c27f0c560e Replace slave by meter in v2c (#118893) 2024-06-05 18:59:52 +02:00
Michael Hansen
0f4a1b421e Bump intents to 2024.6.5 (#118890) 2024-06-05 18:59:49 +02:00
Erik Montnemery
5e35ce2996 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:59:44 +02:00
Franck Nijhof
e5804307e7 Bump version to 2024.6.0b9 2024-06-05 15:51:19 +02:00
Bram Kragten
3b74b63b23 Update frontend to 20240605.0 (#118875) 2024-06-05 15:51:08 +02:00
Marc Mueller
06df32d9d4 Fix TypeAliasType not callable in senz (#118872) 2024-06-05 15:51:05 +02:00
Jan Bouwhuis
63947e4980 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:51:02 +02:00
Ethem Cem Özkan
ac6a377478 Bump python-roborock to 2.2.3 (#118853)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-06-05 15:50:59 +02:00
Paulus Schoutsen
18af423a78 Fix the radio browser doing I/O in the event loop (#118842) 2024-06-05 15:50:56 +02:00
Franck Nijhof
f1445bc8f5 Fix capitalization of protocols in Reolink option flow (#118839) 2024-06-05 15:50:53 +02:00
starkillerOG
3784c99305 Conserve Reolink battery by not waking the camera on each update (#118773)
* update to new cmd_list type

* Wake battery cams each 1 hour

* fix styling

* fix epoch

* fix timezone

* force full update when using generic update service

* improve comment

* Use time.time() instead of datetime

* fix import order
2024-06-05 15:50:50 +02:00
Pete Sage
0084d6c5bd Fix Hydrawise sensor availability (#118669)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-06-05 15:50:47 +02:00
Franck Nijhof
f1e6375406 Bump version to 2024.6.0b8 2024-06-04 21:32:36 +02:00
Jan-Philipp Benecke
9157905f80 Initialize the Sentry SDK within an import executor job to not block event loop (#118830) 2024-06-04 21:31:49 +02:00
J. Nick Koston
b02c9aa2ef Ensure name of task is logged for unhandled loop exceptions (#118822) 2024-06-04 21:31:45 +02:00
Bram Kragten
6e30fd7633 Update frontend to 20240604.0 (#118811) 2024-06-04 21:31:42 +02:00
Stefan Agner
74b29c2e54 Bump Python Matter Server library to 6.1.0 (#118806) 2024-06-04 21:31:38 +02:00
Maciej Bieniek
b1b26af92b 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 21:31:33 +02:00
arturyak
b107ffd30d Add missing FAN_ONLY mode to ccm15 (#118804) 2024-06-04 21:31:28 +02:00
Joost Lekkerkerker
776675404a Set unique id in aladdin connect config flow (#118798) 2024-06-04 21:30:08 +02:00
Paulus Schoutsen
38ee32fed2 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 21:21:26 +02:00
Tsvi Mostovicz
111d11aaca Fix updating options in Jewish Calendar (#118643) 2024-06-04 21:21:23 +02:00
Jack Boswell
ff8752ea4f Fix calculation of Starlink sleep end setting (#115507)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-04 21:21:13 +02:00
Franck Nijhof
2151f7ebf3 Bump version to 2024.6.0b7 2024-06-04 12:20:22 +02:00
Richard Kroegel
50efce4e53 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 12:20:08 +02:00
Richard Kroegel
c8538f3c08 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-04 12:19:01 +02:00
Richard Kroegel
4bfff12570 Set lock state to unkown on BMW API error (#118559)
* Revert to previous lock state on BMW API error

* Set lock state to unkown on error and force refresh from API

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-06-04 12:02:47 +02:00
Richard Kroegel
f2b1635969 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-04 12:01:40 +02:00
Joost Lekkerkerker
b3b8ae31fd Move Aladdin stale device removal to init module (#118784) 2024-06-04 11:58:35 +02:00
Joost Lekkerkerker
ba96fc272b Re-enable sensor platform for Aladdin Connect (#118782) 2024-06-04 11:58:32 +02:00
Joost Lekkerkerker
c702174fa0 Add coordinator to Aladdin Connect (#118781) 2024-06-04 11:58:29 +02:00
Joost Lekkerkerker
5d6fe7387e Use model from Aladdin Connect lib (#118778)
* Use model from Aladdin Connect lib

* Fix
2024-06-04 11:58:25 +02:00
Joost Lekkerkerker
c76b7a48d3 Initial cleanup for Aladdin connect (#118777) 2024-06-04 11:58:22 +02:00
Joost Lekkerkerker
954e8ff9b3 Bump airgradient to 0.4.3 (#118776) 2024-06-04 11:58:18 +02:00
Joakim Sørensen
8c332ddbdb Update hass-nabucasa to version 0.81.1 (#118768) 2024-06-04 11:58:15 +02:00
Jan Bouwhuis
01c4ca2749 Recover mqtt abbrevations optimizations (#118762)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-04 11:58:12 +02:00
Michael Hansen
4b4b5362d9 Clean up exposed domains (#118753)
* Remove lock and script

* Add media player

* Fix tests
2024-06-04 11:58:08 +02:00
Jan Bouwhuis
70d7cedf08 Do not log mqtt origin info if the log level does not allow it (#118752) 2024-06-04 11:58:05 +02:00
Michael Hansen
7bbfb1a22b Bump intents to 2024.6.3 (#118748) 2024-06-04 11:58:02 +02:00
Paulus Schoutsen
d68d871054 Update OpenAI prompt on each interaction (#118747) 2024-06-04 11:57:58 +02:00
Jan Bouwhuis
69bdefb02d Revert "Allow MQTT device based auto discovery" (#118746)
Revert "Allow MQTT device based auto discovery (#109030)"

This reverts commit 585892f067.
2024-06-04 11:57:55 +02:00
Paulus Schoutsen
ebaec6380f Google Gen AI: Copy messages to avoid changing the trace data (#118745) 2024-06-04 11:57:51 +02:00
starkillerOG
9cf6e9b21a Bump reolink-aio to 0.9.1 (#118655)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-04 11:55:34 +02:00
David Bonnes
eb1a9eda60 Harden evohome against failures to retrieve zone schedules (#118517) 2024-06-04 11:55:21 +02:00
Franck Nijhof
26344ffd74 Bump version to 2024.6.0b6 2024-06-03 21:27:31 +02:00
Paulus Schoutsen
2940104008 Remove dispatcher from Tag entity (#118671)
* Remove dispatcher from Tag entity

* type

* Don't use  helper

* Del is faster than pop

* Use id in update

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-06-03 21:27:08 +02:00
Joost Lekkerkerker
8072a268a1 Require firmware version 3.1.1 for airgradient (#118744) 2024-06-03 21:26:19 +02:00
Bram Kragten
b5f557ad73 Update frontend to 20240603.0 (#118736) 2024-06-03 21:26:16 +02:00
Michael Hansen
f977b54312 Resolve areas/floors to ids in intent_script (#118734) 2024-06-03 21:26:13 +02:00
Jan-Philipp Benecke
11b2f201f3 Rename Discovergy to inexogy (#118724) 2024-06-03 21:26:10 +02:00
Erik Montnemery
8cc3c147fe Tweak light service schema (#118720) 2024-06-03 21:26:07 +02:00
epenet
fd9ea2f224 Bump renault-api to 0.2.3 (#118718) 2024-06-03 21:26:04 +02:00
Diogo Gomes
f064f44a09 Address reviews comments in #117147 (#118714) 2024-06-03 21:26:01 +02:00
Erik Montnemery
f3d1157bc4 Remove tag_id from tag store (#118713) 2024-06-03 21:25:58 +02:00
mkmer
85982d2b87 Remove unintended translation key from blink (#118712) 2024-06-03 21:25:55 +02:00
Erik Montnemery
cc83443ad1 Don't store tag_id in tag storage (#118707) 2024-06-03 21:25:52 +02:00
tronikos
8a516207e9 Use ISO format when passing date to LLMs (#118705) 2024-06-03 21:25:49 +02:00
Mick Vleeshouwer
f805df8390 Bump pyoverkiz to 1.13.11 (#118703) 2024-06-03 21:25:46 +02:00
Joost Lekkerkerker
ea85ed6992 Disable both option in Airgradient select (#118702) 2024-06-03 21:25:43 +02:00
Joost Lekkerkerker
54425b756e Configure device in airgradient config flow (#118699) 2024-06-03 21:25:40 +02:00
Paul Bottein
7b43b587a7 Bump python-roborock to 2.2.2 (#118697) 2024-06-03 21:25:37 +02:00
Matrix
7e71975358 Fixing device model compatibility issues. (#118686) 2024-06-03 21:25:34 +02:00
J. Nick Koston
e0232510d7 Revert "Add websocket API to get list of recorded entities (#92640)" (#118644)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-06-03 21:21:45 +02:00
Paulus Schoutsen
84f9bb1d63 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 21:21:41 +02:00
David Knowles
b436fe94ae Bump pydrawise to 2024.6.2 (#118608) 2024-06-03 21:21:38 +02:00
epenet
aff5da5762 Address late review comment in samsungtv (#118539)
Address late comment in samsungtv
2024-06-03 21:21:29 +02:00
Paulus Schoutsen
b5783e6f5c Bump version to 2024.6.0b5 2024-06-03 01:10:10 +00:00
G Johansson
1708b60ecf Fix entity state dispatching for Tag entities (#118662) 2024-06-03 01:10:06 +00:00
puddly
3c012c497b Bump ZHA dependencies (#118658)
* Bump bellows to 0.39.0

* Do not create a backup if there is no active ZHA gateway object

* Bump universal-silabs-flasher as well
2024-06-03 01:10:05 +00:00
Joost Lekkerkerker
4d2dc9a40e Fix incorrect placeholder in SharkIQ (#118640)
Update strings.json
2024-06-03 01:10:05 +00:00
Jan Bouwhuis
3653a51288 Fix handling undecoded mqtt sensor payloads (#118633) 2024-06-03 01:10:04 +00:00
J. Nick Koston
9366a4e69b Include a traceback for non-strict event loop blocking detection (#118620) 2024-06-03 01:10:03 +00:00
Luca Angemi
1d1af7ec11 Fix telegram bot send_document (#118616) 2024-06-03 01:10:02 +00:00
tronikos
236b19c5b3 Use gemini-1.5-flash-latest in google_generative_ai_conversation.generate_content (#118594) 2024-06-03 01:10:02 +00:00
tronikos
1afbfd687f Strip Google AI text responses (#118593)
* Strip Google AI test responses

* strip each part
2024-06-03 01:10:01 +00:00
Paulus Schoutsen
20159d0277 Add base prompt for LLMs (#118592) 2024-06-03 01:10:00 +00:00
tronikos
4df3d43e45 Stop instructing LLM to not pass the domain as a list (#118590) 2024-06-03 01:10:00 +00:00
Michael
1a588760b9 Avoid future exception during setup of Synology DSM (#118583)
* avoid future exception during integration setup

* clear future flag during setup

* always clear the flag (with comment)
2024-06-03 01:09:58 +00:00
Jan-Philipp Benecke
6ba9e7d5fd Run ruff format for device registry (#118582) 2024-06-03 01:09:58 +00:00
epenet
4b06c5d2fb Update device connections in samsungtv (#118556) 2024-06-03 01:09:57 +00:00
Adam Pasztor
bfc1c62a49 Bump pyads to 3.4.0 (#116934)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-03 01:09:57 +00:00
Thomas Ytterdal
c52fabcf77 Ignore myuplink sensors without a description that provide non-numeric values (#115525)
Ignore sensors without a description that provide non-numeric values

Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2024-06-03 01:09:56 +00:00
Paulus Schoutsen
b39d7b39e1 Bump version to 2024.6.0b4 2024-05-31 19:34:58 +00:00
Paulus Schoutsen
c01c155037 Fix openAI tool calls (#118577) 2024-05-31 19:34:38 +00:00
epenet
b459559c8b Add ability to replace connections in DeviceRegistry (#118555)
* Add ability to replace connections in DeviceRegistry

* Add more tests

* Improve coverage

* Apply suggestion

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-31 19:34:38 +00:00
Maciej Bieniek
d823e56659 In Brother integration use SnmpEngine from SNMP integration (#118554)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-31 19:34:37 +00:00
Michael Chisholm
e401a0da7f Fix KeyError in dlna_dmr SSDP config flow when checking existing config entries (#118549)
Fix KeyError checking existing dlna_dmr config entries
2024-05-31 19:34:36 +00:00
Tsvi Mostovicz
3f6df28ef3 Fix YAML deprecation breaking version in jewish calendar and media extractor (#118546)
* Fix YAML deprecation breaking version

* Update

* fix media extractor deprecation as well

* Add issue_domain
2024-05-31 19:34:35 +00:00
Joost Lekkerkerker
9b63779063 Fix typo in OWM strings (#118538)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-31 19:34:35 +00:00
Josef Zweck
4998fe5e6d Migrate openai_conversation to entry.runtime_data (#118535)
* switch to entry.runtime_data

* check for missing config entry

* Update homeassistant/components/openai_conversation/__init__.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-31 19:34:34 +00:00
Brett Adams
a59c890779 Fix off_grid_vehicle_charging_reserve_percent in Teselemetry (#118532) 2024-05-31 19:34:34 +00:00
Luca Angemi
a2cdb349f4 Fix telegram doing blocking I/O in the event loop (#118531) 2024-05-31 19:34:33 +00:00
J. Nick Koston
267228cae0 Fix openweathermap config entry migration (#118526)
* Fix openweathermap config entry migration

The options keys were accidentally migrated to data so
they could no longer be changed in the options flow

* more fixes

* adjust

* reduce

* fix

* adjust
2024-05-31 19:34:32 +00:00
J. Nick Koston
ba769f4d9f Fix snmp doing blocking I/O in the event loop (#118521) 2024-05-31 19:34:31 +00:00
Denis Shulyaka
c09bc726d1 Add OpenAI Conversation system prompt user_name and llm_context variables (#118512)
* 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>
2024-05-31 19:34:31 +00:00
Josef Zweck
c441f689bf Add typing for OpenAI client and fallout (#118514)
* typing for client and consequences

* Update homeassistant/components/openai_conversation/conversation.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-31 19:34:07 +00:00
Denis Shulyaka
395e1ae31e Add Google Generative AI Conversation system prompt user_name and llm_context variables (#118510)
* 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>
2024-05-31 19:32:47 +00:00
Bas Brussee
2e45d678b8 Revert "Fix Tibber sensors state class" (#118409)
Revert "Fix Tibber sensors state class (#117085)"

This reverts commit 658c1f3d97.
2024-05-31 19:32:46 +00:00
Paulus Schoutsen
17cb25a5b6 Rename llm.ToolContext to llm.LLMContext (#118566) 2024-05-31 19:32:07 +00:00
Paulus Schoutsen
e5e26de06f Bump version to 2024.6.0b3 2024-05-31 02:20:10 +00:00
tronikos
7dab255c15 Fix unnecessary single quotes escaping in Google AI (#118522) 2024-05-31 02:19:58 +00:00
tronikos
cea7347ed9 Improve LLM prompt (#118520) 2024-05-31 02:19:56 +00:00
tronikos
f4a876c590 Fix LLMs asking which area when there is only one device (#118518)
* 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
2024-05-31 02:19:55 +00:00
tronikos
117a02972d Ignore deprecated open and close cover intents for LLMs (#118515) 2024-05-31 02:19:54 +00:00
G Johansson
3fb40deacb Fix key issue in config entry options in Openweathermap (#118506) 2024-05-31 02:19:54 +00:00
G Johansson
38c88c576b Fix tado non-string unique id for device trackers (#118505)
* Fix tado none string unique id for device trackers

* Add comment

* Fix comment
2024-05-31 02:19:53 +00:00
Paulus Schoutsen
e95b63bc89 Intent script: allow setting description and platforms (#118500)
* Add description to intent_script

* Allow setting platforms
2024-05-31 02:19:51 +00:00
Jan Bouwhuis
ea44b534e6 Fix group platform dependencies (#118499) 2024-05-31 02:19:50 +00:00
G Johansson
7646d853f4 Remove not needed hass object from Tag (#118498) 2024-05-31 02:19:49 +00:00
G Johansson
248c7c33b2 Fix blocking call in holiday (#118496) 2024-05-31 02:19:48 +00:00
Paulus Schoutsen
eb887a707c Ignore the toggle intent (#118491) 2024-05-31 02:19:46 +00:00
David Bonnes
e3ddbb2768 Fix evohome so it doesn't retrieve schedules unnecessarily (#118478) 2024-05-31 02:19:45 +00:00
Jan-Philipp Benecke
008aec5670 Log aiohttp error in rest_command (#118453) 2024-05-31 02:19:45 +00:00
Tsvi Mostovicz
d93d7159db Fix Jewish calendar unique id's (#117985)
* 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
2024-05-31 02:19:44 +00:00
Diogo Gomes
e6e017dab7 Add support for V2C Trydan 2.1.7 (#117147)
* Support for firmware 2.1.7

* add device ID as unique_id

* add device ID as unique_id

* add test device id as unique_id

* backward compatibility

* move outside try

* Sensor return type

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* not needed

* make slave error enum state

* fix enum

* Update homeassistant/components/v2c/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/v2c/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/v2c/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* simplify tests

* fix misspellings from upstream library

* add sensor tests

* just enough coverage for enum sensor

* Refactor V2C tests (#117264)

* Refactor V2C tests

* fix rebase issues

* ruff

* review

* fix https://github.com/home-assistant/core/issues/117296

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-31 02:19:43 +00:00
dontinelli
486c72db73 Adjustment of unit of measurement for light (#116695) 2024-05-31 02:19:42 +00:00
Franck Nijhof
4beb184faf Bump version to 2024.6.0b2 2024-05-30 17:02:58 +02:00
Bram Kragten
4951b60b1d Update frontend to 20240530.0 (#118489) 2024-05-30 17:02:37 +02:00
Marcel van der Veldt
9095941b62 Mark Matter climate dry/fan mode support on Panasonic AC (#118485) 2024-05-30 17:02:32 +02:00
Marcel van der Veldt
e906812fbd Extend Matter sensor discovery schemas for Air Purifier / Air Quality devices (#118483)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-05-30 17:02:26 +02:00
Robert Resch
522152e7d2 Set enity_category to config for airgradient select entities (#118477) 2024-05-30 17:02:21 +02:00
lunmay
50acc26812 Typo fix in media_extractor (#118473) 2024-05-30 17:02:16 +02:00
Maciej Bieniek
356374cdc3 Raise ConfigEntryNotReady when there is no _id in the Tractive data (#118467)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-30 17:02:11 +02:00
Robert Resch
98d905562e Bump deebot-client to 7.3.0 (#118462) 2024-05-30 17:02:05 +02:00
tronikos
48342837c0 Instruct LLM to not pass a list to the domain (#118451) 2024-05-30 17:02:00 +02:00
tronikos
3e0d9516a9 Improve LLM prompt (#118443)
* Improve LLM prompt

* test

* improvements

* improvements
2024-05-30 17:01:55 +02:00
Alexey Guseynov
c6c36718b9 Add Total Volatile Organic Compounds (tVOC) matter discovery schema (#116963) 2024-05-30 17:01:49 +02:00
Franck Nijhof
8ee1d8865c Bump version to 2024.6.0b1 2024-05-30 01:19:49 +02:00
J. Nick Koston
5d5210b47d Fix google_mail doing blocking i/o in the event loop (take 2) (#118441) 2024-05-30 01:18:34 +02:00
tronikos
27cc97bbeb Bump opower to 0.4.6 (#118434) 2024-05-30 01:18:31 +02:00
J. Nick Koston
9728103de4 Fix blocking I/O in the event loop in meteo_france (#118429) 2024-05-30 01:18:28 +02:00
Evgeny
ebf9013569 Fix OpenWeatherMap migration (#118428) 2024-05-30 01:18:24 +02:00
J. Nick Koston
b75f3d9681 Fix workday doing blocking I/O in the event loop (#118422) 2024-05-30 01:18:21 +02:00
J. Nick Koston
0d4990799f Fix google_mail doing blocking I/O in the event loop (#118421)
fixes #118411
2024-05-30 01:18:17 +02:00
J. Nick Koston
1e77a59561 Fix google_tasks doing blocking I/O in the event loop (#118418)
fixes #118407
2024-05-30 01:17:37 +02:00
J. Nick Koston
7ee2f09fe1 Ensure paho.mqtt.client is imported in the executor (#118412)
fixes #118405
2024-05-30 00:12:34 +02:00
Michael Hansen
23d9b4b17f Handle case where timer device id exists but is not registered (delayed command) (#118410)
Handle case where device id exists but is not registered
2024-05-30 00:12:30 +02:00
Marcel van der Veldt
a580d834da Fix light discovery for Matter dimmable plugin unit (#118404) 2024-05-30 00:12:27 +02:00
Marcel van der Veldt
4fb6e59fdc Add translation strings for Matter Fan presets (#118401) 2024-05-30 00:12:24 +02:00
swcloudgenie
ad3823764a New official genie garage integration (#117020)
* new official genie garage integration

* move api constants into api module

* move scan interval constant to cover.py
2024-05-30 00:12:19 +02:00
Franck Nijhof
024de4f8a6 Bump version to 2024.6.0b0 2024-05-29 20:17:13 +02:00
Joost Lekkerkerker
c80718628e Add select entities to AirGradient (#117136) 2024-05-29 20:12:51 +02:00
TheJulianJES
6382cb9134 Bump zha-quirks to 0.0.116 (#118393) 2024-05-29 19:52:25 +02:00
Marcel van der Veldt
7136be5047 Bump Python Matter Server library to 6.1.0(b0) (#118388) 2024-05-29 19:20:18 +02:00
Bram Kragten
23381ff30c Bump frontend to 20240529.0 (#118392) 2024-05-29 19:06:46 +02:00
Michael Hansen
3ffbbcfa5c Allow delayed commands to not have a device id (#118390) 2024-05-29 12:39:41 -04:00
Joost Lekkerkerker
181ae1227a Bump airgradient to 0.4.2 (#118389) 2024-05-29 18:17:26 +02:00
G Johansson
9e3e7f5b48 Entity for Tags (#115048)
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik <erik@montnemery.com>
2024-05-29 17:45:19 +02:00
Sid
f37edc207e Bump ruff to 0.4.6 (#118384) 2024-05-29 17:35:54 +02:00
Markus Jacobsen
7fda7ccafc Convert unnecessary coroutines into functions (#118311) 2024-05-29 16:44:43 +02:00
Michael
916c6a2f46 Rework and simplify the cleanup of orphan AVM Fritz!Tools entities (#117706) 2024-05-29 15:52:49 +02:00
tronikos
3d15e15e59 Add Android TV Remote debug logs to help with zeroconf issue (#117960) 2024-05-29 15:50:13 +02:00
Joost Lekkerkerker
9e342a61f3 Bump yt-dlp to 2024.05.27 (#118378) 2024-05-29 15:38:21 +02:00
epenet
461ac1e0bc Add ClientSessionGenerator type hints in tests (#118377) 2024-05-29 14:49:14 +02:00
epenet
d10362e226 Add AiohttpClientMocker type hints in tests (#118373) 2024-05-29 14:38:46 +02:00
osohotwateriot
d69431ea48 Bump pyosoenergyapi to 1.1.4 (#118368) 2024-05-29 14:15:26 +02:00
epenet
1fbf93fd36 Add SnapshotAssertion type hints in tests (#118371) 2024-05-29 14:11:58 +02:00
epenet
166c588cac Add LogCaptureFixture type hints in tests (#118372) 2024-05-29 14:10:00 +02:00
tronikos
aeee222df4 Default to gemini-1.5-flash-latest in Google Generative AI (#118367)
Default to flash
2024-05-29 08:04:47 -04:00
tronikos
4056c4c2cc Ask LLM to pass area name and domain (#118357) 2024-05-29 08:03:43 -04:00
tronikos
c75cb08aae Fix LLM tracing for Google Generative AI (#118359)
Fix LLM tracing for Gemini
2024-05-29 08:02:59 -04:00
tronikos
b7ee90a53c Expose useful media player attributes to LLMs (#118363) 2024-05-29 08:01:40 -04:00
karwosts
6e5dcd8b8d Support in blueprint schema for input sections (#110513)
* initial commit for sections

* updates

* add description

* fix test

* rename collapsed key

* New schema

* update snapshots

* Testing for sections

* Validate no duplicate input keys across sections

* rename all_inputs

* Update homeassistant/components/blueprint/models.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-29 13:13:01 +02:00
tronikos
d83ab7bb04 Fix issue when you have multiple Google Generative AI config entries and you remove one of them (#118365) 2024-05-29 11:59:06 +02:00
dontinelli
aa957600ce Set quality scale of fyta to platinum (#118307) 2024-05-29 11:41:59 +02:00
Joakim Sørensen
d33068d00c Update pylaunches dependency to version 2.0.0 (#118362) 2024-05-29 11:18:29 +02:00
Adam Kapos
43f42dd512 Extend image_upload to return the original image (#116652) 2024-05-29 11:16:23 +02:00
Jan Bouwhuis
585892f067 Allow MQTT device based auto discovery (#109030)
* 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>
2024-05-29 11:12:05 +02:00
Bouwe Westerdijk
83e62c5239 Discover new device at runtime in Plugwise (#117688)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-05-29 11:00:07 +02:00
G Johansson
6b7ff2bf44 Add default code to alarm_control_panel (#112540) 2024-05-29 10:46:53 +02:00
Erwin Douna
38da61a5ac Add DSMR Reader icons (#118329) 2024-05-29 10:41:51 +02:00
G Johansson
13ebc6fb0e Add more tests to Yale Smart Alarm (#116501) 2024-05-29 10:34:20 +02:00
epenet
bead6b0094 Rename service_calls fixture in template tests (#118358) 2024-05-29 10:27:52 +02:00
Stefan Agner
cae22e5109 Adjust add-on installation error message (#118309) 2024-05-29 09:41:09 +02:00
epenet
98d24dd276 Improve typing for calls fixture in tests (m-z) (#118350)
* Improve typing for `calls` fixture in tests (m-z)

* More

* More
2024-05-29 09:30:41 +02:00
epenet
0c38aa56f5 Rename calls fixture in components tests (#118355) 2024-05-29 09:26:44 +02:00
epenet
0f8588a857 Rename calls fixture in mqtt tests (#118354)
Rename calls fixture in mqtt
2024-05-29 09:25:34 +02:00
epenet
e488f9b87f Rename calls fixture in calendar tests (#118353) 2024-05-29 09:24:36 +02:00
J. Nick Koston
0888233f06 Make Recorder dialect_name a cached_property (#117922) 2024-05-29 09:23:40 +02:00
Bygood91
f7d2d94fdc Add Google assistant Gate device type (#118144) 2024-05-29 09:18:02 +02:00
dependabot[bot]
09d4112784 Bump docker/login-action from 3.1.0 to 3.2.0 (#118351)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 09:16:54 +02:00
Robert Resch
e087abe802 Add ws endpoint to remove expiration date from refresh tokens (#117546)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-29 09:09:59 +02:00
epenet
7e62061b9a Improve typing for calls fixture in tests (a-l) (#118349)
* Improve typing for `calls` fixture in tests (a-l)

* More

* More
2024-05-29 09:06:48 +02:00
Raman Gupta
89ae425ac2 Update zwave_js WS APIs for provisioning (#117400) 2024-05-29 02:47:09 -04:00
osohotwateriot
1c2cda5033 Add OSO Energy binary sensors (#117174) 2024-05-29 08:36:20 +02:00
Maximilian Hildebrand
05d0174e07 Add august open action (#113795)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-28 20:35:53 -10:00
G Johansson
ae6c394b53 Add smoke detector temperature to Yale Smart Alarm (#116306) 2024-05-29 08:34:00 +02:00
Erik Montnemery
7abffd7cc8 Don't report entities with invalid unique id when loading the entity registry (#118290) 2024-05-29 08:32:39 +02:00
Quentame
4d7b1288d1 Fix epic_games_store mystery game URL (#118314) 2024-05-29 08:32:29 +02:00
Jan-Philipp Benecke
2c99925286 Use runtime_data in ping (#118332) 2024-05-29 08:12:54 +02:00
J. Nick Koston
76aa504e36 Fix last_reported_timestamp not being updated when last_reported is changed (#118341)
* 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
2024-05-28 19:03:19 -10:00
J. Nick Koston
f3fa843b9d Replace pop calls with del where the result is discarded in restore_state (#118339) 2024-05-28 23:14:40 -04:00
J. Nick Koston
79bc179ce8 Improve websocket message coalescing to handle thundering herds better (#118268)
* 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
2024-05-28 23:14:06 -04:00
J. Nick Koston
b94bf1f214 Add cache to more complex entity filters (#118344)
Many of these do regexes and since the entity_ids are almost
always the same we should cache these
2024-05-28 23:07:50 -04:00
Paulus Schoutsen
d22871f1fd Reduce the intent response data sent to LLMs (#118346)
* Reduce the intent response data sent to LLMs

* No longer delete speech
2024-05-28 23:07:00 -04:00
J. Nick Koston
fa9ebb062c Small speed up to connecting dispatchers (#118342) 2024-05-28 16:49:58 -10:00
Paulus Schoutsen
c097a05ed4 Tweak Assist LLM API prompt (#118343) 2024-05-28 22:43:22 -04:00
Michael Hansen
d223e1f2ac Add Conversation command to timers (#118325)
* Add Assist command to timers

* Rename to conversation_command. Execute in timer code.

* Make agent_id optional

* Fix arg

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-28 20:33:31 -05:00
Paulus Schoutsen
615a1eda51 LLM Assist API to ignore intents if not needed for exposed entities or calling device (#118283)
* 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
2024-05-28 21:29:18 -04:00
J. Nick Koston
e0264c8604 Replace pop calls with del where the result is discarded in entity (#118340) 2024-05-28 15:26:53 -10:00
J. Nick Koston
9de066d9e1 Replace pop calls with del where the result is discarded in mqtt (#118338) 2024-05-28 15:26:35 -10:00
J. Nick Koston
fd9d4dbb34 Use del instead of pop in the entity platform remove (#118337) 2024-05-28 15:26:22 -10:00
Paulus Schoutsen
0cf574dc42 Update the recommended model for Google Gen AI (#118323) 2024-05-28 21:21:28 -04:00
Markus Jacobsen
8d7dff0228 Fix source_change not triggering an update (#118312) 2024-05-28 21:19:10 -04:00
Marcel van der Veldt
5f5288d8b9 Several fixes for the Matter climate platform (#118322)
* extend hvacmode mapping with extra modes

* Fix climate platform

* adjust tests

* fix reversed test

* cleanup

* dry and fan hvac mode test
2024-05-28 21:18:35 -04:00
Joakim Sørensen
7f1a616c9a Use None default for traccar server battery level sensor (#118324)
Do not set -1 as default for traccar server battery level
2024-05-28 21:15:22 -04:00
Jesse Hills
035e21ddbb [esphome] 100% voice assistant test coverage (#118334) 2024-05-28 21:14:47 -04:00
J. Nick Koston
097ca3a0ae Mark sonos group update a background task (#118333) 2024-05-28 14:53:28 -10:00
Michael Hansen
9e1676bee4 Filter timers more when pausing/unpausing (#118331) 2024-05-28 19:36:34 -04:00
Joakim Plate
acfc027456 Update ha philips_js to 3.2.2 (#118326) 2024-05-28 23:13:17 +02:00
J. Nick Koston
69353d2719 Speed up mqtt debug info on message callback (#118303) 2024-05-28 11:10:07 -10:00
Michael Hansen
2dc49f0410 Add platforms to intent handlers (#118328) 2024-05-28 16:46:08 -04:00
dontinelli
5eb1d72691 Raise UpdateFailed on fyta API error (#118318)
* Raise UpdateFailed

* Update homeassistant/components/fyta/coordinator.py

Co-authored-by: Robert Resch <robert@resch.dev>

* Remove logger

* simplify code

---------

Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-28 21:18:15 +02:00
Jesse Hills
7f530ee0e4 [esphome] Assist timers (#118275)
* [esphome] Assist timers

* Add intent to manifest dependencies

* Add test

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-28 14:57:58 -04:00
Michael Hansen
06d6f99964 Respect WyomingSatelliteMuteSwitch state on start (#118320)
* Respect WyomingSatelliteMuteSwitch state on start

* Fix test

---------

Co-authored-by: Kostas Chatzikokolakis <kostas@chatzi.org>
2024-05-28 14:55:02 -04:00
Michael Hansen
75ab4d2398 Add temperature slot to light turn on intent (#118321) 2024-05-28 14:53:49 -04:00
epenet
a59621bf9e Add more type hints to pylint plugin (#118319) 2024-05-28 18:37:38 +02:00
epenet
0b2aac8f4c Use registry fixtures in tests (z) (#118300) 2024-05-28 18:25:49 +02:00
Michael Hansen
106cb4cfb7 Bump intents and add tests for new error messages (#118317)
* Add new error keys

* Bump intents and test new error messages

* Fix response text
2024-05-28 12:24:24 -04:00
epenet
05fc7cfbde Enforce namespace use for import conventions (#118215)
* 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
2024-05-28 18:15:53 +02:00
Kostas Chatzikokolakis
14132b5090 Don't set 'assist in progess' flag on wake_word-end (#113585) 2024-05-28 11:09:59 -05:00
Paulus Schoutsen
f0d7f48930 Handle generic commands as area commands in the LLM Assist API (#118276)
* Handle generic commands as area commands in the LLM Assist API

* Add word area
2024-05-28 11:21:17 -04:00
Mike Degatano
dbcef2e3c3 Add more supervisor info to system info panel (#115715)
* 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
2024-05-28 16:14:42 +02:00
epenet
e58d060f82 Use registry fixtures in tests (s) (#118295) 2024-05-28 15:41:03 +02:00
Poshy163
90500c4b97 Thread: Add more Thread vendor to brand mappings (#115888)
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-28 15:33:32 +02:00
epenet
f07f183a3e Use registry fixtures in tests (v-y) (#118299) 2024-05-28 14:26:14 +02:00
epenet
8d8696075b Use registry fixtures in tests (r) (#118293) 2024-05-28 14:23:31 +02:00
epenet
2545b7d3bb Use registry fixtures in tests (t-u) (#118297) 2024-05-28 14:23:01 +02:00
epenet
ef6c7621cf Use registry fixtures in scaffold (#118308) 2024-05-28 14:20:01 +02:00
epenet
301c17cba7 Use registry fixtures in tests (o-p) (#118292) 2024-05-28 13:42:38 +02:00
epenet
ead0e797c1 Use registry fixtures in tests (m-n) (#118291) 2024-05-28 13:40:45 +02:00
epenet
8837c50da7 Use registry fixtures in tests (a-h) (#118288) 2024-05-28 13:15:16 +02:00
Sebastian Lövdahl
e9ab9b818f Add reconfigure step for vallox (#115915)
* Add reconfigure step for vallox

* Reuse translation
2024-05-28 13:13:53 +02:00
epenet
01be006d40 Use registry fixtures in tests (tailscale) (#118301) 2024-05-28 13:12:51 +02:00
Marcel van der Veldt
21f5ac7715 Fix Matter device ID for non-bridged composed device (#118256) 2024-05-28 12:47:46 +02:00
starkillerOG
a5f81262aa Bump reolink-aio to 0.8.11 (#118294) 2024-05-28 12:29:30 +02:00
Ludovic BOUÉ
f44dfe8fef Add Matter fan platform (#111212)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
2024-05-28 12:24:58 +02:00
ollo69
7f934bafc2 Add diagnostics test to AndroidTV (#117129) 2024-05-28 10:56:32 +02:00
J. Nick Koston
a3c3f938a7 Migrate mqtt mixin async_added_to_hass inner functions to bound methods (#118280) 2024-05-27 22:45:40 -10:00
Erwin Douna
fb95b91507 Add DSMR Reader tests (#115808)
* Add DSMR Reader sensor tests

* Change to paramatization

* Removing patch

* Emulate the test

* Go for 100% test coverage

* Adding defintions.py

* Add myself as code owner to keep improving
2024-05-28 10:42:21 +02:00
Mr. Bubbles
98710e6c91 Fix some typing errors in Bring integration (#115641)
Fix typing errors
2024-05-28 10:25:39 +02:00
Ville Skyttä
3b938e592f Add additional Huawei LTE 5G sensors (#108928)
* Add some Huawei LTE 5G sensor descriptions

Closes https://github.com/home-assistant/core/issues/105786

* Mark cqi1 and nrcqi1 as diagnostic
2024-05-28 09:59:28 +02:00
Brett Adams
b71f6a2b7d Use entry.runtime_data in Tessie (#118287) 2024-05-28 09:05:24 +02:00
J. Nick Koston
3ba3e3135e Fix flakey bootstrap test (#118285) 2024-05-28 08:11:14 +02:00
Michael
5d61743a5b Bump aiovlc to 0.3.2 (#118258) 2024-05-28 07:58:20 +02:00
Tsvi Mostovicz
ea91f7a5aa Change strings to const in Jewish Calendar (#118274) 2024-05-28 07:49:39 +02:00
tronikos
4f7a91828e Mock llm prompts in test_default_prompt for Google Generative AI (#118286) 2024-05-28 00:40:26 -04:00
J. Nick Koston
69a177e864 Migrate mqtt discovery subscribes to use internal helper (#118279) 2024-05-27 18:14:58 -10:00
tronikos
63227f14ed Add diagnostics to Google Generative AI (#118262)
* Add diagnostics for Google Generative AI

* Remove quality scale from manifest

* include options in diagnostics
2024-05-28 00:02:32 -04:00
Ben Thomas
f6f6bf8953 SharkIQ Fix for vacuums without room support (#118209)
* Fix SharkIQ vacuums without room support crashing the SharkIQ integration

* Fix ruff format

* Fix SharkIQ tests to account for robot identifier and second expected value
2024-05-27 23:57:21 -04:00
Ben Thomas
4d7802215c Fix rooms not being matched correctly in sharkiq.clean_room (#118277)
* Fix rooms not being matched correctly in sharkiq.clean_room

* Update sharkiq tests to account for new room matching logic
2024-05-27 23:51:51 -04:00
tronikos
0c245f1976 Fix freezing on HA startup when there are multiple Google Generative AI config entries (#118282)
* Fix freezing on HA startup when there are multiple Google Generative AI config entries

* Add timeout to list_models
2024-05-27 23:49:16 -04:00
Paulus Schoutsen
aa78998f41 Make sure conversation entities have correct name in list output (#118272) 2024-05-27 21:45:14 -04:00
J. Nick Koston
a5644c8ddb Rewrite flow handler to flow result conversion as a list comp (#118269) 2024-05-27 15:39:59 -10:00
Paulus Schoutsen
6f248acfd5 LLM Assist API: Inline all exposed entities (#118273)
Inline all exposed entities
2024-05-27 21:12:10 -04:00
Jesse Hills
a23da3bd46 Bump aioesphomeapi to 24.5.0 (#118271) 2024-05-28 13:03:01 +12:00
tronikos
f2d0512f39 Make sure HassToggle and HassSetPosition have description (#118267) 2024-05-27 20:30:34 -04:00
J. Nick Koston
33ff84469a Align max expected entities constant between modules (#118102) 2024-05-27 14:06:16 -10:00
tronikos
722feb285b Handle multiple function_call and text parts in Google Generative AI (#118270) 2024-05-27 19:57:03 -04:00
Jan Bouwhuis
bfc3194661 Fix mqtt not publishing null payload payload to remove discovery (#118261) 2024-05-27 12:53:22 -10:00
G Johansson
6067ea2454 Cleanup tag integration (#118241)
* Cleanup tag integration

* Fix review comments
2024-05-27 21:53:06 +02:00
Josef Zweck
c349797938 Add new lock states to tedee integration (#117108) 2024-05-27 15:04:44 -04:00
G Johansson
d9ce4128c0 Add entry.runtime_data typing for Teslemetry (#118253) 2024-05-27 19:11:55 +02:00
dontinelli
e54fbcec77 Add diagnostics for fyta (#118234)
* Add diagnostics

* add test for diagnostics

* Redact access_token

* remove unnecessary redaction
2024-05-27 18:34:05 +02:00
Josef Zweck
70820c1702 Migrate tedee to entry.runtime_data (#118246)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-27 16:11:38 +02:00
Åke Strandberg
b61919ec71 Add helper strings for myuplink application credentials (#115349) 2024-05-27 15:58:22 +02:00
Michael
a24d97d79d Convert Feedreader to use an update coordinator (#118007) 2024-05-27 14:48:41 +02:00
epenet
97f6b578c8 Enforce namespace import in core (#118235) 2024-05-27 14:03:00 +02:00
Josef Zweck
9828a50dca Add quality scale (platinum) to tedee integration (#106940) 2024-05-27 12:57:58 +02:00
Maciej Bieniek
805f634634 Bump nettigo_air_monitor to version 3.1.0 (#118227)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-27 12:54:10 +02:00
epenet
e7ce01e649 Enforce namespace import in components (#118218) 2024-05-27 12:50:11 +02:00
shelvacu
33bdcb46cf Fix XMPP giving up on first auth fail (#118224) 2024-05-27 12:44:56 +02:00
epenet
fa038bef92 Use area_registry fixture in component tests (#118236) 2024-05-27 12:40:08 +02:00
Brett Adams
46158f5c14 Allow older vehicles to sleep in Teslemetry (#117229)
* Allow older vehicles to sleep

* Remove updated_once

* move pre2021 to lib

* bump

* Bump again

* Bump to 0.5.11

* Fix VIN so it matches the check

* Fix snapshot

* Snapshots

* Fix self.updated_once

* Remove old pre2021 attribute

* fix snapshots

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-27 12:37:33 +02:00
dontinelli
2a8fc7f310 Add Fyta sensor tests (#117995)
* Add test for init

* update tests

* split common.py into const.py and __init__.py

* Update tests/components/fyta/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* add autospec, tidy up

* adjust len-test

* add test_sensor.py, amend tests for coordinator.py

* Update tests/components/fyta/conftest.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* move load_unload with expired token into own test

* Update tests/components/fyta/test_init.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* ruff change

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-27 12:01:11 +02:00
Tsvi Mostovicz
1565561c03 Remove platform sensor from Jewish Calendar binary sensor (#118231) 2024-05-27 11:47:08 +02:00
Joost Lekkerkerker
f2762c9031 Bump yt-dlp to 2024.05.26 (#118229) 2024-05-27 11:38:30 +02:00
Claes Hallström
efcfbbf189 Add key expiry disabled binary sensor to Tailscale (#117667) 2024-05-27 11:37:00 +02:00
Duco Sebel
22cc7d34d5 Fix unique_id not being unique in HomeWizard (#117940) 2024-05-27 11:23:10 +02:00
J. Nick Koston
6b8223e339 Try to read multiple packets in MQTT (#118222) 2024-05-27 11:07:24 +02:00
Arie Catsman
83e4c2927c Implement reconfigure step for enphase_envoy (#115781) 2024-05-27 11:06:55 +02:00
Richard Kroegel
10291b1ce8 Bump bimmer_connected to 0.15.3 (#118179)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-05-27 11:01:22 +02:00
Joost Lekkerkerker
481c50f7a5 Remove platform setup from Jewish calendar (#118226) 2024-05-27 10:51:54 +02:00
Joost Lekkerkerker
a2b1dd8a5f Add config flow to Media Extractor (#115717) 2024-05-27 10:43:49 +02:00
J. Nick Koston
87989a88cd Remove translation and icon component path functions (#118214)
These functions have been stripped down to always return
the same path so there was no longer a need to have a
function for this. This is left-over cleanup from
previous refactoring.
2024-05-27 10:35:52 +02:00
Joost Lekkerkerker
3d2ecd6a28 Refactor Twitch tests (#114330)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-05-27 10:09:12 +02:00
J. Nick Koston
21b9a4ef2e Increase MQTT incoming buffer to 8MiB (#118220) 2024-05-27 10:07:53 +02:00
J. Nick Koston
3ebcee9bbb Fix mqtt chunk subscribe logging (#118217) 2024-05-26 21:56:09 -10:00
J. Nick Koston
3680d1f8c5 Remove legacy mqtt debug_info implementation (#118212) 2024-05-26 21:55:54 -10:00
J. Nick Koston
cfc2cadb77 Eagerly remove MQTT entities on reload (#118213) 2024-05-26 21:55:42 -10:00
G Johansson
e6142985a5 Use config entry runtime data in Scrape (#118191)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-05-27 08:48:54 +02:00
G Johansson
4d52d920ee Create EventEntity for Folder Watcher (#116526) 2024-05-27 08:47:02 +02:00
J. Nick Koston
5b608bea01 Remove extra inner function for mqtt reload service (#118211) 2024-05-26 18:55:00 -10:00
J. Nick Koston
872e9f2d5e Fix thundering herd of mqtt component setup tasks (#118210)
We had a thundering herd of tasks to back up against the lock to load each MQTT platform at startup because we had to wait to import the platforms.
2024-05-27 00:29:35 -04:00
Paulus Schoutsen
ecb05989ca Add exposed entities to the Assist LLM API prompt (#118203)
* Add exposed entities to the Assist LLM API prompt

* Check expose entities in Google test

* Copy Google default prompt test cases to LLM tests
2024-05-27 00:27:08 -04:00
J. Nick Koston
c391d73fec Remove unneeded time fetch in mqtt discovery (#118208) 2024-05-26 18:07:27 -10:00
J. Nick Koston
25f199c39c Improve performance of verify_event_loop_thread (#118198) 2024-05-26 17:39:15 -10:00
Paulus Schoutsen
87fc27eeae Teach Context about deepcopy (#118206)
Teach context about deepcopy
2024-05-26 23:14:02 -04:00
J. Nick Koston
c15f7f304f Remove unneeded dispatcher in mqtt discovery (#118205) 2024-05-26 17:07:24 -10:00
Paulus Schoutsen
9dc580e5de Add (deep)copy support to read only dict (#118204) 2024-05-26 23:05:45 -04:00
J. Nick Koston
56431ef750 Pre-set the HassJob job_type cached_property if its known (#118199) 2024-05-26 16:13:48 -10:00
J. Nick Koston
811ec57c31 Convert mqtt entity discovery to use callbacks (#118200) 2024-05-26 16:12:40 -10:00
Paulus Schoutsen
1602c8063c Standardize LLM instructions prompt (#118195)
* Standardize instructions prompt

* Add time/date to default instructions
2024-05-26 20:24:26 -04:00
J. Nick Koston
98d7821f47 Avoid creating template objects in mqtt sensor if they are not configured (#118194) 2024-05-26 12:09:06 -10:00
Brett Adams
841d5dfd4f Fix flaky test in Teslemetry (#118196)
Cleanup tests
2024-05-26 17:31:11 -04:00
Michael Hansen
3766c72ddb Forward timer events to Wyoming satellites (#118128)
* Add timer tests

* Forward timer events to satellites

* Use config entry for background tasks
2024-05-26 17:29:46 -04:00
J. Nick Koston
039bc3501b Fix mqtt switch types (#118193)
Remove unused code, add missing type for _is_on_map
2024-05-26 23:18:07 +02:00
tronikos
0588806922 Promote Google Generative AI to platinum quality (#118158)
* Promote Google Generative AI to platinum quality

* make exception for diagnostics
2024-05-26 17:07:31 -04:00
J. Nick Koston
f0b4f4655c Simplify mqtt switch state message processor (#118187) 2024-05-26 10:42:24 -10:00
J. Nick Koston
e74292e358 Move sensor mqtt state update functions to bound methods (#118188) 2024-05-26 10:42:09 -10:00
J. Nick Koston
226d010ab2 Simplify mqtt connection state dispatcher (#118184) 2024-05-26 10:21:21 -10:00
Jan Bouwhuis
b7f1f805fa Simplify subscription mqtt entity platforms (#118177) 2024-05-26 09:25:54 -10:00
G Johansson
008b56b4dd Bump holidays to 0.49 (#118181) 2024-05-26 20:29:58 +02:00
Tsvi Mostovicz
11646cab5f Move Jewish calendar constants to const file (#118180)
* Move Jewish calendar constants to const file

* Add a few missed constants

* Move CONF_LANGUAGE to it's correct path
2024-05-26 19:23:02 +02:00
tronikos
0972b29510 Add Google Generative AI reauth flow (#118096)
* Add reauth flow

* address comments
2024-05-26 11:44:48 -04:00
Angel Nunez Mencias
b85cf36a68 Upgrade thethingsnetwork to v3 (#113375)
* thethingsnetwork upgrade to v3

* add en translations and requirements_all

* fix most of the findings

* hassfest

* use ttn_client v0.0.3

* reduce content of initial release

* remove features that trigger errors

* remove unneeded

* add initial testcases

* Exception warning

* add strict type checking

* add strict type checking

* full coverage

* rename to conftest

* review changes

* avoid using private attributes - use protected instead

* simplify config_flow

* remove unused options

* review changes

* upgrade client

* add types client library - no need to cast

* use add_suggested_values_to_schema

* add ruff fix

* review changes

* remove unneeded comment

* use typevar for TTN value

* use typevar for TTN value

* review

* ruff error not detected in local

* test review

* re-order fixture

* fix test

* reviews

* fix case

* split testcases

* review feedback

* Update homeassistant/components/thethingsnetwork/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/thethingsnetwork/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update tests/components/thethingsnetwork/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Remove deprecated var

* Update tests/components/thethingsnetwork/test_config_flow.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Remove unused import

* fix ruff warning

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-26 16:30:33 +02:00
Robert Svensson
a7938091bf Use fixtures to setup UniFi config entries (#118126) 2024-05-26 16:30:22 +02:00
J. Nick Koston
caa65708fb Collapse websocket_api _state_diff into _state_diff_event (#118170) 2024-05-26 16:04:34 +02:00
Jan Bouwhuis
4a5c5fa311 Remove remove unreachable code in async_wait_for_mqtt_client (#118172) 2024-05-26 16:04:03 +02:00
J. Nick Koston
8b3cad372e Avoid constructing mqtt availability template objects when there is no template (#118171) 2024-05-26 02:02:13 -10:00
J. Nick Koston
c368ffffd5 Add async_get_hass_or_none (#118164) 2024-05-26 13:38:46 +02:00
Mike Degatano
05c24e92d1 Add repair for detached addon issues (#118064)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-05-26 13:37:50 +02:00
Paulus Schoutsen
233c3bb2be Add render prompt method when no API selected (#118136) 2024-05-26 13:35:15 +02:00
J. Nick Koston
dff8c06166 Fix unnecessary calls to update entity display_precision (#118159) 2024-05-26 13:32:59 +02:00
J. Nick Koston
80371d3a73 Reduce duplicate publish code in mqtt (#118163) 2024-05-26 01:22:54 -10:00
J. Nick Koston
5d37217d96 Avoid expensive inspection of callbacks to setup mqtt subscriptions (#118161) 2024-05-26 01:22:44 -10:00
J. Nick Koston
607aaa0efe Speed up template result parsing (#118168) 2024-05-26 13:09:12 +02:00
Paulus Schoutsen
4a3808c08e Don't crash when firing event for timer for unregistered device (#118132) 2024-05-26 13:08:00 +02:00
J. Nick Koston
6697cf07a6 Fix parallel script execution in queued mode (#118153) 2024-05-26 13:05:31 +02:00
Brett Adams
f12f82caac Add update platform to Teslemetry (#118145)
* Add update platform

* Add tests

* updates

* update test

* Fix support features comment

* Add assertion
2024-05-26 13:04:02 +02:00
J. Nick Koston
7bbb33b415 Improve script disallowed recursion logging (#118151) 2024-05-26 12:58:34 +02:00
G-Two
189cf88537 Bump subarulink to 0.7.11 (#117743) 2024-05-26 12:56:43 +02:00
Michael
66119c9d47 Clean up PIhole unneccesary async_block_till_done call (#118166)
leanup unneccesary async_bock_till_done calls
2024-05-26 12:40:22 +02:00
Michael
1b191230e4 Clean up AVM Fritz!Box Tools unneccesary async_block_till_done call (#118165)
cleanup unneccesary async_bock_till_done calls
2024-05-26 12:40:07 +02:00
Brett Adams
28a6f9eae7 Add number platform to Teslemetry (#117470)
* Add number platform

* Cast numbers

* rework numbers

* Add number platform

* Update docstrings

* fix json

* Remove speed limit

* Fix snapshot

* remove speed limit icon

* Remove speed limit strings

* rework min max

* Fix coverage

* Fix snapshot

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Type callable

* Fix types

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-26 11:02:35 +02:00
Michael
74f288286a Bump py-sucks to 0.9.10 (#118148)
bump py-sucks to 0.9.10
2024-05-26 10:55:04 +02:00
Brett Adams
711f7e1ac3 Add media player platform to Teslemetry (#117394)
* Add media player

* Add tests

* Better service assertions

* Update strings.json

* Update snapshot

* Docstrings

* Fix json

* Update diag

* Review feedback

* Update snapshot

* use key for title
2024-05-26 10:36:35 +02:00
Brett Adams
af8542ebe1 Add button platform to Teslemetry (#117227)
* Add buttons

* Add buttons

* Fix docstrings

* Rebase entry.runtime_data

* Revert testing change

* Fix tests

* format json

* Type callable

* Remove refresh

* Update icons.json

* Update strings.json

* Update homeassistant/components/teslemetry/button.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* import Awaitable

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-26 09:04:07 +02:00
J. Nick Koston
04101b044b Avoid constructing mqtt json attrs template if its not defined (#118146) 2024-05-25 16:13:54 -10:00
Shay Levy
0ae5275f01 Bump aioswitcher to 3.4.3 (#118123) 2024-05-26 00:04:44 +02:00
J. Nick Koston
5eeeb8c11f Remove code that is no longer used in mqtt (#118143) 2024-05-25 11:59:34 -10:00
Shay Levy
6a0e7cfea5 Clean up WebOS TV unneccesary async_block_till_done calls (#118142) 2024-05-26 00:37:44 +03:00
Jan Bouwhuis
991d6d92db Refactor mqtt callbacks for valve (#118140) 2024-05-25 11:34:56 -10:00
J. Nick Koston
9be829ba1f Make mqtt internal subscription a normal function (#118092)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-05-25 11:34:24 -10:00
Shay Levy
ecd48cc447 Clean up Shelly unneccesary async_block_till_done calls (#118141) 2024-05-26 00:28:48 +03:00
Jan Bouwhuis
d4a95b3735 Refactor mqtt callbacks for light basic, json and template schema (#118113) 2024-05-25 11:24:38 -10:00
Jan Bouwhuis
f21c0679b4 Rework mqtt callbacks for camera, image and event (#118109) 2024-05-25 11:23:45 -10:00
Jan Bouwhuis
ae0c00218a Refactor mqtt callbacks for vacuum (#118137) 2024-05-25 11:19:37 -10:00
Jan Bouwhuis
fc9f7aee7e Refactor mqtt callbacks for switch (#118127) 2024-05-25 11:17:54 -10:00
Jan Bouwhuis
6b1b15ef9b Refactor mqtt callbacks for text (#118130) 2024-05-25 11:16:54 -10:00
Jan Bouwhuis
e740e2cdc1 Refactor mqtt callbacks for select platform (#118121) 2024-05-25 11:16:16 -10:00
Jan Bouwhuis
3dbe9a41af Refactor mqtt callbacks for number (#118119) 2024-05-25 11:15:53 -10:00
Jan Bouwhuis
c510031fcf Refactor mqtt callbacks for siren (#118125) 2024-05-25 11:15:22 -10:00
Jan Bouwhuis
0f44ebd51e Refactor mqtt callbacks for update platform (#118131) 2024-05-25 11:14:48 -10:00
Jan Bouwhuis
e30297d837 Refactor mqtt callbacks for lawn_mower (#118117) 2024-05-25 11:13:43 -10:00
Jan Bouwhuis
05d8ec85aa Refactor mqtt callbacks for lock (#118118) 2024-05-25 11:13:14 -10:00
Jan Bouwhuis
6580a07308 Refactor mqtt callbacks for humidifier (#118116) 2024-05-25 11:11:07 -10:00
Jan Bouwhuis
b4acadc992 Rework mqtt callbacks for fan (#118115) 2024-05-25 11:09:24 -10:00
Jan Bouwhuis
5d7a735da6 Rework mqtt callbacks for device_tracker (#118110) 2024-05-25 11:07:50 -10:00
Jan Bouwhuis
521ed0a220 Fix mqtt callback exception logging (#118138)
* Fix mqtt callback exception logging

* Improve code

* Add test
2024-05-25 22:46:33 +02:00
elmurato
569763b7a8 Reach platinum level in Minecraft Server (#105432)
Reach platinum level
2024-05-25 22:13:32 +02:00
Denis Shulyaka
cee3be5f7a Break long strings in LLM tools (#118114)
* Break long code strings

* Address comments

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-25 14:24:51 -04:00
Allen Porter
89e2c57da6 Add conversation agent debug tracing (#118124)
* Add debug tracing for conversation agents

* Minor cleanup
2024-05-25 14:16:51 -04:00
Marc Mueller
2f16c3aa80 Fix mqtt callback typing (#118104) 2024-05-25 18:59:29 +02:00
Matthias Alphart
344bb568f4 Add diagnostics support for Fronius (#117845)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-25 14:01:24 +02:00
Michael
73f9234107 Remove deprecated services from AVM Fritz!Box Tools (#118108) 2024-05-25 13:52:28 +02:00
tronikos
0182bfcc81 Google Generative AI: 100% test coverage for conversation (#118112)
100% coverage for conversation
2024-05-25 07:52:20 -04:00
MatthewFlamm
8fbe39f2a7 Improve nws tests by centralizing and removing unneeded patching (#118052) 2024-05-25 13:50:15 +02:00
Michael
a89dcbc78b Use PEP 695 type alias for ConfigEntry type in Forecast Solar (#118107) 2024-05-25 13:48:58 +02:00
Brett Adams
ec76f34ba5 Add device tracker platform to Teslemetry (#117341) 2024-05-25 12:29:27 +01:00
Michael
10efb2017b Use PEP 695 type alias for ConfigEntry type in Spotify (#118106)
Use PEP 695 type alias for ConfigEntry type
2024-05-25 12:55:40 +02:00
Jan Bouwhuis
6fc6d109c9 Freeze and fix plaato CI tests (#118103) 2024-05-25 12:34:44 +02:00
nopoz
543d47d7f7 Allow Meraki API v2 or v2.1 (#115828) 2024-05-25 12:33:39 +02:00
J. Nick Koston
de275878c4 Small speed up to mqtt _async_queue_subscriptions (#118094) 2024-05-25 12:32:15 +02:00
Franck Nijhof
09cbc35b46 Merge branch 'master' into dev 2024-05-25 12:28:34 +02:00
Shay Levy
e8226a8056 Store Switcher runtime data in config entry (#118054) 2024-05-25 12:17:33 +02:00
J. Nick Koston
3f76b865fa Switch mqtt to use async_unload_platforms (#118097) 2024-05-25 11:55:36 +02:00
J. Nick Koston
b58e0331cf Migrate zwave_js to use async_unload_platforms (#118101) 2024-05-25 11:54:25 +02:00
J. Nick Koston
2954cba65d Migrate zha to use async_unload_platforms (#118100) 2024-05-25 11:53:42 +02:00
J. Nick Koston
131c1807c4 Migrate vera to use async_unload_platforms (#118099) 2024-05-25 11:48:55 +02:00
J. Nick Koston
204cd376cb Migrate firmata to use async_unload_platforms (#118098) 2024-05-25 11:48:06 +02:00
J. Nick Koston
4da125e27b Simplify mqtt discovery cooldown calculation (#118095) 2024-05-24 23:27:22 -10:00
Allister Maguire
5c60a5ae59 Bump pyenvisalink version to 4.7 (#118086) 2024-05-25 11:16:51 +02:00
Joakim Plate
943799f4d9 Adjust title of integration sensor (#116954) 2024-05-25 11:00:47 +02:00
Michael
a43fe71413 Store runtime data inside the config entry in Forecast Solar (#117033) 2024-05-25 10:54:38 +02:00
Michael
0ea1474556 Store runtime data inside the config entry in Spotify (#117037) 2024-05-25 10:41:23 +02:00
J. Nick Koston
ad638dbcc5 Speed up removing MQTT subscriptions (#118088) 2024-05-25 10:28:14 +02:00
Maikel Punie
ffcc9100a6 Bump velbusaio to 2024.5.1 (#118091) 2024-05-25 10:24:06 +02:00
Paulus Schoutsen
81f3387d06 Flip prompts to put user prompt on top (#118085) 2024-05-25 00:33:24 -04:00
Paulus Schoutsen
69f237fa9e Update Google safety defaults to match Google (#118084) 2024-05-25 00:02:53 -04:00
Paulus Schoutsen
676fe5a9a2 Add recommended model options to OpenAI (#118083)
* Add recommended options to OpenAI

* Use string join
2024-05-25 00:01:48 -04:00
Paulus Schoutsen
c59d4f9bba Add no-API LLM prompt back to Google (#118082)
* Add no-API LLM prompt back

* Use string join
2024-05-25 00:00:04 -04:00
Paulus Schoutsen
86a24cc3b9 Fix default Google AI prompt on initial setup (#118078) 2024-05-24 23:55:11 -04:00
Paulus Schoutsen
a257f63119 Add device info to OpenAI (#118077) 2024-05-24 23:55:01 -04:00
J. Nick Koston
d71c7705ae Convert remaining mqtt attrs classes to dataclasses (#118073) 2024-05-24 17:44:50 -10:00
J. Nick Koston
42232ecc8a Remove unused code in template helper (#118075) 2024-05-24 17:44:24 -10:00
J. Nick Koston
6923fb1601 Avoid template context manager overhead when template is already compiled (#118079) 2024-05-24 17:44:02 -10:00
J. Nick Koston
5cb3bc19c0 Speed up async_render_with_possible_json_value (#118080) 2024-05-24 17:43:42 -10:00
J. Nick Koston
3416162fdb Remove OrderedDict from entity_values as dict guarantees order on newer cpython (#118081) 2024-05-24 17:43:20 -10:00
J. Nick Koston
f026083712 Speed up is_template_string by avoiding regex engine (#118076) 2024-05-24 17:42:55 -10:00
Paulus Schoutsen
4b0f58ec63 Add device info to Google (#118074) 2024-05-24 22:23:25 -04:00
Denis Shulyaka
da74ac06d7 Add user name and location to the LLM assist prompt (#118071)
Add user name and location to the llm assist prompt
2024-05-24 22:23:05 -04:00
tronikos
620487fe75 Add Google Generative AI safety settings (#117679)
* Add safety settings

* snapshot-update

* DROPDOWN

* fix test

* rename const

* Update const.py

* Update strings.json
2024-05-24 21:48:39 -04:00
tronikos
5ca27f5d0c Google Generative AI: add timeout to ensure we don't block HA startup (#118066)
* timeout

* fix

* tests
2024-05-24 21:31:02 -04:00
Jan Bouwhuis
c9a79f6293 Fix lingering mqtt test (#118072) 2024-05-24 14:34:18 -10:00
J. Nick Koston
90d10dd773 Use defaultdict instead of setdefault in mqtt client (#118070) 2024-05-24 14:34:06 -10:00
J. Nick Koston
3031e4733b Reduce duplicate code to handle mqtt message replies (#118067) 2024-05-24 14:33:21 -10:00
J. Nick Koston
c7a1c59215 Avoid catch_log_exception overhead in MQTT for simple callbacks (#118036) 2024-05-24 14:32:32 -10:00
J. Nick Koston
65a702761b Avoid generating matchers that will never be used in MQTT (#118068) 2024-05-24 14:04:03 -10:00
Jan Bouwhuis
fa1ef8b0cf Split mqtt subscribe and unsubscribe calls to smaller chunks (#118035) 2024-05-24 13:33:28 -10:00
Jan Bouwhuis
01f3a5a97c Consequently ignore empty MQTT state payloads and set state to unknown on "None" payload (#117813)
* Consequently ignore empty MQTT state payloads and set state to `unknown` on "None" payload

* Do not change preset mode behavior

* Add device tracker ignoring empty state

* Ignore empty state for lock

* Resolve merge errors
2024-05-25 01:29:43 +02:00
Jan Bouwhuis
c616fc036e Move recorder chunk utils to shared collection utils (#118065) 2024-05-24 12:49:39 -10:00
Jan Bouwhuis
7522bbfa9d Refactor mqtt callbacks for climate and water_heater (#118040)
* Refactor mqtt callbacks for climate and water_heater

* Reduce callbacks
2024-05-25 00:20:05 +02:00
J. Nick Koston
cf73a47fc0 Significantly speed up single use callback dispatchers (#117934) 2024-05-24 11:21:10 -10:00
Aaron Bach
881237189d Add activity type to appropriate RainMachine switches (#117875) 2024-05-24 22:40:13 +02:00
Jan Bouwhuis
35a20d9c60 Refactor mqtt callbacks for cover (#118044) 2024-05-24 10:26:24 -10:00
Jan Bouwhuis
4b89443f62 Refactor mqtt callbacks for alarm_control_panel (#118037) 2024-05-24 10:20:37 -10:00
Christian Neumeier
ee38099a91 Add tests to Zeversolar integration (#117928) 2024-05-24 22:18:29 +02:00
Paulus Schoutsen
7554ca9460 Allow llm API to render dynamic template prompt (#118055)
* Allow llm API to render dynamic template prompt

* Make rendering api prompt async so it can become a RAG

* Fix test
2024-05-24 16:04:48 -04:00
Franck Nijhof
c347311851 2024.5.5 (#118049) 2024-05-24 22:01:44 +02:00
Paulus Schoutsen
3b2cdb63f1 Update OpenAI defaults (#118059)
* Update OpenAI defaults

* Update max temperature
2024-05-24 15:37:44 -04:00
J. Nick Koston
750ec261be Add state check to config entry setup to ensure it cannot be setup twice (#117193) 2024-05-24 21:28:04 +02:00
Paulus Schoutsen
ffc3560dad Remove unneeded asserts (#118056)
* Remove unneeded asserts

* No need to guard changing a timer that is owned by a disconnected device
2024-05-24 14:56:57 -04:00
Michael Hansen
5be15c94bc Require registered device id for all timer intents (#117946)
* Require device id when registering timer handlers

* Require device id for timer intents

* Raise errors for unregistered device ids

* Add callback

* Add types for callback to __all__

* Clean up

* More clean up
2024-05-24 12:55:52 -05:00
Michael Hansen
77e385db52 Fix intent helper test (#118053)
Fix test
2024-05-24 12:59:19 -04:00
Franck Nijhof
8128449879 Fix rc pylint warning in MQTT (#118050) 2024-05-24 18:41:46 +02:00
Franck Nijhof
3f7e57dde2 Bump version to 2024.5.5 2024-05-24 16:13:44 +02:00
Marcel van der Veldt
81bf31bbb1 Extend the blocklist for Matter transitions with more models (#118038) 2024-05-24 16:13:32 +02:00
J. Nick Koston
f5c20b3528 Bump pySwitchbot to 0.46.1 (#118025) 2024-05-24 16:13:29 +02:00
Erik Montnemery
3238bc83b8 Improve async_get_issue_tracker for custom integrations (#118016) 2024-05-24 16:13:26 +02:00
J. Nick Koston
f4b653a767 Update pySwitchbot to 0.46.0 to fix lock key retrieval (#118005)
* Update pySwitchbot to 0.46.0 to fix lock key retrieval

needs https://github.com/Danielhiversen/pySwitchbot/pull/236

* bump

* fixes
2024-05-24 16:13:22 +02:00
Shay Levy
09779b5f6e Add Shelly debug logging for async_reconnect_soon (#117945) 2024-05-24 16:13:19 +02:00
On Freund
ac97f25d6c Bump pyrympro to 0.0.8 (#117919) 2024-05-24 16:13:15 +02:00
Joakim Plate
7e18527dfb Update philips_js to 3.2.1 (#117881)
* Update philips_js to 3.2.0

* Update to 3.2.1
2024-05-24 16:13:12 +02:00
Peter
7d5f9b1adf Prevent time pattern reschedule if cancelled during job execution (#117879)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-24 16:13:09 +02:00
Bernardus Jansen
0fb5aaf0f8 Tesla Wall Connector fix spelling error/typo (#117841) 2024-05-24 16:13:05 +02:00
puddly
6956d0d65a Account for disabled ZHA discovery config entries when migrating SkyConnect integration (#117800)
* Properly handle disabled ZHA discovery config entries

* Update tests/components/homeassistant_sky_connect/test_util.py

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-05-24 16:13:02 +02:00
Franck Nijhof
db73074185 Update wled to 0.18.0 (#117790) 2024-05-24 16:12:59 +02:00
J. Nick Koston
dae4d316ae Fix race in config entry setup (#117756) 2024-05-24 16:12:55 +02:00
J. Nick Koston
56b55a0df5 Block older versions of custom integration mydolphin_plus since they cause crashes (#117751) 2024-05-24 16:12:50 +02:00
Ricardo Steijn
8d24f68f55 Bump crownstone-sse to 2.0.5, crownstone-cloud to 1.4.11 (#117748) 2024-05-24 16:12:46 +02:00
Anrijs
b44821b805 Bump aranet4 to 2.3.4 (#117738)
bump aranet4 lib version to 2.3.4
2024-05-24 16:12:43 +02:00
Michael
66c52e144e Consider only active config entries as media source in Synology DSM (#117691)
consider only active config entries as media source
2024-05-24 16:12:40 +02:00
On Freund
66fccb7296 Bump pyrisco to 0.6.2 (#117682) 2024-05-24 16:12:36 +02:00
J. Nick Koston
ecb587c4ca Fix setting MQTT socket buffer size with WebsocketWrapper (#117672) 2024-05-24 16:12:33 +02:00
Bouwe Westerdijk
c6a9388aea Add options-property to Plugwise Select (#117655) 2024-05-24 16:12:29 +02:00
Ville Skyttä
85f0fffa5a Filter out HTML greater/less than entities from huawei_lte sensor values (#117209) 2024-05-24 16:12:26 +02:00
Pete Sage
9dc66404e7 Fix Sonos album artwork performance (#116391) 2024-05-24 16:12:05 +02:00
epenet
6a10e89f6d Exclude gold and platinum integrations from .coveragerc (#117563) 2024-05-24 16:10:22 +02:00
J. Nick Koston
a8fba691ee Add types to event tracker data (#118010)
* Add types to event tracker data

* fixes

* do not test event internals in other tests

* fixes

* Update homeassistant/helpers/event.py

* cleanup

* cleanup
2024-05-24 10:09:39 -04:00
dontinelli
7183260d95 Change ZoneInfo to async_get_time_zone in fyta (#117996) 2024-05-24 16:09:18 +02:00
epenet
44f715bd02 Use issue_registry fixture in component tests (#118041) 2024-05-24 15:54:20 +02:00
Robert Resch
cb62f4242e Remove strict connection (#117933) 2024-05-24 15:50:22 +02:00
Jan Bouwhuis
6f81852eb4 Rename MQTT mixin classes (#118039) 2024-05-24 15:41:59 +02:00
Brian Rogers
080bba5d9b Update Rachio hose timer battery sensor (#118045) 2024-05-24 15:31:05 +02:00
epenet
0b4f1cff98 Use issue_registry fixture in core tests (#118042) 2024-05-24 15:26:32 +02:00
Marc Mueller
dd22ee3dac Improve annotation styling (#118032) 2024-05-24 15:05:53 +02:00
J. Nick Koston
2308ff2cbf Add json cache to lovelace config (#117843) 2024-05-24 14:07:43 +02:00
Yuval Aboulafia
2c09f72c33 Add config flow to Jewish Calendar (#84464)
* Initial commit

* add basic tests (will probably fail)

* Set basic UID for now

* Various improvements

* use new naming convention?

* bit by bit, still not working tho

* Add tz selection

* Remove failing tests

* update unique_id

* add the tests again

* revert to previous binary_sensor test

* remove translations

* apply suggestions

* remove const.py

* Address review

* revert changes

* Initial fixes for tests

* Initial commit

* add basic tests (will probably fail)

* Set basic UID for now

* Various improvements

* use new naming convention?

* bit by bit, still not working tho

* Add tz selection

* Remove failing tests

* update unique_id

* add the tests again

* revert to previous binary_sensor test

* remove translations

* apply suggestions

* remove const.py

* Address review

* revert changes

* Fix bad merges in rebase

* Get tests to run again

* Fixes due to fails in ruff/pylint

* Fix binary sensor tests

* Fix config flow tests

* Fix sensor tests

* Apply review

* Adjust candle lights

* Apply suggestion

* revert unrelated change

* Address some of the comments

* We should only allow a single jewish calendar config entry

* Make data schema easier to read

* Add test and confirm only single entry is allowed

* Move OPTIONS_SCHEMA to top of file

* Add options test

* Simplify import tests

* Test import end2end

* Use a single async_forward_entry_setups statement

* Revert schema updates for YAML schema

* Remove unneeded brackets

* Remove CONF_NAME from config_flow

* Assign hass.data[DOMAIN][config_entry.entry_id] to a local variable before creating the sensors

* Data doesn't have a name remove slugifying of it

* Test that the entry has been created correctly

* Simplify setup_entry

* Use suggested values helper and flatten location dictionary

* Remove the string for name exists as this error doesn't exist

* Remove name from config entry

* Remove _attr_has_entity_name - will be added in a subsequent PR

* Don't override entity id's - we'll fixup the naming later

* Make location optional - will by default revert to the user's home location

* Update homeassistant/components/jewish_calendar/strings.json

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* No need for local lat/long variable

* Return name attribute, will deal with it in another PR

* Revert unique_id changes, will deal with this in a subsequent PR

* Add time zone data description

* Don't break the YAML config until the user has removed it.

* Cleanup initial config flow test

---------

Co-authored-by: Tsvi Mostovicz <ttmost@gmail.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-24 14:04:17 +02:00
Marcel van der Veldt
23597a8cdf Extend the blocklist for Matter transitions with more models (#118038) 2024-05-24 13:50:10 +02:00
Fabrice
d4acd86819 Make co/co2 threshold configurable via entity_config (#112978)
* make co/co2 threshold configurable via entity_config

* Split threshold into co/co2_threshold configuration
2024-05-24 13:28:19 +02:00
Philip Rosenberg-Watt
e7d23d8b49 Add APRS object tracking (#113080)
* Add APRS object tracking

Closes issue #111731

* Fix unit test

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-24 13:13:02 +02:00
Jan Bouwhuis
f12aee28a8 Improve error logging on invalid MQTT entity state (#118006)
* Improve error logging on invalid MQTT entity state

* Explain not hanlding TpeError and ValueError

* Move length check closer to source

* use _LOGGER.exception
2024-05-24 13:11:52 +02:00
Em
7d44321f0f Remove duplicate tests in generic_thermostat (#105622)
Tests using `setup_comp_4` and `setup_comp_6` have been replaced by a parameterized tests in #105643. Tests using `setup_comp_5` are therefore still duplicates and are removed.
2024-05-24 12:24:05 +02:00
Brett Adams
b99476284b Add Cover platform to Teslemetry (#117340)
* Add cover

* Test coverage

* Json lint

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Update tests

* Fix features

* Update snapshot from fixture

* Apply suggestions from code review

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-24 12:09:23 +02:00
Jan Bouwhuis
9333965b23 Create bound callback_message_received method for handling mqtt callbacks (#117951)
* Create bound callback_message_received method for handling mqtt callbacks

* refactor a bit

* fix ruff

* reduce overhead

* cleanup

* cleanup

* Revert changes alarm_control_panel

* Add sensor and binary sensor

* use same pattern for MqttAttributes/MqttAvailability

* remove useless function since we did not need to add to it

* code cleanup

* collapse

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-24 11:18:25 +02:00
epenet
d4df86da06 Move TibberDataCoordinator to separate module (#118027) 2024-05-24 11:05:54 +02:00
epenet
95840a031a Move nuki coordinator to separate module (#117975) 2024-05-24 10:55:26 +02:00
Thomas55555
13385912d1 Refactor Husqvarna Automower (#117938) 2024-05-24 10:54:19 +02:00
Sid
bc72f82776 Convert namedtuple to NamedTuple for smartthings (#115395) 2024-05-24 10:53:05 +02:00
Pete Sage
1ad2e4951d Fix Sonos album artwork performance (#116391) 2024-05-24 10:42:45 +02:00
mkmer
5c263b039e Catch client connection error in Honeywell (#117502)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-24 10:40:30 +02:00
epenet
bb0b01e4a9 Add error message to snapshot_platform helper (#117974) 2024-05-24 10:38:23 +02:00
J. Nick Koston
488b2edfd8 Bump pySwitchbot to 0.46.1 (#118025) 2024-05-24 10:37:10 +02:00
epenet
39f618d5e5 Add snapshot tests to nuki (#117973) 2024-05-24 10:36:59 +02:00
Ulfmerbold2000
e274316a50 Add missing Ecovacs life spans (#117134)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-24 10:36:13 +02:00
Fredrik Erlandsson
d1904941c1 Fix issue with device_class.capitalize() in point (#117969) 2024-05-24 10:35:44 +02:00
Marc Mueller
905adb2431 Update codespell ignore list (#118018) 2024-05-24 10:24:34 +02:00
Marc Mueller
3b4b36a9fd Fix partial typing (#118022) 2024-05-24 10:24:18 +02:00
Marc Mueller
0e03e591e7 Improve callable annotations (#118024) 2024-05-24 10:24:09 +02:00
J. Nick Koston
b7a18e9a8f Avoid calling split_entity_id in event add/remove filters (#118015) 2024-05-24 10:01:33 +02:00
Marc Mueller
01ace8cffd Update typing-extensions to 4.12.0 (#118020) 2024-05-24 10:00:43 +02:00
epenet
a6ca5c5b84 Add logging to SamsungTV turn-on (#117962)
* Add logging to SamsungTV turn-on

* Apply suggestions from code review

Co-authored-by: J. Nick Koston <nick@koston.org>

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-24 09:59:29 +02:00
Erik Montnemery
f896c7505b Improve async_get_issue_tracker for custom integrations (#118016) 2024-05-24 09:55:05 +02:00
Evgeny
24d31924a0 Migrate OpenWeaterMap to new library (support API 3.0) (#116870)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-23 21:51:10 -10:00
epenet
5bca9d142c Use snapshot in renault diagnostics tests (#118021) 2024-05-24 09:42:33 +02:00
epenet
19aaa8ccee Move plaato coordinator to separate module (#118019) 2024-05-24 09:42:12 +02:00
Franck Nijhof
9224997411 Add sequence action for automations & scripts (#117690)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-24 09:34:49 +02:00
kingy444
e70d8aec96 Daikin Aircon - Add strings and debug (#116674) 2024-05-24 09:28:44 +02:00
epenet
edd14929e3 Add snapshot tests to plaato (#118017) 2024-05-24 09:23:09 +02:00
Brett Adams
96d9342f13 Add models to energy sites in Teslemetry (#117419)
* Add models to energy sites and test devices

* Fix device testing

* Revert VIN

* Fix snapshot

* Fix snapshot

* fix snap

* Sort list
2024-05-24 09:18:22 +02:00
Shay Levy
cb59eb183d Switcher - use single_config_entry and register_discovery_flow in con… (#118000) 2024-05-24 09:15:17 +02:00
Brett Adams
ad90ecef3f Add binary sensor platform to Teslemetry (#117230)
* Add binary sensor platform

* Add tests

* Cleanup

* Add refresh test

* Fix runtime_data after rebase

* Remove streaming strings

* test error

* updated_once

* fix updated_once

* assert_entities_alt

* Update homeassistant/components/teslemetry/binary_sensor.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-24 08:55:27 +02:00
epenet
8da799e420 Move omnilogic coordinator to separate module (#118014) 2024-05-24 08:48:05 +02:00
Marc Mueller
301c484e05 Fix vallow test fixtures (#118003) 2024-05-24 08:31:21 +02:00
Thomas55555
528d67ee06 Remove unused snapshots [a-f] (#117999) 2024-05-24 08:28:04 +02:00
Brett Adams
3c7857f0f0 Add lock platform to Teslemetry (#117344)
* Add lock platform

* Tests and fixes

* Fix json

* Review Feedback

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* wording

* Fix rebase

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-24 08:26:29 +02:00
Marc Mueller
dc47792ff2 Update codespell to 2.3.0 (#118001) 2024-05-24 08:22:29 +02:00
J. Nick Koston
93daac9b3d Update pySwitchbot to 0.46.0 to fix lock key retrieval (#118005)
* Update pySwitchbot to 0.46.0 to fix lock key retrieval

needs https://github.com/Danielhiversen/pySwitchbot/pull/236

* bump

* fixes
2024-05-23 23:59:44 -04:00
Paulus Schoutsen
d1af40f1eb Google gen updates (#117893)
* Add a recommended model for Google Gen AI

* Add recommended settings to Google Gen AI

* Revert no API msg

* Use correct default settings

* Make sure options are cleared when using recommended

* Update snapshots

* address comments
2024-05-23 17:16:48 -04:00
Shay Levy
c0bcf00bf8 Remove Switcher YAML import support (#117994) 2024-05-23 21:12:19 +02:00
epenet
4ee1460eec Move moehlenhoff_alpha2 coordinator to separate module (#117970) 2024-05-23 21:06:00 +02:00
epenet
34deac1a61 Add snapshot tests to omnilogic (#117986) 2024-05-23 21:04:31 +02:00
J. Nick Koston
bdc3bb57f3 Bump habluetooth to 3.1.1 (#117992) 2024-05-23 20:43:14 +02:00
Shay Levy
36d77414c6 Enable Switcher assume buttons for all devices (#117993) 2024-05-23 20:29:49 +02:00
Allen Porter
978fe2d7b0 Bump to google-nest-sdm to 4.0.4 (#117982) 2024-05-23 20:27:48 +02:00
agrauballe
ef138eb976 Deconz - Added trigger support for Aqara WB-R02D mini switch (#117917)
Added support for Aqara WB-R02D mini switch

Co-authored-by: agr <agr@kamstrup.com>
2024-05-23 18:04:37 +02:00
J. Nick Koston
c5cc9801a6 Cache serialize of manifest for loaded integrations (#117965)
* Cache serialize of manifest for loaded integrations

The manifest/list and manifest/get websocket apis
are called frequently when moving around in the UI.
Since the manifest does not change we can make
the the serialized version a cached property

* reduce

* reduce
2024-05-23 10:52:05 -04:00
J. Nick Koston
09e7156d2d Fix turbojpeg init doing blocking I/O in the event loop (#117971)
* Fix turbojpeg init doing blocking I/O in the event loop

fixes
```
Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22
```

* Update homeassistant/components/camera/img_util.py

* Fix turbojpeg init doing blocking I/O in the event loop

fixes
```
Detected blocking call to open inside the event loop by integration camera at homeassistant/components/camera/img_util.py, line 100: TurboJPEGSingleton.__instance = TurboJPEG() (offender: /usr/local/lib/python3.12/ctypes/util.py, line 276: with open(filepath, rb) as fh:), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+camera%22
```

* already suppressed and logged
2024-05-23 10:50:25 -04:00
epenet
6b2ddcca5e Move rainmachine coordinator to separate module (#117983)
* Move rainmachine coordinator to separate module

* Coverage
2024-05-23 16:41:50 +02:00
epenet
162f5ccbde Add snapshot platform tests to rainmachine (#117978)
* Add snapshot tests to rainmachine

* Add sensor and switch tests
2024-05-23 16:29:39 +02:00
epenet
0c243d699c Use SnapshotAssertion in rainmachine diagnostic tests (#117979)
* Use SnapshotAssertion in rainmachine diagnostic tests

* Force entry_id

* Adjust

* Fix incorrect fixtures

* Adjust
2024-05-23 16:22:31 +02:00
Brett Adams
880b315890 Add switch platform to Teslemetry (#117482)
* Add switch platform

* Add tests

* Add test

* Fixes

* ruff

* Rename to storm watch

* Remove valet

* Apply suggestions from code review

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* ruff

* Review feedback

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-23 14:28:18 +02:00
epenet
bc51a4c524 Add snapshot tests to moehlenhoff_alpha2 (#117967)
* Add tests to moehlenhoff_alpha2

* Adjust coverage

* Adjust coverage

* Adjust coverage

* Adjust patch

* Adjust
2024-05-23 11:54:20 +02:00
epenet
bbe8e69795 Cleanup pylint ignore (#117964) 2024-05-23 11:09:33 +02:00
dontinelli
6682244abf Improve fyta tests (#117661)
* Add test for init

* update tests

* split common.py into const.py and __init__.py

* Update tests/components/fyta/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* add autospec, tidy up

* adjust len-test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-23 10:51:30 +02:00
Joost Lekkerkerker
e8f544d216 Bump airgradient to 0.4.1 (#117963) 2024-05-23 10:25:54 +02:00
J. Nick Koston
6c6a5f496a Simplify async_track_time_interval implementation (#117956) 2024-05-22 21:56:49 -10:00
Matthias Alphart
fc4ea774ca Fix run-in-env script for not running in venv (#117961) 2024-05-23 09:14:59 +02:00
kaareseras
cd14d9b0e3 Add Azure data explorer (#68992)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-23 09:14:09 +02:00
Galorhallen
767d971c5f Better handling of EADDRINUSE for Govee light (#117943) 2024-05-23 08:45:49 +02:00
Jan-Philipp Benecke
88257c9c42 Allow to reconfigure integrations with single_config_entry set (#117939) 2024-05-23 08:41:12 +02:00
Sid
cc17725d1d Bump ruff to 0.4.5 (#117958) 2024-05-23 07:29:09 +02:00
Shay Levy
178c185a2f Add Shelly debug logging for async_reconnect_soon (#117945) 2024-05-22 23:15:15 -04:00
J. Nick Koston
e663d4f602 Refactor state_reported listener setup to avoid merge in async_fire_internal (#117953)
* Refactor state_reported listener setup to avoid merge in async_fire_internal

Instead of merging the listeners in async_fire_internal, setup the listener for
state_changed at the same time so async_fire_internal can avoid having to copy
another list

* Refactor state_reported listener setup to avoid merge in async_fire_internal

Instead of merging the listeners in async_fire_internal, setup the listener for
state_changed at the same time so async_fire_internal can avoid having to copy
another list

* tweak

* tweak

* tweak

* tweak

* tweak
2024-05-22 23:14:50 -04:00
Paulus Schoutsen
1f7245ecf2 Update LLM no tools message (#117935) 2024-05-22 21:17:03 -04:00
Jan Bouwhuis
050fc73056 Refactor shared mqtt schema's to new module (#117944)
* Refactor mqtt schema's to new module

* Remove unrelated change
2024-05-23 01:12:25 +02:00
Mischa Siekmann
ad69a23fda Send MEDIA_ANNOUNCE flag to ESPHome media_player (#116993) 2024-05-23 09:47:34 +12:00
Peter
eb76386c68 Prevent time pattern reschedule if cancelled during job execution (#117879)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-22 10:36:03 -10:00
Kevin Worrel
40fdc840ab Add number entities for screenlogic values used in SI calc (#117812) 2024-05-22 09:52:09 -10:00
Michael
be6598ea4f Store runtime data inside the config entry in iBeacon (#117936)
store runtime data inside the config entry

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-22 20:44:41 +02:00
epenet
deded19bb3 Add available and state to SamsungTV remote (#117909)
* Add available and state to SamsungTV remote

* Align turn_off

* Fix merge

* Fix merge (again)
2024-05-22 20:35:34 +02:00
J. Nick Koston
0d5c8e30cd Migrate issue registry to use singleton helper (#117848)
* Migrate issue registry to use singleton helper

The other registries were already migrated, but since this
one had a read only flag, it required a slightly different
solution since it uses the same hass.data key

* refactor
2024-05-22 14:13:19 -04:00
Allen Porter
7a6b107248 Move nest diagnostic tests to use snapshots (#117929) 2024-05-22 14:11:07 -04:00
Joost Lekkerkerker
0c5296b38f Add lock to token validity check (#117912) 2024-05-22 14:10:23 -04:00
puddly
55c8ef1c7b Simplify SkyConnect setup flow (#117868)
* Delay firmware probing until after the user picks the firmware type

* Remove confirmation step

* Fix unit tests

* Simplify unit test patching logic

Further simplify unit tests

* Bump Zigbee firmware up to the first choice

* Reuse `async_step_pick_firmware` during options flow

* Proactively validate all ZHA entries, not just the first
There can only be one (for now) so this changes nothing functionally

* Add unit test for bad firmware when configuring Thread
2024-05-22 14:09:30 -04:00
J. Nick Koston
6113b58e9c Speed up registry indices (#117897)
* Use defaultdict for registry indices

defaultdict is faster and does not have to create an empty
dict that gets throw away when the key is already present

* Use defaultdict for registry indices

defaultdict is faster and does not have to create an empty
dict that gets throw away when the key is already present
2024-05-22 14:07:39 -04:00
Michael Hansen
f99ec87338 Fail if targeting all devices in the house in service intent handler (#117930)
* Fail if targeting all devices in the house

* Update homeassistant/helpers/intent.py

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-22 13:53:31 -04:00
Thomas55555
eeeb5b2725 Add switch for stay out zones in Husqvarna Automower (#117809)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-05-22 18:51:21 +02:00
On Freund
f9eb3db897 Bump pyrympro to 0.0.8 (#117919) 2024-05-22 18:14:04 +02:00
tronikos
e4130480c3 Google Generative AI: Handle response with empty parts in generate_content (#117908)
Handle response with empty parts in generate_content
2024-05-22 07:47:16 -07:00
mkmer
5b1677ccb7 Use common title for reauth confirm in Whirlpool config flow (#117924)
* Add missing placeholder

* Use common title for reauth
2024-05-22 16:45:54 +02:00
G Johansson
d1bdf73bc5 Add clear night to smhi (#115998) 2024-05-22 16:03:48 +02:00
Marc Mueller
5c9c71ba2c Fix performance regression with SignalType (#117920) 2024-05-22 13:58:37 +02:00
Joost Lekkerkerker
5229f0d0ef Exclude modbus from diagnostics hassfest check (#117855) 2024-05-22 13:09:20 +02:00
epenet
5ee42ec780 Remove duplicate code in SamsungTV (#117913) 2024-05-22 12:29:25 +02:00
J. Nick Koston
9454dfc719 Bump habluetooth to 3.1.0 (#117905) 2024-05-22 12:28:13 +02:00
J. Nick Koston
4e3c4400a7 Refactor MQTT to replace get_mqtt_data with HassKey (#117899) 2024-05-21 23:21:51 -10:00
Chris
b4d0562063 Adopt new runtime entry data model for AlarmDecoder (#117856)
* Adopt new runtime entity data model for AlarmDecoder

Transition the AlarmDecoder integration to the new runtime entity model.

* Apply change suggestions by epenet

Tested & applied the suggestions from epenet.
2024-05-22 10:47:37 +02:00
epenet
b898c86c89 Add MAC cleanup to SamsungTV (#117906)
* Add MAC cleanup to samsungtv

* Simplify

* Adjust

* leftover

* Appl

Co-authored-by: J. Nick Koston <nick@koston.org>

* Update diagnostics tests

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-22 10:36:21 +02:00
MatthewFlamm
52bb02b376 Keep observation data valid for 60 min and retry with no data for nws (#117109)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-21 22:14:05 -10:00
epenet
cddb057eae Adjust conftest type hints (#117900) 2024-05-22 09:34:17 +02:00
epenet
39b4e890a0 Add coordinator to SamsungTV (#117863)
* Introduce samsungtv coordinator

* Adjust

* Adjust media_player

* Remove remote

* Adjust

* Fix mypy

* Adjust

* Use coordinator.async_refresh
2024-05-22 09:20:05 +02:00
Jakob Schlyter
2e68363755 Improve typing via hassfest serializer (#117382) 2024-05-22 08:22:18 +02:00
J. Nick Koston
1985a2ad8b Small speed up to creating flows (#117896)
Use a defaultdict instead of setdefault
2024-05-22 08:16:08 +02:00
Robert Svensson
5abf77662a Support carbon dioxide and formaldehyde sensors in deCONZ (#117877)
* Add formaldehyde sensor
* Add carbon dioxide sensor
* Bump pydeconz to v116
2024-05-22 07:33:55 +02:00
J. Nick Koston
f42b98336c Reduce overhead to validate mqtt topics (#117891)
* Reduce overhead to validate mqtt topics

valid_topic would iterate all the chars 4x, refactor to only
do it 1x

valid_subscribe_topic would enumerate all the chars when there was
no + in the string

* check if adding a cache helps

* tweak lrus based on testing stats

* note to future maintainers

* note to future maintainers

* keep standard lru_cache size as increasing makes no material difference
2024-05-21 23:11:05 -04:00
Denis Shulyaka
2f0215b034 LLM Tools support for OpenAI integration (#117645)
* initial commit

* Add tests

* Move tests to the correct file

* Fix exception type

* Undo change to default prompt

* Add intent dependency

* Move format_tool out of the class

* Fix tests

* coverage

* Adjust to new API

* Update strings

* Update tests

* Remove unrelated change

* Test referencing non-existing API

* Add test to verify no exception on tool conversion for Assist tools

* Bump voluptuous-openapi==0.0.4

* Add device_id to tool input

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-21 22:45:04 -04:00
J. Nick Koston
09213d8933 Avoid creating tasks to subscribe to discovery in MQTT (#117890) 2024-05-21 16:39:23 -10:00
Denis Shulyaka
009c9e79ae LLM Tools: Add device_id (#117884) 2024-05-21 21:24:46 -04:00
J. Nick Koston
4ed45a322c Reduce overhead to call get_mqtt_data (#117887)
We call this 100000s of times if there are many subscriptions

https://github.com/home-assistant/core/pull/109030#issuecomment-2123612530
2024-05-21 21:11:27 -04:00
J. Nick Koston
f429bfa903 Fix mqtt timer churn (#117885)
Borrows the same design from homeassistant.helpers.storage to avoid
rescheduling the timer every time async_schedule is called if a timer
is already running.

Instead of the timer fires too early it gets rescheduled for the time
we wanted it. This avoids 1000s of timer add/cancel during startup
2024-05-21 21:05:33 -04:00
J. Nick Koston
1800a60a6d Simplify and speed up mqtt_config_entry_enabled check (#117886) 2024-05-21 21:04:31 -04:00
Joakim Plate
5f7b84caea Update philips_js to 3.2.1 (#117881)
* Update philips_js to 3.2.0

* Update to 3.2.1
2024-05-22 00:11:10 +02:00
Matthias Alphart
70cf176d93 Add value_template option to KNX expose (#117732)
* Add value_template option to KNX expose

* template exception handling
2024-05-22 00:09:42 +02:00
Matthias Alphart
622d1e4c50 Add data point type option to knx.telegram trigger (#117463)
* Add data point type (dpt) option to `knx.telegram` trigger

* Rename from `dpt` to `type` to match services

* Add test for GroupValueRead telegrams

* Fix device trigger schema inheritance

* Typesafe dispatcher signal

* readability

* Avoid re-decoding with same transcoder
2024-05-22 00:03:54 +02:00
Matthias Alphart
b94735a445 Add async_turn_on/off methods for KNX climate entities (#117882)
Add async_turn_on/off methods for KNX climate entities
2024-05-21 23:54:43 +02:00
Sid
c2b3bf3fb9 Enable Ruff RET502 (#115139) 2024-05-21 22:19:33 +02:00
Paulus Schoutsen
ff2b851683 Make Google AI model picker a dropdown (#117878) 2024-05-21 22:13:07 +02:00
Paulus Schoutsen
f21226dd0e Address late feedback Google LLM (#117873) 2024-05-21 20:11:18 +02:00
mkmer
2a9b31261c Add missing placeholder name to reauth (#117869)
add placeholder name to reauth
2024-05-21 12:57:23 -04:00
Michael Hansen
8079cc0464 Add description to intent handlers and use in LLM helper (#117864) 2024-05-21 12:54:34 -04:00
wittypluck
0c37a065ad Add support for Glances v4 (#117664) 2024-05-21 16:21:36 +02:00
J. Nick Koston
0112c7fcfd Small speed up to logbook humanify (#117854) 2024-05-21 09:10:20 -04:00
J. Nick Koston
e12d23bd48 Speed up async_get_loaded_integrations (#117851)
* Speed up async_get_loaded_integrations

Use a setcomp and difference to find the components to split
to avoid the loop. A setcomp is inlined in python3.12 so its
much faster

* Speed up async_get_loaded_integrations

Use a setcomp and difference to find the components to split
to avoid the loop. A setcomp is inlined in python3.12 so its
much faster

* simplify

* fix compat

* bootstrap

* fix tests
2024-05-21 09:08:49 -04:00
J. Nick Koston
266ce9e268 Cache area registry JSON serialize (#117847)
We already cache the entity and device registry, but since I never
used area until recently I did not have enough to notice that they
were not cached
2024-05-21 09:03:31 -04:00
J. Nick Koston
905692901c Simplify service description cache logic (#117846) 2024-05-21 09:02:32 -04:00
J. Nick Koston
e8fc4e0f19 Small speed up to adding event bus listeners (#117849) 2024-05-21 13:52:44 +02:00
epenet
bfffcc3ad6 Simplify samsungtv unload (#117838) 2024-05-21 10:01:52 +02:00
epenet
54d048fb11 Remove silver integrations from NO_DIAGNOSTICS (#117840) 2024-05-21 10:01:13 +02:00
Bernardus Jansen
d5e0ffc4d8 Tesla Wall Connector fix spelling error/typo (#117841) 2024-05-21 10:00:29 +02:00
Robert Resch
5e3483ac3c Use uv instead of pip in development env (#113517) 2024-05-21 09:56:31 +02:00
Marc Mueller
d44f949b19 Use PEP 695 misc (2) (#117814) 2024-05-21 09:45:57 +02:00
J. Nick Koston
c1b4c977e9 Convert solax to use DataUpdateCoordinator (#117767) 2024-05-21 09:44:10 +02:00
Thomas55555
bb758bcb26 Bump aioautomower to 2024.5.1 (#117815) 2024-05-21 09:43:36 +02:00
Marc Mueller
58d0ac7f21 Remove future import to fix broken typing.get_type_hints call (#117837) 2024-05-21 09:39:47 +02:00
J. Nick Koston
508cc2e5a1 Remove @ from codeowners when downloading diagnostics (#117825)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-21 09:32:07 +02:00
Bernardus Jansen
d0b1ac6918 Tesla wall connector add sensors (#117769) 2024-05-21 09:30:24 +02:00
dependabot[bot]
0fb78b3ab3 Bump github/codeql-action from 3.25.5 to 3.25.6 (#117835)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:29:06 +02:00
epenet
aaa5df9981 Refactor SamsungTV auth check (#117834) 2024-05-21 09:14:17 +02:00
dependabot[bot]
ae0988209b Bump codecov/codecov-action from 4.4.0 to 4.4.1 (#117836)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 09:09:53 +02:00
Allen Porter
fc931ac449 Stop the nest subscriber on Home Assistant stop (#117830) 2024-05-20 22:59:11 -07:00
Marc Mueller
9cbcf5f2a5 Improve zwave_js TypeVar usage (#117810)
* Improve zwave_js TypeVar usage

* Use underscore for TypeVar name
2024-05-21 07:42:07 +02:00
Marc Mueller
26fb7627ed Update scaffold templates to use runtime_data (#117819) 2024-05-21 07:15:08 +02:00
J. Nick Koston
c9d1b127d8 Improve error message when template is rendered from wrong thread (#117822)
* Improve error message when template is rendered from wrong thread

* Improve error message when template is rendered from wrong thread
2024-05-20 23:26:48 -04:00
J. Nick Koston
58210b1968 Bump tesla-powerwall to 0.5.2 (#117823) 2024-05-20 16:51:39 -10:00
J. Nick Koston
7c58f05898 Bump dbus-fast to 2.21.3 (#117824) 2024-05-20 16:27:02 -10:00
puddly
4dc670056c Account for disabled ZHA discovery config entries when migrating SkyConnect integration (#117800)
* Properly handle disabled ZHA discovery config entries

* Update tests/components/homeassistant_sky_connect/test_util.py

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>

---------

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-05-20 21:35:57 -04:00
J. Nick Koston
7714f807b4 Detect incorrect exception in forwarded platforms (#117754)
* Detect incorrect exception in forwarded platforms

If an integration raises ConfigEntryError/ConfigEntryAuthFailed/ConfigEntryAuthFailed
in a forwarded platform it would affect the state of the config entry and cause it to
process unloads and setup retries in while the other platforms continued to setup

* Detect incorrect exception in forwarded platforms

If an integration raises ConfigEntryError/ConfigEntryAuthFailed/ConfigEntryAuthFailed
in a forwarded platform it would affect the state of the config entry and cause it to
process unloads and setup retries in while the other platforms continued to setup

* Update homeassistant/config_entries.py

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>

* adjust

* fix

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-20 20:01:59 -04:00
MatthewFlamm
4d447ee0a7 Bump pynws to 1.8.1 for nws (#117820) 2024-05-20 10:43:31 -10:00
Marc Mueller
bc2ee96cae Remove quotes surrounding annotations (#117817) 2024-05-20 22:06:58 +02:00
Marc Mueller
1ad8151bd1 Use PEP 695 type alias in tests (#117797) 2024-05-20 19:03:04 +02:00
Michael Hansen
e8aa4b069a Unpause media players that were paused outside voice (#117575)
* Unpause media players that were paused outside voice

* Use time.time()

* Update last paused as media players change state

* Add sleep to test

* Use context

* Implement suggestions
2024-05-20 11:02:36 -05:00
Marc Mueller
32bf02479b Enable UP040 ruff check (#117792) 2024-05-20 15:57:03 +02:00
Franck Nijhof
7f92ee5e04 Update wled to 0.18.0 (#117790) 2024-05-20 14:49:52 +03:00
Marc Mueller
7998f874c0 Use PEP 695 for function annotations with scoping (#117787) 2024-05-20 12:43:39 +02:00
Marc Mueller
f50973c76c Use PEP 695 misc (#117788) 2024-05-20 12:01:49 +02:00
Marc Mueller
649981e503 Update mypy-dev to 1.11.0a3 (#117786) 2024-05-20 11:40:55 +02:00
Marlon
2809070e85 Set integration_type to device for apsystems integration (#117782) 2024-05-20 11:13:08 +02:00
epenet
1bf7a4035c Downgrade tellduslive quality scale to silver (#117784) 2024-05-20 11:07:26 +02:00
epenet
ae5769dc50 Downgrade point quality scale to silver (#117783) 2024-05-20 11:06:56 +02:00
J. Nick Koston
5a609c34bb Fix blocking I/O in the event loop when loading timezones (#117721) 2024-05-20 11:06:03 +02:00
Marc Mueller
0293315b23 Use PEP 695 for covariant class annotations (#117780) 2024-05-20 10:55:44 +02:00
Marc Mueller
f76842d7db Use PEP 695 for hass_dict annotations (#117779) 2024-05-20 10:46:50 +02:00
Marc Mueller
7b27101f8a Use PEP 695 for class annotations (3) (#117777) 2024-05-20 10:46:01 +02:00
Marc Mueller
8f0fb4db3e Use PEP 695 for class annotations (4) (#117778) 2024-05-20 10:44:52 +02:00
Marc Mueller
eedce95bc9 Use PEP 695 for class annotations (2) (#117776) 2024-05-20 10:43:59 +02:00
Marc Mueller
b93312b62c Use PEP 695 for class annotations (1) (#117775) 2024-05-20 10:42:57 +02:00
epenet
3f15b44a11 Move environment_canada coordinator to separate module (#117426) 2024-05-20 10:00:01 +02:00
Marc Mueller
e48cf6fad2 Update pylint to 3.2.2 (#117770) 2024-05-20 09:59:22 +02:00
J. Nick Koston
149120b749 Add setup time detail to diagnostics (#117766) 2024-05-20 09:52:28 +02:00
J. Nick Koston
13ba8e62a9 Fix race in config entry setup (#117756) 2024-05-20 09:47:47 +02:00
J. Nick Koston
d11003ef12 Block older versions of custom integration mydolphin_plus since they cause crashes (#117751) 2024-05-20 09:45:52 +02:00
J. Nick Koston
fe769c4527 Fix missing type for mqtt websocket wrapper (#117752) 2024-05-20 09:32:50 +02:00
epenet
570d5f2b55 Add turn_on to SamsungTV remote (#117403)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-19 20:14:20 -10:00
Ricardo Steijn
14f1e8c520 Bump crownstone-sse to 2.0.5, crownstone-cloud to 1.4.11 (#117748) 2024-05-19 19:18:28 -10:00
Alberto Geniola
9fab2aa2bc Update elmax_api to v0.0.5 (#117693)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-19 19:16:46 -10:00
Denis Shulyaka
c3196a5667 LLM Tools support for Google Generative AI integration (#117644)
* 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>
2024-05-19 22:11:25 -04:00
J. Nick Koston
ac3321cef1 Fix setting MQTT socket buffer size with WebsocketWrapper (#117672) 2024-05-19 14:09:21 -10:00
Jan-Philipp Benecke
99565bef27 Bump pydiscovergy to 3.0.1 (#117740) 2024-05-19 20:56:58 +02:00
Maciej Bieniek
826f6c6f7e Refactor tests for Brother integration (#117377)
* Refactor tests - step 1

* Remove fixture

* Refactor test_init

* Refactor test_diagnostics

* Refactor test_config_flow

* Increase test coverage

* Cleaning

* Cleaning

* Check config entry state in test_async_setup_entry

* Simplify patching

* Use AsyncMock when patching

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-19 20:41:47 +02:00
Anrijs
d2008ffdd7 Bump aranet4 to 2.3.4 (#117738)
bump aranet4 lib version to 2.3.4
2024-05-19 21:08:39 +03:00
Guido Schmitz
e68bf623a7 Use reauth helper in devolo Home Control (#117739) 2024-05-19 19:31:19 +02:00
Joost Lekkerkerker
1b105a3c97 Use helper in Withings reauth (#117727) 2024-05-19 19:25:31 +02:00
Shay Levy
d84890bc59 Bump aioshelly to 10.0.0 (#117728) 2024-05-19 19:25:12 +02:00
Guido Schmitz
38f0c47942 Use reauth helper in devolo Home Network (#117736) 2024-05-19 19:23:30 +02:00
Jake Martin
cc60fc6d9f Bump monzopy to 1.2.0 (#117730) 2024-05-19 15:37:25 +02:00
jjlawren
b8c5dcaeef Bump PlexAPI to 4.15.13 (#117712) 2024-05-19 11:36:25 +02:00
Maciej Bieniek
da42a8e1c6 Use SnmpEngine stored in hass.data by singleton in Brother integration (#117043) 2024-05-19 11:33:21 +02:00
Paulus Schoutsen
d001e7daea Add API class to LLM helper (#117707)
* Add API class to LLM helper

* Add more tests

* Rename intent to assist to broaden scope
2024-05-18 21:14:05 -04:00
Shay Levy
bfc52b9fab Avoid Shelly RPC reconnect during device shutdown (#117702) 2024-05-19 02:05:51 +03:00
Paulus Schoutsen
c59010c499 Remove AngellusMortis as code-owner Unifi Protect (#117708) 2024-05-18 22:54:00 +02:00
Paulus Schoutsen
98330162e9 Add GitHub CoPilot to extensions devcontainer (#117699) 2024-05-18 22:30:22 +02:00
Michael
6d3cafb43b Move entity definitions into own module in AVM Fritz!Tools (#117701)
* move entity definitions into own module

* merge entity description mixin

* add entity.py to .coveragerc
2024-05-18 22:25:25 +02:00
Michael
a983a8c6d8 Consider only active config entries as media source in Synology DSM (#117691)
consider only active config entries as media source
2024-05-18 16:38:22 +02:00
epenet
d81bb8cdcd Allow manual delete of stale Renault vehicles (#116229) 2024-05-18 13:46:38 +02:00
Ville Skyttä
a27cc24da2 Filter out HTML greater/less than entities from huawei_lte sensor values (#117209) 2024-05-18 13:45:42 +02:00
epenet
3a8bdfbfdf Use remove_device helper in tasmota tests (#116617) 2024-05-18 13:43:21 +02:00
Joost Lekkerkerker
1d16e219e4 Refactor Aurora tests (#117323) 2024-05-18 13:40:30 +02:00
Sid
54ba393be8 Add __pycache__ to gitignore (#114056) 2024-05-18 13:30:03 +02:00
Brett Adams
1b0c91fa4d Improve diagnostics in Teslemetry (#117613) 2024-05-18 13:27:23 +02:00
Joost Lekkerkerker
b39028acf2 Improve Monzo tests (#117036) 2024-05-18 13:20:08 +02:00
epenet
4dad9c8859 Move plenticore coordinators to separate module (#117491) 2024-05-18 13:11:22 +02:00
Joost Lekkerkerker
c38539b368 Use generator expression in poolsense (#117582) 2024-05-18 13:10:06 +02:00
Marc Mueller
10dfa91e54 Remove useless TypeVars (#117687) 2024-05-18 12:58:51 +02:00
Marc Mueller
97a4101900 Use PEP 695 for dispatcher helper typing (#117685) 2024-05-18 12:47:03 +02:00
Bouwe Westerdijk
fe6df8db1e Add options-property to Plugwise Select (#117655) 2024-05-18 12:39:58 +02:00
Marc Mueller
3cd1717437 Improve YieldFixture typing (#117686) 2024-05-18 12:35:02 +02:00
Marc Mueller
26a599ad11 Use PEP 695 for function annotations (1) (#117658) 2024-05-18 11:45:54 +02:00
Marc Mueller
900b6211ef Use PEP 695 for function annotations (2) (#117659) 2024-05-18 11:44:39 +02:00
Marc Mueller
4cf0a3f154 Use PEP 695 for function annotations (3) (#117660) 2024-05-18 11:43:32 +02:00
Marc Mueller
34ea781031 Use PEP 695 for decorator typing with type aliases (1) (#117662) 2024-05-18 11:42:39 +02:00
Marc Mueller
907b9c42e5 Use PEP 695 for decorator typing with type aliases (2) (#117663) 2024-05-18 11:41:46 +02:00
tronikos
d65437e347 Bump google-generativeai==0.5.4 (#117680) 2024-05-18 11:38:33 +02:00
On Freund
b97cf9ce42 Bump pyrisco to 0.6.2 (#117682) 2024-05-18 11:37:24 +02:00
Maciej Bieniek
fe65ef72a7 Add missing string reconfigure_successful for NAM reconfigure flow (#117683)
Add missing string reconfigure_successful

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-18 11:24:39 +02:00
David Knowles
034197375c Clean up some bad line wrapping in Hydrawise (#117671)
Fix some bad line wrapping
2024-05-18 10:26:22 +02:00
epenet
a904557bbb Move philips_js coordinator to separate module (#117561) 2024-05-18 10:21:22 +02:00
epenet
7ceaf2d3f0 Move tomorrowio coordinator to separate module (#117537)
* Move tomorrowio coordinator to separate module

* Adjust imports
2024-05-18 09:01:50 +02:00
Christopher Tremblay
b015dbfccb Add AlarmDecoder device info (#117357)
* Update AlarmDecoder component to newer model

This commit makes AlarmDecoder operate as a proper device entity following the new model introduced a few years ago.

Code also has an internal dependency on a newer version of adext (>= 0.4.3) which has been updated correspondingly.

* Created AlarmDecoder entity

Added an alarmdecoder entity so the device_info can be re-used across the integration

* Move _attr_has_entity_name to base entity

As per code review suggestion, clean up the object model.

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

* Missed one suggestion with the prior commit

Moves _attr_has_entity_name to base entity

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

* Address some ruff issues

* Apply additional ruff cleanups

Ran ruff again to clean up a few files tat weren't picked up last time

* Apply suggestions from code review

Some additional cleanup of style & removal of unnecessary code

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

* Properly generated the integration file

generation had to happen twice for this to work.  Now that it's generated, I'm including the missing update.

* Apply suggestions from code review

Use local client variable instead of self._client

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

* Sort the manifest

documentation was added, but it wasn't sorted properly in the key/value pairs

* Add alarmdecoder entity file to coverage ignore file

Added the alarmdecoder entity file so it is ignored for coverage

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-18 08:59:44 +02:00
Mr. Bubbles
2b195cab72 Fix Habitica doing blocking I/O in the event loop (#117647) 2024-05-17 21:06:26 -04:00
Maikel Punie
3efdeaaa77 Bump pyduotecno to 2024.5.1 (#117643) 2024-05-17 18:37:59 +02:00
Allen Porter
caa35174cb Add Google Gen AI Conversation Agent Entity (#116362)
* Add Google Gen AI Conversation Agent Entity

* Rename agent to entity

* Revert ollama changes

* Don't copy service tests to conversation_test.py

* Move logger and cleanup snapshots

* Move property after init

* Set logger to use package

* Cleanup hass from constructor

* Fix merges

* Revert ollama change
2024-05-17 11:00:11 -04:00
epenet
fce4263493 Move p1_monitor coordinator to separate module (#117562) 2024-05-17 16:34:47 +02:00
Marc Mueller
c41962455e Use PEP 695 for decorator typing (2) (#117639) 2024-05-17 16:31:01 +02:00
Marc Mueller
25d1ca747b Use PEP 695 for decorator typing (3) (#117640) 2024-05-17 16:27:32 +02:00
Marc Mueller
34bd291615 Use PEP 695 for decorator typing (1) (#117638) 2024-05-17 16:27:02 +02:00
epenet
067c9e63e9 Adjust bootstrap script to use correct version of pre-commit (#117621) 2024-05-17 16:18:44 +02:00
Joost Lekkerkerker
9cf8e49b01 Fix icons and strings in Balboa (#117618) 2024-05-17 16:17:36 +02:00
epenet
a29a0a36e5 Move elmax coordinator to separate module (#117425) 2024-05-17 16:02:19 +02:00
epenet
bbcbf57117 Add snapshot tests to elmax (#117637)
* Add snapshot tests to elmax

* Rename test methods

* Re-generate
2024-05-17 15:55:38 +02:00
Marc Mueller
44049c34f9 Use PEP 695 type alias for ConfigEntry types (#117632) 2024-05-17 15:42:58 +02:00
Joost Lekkerkerker
0b8a5ac9ad Add snapshot tests to Balboa (#117620) 2024-05-17 15:38:39 +02:00
epenet
081bf1cc39 Move modern_forms coordinator to separate module (#117610) 2024-05-17 15:19:40 +02:00
Bas Brussee
658c1f3d97 Fix Tibber sensors state class (#117085)
* set correct state classes

* revert bool to pass mypy locally
2024-05-17 09:10:08 -04:00
tronikos
a7ca36e88c Android TV Remote: Mention the TV will turn on in the reauth flow (#117548)
* Update strings.json

* Remove duplicate space

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-05-17 09:05:46 -04:00
Franck Nijhof
3dc3de95fa 2024.5.4 (#117631) 2024-05-17 15:04:13 +02:00
Marc Mueller
87bb7ced79 Use PEP 695 for simple type aliases (#117633) 2024-05-17 14:42:21 +02:00
Franck Nijhof
5c8f7fe52a Fix rc pylint warning for Home Assistant Analytics (#117635) 2024-05-17 14:13:10 +02:00
Franck Nijhof
8896d134e9 Bump version to 2024.5.4 2024-05-17 13:45:47 +02:00
Robert Svensson
f043b2db49 Improve syncing light states to deCONZ groups (#117588) 2024-05-17 13:45:03 +02:00
Joost Lekkerkerker
5cd101d2b1 Fix poolsense naming (#117567) 2024-05-17 13:45:00 +02:00
Joost Lekkerkerker
ab9ed0eba4 Handle uncaught exceptions in Analytics insights (#117558) 2024-05-17 13:44:57 +02:00
starkillerOG
4548ff619c Bump reolink-aio to 0.8.10 (#117501) 2024-05-17 13:44:53 +02:00
Erik Montnemery
b1746faa47 Fix API creation for passwordless pi_hole (#117494) 2024-05-17 13:43:50 +02:00
starkillerOG
615ae780ca Reolink fix not unregistering webhook during ReAuth (#117490) 2024-05-17 13:38:56 +02:00
J. Nick Koston
b86513c3a4 Fix non-thread-safe state write in tellduslive (#117487) 2024-05-17 13:38:51 +02:00
Maikel Punie
970ad8c07c Bump pyduotecno to 2024.5.0 (#117446) 2024-05-17 13:38:48 +02:00
Franck Nijhof
819e9860a8 Update wled to 0.17.1 (#117444) 2024-05-17 13:38:44 +02:00
mk-81
e7ff552de6 Fix Kodi on/off status (#117436)
* Fix Kodi Issue 104603

Fixes issue, that Kodi media player is displayed as online even when offline. The issue occurrs when using HTTP(S) only (no web Socket) integration after kodi was found online once.
Issue: In async_update the connection exceptions from self._kodi.get_players are not catched and therefore self._players (and the like) are not reset. The call of self._connection.connected returns always true for HTTP(S) connections.

Solution: Catch Exceptions from self._kodi.get_players und reset state in case of HTTP(S) only connection. Otherwise keep current behaviour.

* Fix Kodi Issue 104603 / code style adjustments

as requested
2024-05-17 13:38:41 +02:00
Jiaqi Wu
f48f8eefe7 Fix Lutron Serena Tilt Only Wood Blinds set tilt function (#117374) 2024-05-17 13:38:38 +02:00
J. Nick Koston
c90818e10c Fix squeezebox blocking startup (#117331)
fixes #117079
2024-05-17 13:38:33 +02:00
tronikos
642a6b44eb Call Google Assistant SDK service using async_add_executor_job (#117325) 2024-05-17 13:38:30 +02:00
Joost Lekkerkerker
bca20646bb Fix Aurora naming (#117314) 2024-05-17 13:38:26 +02:00
Jan Bouwhuis
dba4785c9b Increase MQTT broker socket buffer size (#117267)
* Increase MQTT broker socket buffer size

* Revert unrelated change

* Try to increase buffer size

* Set INITIAL_SUBSCRIBE_COOLDOWN back to 0.5 sec

* Sinplify and add test

* comments

* comments

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-17 13:38:23 +02:00
Raman Gupta
57cf91a8d4 Fix zwave_js discovery logic for node device class (#117232)
* Fix zwave_js discovery logic for node device class

* simplify check
2024-05-17 13:38:19 +02:00
jjlawren
17c6a49ff8 Bump SoCo to 0.30.4 (#117212) 2024-05-17 13:38:17 +02:00
Tom Harris
5941cf05e4 Fix issue changing Insteon Hub configuration (#117204)
Add Hub version to config schema
2024-05-17 13:38:14 +02:00
Thomas55555
a53b8cc0e2 Add reauth for missing token scope in Husqvarna Automower (#117098)
* Add repair for wrong token scope to Husqvarna Automower

* avoid new installations with missing scope

* tweaks

* just reauth

* texts

* Add link to correct account

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add comment

* directly assert mock_missing_scope_config_entry.state is loaded

* assert that a flow is started

* pass complete url to strings and simplify texts

* shorten long line

* address review

* simplify tests

* grammar

* remove obsolete fixture

* fix test

* Update tests/components/husqvarna_automower/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* test if reauth flow has started

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-17 13:38:11 +02:00
Michal Čihař
9d25d228ab Reduce update interval in Ondilo Ico (#116989)
Ondilo: reduce update interval

The API seems to have sticter rate-limiting and frequent requests fail
with HTTP 400.

Fixes #116593
2024-05-17 13:38:08 +02:00
tronikos
652ee1b90d Avoid exceptions when Gemini responses are blocked (#116847)
* Bump google-generativeai to v0.5.2

* Avoid exceptions when Gemini responses are blocked

* pytest --snapshot-update

* set error response

* add test

* ruff
2024-05-17 13:38:05 +02:00
Thomas55555
afb5e622cd Catch auth exception in husqvarna automower (#115365)
* Catch AuthException in Husqvarna Automower

* don't use getattr

* raise ConfigEntryAuthFailed
2024-05-17 13:38:01 +02:00
Maikel Punie
4501658a16 Mark Duotecno entities unavailable when tcp goes down (#114325)
When the tcp connection to the duotecno smartbox goes down, mark all entities as unavailable.
2024-05-17 13:37:58 +02:00
amura11
52147e5196 Fix Fully Kiosk set config service (#112840)
* Fixed a bug that prevented setting Fully Kiosk config values using a template

* Added test to cover change

* Fixed issue identified by Ruff

* Update services.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-17 13:37:52 +02:00
Marc Mueller
4edee94a81 Update mypy-dev to 1.11.0a2 (#117630) 2024-05-17 13:32:20 +02:00
epenet
eacbebce22 Prevent const.py in coverage ignore list (#117625) 2024-05-17 12:53:58 +02:00
Joost Lekkerkerker
098ba125d1 Extract Monzo coordinator in separate module (#117034) 2024-05-17 12:40:19 +02:00
epenet
addc4a84ff Rename hassio coordinator module (#117611) 2024-05-17 12:10:21 +02:00
epenet
ac62faee23 Bump pre-commit to 3.7.1 (#117619) 2024-05-17 11:44:51 +02:00
starkillerOG
abe83f5515 Fix Reolink battery translation_key unneeded (#117616) 2024-05-17 09:09:01 +02:00
dependabot[bot]
1589226618 Bump actions/checkout from 4.1.4 to 4.1.6 (#117612)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 08:45:23 +02:00
Robert Svensson
bbfc2456ec Improve syncing light states to deCONZ groups (#117588) 2024-05-17 08:44:09 +02:00
J. Nick Koston
48ea15cc6e Fix dlna_dmr task flood when player changes state (#117606) 2024-05-17 08:40:14 +02:00
epenet
bbf86335be Move opengarage coordinator to separate module (#117608) 2024-05-17 08:05:43 +02:00
epenet
407d0f88f0 Rename openweathermap coordinator module (#117609) 2024-05-17 08:05:11 +02:00
Tom Harris
9420e041ac Fix issue changing Insteon Hub configuration (#117204)
Add Hub version to config schema
2024-05-16 21:45:03 -04:00
Robert Svensson
0e3c0ccfd8 Remove old deCONZ entity cleanup (#117590) 2024-05-16 21:42:09 -04:00
Robert Svensson
657b3ceedc Rework deCONZ services to load once and never unload (#117592)
* Rework deCONZ services to load once and never unload

* Fix hassfest
2024-05-16 21:41:23 -04:00
Marc Mueller
4300ff6b60 Mark HassJob target as Final (#117578) 2024-05-17 00:01:07 +02:00
MatthewFlamm
121aa158c9 Use config entry runtime_data in nws (#117593) 2024-05-16 23:14:44 +02:00
starkillerOG
f788f88052 Add Reolink battery entities (#117506)
* add battery sensors

* Disable Battery Temperature and State by default

* fix mypy

* Use device class for icon
2024-05-16 21:41:19 +02:00
Joost Lekkerkerker
68b7302cdc Add Poolsense platform tests (#117579) 2024-05-16 21:35:00 +02:00
MatthewFlamm
9aa7d3057b Add diagnostics for nws (#117587)
* add diagnostics

* remove hassfezt exception
2024-05-16 21:26:22 +02:00
Chris Talkington
5635bcce86 Bump pyipp to 0.16.0 (#117583)
bump pyipp to 0.16.0
2024-05-16 13:04:35 -05:00
Joost Lekkerkerker
cd8dac65b3 Refactor Poolsense config flow tests (#117573) 2024-05-16 17:51:57 +02:00
Maciej Bieniek
789073384b Support reconfigure flow in Shelly integration (#117525)
* Support reconfigure flow

* Update strings

* Add tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-16 17:47:12 +02:00
epenet
996132f3f8 Ensure gold and platinum integrations implement diagnostic (#117565) 2024-05-16 11:33:23 -04:00
Joost Lekkerkerker
0335a01fba Use runtime data in Poolsense (#117570) 2024-05-16 17:31:14 +02:00
Joakim Sørensen
535aa05c65 Update hass-nabucasa dependency to version 0.81.0 (#117568) 2024-05-16 11:08:01 -04:00
epenet
d670f1d81d Move pure_energie coordinator to separate module (#117560) 2024-05-16 16:51:25 +02:00
Michael Hansen
e168cb96e9 Add area filter and rounded time to timers (#117527)
* Add area filter

* Add rounded time to status

* Fix test

* Extend test

* Increase test coverage
2024-05-16 09:45:14 -05:00
Joost Lekkerkerker
ba395fb9f3 Fix poolsense naming (#117567) 2024-05-16 16:42:40 +02:00
epenet
d019c25ae4 Move pvpc coordinator to separate module (#117559) 2024-05-16 16:06:50 +02:00
dfaour
6f5e820090 Improve recorder statistics error messages (#113498)
* Update statistics.py

Added more detail error descriptions to make debugging easier

* Update statistics.py

formatting corrected
2024-05-16 13:44:03 +02:00
Joost Lekkerkerker
4cded378bf Handle uncaught exceptions in Analytics insights (#117558) 2024-05-16 13:43:03 +02:00
epenet
59645aeb0f Move risco coordinator to separate module (#117549) 2024-05-16 13:29:57 +02:00
epenet
388132cfc8 Move rainforest_eagle coordinator to separate module (#117556) 2024-05-16 12:57:20 +02:00
Simone Chemelli
32a9cb4b14 Add Shelly motion sensor switch (#115312)
* Add Shelly motion sensor switch

* update name

* make motion switch a restore entity

* add test

* apply review comment

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* rename switch

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* Update tests/components/shelly/test_switch.py

Co-authored-by: Shay Levy <levyshay1@gmail.com>

* fix ruff

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-05-16 12:49:49 +02:00
Marc Mueller
53da59a454 Replace meaningless TypeVar usage (#117553) 2024-05-16 12:48:02 +02:00
Marc Mueller
ab07bc5298 Improve ReloadServiceHelper typing (#117552) 2024-05-16 12:47:43 +02:00
Sid
9d10e42d79 Only allow ethernet and wi-fi interfaces as unique ID in webmin (#113084) 2024-05-16 12:16:13 +02:00
Jeffrey Stone
e6f5b08264 Add functionality to Mastodon (#112862)
* Adds functionality to Mastodon

* protect media type

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* update log warning

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* protect upload media

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update protected functions

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-16 12:08:50 +02:00
epenet
962dd81eb7 Move upcloud coordinator to separate module (#117536) 2024-05-16 11:45:22 +02:00
epenet
c2bf4b905c Move surepetcare coordinator to separate module (#117544) 2024-05-16 11:44:36 +02:00
Christopher Tremblay
2a540e1100 Bump adext to 0.4.3 (#117496) 2024-05-16 10:54:44 +02:00
Mischa Siekmann
481264693e Bump aioesphomeapi to 24.4.0 (#117543) 2024-05-16 10:53:00 +02:00
epenet
8bbac8040f Move gogogate2 coordinator to separate module (#117433) 2024-05-16 09:11:49 +02:00
epenet
07d289d1c6 Move switcher_kis coordinator to separate module (#117538) 2024-05-16 10:11:19 +03:00
epenet
2cd9bc1c2c Move xbox coordinator to separate module (#117421) 2024-05-16 09:10:41 +02:00
Sid
6ce1d97e7a Add Webmin filesystem sensors (#112660)
* Add Webmin filesystem sensors

* fix names

* update snapshots

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-16 09:03:35 +02:00
epenet
465e3d421e Move google coordinator to separate module (#117473) 2024-05-15 20:40:51 -07:00
J. Nick Koston
f1e8262db2 Bump bleak to 0.22.1 (#117383) 2024-05-16 12:36:27 +09:00
Michael Hansen
daee3d8db0 Don't prioritize "name" slot if it's a wildcard in default conversation agent (#117518)
* Don't prioritize "name" slot if it's a wildcard

* Fix typing error
2024-05-15 22:23:24 -04:00
Denis Shulyaka
f31873a846 Add LLM tools (#115464)
* 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>
2024-05-15 19:16:47 -04:00
Paulus Schoutsen
4aba92ad04 Fix the type of slot schema of intent handlers (#117520)
Fix the slot schema of dynamic intenet handler
2024-05-15 16:45:15 -04:00
Paulus Schoutsen
a95baf0d39 Set integration type for wyoming (#117519)
* Set integration type to wyoming

* Add entry_type
2024-05-15 16:17:49 -04:00
Jan-Philipp Benecke
5e194b8a82 Do not register mqtt mock config flow with handlers (#117521) 2024-05-15 16:17:27 -04:00
epenet
0a625baeed Rename fritz coordinator module (#117440)
* Rename fritz coordinator module

* Update .coveragerc

* Adjust .coveragerc

* Adjust coverage

* Adjust coverage
2024-05-15 21:58:29 +02:00
IceBotYT
ebb02a7081 Add light platform to Linear garage door (#111426)
* Add light platform

* Fix light test

* Suggestions by CFenner

* Fix tests

* More fixes

* Revert test changes

* Undo base entity

* Rebase

* Fix to use base entity

* Fix name

* More fixes

* Fix tests

* Add translation key

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-15 21:43:31 +02:00
starkillerOG
38c2688ec2 Add Reolink PIR entities (#117507)
* Add PIR entities

* fix typo
2024-05-15 21:10:52 +02:00
Matthias Alphart
ec4c8ae228 Allow templates for enabling actions (#117049)
* Allow templates for enabling automation actions

* Use `cv.template` instead of `cv.template_complex`

* Rename test function
2024-05-15 21:03:52 +02:00
Matthias Alphart
076f57ee07 Allow templates for enabling conditions (#117047)
* Allow templates for enabling automation conditions

* Use `cv.template` instead of `cv.template_complex`
2024-05-15 21:03:28 +02:00
epenet
aa2485c7b9 Move vallox coordinator to separate module (#117503)
* Move vallox coordinator to separate module

* Move logic into coordinator class

* Adjust
2024-05-15 21:01:21 +02:00
epenet
2c6071820e Move vizio coordinator to separate module (#117498) 2024-05-15 21:00:21 +02:00
Marlon
3604a34823 Post review comments on APsystems (#117504)
* Cleanup for apsystems and fix for strings

* Migrate to typed ConfigEntry Data for apsystems

* Improve strings for apsystems

* Improve config flow tests for apsystems by cleaning up fixtures

* Do not use Dataclass for Config Entry Typing

* Improve translations for apsystems by using sentence case and removing an apostrophe

* Rename test fixture and remove unnecessary comment in tests from apsystems

* Remove default override with default in coordinator from apsystems
2024-05-15 19:56:12 +02:00
Brett Adams
4125b6e15f Add select platform to Teslemetry (#117422)
* Add select platform

* Add tests

* Tests WIP

* Add tests

* Update homeassistant/components/teslemetry/select.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/teslemetry/select.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* use references

* Fix typo

* Update homeassistant/components/teslemetry/select.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Update homeassistant/components/teslemetry/select.py

Co-authored-by: G Johansson <goran.johansson@shiftit.se>

* Make less confusing for @joostlek

* Update homeassistant/components/teslemetry/select.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/teslemetry/select.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-15 18:17:28 +02:00
Åke Strandberg
c4c96be880 Add alarm and connectivity binary_sensors to myuplink (#111643)
* Add alarm and connectivity binary_sensors

* Get is_on for correct system

* Make coverage 100% in binary_sensor

* Address review comments

* Revert dict comprehension for now
2024-05-15 17:13:56 +02:00
Anil Daoud
8eaf471dd2 Improve error handing in kaiterra data retrieval when no aqi data is present (#112885)
* Update api_data.py

change log level on typeerror on line 103 from error to debug, it occurs too often to be useful as an error

* Update api_data.py

restore error level and add a type check instead

* Update homeassistant/components/kaiterra/api_data.py

actually filter for aqi being None rather than None or 0

Co-authored-by: Erik Montnemery <erik@montnemery.com>

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-15 16:22:58 +02:00
starkillerOG
fd8dbe0367 Bump reolink-aio to 0.8.10 (#117501) 2024-05-15 16:19:02 +02:00
Dennis Lee
4d34350f66 Add Jellyfin audio_codec optionflow (#113036)
* Fix #92419; Add Jellyfin audio_codec optionflow

* Use CONF_AUDIO_CODEC constant, clean up code based on suggestions

* Fixed typos

* Parameterize Tests

* Use parameterized test for jellyfin test media resolve

* Apply suggestions from code review

* Update homeassistant/components/jellyfin/config_flow.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-15 16:11:11 +02:00
tronikos
d2d39bce3a Android TV Remote: Support launching any app by its application ID/package name (#116906)
Bumps androidtvremote2 to 0.1.1
2024-05-15 15:48:57 +02:00
Marcel van der Veldt
5af8041c57 Fix ghost events for Hue remotes (#113047)
* Use report values for events

* adjust tests
2024-05-15 15:48:15 +02:00
epenet
4e600b7b19 Move venstar coordinator to separate module (#117500) 2024-05-15 15:18:26 +02:00
Maikel Punie
d5a1587b1c Mark Duotecno entities unavailable when tcp goes down (#114325)
When the tcp connection to the duotecno smartbox goes down, mark all entities as unavailable.
2024-05-15 15:12:47 +02:00
amura11
2a9d29c5f5 Fix Fully Kiosk set config service (#112840)
* Fixed a bug that prevented setting Fully Kiosk config values using a template

* Added test to cover change

* Fixed issue identified by Ruff

* Update services.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-15 15:01:55 +02:00
epenet
60193a3c2d Move mill coordinator to separate module (#117493) 2024-05-15 13:52:32 +02:00
epenet
4803db7cf0 Move prusalink coordinators to separate module (#117495) 2024-05-15 13:51:22 +02:00
Erik Montnemery
6ecc0ec3a1 Fix API creation for passwordless pi_hole (#117494) 2024-05-15 13:39:07 +02:00
epenet
6bd3648c77 Move melnor coordinator to separate module (#117486) 2024-05-15 12:13:05 +02:00
J. Nick Koston
37c55d81e3 Fix non-thread-safe state write in tellduslive (#117487) 2024-05-15 12:08:24 +02:00
starkillerOG
e286621f93 Reolink fix not unregistering webhook during ReAuth (#117490) 2024-05-15 12:04:12 +02:00
epenet
6c892b227b Rename mikrotik coordinator module (#117488) 2024-05-15 12:02:33 +02:00
epenet
73ed49e4b7 Remove ignore-wrong-coordinator-module in pylint CI (#117479) 2024-05-15 11:51:14 +02:00
epenet
6116caa7ed Move idasen_desk coordinator to separate module (#117485) 2024-05-15 11:26:40 +02:00
epenet
48c03a6564 Move gios coordinator to separate module (#117471) 2024-05-15 11:26:04 +02:00
Aidan Timson
65e6e1fa28 Add exception translations to System Bridge integration (#112206)
* Add exception translations to System Bridge integration

* Add translated error to coordinator

* Refactor strings.json in system_bridge component

* Sort

* Add HomeAssistantError import
2024-05-15 11:00:56 +02:00
Dave T
30f789d5e9 Set integration type for generic (#117464) 2024-05-15 09:33:47 +02:00
epenet
a36ad6bb64 Move ialarm coordinator to separate module (#117478) 2024-05-15 09:30:44 +02:00
Joost Lekkerkerker
72d873ce70 Rename add entities function in Aurora (#117480) 2024-05-15 09:27:19 +02:00
Franck Nijhof
bed31f302a Revert "Bump opower to 0.4.5 and use new account.id" (#117476) 2024-05-15 09:22:45 +02:00
Erik Montnemery
e6296ae502 Revert "Add Viam image processing integration" (#117477) 2024-05-15 09:20:40 +02:00
Renat Sibgatulin
be5d6425dc Add options flow to the airq integration (#109337)
* Add support for options to airq integration

Expose to the user the following configuration:
1. A choice between fetching from the device either:
    a. the averaged (previous and the new default behaviour) or
    b. noisy momentary sensor reading
2. A toggle to clip (spuriously) negative sensor values (default
    functionality, previously unexposed)

To those ends:
- Introduce an `OptionsFlowHandler` alongside with a listener
  `AirQCoordinator.async_set_options`
- Introduce constants to handle represent options
- Add tests and strings

* Drop OptionsFlowHandler in favour of SchemaOptionsFlowHandler

Modify `AirQCoordinator.__init__` to accommodate the change in option
handling, and drop `async_set_options` which slipped through the
previous commit.

* Ruff formatting
2024-05-15 09:13:26 +02:00
epenet
f188668d8a Rename gree coordinator module (#117474) 2024-05-15 08:57:27 +02:00
epenet
a4ceba2e0f Split homeassistant_alerts constants and coordinator (#117475) 2024-05-15 08:54:12 +02:00
dependabot[bot]
141355e776 Bump codecov/codecov-action from 4.3.1 to 4.4.0 (#117472)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 08:52:04 +02:00
J. Nick Koston
3f053eddbd Add websocket API to get list of recorded entities (#92640)
* Add API to get list of recorded entities

* update for latest codebase

* ruff

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* Update homeassistant/components/recorder/websocket_api.py

* add suggested test
2024-05-15 08:41:56 +02:00
J. Nick Koston
d29084d6fc Improve thread safety check messages to better convey impact (#117467)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-15 13:49:57 +09:00
Paulus Schoutsen
8f9273e945 Fix intent_type type (#117469) 2024-05-14 21:32:11 -07:00
Marlon
d4d30f1c46 Add integration for APsystems EZ1 microinverter (#114531)
* Add APsystems local API integration

* Fix session usage in config_flow in apsystems local api

* Remove skip check option for apsystems_loca api

* Update APsystems API dependency and increased test coverage to 100%

* Utilize EntityDescriptions for APsystems Local integration

* Ensure coverage entries are sorted (#114424)

* Ensure coverage entries are sorted

* Use autofix

* Adjust

* Add comment to coverage file

* test CI

* revert CI test

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Use patch instead of Http Mocks for APsystems API tests

* Fix linter waring for apsystemsapi

* Fix apsystemsapi test

* Fix CODEOWNERS for apsystemsapi

* Address small PR review changes for apsystems_local

* Remove wrong lines in coveragerc

* Add serial number for apsystems_local

* Remove option of custom refresh interval fro apsystems_local

* Remove function override and fix stale comments

* Use native device id and name storage instead of custom one for apsystems_local

* Use runtime_data for apsystems_local

* Don't store entry data in runtime data

* Move from apsystems_local to apsystems domain

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-05-14 22:50:25 -04:00
Scott K Logan
2590db1b6d Fix brand ID for Rainforest Automation (#113770) 2024-05-14 22:50:48 +02:00
Floris272
b4eeb00f9e Separate Blue Current timestamp sensors (#111942) 2024-05-14 22:46:31 +02:00
Dave T
03cce66f23 Set integration type for aurora_abb_powerone (#117462) 2024-05-14 22:36:15 +02:00
Ben Van Mechelen
dad9423c08 Add water meter to Youless intergration (#117452)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-05-14 21:50:38 +02:00
Michael Hansen
d441a62aa6 Remove "device_id" slot from timers (#117460)
Remove "device_id" slot
2024-05-14 15:48:24 -04:00
Ben Van Mechelen
6322821b65 Bump youless_api to 1.1.1 (#117459) 2024-05-14 21:34:50 +02:00
c0mputerguru
420afe0029 Bump opower to 0.4.5 and use new account.id (#117330) 2024-05-14 21:21:31 +02:00
Sean Chen
b6a530c405 Add PM10 sensor to AirNow (#117432) 2024-05-14 21:17:09 +02:00
Erik Montnemery
7f3d6fe1f0 Fix lying docstring in entity_platform (#117450) 2024-05-14 21:15:05 +02:00
Richard Kroegel
13e2bc7b6f Enable raising ConfigEntryAuthFailed on BMW coordinator init (#116643)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-05-14 21:14:35 +02:00
Robert Svensson
fa815234be Make UniFi use runtime data (#117457) 2024-05-14 21:04:26 +02:00
Franck Nijhof
faff5f4738 Some minor cleanups in WLED (#117453) 2024-05-14 21:02:31 +02:00
mk-81
0df9006bf7 Fix Kodi on/off status (#117436)
* Fix Kodi Issue 104603

Fixes issue, that Kodi media player is displayed as online even when offline. The issue occurrs when using HTTP(S) only (no web Socket) integration after kodi was found online once.
Issue: In async_update the connection exceptions from self._kodi.get_players are not catched and therefore self._players (and the like) are not reset. The call of self._connection.connected returns always true for HTTP(S) connections.

Solution: Catch Exceptions from self._kodi.get_players und reset state in case of HTTP(S) only connection. Otherwise keep current behaviour.

* Fix Kodi Issue 104603 / code style adjustments

as requested
2024-05-14 21:02:17 +02:00
Michael Hansen
641754e0bb Pass device_id to intent handlers (#117442) 2024-05-14 13:59:49 -05:00
Joost Lekkerkerker
d88851a85a Refactor Linear tests (#116336) 2024-05-14 20:47:14 +02:00
Michael Hansen
add6ffaf70 Add Assist timers (#117199)
* 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
2024-05-14 14:42:32 -04:00
epenet
458cc838cf Rename wemo coordinator module (#117437) 2024-05-14 20:21:50 +02:00
Andrew Sayre
223bf99ac9 Update SmartThings codeowners (#117448) 2024-05-14 19:40:39 +02:00
Josef Zweck
d0e99b62da Re-introduce webhook to tedee integration (#110247)
* bring webhook over to new branch

* change log levels

* Update homeassistant/components/tedee/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* fix minor version

* ruff

* mock config entry version

* fix

* ruff

* add cleanup during webhook registration

* feedback

* ruff

* Update __init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Update homeassistant/components/tedee/__init__.py

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* add downgrade test

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-14 19:38:58 +02:00
Ethem Cem Özkan
b684801cae Use integration fallback configuration for tado water heater fallback (#111014)
* 103619 tado water heater fallback

* extracted a method to remove code duplication

* test cases and suggested changes

* tests

* util method for connector

* Update homeassistant/components/tado/climate.py

Co-authored-by: Andriy Kushnir <me@orhideous.name>

* missing import after applies suggestion

* early return

* simplify if statements

* simplify pr

* pr requested changes

* better docstring

---------

Co-authored-by: Andriy Kushnir <me@orhideous.name>
2024-05-14 19:27:26 +02:00
Maikel Punie
ad6e6a1810 Bump pyduotecno to 2024.5.0 (#117446) 2024-05-14 19:22:13 +02:00
Franck Nijhof
c94d7b3294 Update wled to 0.17.1 (#117444) 2024-05-14 19:17:50 +02:00
epenet
3f4fd41549 Rename flo coordinator module (#117438) 2024-05-14 17:34:02 +02:00
Christopher Fenner
eca67eb901 Add ability to change heating programs for heat pumps in ViCare integration (#110924)
* heating programs

* fix heating program

* fix heating program

* remove commented code

* simplify

* Update types.py

* update vicare_programs in init
2024-05-14 17:01:34 +02:00
epenet
83f5133065 Move evil_genius_labs coordinator to separate module (#117435) 2024-05-14 10:32:41 -04:00
Denis Shulyaka
9add251b0a Add context to telegram_bot events (#109920)
* Add context for received messages events

* Add context for sent messages events

* ruff

* ruff

* ruff

* Removed user_id mapping

* Add tests
2024-05-14 15:48:59 +02:00
Robert Hillis
121966245b Bump pyefergy to 22.5.0 (#117395) 2024-05-14 15:42:41 +02:00
Diogo Gomes
450c57969a Add diagnostic platform to utility_meter (#114967)
* Add diagnostic to identify next_reset

* Add test

* add next_reset attr

* Trigger CI

* set as _unrecorded_attributes
2024-05-14 15:20:59 +02:00
J. Nick Koston
7871e9279b Adjust thread safety check messages to point to developer docs (#117392) 2024-05-14 15:20:31 +02:00
epenet
77de1b2331 Move abode service registration (#117418) 2024-05-14 15:18:45 +02:00
epenet
2e155f4de5 Move esphome coordinator to separate module (#117427) 2024-05-14 15:16:47 +02:00
Joost Lekkerkerker
92bb76ed24 Use snapshot platform helper in Flexit bacnet (#117428) 2024-05-14 15:10:21 +02:00
epenet
09fccf5188 Rename sharkiq coordinator module (#117429) 2024-05-14 15:07:19 +02:00
Matthias Alphart
bca277a027 Add knx.telegram integration specific trigger; update KNX Interface device trigger (#107592)
* Add `knx.telegram` integration specific trigger

* Move implementation to trigger.py, use it from device_trigger

* test device_trigger

* test trigger.py

* Add "incoming" and "outgoing" and handle legacy device triggers

* work with mixed group address styles

* improve coverage

* Add no-op option

* apply changed linting rules

* Don't distinguish legacy device triggers from new ones

that's now supported since frontend has fixed default values of extra_fields

* review suggestion: reuse trigger schema for device trigger extra fields

* cleanup for readability

* Remove no-op option
2024-05-14 14:45:49 +02:00
Matthias Alphart
ba48da7678 Allow templates for enabling automation triggers (#114458)
* 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
2024-05-14 14:44:21 +02:00
Marc Mueller
2a6a0e6230 Update pytest warnings filter (#117413) 2024-05-14 13:59:45 +02:00
J. Nick Koston
6d7345ea1c Speed up loading YAML (#117388)
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-05-14 13:56:42 +02:00
Nick Hehr
55bf0b6647 Add Viam image processing integration (#101786)
* feat: scaffold integration, configure client

* feat: register services, allow API key auth flow

* feat: register detection, classification services

* test(viam): add test coverage

* chore(viam): update viam-sdk version

* fix(viam): add service schemas and translation keys

* test(viam): update config flow to use new selector values

* chore(viam): update viam-sdk to 0.11.0

* feat: add exceptions translation stings

* refactor(viam): use constant keys, defer filesystem IO execution

* fix(viam): add missing constants, resolve correct image for services

* fix(viam): use lokalize string refs, resolve more constant strings

* fix(viam): move service registration to async_setup

* refactor: abstract services into separate module outside of manager

* refactor(viam): extend common vol schemas

* refactor(viam): consolidate common service values

* refactor(viam): replace FlowResult with ConfigFlowResult

* chore(viam): add icons.json for services

* refactor(viam): use org API key to connect to robot

* fix(viam): close app client if user abort config flow

* refactor(viam): run ruff formatter

* test(viam): confirm 100% coverage of config_flow

* refactor(viam): simplify manager, clean up config flow methods

* refactor(viam): split auth step into auth_api & auth_location

* refactor(viam): remove use of SelectOptionDict for auth choice, update strings

* fix(viam): use sentence case for translation strings

* test(viam): create mock_viam_client fixture for reusable mock
2024-05-14 13:35:56 +02:00
Federico D'Amico
746cfd3492 Add climate platform to microBees (#111152)
* Add climate platform to microBees

* add list comprehension

* fixes

* fixes

* fixes

* fix multiline ternary

* use a generator expression instead of filter + lambda.

* bug fixes

* Update homeassistant/components/microbees/climate.py

---------

Co-authored-by: Marco Lettieri <m.lettieri@microbees.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-14 12:11:19 +02:00
epenet
ed2c30b830 Move abode base entities to separate module (#117417) 2024-05-14 11:41:27 +02:00
Marc Mueller
09a8c06133 Update pylint to 3.1.1 (#117416) 2024-05-14 11:40:37 +02:00
epenet
438db92d86 Use ConfigEntry runtime_data in agent_dvr (#117412) 2024-05-14 11:10:40 +02:00
epenet
010ed8da9c Use ConfigEntry runtime_data in aemet (#117411) 2024-05-14 10:59:55 +02:00
Franck Nijhof
003622defd Update gotailwind to 0.2.3 (#117402) 2024-05-14 10:54:53 +02:00
dependabot[bot]
744e82f4fe Bump github/codeql-action from 3.25.4 to 3.25.5 (#117409) 2024-05-14 10:53:34 +02:00
epenet
635a89b9f9 Use ConfigEntry runtime_data in advantage_air (#117408) 2024-05-14 10:52:49 +02:00
Marc Mueller
31f980b054 Update types packages (#117407) 2024-05-14 10:48:54 +02:00
Franck Nijhof
053c898101 Update apprise to 1.8.0 (#117370) 2024-05-14 10:39:05 +02:00
Marc Mueller
d60f97262e Update uv to 0.1.43 (#117405) 2024-05-14 10:38:50 +02:00
Franck Nijhof
f5f57908dc Use ConfigEntry runtime_data in Tailwind (#117404) 2024-05-14 10:30:53 +02:00
Allen Porter
b84829f70f Import and cache supported feature enum flags only when needed (#117270)
* 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>
2024-05-13 21:07:39 -07:00
J. Nick Koston
13414a0a32 Pass loop to create_eager_task in loops from more coros (#117390) 2024-05-14 09:48:25 +09:00
J. Nick Koston
9381462877 Migrate restore_state to use the singleton helper (#117385) 2024-05-14 09:13:44 +09:00
Jiaqi Wu
728e1a2223 Fix Lutron Serena Tilt Only Wood Blinds set tilt function (#117374) 2024-05-14 09:05:12 +09:00
Thomas55555
b2996844be Add reauth for missing token scope in Husqvarna Automower (#117098)
* Add repair for wrong token scope to Husqvarna Automower

* avoid new installations with missing scope

* tweaks

* just reauth

* texts

* Add link to correct account

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update homeassistant/components/husqvarna_automower/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Add comment

* directly assert mock_missing_scope_config_entry.state is loaded

* assert that a flow is started

* pass complete url to strings and simplify texts

* shorten long line

* address review

* simplify tests

* grammar

* remove obsolete fixture

* fix test

* Update tests/components/husqvarna_automower/test_init.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* test if reauth flow has started

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-13 23:00:51 +02:00
J. Nick Koston
9c97269fad Bump dbus-fast to 2.21.2 (#117195) 2024-05-14 05:52:43 +09:00
Jan Bouwhuis
85e651fd5a Create helper for File config flow step handling (#117371) 2024-05-13 22:40:01 +02:00
Joakim Plate
f23419ed35 Update to arcam 1.5.2 (#117375) 2024-05-13 20:59:50 +02:00
Maciej Bieniek
0d09226661 Support reconfigure flow in Nettigo Air Monitor integration (#117318)
* Add reconfigure flow

* Fix input

* Add tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-13 19:17:14 +02:00
Laurence Presland
c3f95a4f7a Implement support for SwitchBot Meter, MeterPlus, and Outdoor Meter (#115522)
* Implement support for SwitchBot MeterPlus

Add temperature, humidity, and battery sensor entities for the MeterPlus device

* Rename GH username

* Update homeassistant/components/switchbot_cloud/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Refactor to use EntityDescriptions

Concat entity ID in SwitchBotCloudSensor init

* Remove __future__ import

* Make scan interval user configurable

* Add support for Meter and Outdoor Meter

* Revert "Make scan interval user configurable"

This reverts commit e256c35bb7.

* Remove device-specific default scan intervals

* Update homeassistant/components/switchbot_cloud/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/switchbot_cloud/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/switchbot_cloud/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Fix ruff errors

* Reorder manifest keys

* Update CODEOWNERS

* Add sensor.py to coveragerc

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-13 15:18:28 +02:00
Jan Bouwhuis
548eb35b79 Migrate File notify entity platform (#117215)
* Migrate File notify entity platform

* Do not load legacy notify service for new  config entries

* Follow up comment

* mypy

* Correct typing

* Only use the name when importing notify services

* Make sure a name is set on new entires
2024-05-13 11:22:13 +02:00
Erik Montnemery
0b47bfc823 Add minor version + migration to config entry store (#117350) 2024-05-13 10:16:18 +02:00
Erik Montnemery
b006aadeff Remove options from FlowResult (#117351) 2024-05-13 10:11:33 +02:00
Erik Montnemery
90ef19a255 Alphabetize some parts of config_entries (#117347) 2024-05-13 09:39:18 +02:00
Erik Montnemery
b09565b4ff Remove migration of config entry data pre version 0.73 (#117345) 2024-05-13 09:39:04 +02:00
Bouwe Westerdijk
84cc650bb3 Implement runtime data for Plugwise (#117172) 2024-05-13 09:38:06 +02:00
Erik Montnemery
d0c60ab21b Fix typo and useless default in config_entries (#117346) 2024-05-13 09:26:18 +02:00
Paulus Schoutsen
f3b694ee42 Add gh cli to dev container (#117321) 2024-05-13 15:33:42 +09:00
Brett Adams
af0dd189d9 Improve error handling in Teslemetry (#117336)
* Improvement command handle

* Add test for ignored reasons
2024-05-12 19:37:59 -07:00
Marc Hörsken
4d5ae57390 Add camera recording service to blink (#110612)
Add camera clip recording service to blink

Revival of #46598 by @fronzbot, therefore:

Co-authored-by: Kevin Fronczak <kfronczak@gmail.com>
2024-05-12 19:35:01 -07:00
Raman Gupta
61b906e29f Bump zwave-js-server-python to 0.56.0 (#117288)
* Bump zwave-js-server-python to 0.56.0

* Fix deprecation warning

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 22:19:47 -04:00
tronikos
492ef67d02 Call Google Assistant SDK service using async_add_executor_job (#117325) 2024-05-12 22:19:20 -04:00
J. Nick Koston
38ce7b15b0 Fix squeezebox blocking startup (#117331)
fixes #117079
2024-05-12 22:18:52 -04:00
J. Nick Koston
11f49280c9 Enable open protection in the event loop (#117289) 2024-05-13 08:50:31 +09:00
J. Nick Koston
d06932bbc2 Refactor asyncio loop protection to improve performance (#117295) 2024-05-13 07:01:55 +09:00
Joost Lekkerkerker
aae39759d9 Clean up aurora (#117315)
* Clean up aurora

* Fix

* Fix

* Fix
2024-05-12 21:54:32 +02:00
Joost Lekkerkerker
8ab4113b4b Fix Aurora naming (#117314) 2024-05-12 15:36:21 -04:00
Robert Hillis
0a8feae49a Add test for radarr update failure (#116882) 2024-05-12 20:23:53 +02:00
Marc Mueller
3434fb70fb Remove ConfigEntry runtime_data on unload (#117312) 2024-05-12 13:53:22 -04:00
Jan Bouwhuis
a1bc929421 Migrate Tibber notify service (#116893)
* Migrate tibber notify service

* Tests and repair flow

* Use notify repair flow helper

* Cleanup strings after using helper, use HomeAssistantError

* Add entry state assertions to unload test

* Update comment

* Update comment
2024-05-12 19:52:08 +02:00
Jan Bouwhuis
07061b14d0 Fix typo in mqtt test name (#117305) 2024-05-12 16:44:39 +02:00
Jan Bouwhuis
606a2848db Fix import on File config entry and other improvements (#117210)
* Address comments

* Remove Name option for File based sensor

* Make sure platform schema is applied
2024-05-12 15:09:54 +02:00
J. Nick Koston
c971d08454 Fix flume doing blocking I/O in the event loop (#117293)
constructing FlumeData opens files
2024-05-12 08:28:22 -04:00
Brett Adams
7509ccff40 Use entry runtime data in Teslemetry (#117283)
* runtime_data

* runtime_data

* Remove some code

* format

* Fix missing entry.runtime_data
2024-05-12 08:25:09 -04:00
J. Nick Koston
f318a3b5e2 Fix blocking I/O in the event loop to get MacOS system_info (#117290)
* Fix blocking I/O in the event look to get MacOS system_info

* split pr

* Update homeassistant/helpers/system_info.py

Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>

* Update homeassistant/helpers/system_info.py

---------

Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2024-05-12 08:16:21 -04:00
Jan Bouwhuis
65a4e5a1af Spelling of controlling in mqtt valve tests (#117301) 2024-05-12 14:06:21 +02:00
Marc Mueller
4f4389ba85 Improve bluetooth generic typing (#117157) 2024-05-12 13:15:30 +02:00
Jan Bouwhuis
92254772ca Increase MQTT broker socket buffer size (#117267)
* Increase MQTT broker socket buffer size

* Revert unrelated change

* Try to increase buffer size

* Set INITIAL_SUBSCRIBE_COOLDOWN back to 0.5 sec

* Sinplify and add test

* comments

* comments

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-12 13:13:41 +02:00
J. Nick Koston
f4e8d46ec2 Small speed ups to bootstrap tests (#117285) 2024-05-12 20:05:02 +09:00
J. Nick Koston
437fe3fa4e Fix mimetypes doing blocking I/O in the event loop (#117292)
The first time aiohttp calls mimetypes, it will load the mime.types file

We now init the db in the executor to avoid blocking the event loop
2024-05-12 10:47:52 +02:00
Ville Skyttä
34175846ff Bump upcloud-api to 2.5.1 (#117231)
Upgrade upcloud-python-api to 2.5.1

- https://github.com/UpCloudLtd/upcloud-python-api/releases/tag/v2.0.1
- https://github.com/UpCloudLtd/upcloud-python-api/releases/tag/v2.5.0
- https://github.com/UpCloudLtd/upcloud-python-api/releases/tag/v2.5.1
2024-05-12 08:10:02 +00:00
J. Nick Koston
eac4aaef10 Use a dictcomp to reconstruct DeviceInfo in the device_registry (#117286)
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
2024-05-12 08:07:12 +02:00
Erik Montnemery
0acf392a50 Use MockConfigEntry in hue tests (#117237)
Use MockConfigEntry in hue tests
2024-05-11 23:36:54 -04:00
J. Nick Koston
b061e7d1aa Small speed up to setting up integrations and config entries (#117278)
* 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
2024-05-11 22:39:20 -04:00
Abílio Costa
15825b9444 Fix docstring in Idasen Desk (#117280) 2024-05-12 09:14:52 +09:00
J. Nick Koston
481de8cdc9 Ensure config entry operations are always holding the lock (#117214)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 08:20:08 +09:00
Erik Montnemery
f55fcca0bb Tweak config_entries tests (#117242) 2024-05-11 21:45:03 +02:00
Joost Lekkerkerker
9f53c807c6 Refactor V2C tests (#117264)
* Refactor V2C tests

* Refactor V2C tests

* Refactor V2C tests

* Refactor V2C tests

* Update tests/components/v2c/conftest.py

* Refactor V2C tests
2024-05-11 21:28:37 +02:00
Jan Bouwhuis
7eb8f265fe Add shared notify service migration repair helper (#117213)
* Add shared notifiy service migration repair helper

* Delete ecobee repairs.py

* Update dependency

* Fix file test

* Fix homematic tests

* Improve tests for file  and homematic
2024-05-11 21:13:44 +02:00
Erik Montnemery
d1525b1edf Sort parameters to MockConfigEntry (#117239) 2024-05-11 14:16:29 -04:00
Erik Montnemery
35900cd579 Use mock_config_flow helper in bootstrap tests (#117240) 2024-05-11 14:11:42 -04:00
Erik Montnemery
021b057a87 Use mock_config_flow helper in config_entries tests (#117241) 2024-05-11 14:11:18 -04:00
Erik Montnemery
5c1f6aeb60 Use mock_config_flow helper in config tests (#117245) 2024-05-11 14:09:00 -04:00
Raman Gupta
1f792fc2aa Start using runtime_data for zwave_js (#117261)
* Start using runtime_data for zwave_js

* fix bug
2024-05-11 14:08:30 -04:00
Tom Harris
a892062f01 Bump pyinsteon to 1.6.1 (#117196)
* Bump pyinsteon

* Bump pyinsteon

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-11 13:41:14 -04:00
mtielen
e5f8e08d62 Bump wolf-comm to 0.0.8 (#117218) 2024-05-11 18:29:59 +02:00
hahn-th
8e71fca511 Bump homematicip to 1.1.1 (#117175) 2024-05-11 18:24:56 +02:00
Raman Gupta
9655db3d55 Fix zwave_js discovery logic for node device class (#117232)
* Fix zwave_js discovery logic for node device class

* simplify check
2024-05-11 17:41:03 +02:00
Erik Montnemery
3bea124d84 Sort asserts in config config_entries tests (#117244) 2024-05-11 17:38:07 +02:00
Erik Montnemery
813f97dedc Rename some MQTT tests (#117246) 2024-05-11 16:57:46 +02:00
Erik Montnemery
745c4aef30 Rename some rflink tests (#117247) 2024-05-11 14:18:41 +01:00
Erik Montnemery
acc78b26f7 Rename some translation helper tests (#117248) 2024-05-11 14:17:53 +01:00
Erik Montnemery
6f50c60e60 Rename some runner tests (#117249) 2024-05-11 14:16:41 +01:00
Erik Montnemery
90a50c162d Use MockConfigEntry in unifi tests (#117238) 2024-05-11 11:11:53 +02:00
J. Nick Koston
daef625985 Speed up init and finish flow (#117226)
Since every flow now has to check for single config entry, change
the check to see if a config entry exists first before calling
the _support_single_config_entry_only since _support_single_config_entry_only
has to load the integration which adds up quite a bit in test runs
2024-05-11 09:47:17 +02:00
Paul Donald
c979597ec4 Prevent shutdown fault-log trace-back (#116735)
Closes issue #116710
2024-05-11 07:59:05 +02:00
G Johansson
70a1e627b6 Add device class to Command Line cover (#117183) 2024-05-11 06:22:30 +01:00
J. Nick Koston
d7aa24fa50 Only load translations for an integration once per test session (#117118) 2024-05-11 12:00:02 +09:00
J. Nick Koston
9e107a02db Fix flakey advantage_air test (#117224) 2024-05-10 21:39:01 -05:00
Allen Porter
f35b9c2b22 Bump pyrainbird to 6.0.1 (#117217)
* Bump pyrainbird to 6.0.0

* Bump to 6.0.1
2024-05-10 19:00:08 -07:00
jjlawren
b180e14224 Bump SoCo to 0.30.4 (#117212) 2024-05-10 21:38:38 -04:00
J. Nick Koston
52cca26473 Use async_get_loaded_integration in config_entries (#117192) 2024-05-11 10:30:34 +09:00
Allen Porter
25c97a5eab Bump ical to 8.0.1 (#117219) 2024-05-10 21:25:16 -04:00
J. Nick Koston
3ad489d835 Fix flakey sonos test teardown (#117222)
https://github.com/home-assistant/core/actions/runs/9039805087/job/24843300480?pr=117214
2024-05-10 21:24:49 -04:00
J. Nick Koston
2e60e09ba2 Ensure config entry setup lock is held when removing a config entry (#117086) 2024-05-11 09:47:26 +09:00
J. Nick Koston
c74c2f3652 Add state check to config entry setup to ensure it cannot be setup twice (#117193) 2024-05-11 07:09:28 +09:00
Jan Bouwhuis
c21dac855a Fix File entry setup config parsing whole YAML config (#117206)
Fix File entry setup config parsingwhole YAML config
2024-05-10 22:05:40 +02:00
Marc-Olivier Arsenault
db6e3f7cbf Add update_without_throttle to ecobee number (#116504)
add update_without_throttle
2024-05-10 21:54:28 +02:00
Paulus Schoutsen
9b6500582a 2024.5.3 (#117203) 2024-05-10 15:08:20 -04:00
Denis Shulyaka
8168aff253 Update SetPositionIntentHandler intent schema (#116794)
Update SetPositionIntentHandler

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-10 14:33:11 -04:00
Paulus Schoutsen
e2da28fbdb Bump version to 2024.5.3 2024-05-10 18:14:24 +00:00
Robert Resch
2c8b3ac8bb Bump deebot-client to 7.2.0 (#117189) 2024-05-10 18:10:05 +00:00
Diogo Gomes
f07c00a05b Bump pytrydan to 0.6.0 (#117162) 2024-05-10 18:10:04 +00:00
Jan Bouwhuis
56b38cd842 Fix typo in xiaomi_ble translation strings (#117144) 2024-05-10 18:10:03 +00:00
J. Nick Koston
1b519a4610 Handle tilt position being None in HKC (#117141) 2024-05-10 18:10:02 +00:00
mletenay
09490d9e0a Bump goodwe to 0.3.5 (#117115) 2024-05-10 18:10:02 +00:00
Jan Bouwhuis
c0cd76b3bf Make the mqtt discovery update tasks eager and fix race (#117105)
* Fix mqtt discovery race for update rapidly followed on creation

* Revert unrelated renaming local var
2024-05-10 18:10:01 +00:00
MatthewFlamm
b9ed2dab5f Fix nws blocking startup (#117094)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-10 18:10:00 +00:00
J. Nick Koston
11f86d9e0b Improve config entry has already been setup error message (#117091) 2024-05-10 18:10:00 +00:00
mletenay
82fab7df39 Goodwe Increase max value of export limit to 200% (#117090) 2024-05-10 18:09:59 +00:00
puddly
d40689024a Add a missing addon_name placeholder to the SkyConnect config flow (#117089) 2024-05-10 18:09:58 +00:00
Arie Catsman
9e7e839f03 Bump pyenphase to 1.20.3 (#117061) 2024-05-10 18:09:57 +00:00
Chris Talkington
08ba5304fe Bump rokuecp to 0.19.3 (#117059) 2024-05-10 18:09:57 +00:00
Jan Bouwhuis
f34a0dc5ce Log an exception mqtt client call back throws (#117028)
* Log an exception mqtt client call back throws

* Supress exceptions and add test
2024-05-10 18:09:56 +00:00
J. Nick Koston
1a13e1d024 Simplify MQTT subscribe debouncer execution (#117006) 2024-05-10 18:09:55 +00:00
Marc Mueller
bee518dc78 Update jinja2 to 3.1.4 (#116986) 2024-05-10 18:09:54 +00:00
Matrix
fdc59547e0 Bump Yolink api to 0.4.4 (#116967) 2024-05-10 18:09:54 +00:00
Mr. Bubbles
57861dc091 Update strings for Bring notification service (#116181)
update translations
2024-05-10 18:09:53 +00:00
Pete Sage
624baebbaa Fix Sonos select_source timeout error (#115640) 2024-05-10 18:09:52 +00:00
Diogo Gomes
8953616d11 Bump pytrydan to 0.6.0 (#117162) 2024-05-10 19:59:28 +02:00
Denis Shulyaka
f2460a6975 Update media_player intent schema (#116793)
Update media_player/intent.py
2024-05-10 11:27:04 -04:00
Jan Bouwhuis
96ccf7f2da Log some mqtt of the discovery logging at debug level (#117185) 2024-05-10 14:49:27 +02:00
Marc Mueller
9f321642b2 Import TypedDict from typing (#117161) 2024-05-10 14:18:13 +02:00
Robert Resch
22b83657f9 Bump deebot-client to 7.2.0 (#117189) 2024-05-10 13:33:18 +02:00
Markus
ed4c3196ab Add ESPhome discovery via MQTT (#116499)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-10 13:32:42 +02:00
Brett Adams
62d70b1b10 Add energy site coordinator to Teslemetry (#117184)
* Add energy site coordinator

* Add missing string

* Add another missing string

* Aprettier
2024-05-10 12:38:20 +02:00
Jan Bouwhuis
55c4ba12f6 Migrate file integration to config entry (#116861)
* File integration entry setup

* Import to entry and tests

* Add config flow

* Exception handling and tests

* Add config flow tests

* Add issue for micration and deprecation

* Check whole entry data for uniqueness

* Revert changes change new notify entity

* Follow up on code review

* Keep name service option

* Also keep sensor name

* Make name unique

* Follow up comment

* No default timestamp needed

* Remove default name as it is already set

* Use links
2024-05-10 10:54:36 +02:00
Brett Adams
1a4e416bf4 Refactor Teslemetry integration (#112480)
* Refactor Teslemetry

* Add abstractmethod

* Remove unused timestamp const

* Ruff

* Fix

* Update snapshots

* ruff

* Ruff

* ruff

* Lint

* Fix tests

* Fix tests and diag

* Refix snapshot

* Ruff

* Fix

* Fix bad merge

* has as property

* Remove _handle_coordinator_update

* Test and error changes
2024-05-10 10:52:33 +02:00
Bertrand Roussel
11f5b48724 Add standard deviation calculation to group (#112076)
* Add standard deviation calculation to group

* Add missing bits

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-05-10 10:16:09 +02:00
RJPoelstra
8c54587d7e Improve base entity state in Vogel's MotionMount integration (#109043)
* Update device info when name changes

* Entities now report themselves as being unavailable when the MotionMount is disconnected

* Don't update device_info when name changes

* Use `device_entry` property to update device name

* Assert device is available

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Add missing import

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-10 09:58:16 +02:00
tizianodeg
d4fbaef4f6 Raise ServiceValidationError in Nibe climate services (#117171)
Fix ClimateService to rise ServiceValidationError for stack free logs
2024-05-10 09:22:20 +02:00
J. Nick Koston
4138c7a0ef Handle tilt position being None in HKC (#117141) 2024-05-10 00:47:13 -05:00
Sid
e4a3cab801 Bump ruff to 0.4.4 (#117154) 2024-05-09 22:13:11 +02:00
Thomas55555
3fa2db84f0 Catch auth exception in husqvarna automower (#115365)
* Catch AuthException in Husqvarna Automower

* don't use getattr

* raise ConfigEntryAuthFailed
2024-05-09 16:56:26 +02:00
Jan Bouwhuis
82e12052e4 Fix typo in xiaomi_ble translation strings (#117144) 2024-05-09 16:31:36 +02:00
J. Nick Koston
333d5a9251 Speed up test teardown when no config entries are loaded (#117095)
Avoid the gather call when there are no loaded config entries
2024-05-09 10:14:07 -04:00
Kevin Worrel
c1f0ebee2c Add screenlogic service tests (#116356) 2024-05-09 07:19:58 -05:00
Joost Lekkerkerker
b30a02dee6 Add base entity for Airgradient (#117135) 2024-05-09 11:12:47 +02:00
Joost Lekkerkerker
6485973d9b Add airgradient integration (#114113) 2024-05-09 10:54:29 +02:00
dependabot[bot]
32061d4eb1 Bump github/codeql-action from 3.25.3 to 3.25.4 (#117127) 2024-05-09 09:28:24 +02:00
J. Nick Koston
19c26b79af Move available property in BasePassiveBluetoothCoordinator to PassiveBluetoothDataUpdateCoordinator (#117056) 2024-05-08 17:45:57 -05:00
Marc Mueller
04c0b7d3df Use HassKey for importlib helper (#117116) 2024-05-08 17:42:28 -05:00
Luke Lashley
a77add1b77 Add better testing to vacuum platform (#112523)
* Add better testing to vacuum platform

* remove state strings

* some of the MR comments

* move MockVacuum

* remove manifest extra

* fix linting

* fix other linting

* Fix create entity calls

* Format

* remove create_entity

* change to match notify

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-09 00:33:23 +02:00
mletenay
f9413fcc9c Bump goodwe to 0.3.5 (#117115) 2024-05-09 00:17:20 +02:00
Luke Lashley
412e9bb072 Add test data for Zeo and Dyad devices to Roborock (#117054) 2024-05-09 00:16:48 +02:00
mletenay
b60c90e5ee Goodwe Increase max value of export limit to 200% (#117090) 2024-05-09 00:08:08 +02:00
Michael
12759b50cc Store runtime data inside the config entry in Tuya (#116822) 2024-05-09 00:04:26 +02:00
J. Nick Koston
89049bc022 Fix config entry _async_process_on_unload being called for forwarded platforms (#117084) 2024-05-08 23:59:37 +02:00
puddly
ac9b8cce37 Add a missing addon_name placeholder to the SkyConnect config flow (#117089) 2024-05-08 23:57:50 +02:00
Sid
fe9e5e4382 Ignore Ruff SIM103 (#115732)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:56:59 +02:00
Sid
ac54cdcdb4 Enable Ruff RUF010 (#115371)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 23:54:49 +02:00
Jan Bouwhuis
589104f63d Export MQTT subscription helpers at integration level (#116150) 2024-05-08 23:46:50 +02:00
Luke Lashley
6da432a5c3 Bump python-roborock to 2.1.1 (#117078) 2024-05-08 23:46:24 +02:00
J. Nick Koston
00150881a5 Migrate elkm1 to use config entry runtime_data (#117077) 2024-05-08 23:44:39 +02:00
J. Nick Koston
8464c95fb4 Migrate yalexs_ble to use config entry runtime_data (#117082) 2024-05-08 23:43:25 +02:00
J. Nick Koston
6eeeafa8b8 Speed up tests by making mock_get_source_ip session scoped (#117096) 2024-05-08 23:42:35 +02:00
J. Nick Koston
03dcede211 Avoid creating inner tasks to load storage (#117099) 2024-05-08 23:41:20 +02:00
J. Nick Koston
ead69af27c Avoid creating a task to clear the hass instance at test teardown (#117103) 2024-05-08 23:39:45 +02:00
J. Nick Koston
8c37b3afd7 Migrate govee_ble to use config entry runtime_data (#117076) 2024-05-08 23:22:40 +02:00
J. Nick Koston
1d833d3795 Avoid storing Bluetooth scanner in hass.data (#117074) 2024-05-08 16:08:12 -05:00
Jan Bouwhuis
840d8cb39f Add open and opening state support to MQTT lock (#117110) 2024-05-08 22:52:57 +02:00
J. Nick Koston
159f0fcce7 Migrate baf to use config entry runtime_data (#117081) 2024-05-08 22:37:14 +02:00
Jan Bouwhuis
20b29242f1 Make the mqtt discovery update tasks eager and fix race (#117105)
* Fix mqtt discovery race for update rapidly followed on creation

* Revert unrelated renaming local var
2024-05-08 21:42:11 +02:00
MatthewFlamm
6b3ffad77a Fix nws blocking startup (#117094)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-08 14:16:20 -05:00
J. Nick Koston
84a91a86a9 Improve config entry has already been setup error message (#117091) 2024-05-08 14:16:08 -05:00
tizianodeg
92b246fda9 Fix nibe_heatpump climate for models without cooling support (#114599)
* fix nibe_heatpump climate for models without cooling support

* add test for set temperature with no cooling support

* fixup use self._coil_setpoint_cool None

* fixup add new test to explicitly test unsupported cooling
2024-05-08 21:02:43 +02:00
G Johansson
7862596ef3 Add open state to LockEntity (#111968)
* Add `open` state to LockEntity

* Add tests

* Fixes

* Fix tests

* strings and icons

* Adjust demo open lock

* Fix lock and tests

* fix import

* Fix strings

* mute ruff

* Change sequence

* Sequence2

* Group on states

* Fix ruff

* Fix tests

* Add more test cases

* Sorting
2024-05-08 20:42:22 +02:00
Peter Antonvich
189c07d502 Correct state class of ecowitt hourly rain rate sensors (#110475)
* Update sensor.py for Hourly Rain Rates mm and in

hourly_rain_rate from integration ecowitt has state class total_increasing, but its state is not strictly increasing

* Update sensor.py format
2024-05-08 17:19:16 +02:00
Troon
cc99a9b62a Add an add template filter (#109884)
* 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>
2024-05-08 15:39:36 +02:00
Chris Talkington
1e35dd9f6f Bump rokuecp to 0.19.3 (#117059) 2024-05-08 08:38:44 -05:00
Luke Lashley
22bc11f397 Convert Anova to cloud push (#109508)
* current state

* finish refactor

* Apply suggestions from code review

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* address MR comments

* Change to sensor setup to be listener based.

* remove assert for websocket handler

* added assert for log

* remove mixin

* fix linting

* fix merge change

* Add clarifying comment

* Apply suggestions from code review

Co-authored-by: Erik Montnemery <erik@montnemery.com>

* Address MR comments

* bump version and fix typing check

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-08 14:53:44 +02:00
J. Nick Koston
de62e205dd Bump bleak to 0.22.0 (#116955) 2024-05-08 07:35:33 -05:00
Joost Lekkerkerker
b54077026a Bump pylutron to 0.2.13 (#117062)
* Bump pylutron to 0.2.13

* Bump pylutron to 0.2.13
2024-05-08 14:32:23 +02:00
Michael
d9ad0c101b Apply late review on Synology DSM (#117060)
keep CONF_TIMEOUT in options to allow downgrades
2024-05-08 14:30:58 +02:00
Simone Chemelli
ad05a542ae Bump aiovodafone to 0.6.0 (#117064)
bump aiovodafone to 0.6.0
2024-05-08 14:26:43 +02:00
Arie Catsman
c437d3f858 Bump pyenphase to 1.20.3 (#117061) 2024-05-08 07:02:49 -05:00
Erik Montnemery
fd8c36d93b User eager task in github config flow (#117066) 2024-05-08 11:25:57 +02:00
Sid
dc1aba0a05 Use runtime_data in webmin (#117058) 2024-05-08 09:04:20 +02:00
Maciej Bieniek
40be1424b5 Store Tractive data in config_entry.runtime_data (#116781)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-05-08 09:03:26 +02:00
Maciej Bieniek
e16a88a9c9 Set the quality scale to platinum for IMGW-PIB integration (#116912)
* Increase test coverage

* Set the quality scale to platinum

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-08 08:51:25 +02:00
Michael
2891a63281 Store runtime data inside the config entry in IPP (#116765)
* store runtime data inside the config entry

* improve tests
2024-05-08 01:16:06 -05:00
Kevin Stillhammer
3844e2d533 Add service waze_travel_time.get_travel_times (#108170)
* Add service waze_travel_time.get_travel_times

* Align strings with home-assistant.io

* Remove not needed service args

* Use SelectSelectorConfig.sort

* Move vehicle_type mangling to async_get_travel_times
2024-05-08 07:56:17 +02:00
Michael Hansen
7923471b94 Intent target matching and media player enhancements (#115445)
* Working

* Tests are passing

* Fix climate

* Requested changes from review
2024-05-07 22:01:03 -04:00
J. Nick Koston
8401b05d40 Move thread safety check in category_registry sooner (#117050) 2024-05-07 19:55:43 -05:00
Lennard Beers
3b51bf266a Update eq3btsmart library dependency to 1.1.8 (#117051)
* Update eq3btsmart dependency to 1.1.8

* Update test dependency and manifest for eq3btsmart to 1.1.8
2024-05-07 19:49:00 -05:00
J. Nick Koston
0b2c29fdb9 Move thread safety in floor_registry sooner (#117044) 2024-05-07 18:48:38 -05:00
Joost Lekkerkerker
27d45f04c4 Fix capitalization in Monzo strings (#117035)
* Fix capitalization in Monzo strings

* Fix capitalization in Monzo strings

* Fix capitalization in Monzo strings
2024-05-07 22:33:10 +02:00
J. Nick Koston
fc3c384e0a Move thread safety in label_registry sooner (#117026) 2024-05-07 15:15:30 -05:00
Michael
9557ea902e Store runtime data inside the config entry in Apple TV (#117032)
store runtime data inside the config entry
2024-05-07 22:13:53 +02:00
Michael
7f7d025b44 Store runtime data inside the config entry in Upnp (#117030)
store runtime data inside the config entry
2024-05-07 22:05:04 +02:00
Maciej Bieniek
35d44ec90a Store Airly runtime data in config entry (#117031)
* Store runtime data in config entry

* Fix tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-07 22:04:37 +02:00
John Hollowell
640cd519dd Add Venstar HVAC stage sensor (#107510)
* Add sensor for which stage of heating/cooling is active

for example, a 2-stage heating system would initially use the first stage for heat and if it was unable to fulfill the demand, the thermostat would call for the second stage heat in addition to the first stage heat already in use.

* Add translation keys for english

* Apply suggestions from code review

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>

* Add translation of entity name

* Update sensor name to correctly be translatable

---------

Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
2024-05-07 21:43:01 +02:00
J. Nick Koston
649dd55da9 Simplify MQTT subscribe debouncer execution (#117006) 2024-05-07 14:41:31 -05:00
G Johansson
38a3c3a823 Fix double executor in Filesize (#117029) 2024-05-07 21:34:07 +02:00
Álvaro Fernández Rojas
3774d8ed54 Add climate temp ranges support for Airzone Cloud (#115025)
airzone_cloud: climate: add temperature ranges support

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-05-07 21:29:45 +02:00
Thomas Kistler
14fcf7be8e Add flow and rain sensor support to Hydrawise (#116303)
* Add flow and rain sensor support to Hydrawise

* Address comments

* Cleanup

* Review comments

* Address review comments

* Added tests

* Add icon translations

* Add snapshot tests

* Clean up binary sensor

* Mypy cleanup

* Another mypy error

* Reviewer feedback

* Clear next_cycle sensor when the value is unknown

* Reviewer feedback

* Reviewer feedback

* Remove assert

* Restructure switches, sensors, and binary sensors

* Reviewer feedback

* Reviewer feedback
2024-05-07 21:26:10 +02:00
Jan Bouwhuis
a3248ccff9 Log an exception mqtt client call back throws (#117028)
* Log an exception mqtt client call back throws

* Supress exceptions and add test
2024-05-07 21:19:46 +02:00
Marc Mueller
db138f3727 Add MediaSourceProtocol to improve platform typing (#117001) 2024-05-07 21:18:11 +02:00
Mr. Bubbles
e5b91aa522 Update strings for Bring notification service (#116181)
update translations
2024-05-07 21:10:04 +02:00
J. Nick Koston
26cc1cd3db Use singleton helper for registries (#117027) 2024-05-07 21:04:01 +02:00
Jake Martin
6e024d54f1 Add Monzo integration (#101731)
* Initial monzo implementation

* Tests and fixes

* Extracted api to pypi package

* Add app confirmation step

* Corrected data path for accounts

* Removed useless check

* Improved tests

* Exclude partially tested files from coverage check

* Use has_entity_name naming

* Bumped monzopy to 1.0.10

* Remove commented out code

* Remove reauth from initial PR

* Remove useless code

* Correct comment

* Remove reauth tests

* Remove device triggers from intial PR

* Set attr outside constructor

* Remove f-strings where no longer needed in entity.py

* Rename field to make clearer it's a Callable

* Correct native_unit_of_measurement

* Remove pot transfer service from intial PR

* Remove reauth string

* Remove empty fields in manifest.json

* Freeze SensorEntityDescription and remove Mixin

Also use list comprehensions for producing sensor lists

* Use consts in application_credentials.py

* Revert "Remove useless code"

Apparently this wasn't useless

This reverts commit c6b7109e47202f866c766ea4c16ce3eb0588795b.

* Ruff and pylint style fixes

* Bumped monzopy to 1.1.0

Adds support for joint/business/etc account pots

* Update test snapshot

* Rename AsyncConfigEntryAuth

* Use dataclasses instead of dictionaries

* Move OAuth constants to application_credentials.py

* Remove remaining constants and dependencies for services from this PR

* Remove empty manifest entry

* Fix comment

* Set device entry_type to service

* ACC_SENSORS -> ACCOUNT_SENSORS

* Make value_fn of sensors return StateType

* Rename OAuthMonzoAPI again

* Fix tests

* Patch API instead of integration for unavailable test

* Move pot constant to sensor.py

* Improve type safety in async_get_monzo_api_data()

* Update async_oauth_create_entry() docstring

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-05-07 20:38:58 +02:00
G Johansson
5bef2d5d25 Use entry runtime data on Filesize (#116962)
* Use entry runtime data on Filesize

* Fix comment

* ignore

* Another way

* Refactor
2024-05-07 20:07:32 +02:00
Michal Čihař
789aadcc4c Reduce update interval in Ondilo Ico (#116989)
Ondilo: reduce update interval

The API seems to have sticter rate-limiting and frequent requests fail
with HTTP 400.

Fixes #116593
2024-05-07 19:55:03 +02:00
Erwin Douna
968af28c54 Add Tado reconfigure step (#115970)
Co-authored-by: Matthias Alphart <farmio@alphart.net>
2024-05-07 19:50:07 +02:00
Marc Mueller
f9e2ab2e81 Improve issue_registry event typing (#117023) 2024-05-07 19:49:02 +02:00
G Johansson
b9d26c097f Holiday update calendar once per day (#116421) 2024-05-07 18:52:51 +02:00
Marc Mueller
018e7731ae Add SignificantChangeProtocol to improve platform typing (#117002) 2024-05-07 18:40:57 +02:00
Jan Bouwhuis
7148c849d6 Only log loop client subscription log if log level is DEBUG (#117008)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-07 18:38:59 +02:00
Marc Mueller
15618a8a97 Use HassKey for loader (#116999) 2024-05-07 18:37:01 +02:00
Marc Mueller
b21632ad05 Improve energy platform typing (#117003) 2024-05-07 11:28:42 -05:00
Marc Mueller
2db64c7e6d Use HassKey for helpers (1) (#117012) 2024-05-07 11:25:16 -05:00
Marc Mueller
8f614fb06d Use HassKey for helpers (2) (#117013) 2024-05-07 11:24:13 -05:00
Marc Mueller
c50a340cbc Use HassKey for setup and bootstrap (#116998) 2024-05-07 11:18:20 -05:00
Marc Mueller
fd5885ec83 Use HassKey for registries (#117000) 2024-05-07 18:03:14 +02:00
G-Two
5ad52f122d Return raw API data for subaru device diagnostics (#114119) 2024-05-07 17:32:17 +02:00
Marc Mueller
95a27796f2 Update imports from alarm_control_panel (#117014) 2024-05-07 17:21:29 +02:00
Joost Lekkerkerker
1559562c26 Clean up Ondilo config flow (#116931) 2024-05-07 14:15:56 +02:00
Maciej Bieniek
16d86e5d4c Store Philips TV runtime data in config entry (#116952)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-07 14:10:44 +02:00
Sid
2cc916db6d Replace pylint broad-except with Ruff BLE001 (#116250) 2024-05-07 14:00:27 +02:00
Marc Mueller
b35fbd8d20 Update tqdm to 4.66.4 (#116984) 2024-05-07 13:56:36 +02:00
Marc Mueller
f9755f5c4c Update jinja2 to 3.1.4 (#116986) 2024-05-07 13:56:11 +02:00
Thomas55555
9e5bb92851 Fix flakey test in Husqvarna Automower (#116981) 2024-05-07 12:08:52 +02:00
pemontto
1c414966fe Add support for round-robin DNS (#115218)
* Add support for RR DNS

* 🧪 Update tests for DNS IP round-robin

* 🤖 Configure DNS IP round-robin automatically

* 🐛 Sort IPv6 addresses correctly

* Limit returned IPs and cleanup test class

* 🔟 Change max DNS results to 10

* Rename IPs to ip_addresses
2024-05-07 11:49:13 +02:00
Marc Mueller
3d700e2b71 Add HassDict implementation (#103844) 2024-05-07 10:53:13 +02:00
J. Nick Koston
fd52588565 Bump SQLAlchemy to 2.0.30 (#116964) 2024-05-07 10:42:13 +02:00
Pete Sage
731fe17224 Fix Sonos select_source timeout error (#115640) 2024-05-07 10:08:12 +02:00
SLaks
b5cd0e629d Upgrade to hdate 0.10.8 (#116202)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-07 09:28:54 +02:00
Matrix
6ac44f3f14 Bump Yolink api to 0.4.4 (#116967) 2024-05-07 07:51:10 +02:00
ollo69
5db8082f91 Review AndroidTV decorator exception management (#114133) 2024-05-06 18:00:12 -05:00
Thomas55555
8e66e5bb11 Bump aioautomower to 2024.5.0 (#116942) 2024-05-06 17:59:34 -05:00
Abílio Costa
486b8ca7c4 Make Idasen Desk react to bluetooth changes (#115939) 2024-05-06 17:52:54 -05:00
G Johansson
4037f52d62 Bump python-holidays to 0.48 (#116951)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-06 23:36:47 +02:00
Jan Bouwhuis
eaf277844f Correct typo in MQTT translations (#116956) 2024-05-06 23:21:34 +02:00
J. Nick Koston
dc50095d06 Bump orjson to 3.10.3 (#116945) 2024-05-06 22:45:23 +02:00
Jan Bouwhuis
821c7d813d Correct formatting mqtt MQTT_DISCOVERY_DONE and MQTT_DISCOVERY_UPDATED message (#116947) 2024-05-06 22:32:46 +02:00
Guido Schmitz
e65f2f1984 Use ConfigEntry runtime_data in devolo Home Network (#116694) 2024-05-06 22:31:39 +02:00
G Johansson
b3008b074e Remove ambiclimate integration (#116410) 2024-05-06 22:15:04 +02:00
Joakim Plate
2b6dd59cfc Allow reconfiguration of integration sensor (#116740)
* Allow reconfiguration of integration sensor

* Adjust allowed options to not change unit
2024-05-06 21:03:46 +02:00
G Johansson
ebd1efa53b Handle exceptions in panic button for Yale Smart Alarm (#116515)
* Handle exceptions in panic button for Yale Smart Alarm

* Change key
2024-05-06 20:51:37 +02:00
Joost Lekkerkerker
ffa8265365 Snapshot Ondilo Ico devices (#116932)
Co-authored-by: JeromeHXP <dartdoka@mainguet.fr>
2024-05-06 20:34:29 +02:00
Sid
b456d97e65 Replace pylint protected-access with Ruff SLF001 (#115735) 2024-05-06 20:33:26 +02:00
mtielen
460c05dc43 Revert polling interval back to orginal value in Wolflink (#116758) 2024-05-06 20:09:41 +02:00
Maciej Bieniek
57283d16d9 Store AccuWeather runtime data in config entry (#116946)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-06 20:06:47 +02:00
Joakim Plate
1ef09048e6 Allow the rounding to be optional in integral (#116884) 2024-05-06 20:06:26 +02:00
Franck Nijhof
a8f3b699b3 2024.5.2 (#116937) 2024-05-06 19:49:06 +02:00
Maciej Bieniek
09be56964d AccuWeather tests refactoring (#116923)
* Add mock_accuweather_client

* Improve tests

* Fix exceptions

* Remove unneeded update_listener()

* Fix arguments for fixtures

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-06 19:41:48 +02:00
Franck Nijhof
72d6b4d1c9 Use ConfigEntry runtime_data in TwenteMilieu (#116642) 2024-05-06 19:21:34 +02:00
Marc Mueller
f5c54bcc0d Use runtime_data for wled (#116615) 2024-05-06 19:19:47 +02:00
Joost Lekkerkerker
f92fb0f492 Remove deprecated WAQI state attributes (#116595) 2024-05-06 19:12:45 +02:00
Marc Mueller
8c053a351c Use runtime_data for elgato (#116614) 2024-05-06 19:12:01 +02:00
Joost Lekkerkerker
95405ba6bb Add dataclass to Ondilo Ico (#116928) 2024-05-06 19:10:49 +02:00
Marc Mueller
52b8c189d7 Fix wiz test warning (#116693) 2024-05-06 19:10:06 +02:00
Joost Lekkerkerker
485f3b0f0a Set pH device class in Ondilo Ico (#116930) 2024-05-06 19:09:02 +02:00
J. Nick Koston
f3b08e89a5 Small speed ups to async_get_integration (#116900) 2024-05-06 19:08:33 +02:00
Bram Kragten
eb6ccea8aa Update frontend to 20240501.1 (#116939) 2024-05-06 18:43:20 +02:00
Bram Kragten
71d65e38b5 Update frontend to 20240501.1 (#116939) 2024-05-06 18:40:01 +02:00
Michael
ead9c4af38 Store runtime data inside the config entry in Radio Browser (#116821) 2024-05-06 17:54:44 +02:00
Franck Nijhof
6b93f8d997 Bump version to 2024.5.2 2024-05-06 17:19:04 +02:00
Jan Bouwhuis
ab113570c3 Fix initial mqtt subcribe cooldown timeout (#116904) 2024-05-06 17:18:26 +02:00
Robert Hillis
ed6788ca3f fix radarr coordinator updates (#116874) 2024-05-06 17:18:23 +02:00
J. Nick Koston
9533f5b490 Fix non-thread-safe operations in amcrest (#116859)
* Fix non-thread-safe operations in amcrest

fixes #116850

* fix locking

* fix locking

* fix locking
2024-05-06 17:18:19 +02:00
mletenay
7c9653e397 Bump goodwe to 0.3.4 (#116849) 2024-05-06 17:18:16 +02:00
tronikos
73eabe821c Bump androidtvremote2 to v0.0.15 (#116844) 2024-05-06 17:18:13 +02:00
Michael
834c2e2a09 Avoid duplicate data fetch during Synologs DSM setup (#116839)
don't do first refresh of central coordinator, is already done by api.setup before
2024-05-06 17:18:10 +02:00
Michael
421f74cd7f Increase default timeout to 30 seconds in Synology DSM (#116836)
increase default timeout to 30s and use it consequently
2024-05-06 17:18:06 +02:00
J. Nick Koston
c049888b00 Fix non-thread-safe state write in lutron event (#116829)
fixes #116746
2024-05-06 17:18:01 +02:00
Paulus Schoutsen
ad5e0949b6 Hide conversation agents that are exposed as agent entities (#116813) 2024-05-06 16:58:30 +02:00
J. Nick Koston
ae28c604e5 Fix airthings-ble data drop outs when Bluetooth connection is flakey (#116805)
* Fix airthings-ble data drop outs when Bluetooth adapter is flakey

fixes #116770

* add missing file

* update
2024-05-06 16:57:55 +02:00
Jan Bouwhuis
dbe303d95e Fix IMAP config entry setup (#116797) 2024-05-06 16:51:29 +02:00
J. Nick Koston
ad7688197f Ensure all synology_dsm coordinators handle expired sessions (#116796)
* Ensure all synology_dsm coordinators handle expired sessions

* Ensure all synology_dsm coordinators handle expired sessions

* Ensure all synology_dsm coordinators handle expired sessions

* handle cancellation

* add a debug log message

---------

Co-authored-by: mib1185 <mail@mib85.de>
2024-05-06 16:51:26 +02:00
Patrick Decat
79460cb017 fix UnboundLocalError on modified_statistic_ids in compile_statistics (#116795)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-06 16:51:23 +02:00
J. Nick Koston
18bcc61427 Bump bluetooth-adapters to 0.19.2 (#116785) 2024-05-06 16:51:19 +02:00
J. Nick Koston
57bbd10517 Refactor statistics to avoid creating tasks (#116743) 2024-05-06 16:51:16 +02:00
Joost Lekkerkerker
f068b8cdb8 Remove suggested UoM from Opower (#116728) 2024-05-06 16:51:12 +02:00
Joost Lekkerkerker
bbb94d9e17 Fix Bosch-SHC switch state (#116721) 2024-05-06 16:51:09 +02:00
J. Nick Koston
6d537e2a66 Bump aiohttp-isal to 0.3.1 (#116720) 2024-05-06 16:51:06 +02:00
J. Nick Koston
17c5aa2871 Improve logging of _TrackPointUTCTime objects (#116711) 2024-05-06 16:51:03 +02:00
Erik Montnemery
f4830216a8 Add workaround for data entry flow show progress (#116704)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-06 16:50:52 +02:00
Erik Montnemery
1cea22b8ba Fix search/replace mistake in recorder tests (#116933) 2024-05-06 09:03:21 -05:00
Erik Montnemery
2e945aed54 Convert recorder auto_repairs tests to use async API (#116927) 2024-05-06 08:25:48 -05:00
Erik Montnemery
5150557372 Convert recorder util tests to use async API (#116926) 2024-05-06 08:25:41 -05:00
epenet
9f9493c504 Simplify config entry check in SamsungTV (#116907)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-06 08:12:04 -05:00
Erik Montnemery
9807b2ec11 Convert recorder statistics tests to use async API (#116925) 2024-05-06 08:10:58 -05:00
Erik Montnemery
d01d161fe2 Convert recorder history tests to use async API (#116909) 2024-05-06 08:10:45 -05:00
Joost Lekkerkerker
9517800da6 Add snapshot tests to Ondilo Ico (#116929) 2024-05-06 15:08:15 +02:00
Maciej Bieniek
74df693079 Add new sensors to IMGW-PIB integration (#116631)
Add flood warning/alarm level sensors

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-06 15:03:25 +02:00
Mr. Bubbles
d81fad1ef1 Reduce API calls to fetch Habitica tasks (#116897) 2024-05-06 08:02:54 -05:00
ollo69
7e8fab65ff Store runtime data inside the config entry in AsusWrt (#116889) 2024-05-06 08:00:15 -05:00
Erik Montnemery
f5fe80bc90 Convert recorder init tests to use async API (#116918) 2024-05-06 07:59:39 -05:00
JeromeHXP
c9930d912e Handle errors retrieving Ondilo data and bump ondilo to 0.5.0 (#115926)
* Bump ondilo to 0.5.0 and handle errors retrieving data

* Bump ondilo to 0.5.0 and handle errors retrieving data

* Updated ruff recommendation

* Refactor

* Refactor

* Added exception log and updated call to update data

* Updated test cases to test through state machine

* Updated test cases

* Updated test cases after comments

* REnamed file

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-05-06 14:41:28 +02:00
Jan Bouwhuis
4b8b9ce92d Fix initial mqtt subcribe cooldown timeout (#116904) 2024-05-06 14:32:37 +02:00
tronikos
5c4afe55fd Avoid exceptions when Gemini responses are blocked (#116847)
* Bump google-generativeai to v0.5.2

* Avoid exceptions when Gemini responses are blocked

* pytest --snapshot-update

* set error response

* add test

* ruff
2024-05-06 18:22:22 +10:00
Paulus Schoutsen
4fce99edb5 Only call conversation should_expose once (#116891)
Only call should expose once
2024-05-05 21:37:10 -04:00
J. Nick Koston
5d5f311898 Move thread safety check in issue_registry sooner (#116899) 2024-05-05 20:32:55 -05:00
tronikos
2a4686e1b7 Bump google-generativeai to v0.5.2 (#116845) 2024-05-05 18:59:29 -05:00
Mr. Bubbles
db4eeffeed Bump bring-api to 0.7.1 (#115532)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-05 18:59:21 -05:00
Mr. Bubbles
afe55e2918 Bump Habitipy to 0.3.1 (#116378)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-06 01:44:54 +02:00
ollo69
e6fda4b357 Store runtime data inside the config entry in AndroidTV (#116895) 2024-05-05 18:15:33 -05:00
mletenay
9684867a57 Bump goodwe to 0.3.4 (#116849) 2024-05-05 18:05:21 -05:00
elmurato
2e52a7c4c0 Abort Minecraft Server config flow if device is already configured (#116852)
* Abort config flow if device is already configured

* Fix review findings

* Rename newly added test case
2024-05-06 00:21:50 +02:00
J. Nick Koston
673bbc1372 Switch out aiohttp-isal for aiohttp-fast-zlib to make isal optional (#116814)
* Switch out aiohttp-isal for aiohttp-fast-zlib to make isal optional

aiohttp-isal does not work on core installs where the system has 32bit userland and a 64bit kernel because we have no way to detect this configuration or handle it.

fixes #116681

* Update homeassistant/components/isal/manifest.json

* Update homeassistant/components/isal/manifest.json

* hassfest

* isal

* fixes

* Apply suggestions from code review

* make sure isal is updated before http

* fix tests

* late import
2024-05-05 17:06:12 -04:00
J. Nick Koston
092a2de340 Fix non-thread-safe operations in amcrest (#116859)
* Fix non-thread-safe operations in amcrest

fixes #116850

* fix locking

* fix locking

* fix locking
2024-05-05 16:58:38 -04:00
J. Nick Koston
a57f4b8f42 Index auth token ids to avoid linear search (#116583)
* Index auth token ids to avoid linear search

* async_remove_refresh_token

* coverage
2024-05-05 16:47:26 -04:00
J. Nick Koston
c8e6292cb7 Refactor statistics to avoid creating tasks (#116743) 2024-05-05 16:39:45 -04:00
J. Nick Koston
d970c19342 Fix airthings-ble data drop outs when Bluetooth connection is flakey (#116805)
* Fix airthings-ble data drop outs when Bluetooth adapter is flakey

fixes #116770

* add missing file

* update
2024-05-05 16:37:10 -04:00
J. Nick Koston
2964471e19 Keep august offline key up to date when it changes (#116857)
We only did discovery for the key at setup time. If it
changed, a reloaded of the integration was needed to
update the key. We now update it every time we update
the lock detail.
2024-05-05 16:33:55 -04:00
J. Nick Koston
91fa8b50cc Turn on thread safety checks in async_dispatcher_send (#116867)
* 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
2024-05-05 16:29:43 -04:00
J. Nick Koston
b41b1bb998 Refactor entity_platform polling to avoid double time fetch (#116877)
* 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
2024-05-05 16:28:01 -04:00
J. Nick Koston
76cd498c44 Replace utcnow().timestamp() with time.time() in auth_store (#116879)
utcnow().timestamp() is a slower way to get time.time()
2024-05-05 16:25:27 -04:00
J. Nick Koston
6339c63176 Improve recorder and worker thread matching in RecorderPool (#116886)
* Improve recorder and worker thread matching in RecorderPool

Previously we would look at the name of the threads. This
was a brittle if because other integrations may name their
thread Recorder or DbWorker. Instead we now use explict thread
ids which ensures there will never be a conflict

* fix

* fixes

* fixes
2024-05-05 16:25:10 -04:00
Robert Hillis
ee031f4850 fix radarr coordinator updates (#116874) 2024-05-05 18:54:17 +02:00
Michael
203d110787 Remove timeout option and set timeout static to 30 seconds in Synology DSM (#116815)
* remove timeout option, set timeout static to 30 seconds

* be slightly faster :)
2024-05-05 18:51:35 +02:00
Mr. Bubbles
b53081dc51 Add update coordinator for Habitica integration (#116427)
* Add DataUpdateCoordinator and exception handling for service

* remove unnecessary lines

* revert changes to service

* remove type check

* store coordinator in config_entry

* add exception translations

* update HabiticaData

* Update homeassistant/components/habitica/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/habitica/sensor.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* remove auth exception

* fixes

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-05 17:02:28 +02:00
tronikos
ffe6b9b6f0 Bump androidtvremote2 to v0.0.15 (#116844) 2024-05-05 15:44:40 +02:00
Joost Lekkerkerker
da5d975e22 Add Sensor descriptions for Bosch SHC (#116775)
* Add Sensor descriptions for Bosch SHC

* fix

* fix

* fix
2024-05-05 15:44:11 +02:00
J. Nick Koston
cb9914becd Fix non-thread-safe state write in lutron event (#116829)
fixes #116746
2024-05-05 15:43:39 +02:00
Austin Mroczek
91f5e2c8d3 Bump tcc to 2024.5 (#116827)
bump tcc to 2024.5
2024-05-05 15:38:16 +02:00
Maciej Bieniek
3498cb3ced Increase test coverage for Total Connect (#116851)
Increase test coverage

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-05 15:37:24 +02:00
Michael
b4ec1f5877 Avoid duplicate data fetch during Synologs DSM setup (#116839)
don't do first refresh of central coordinator, is already done by api.setup before
2024-05-05 15:09:26 +02:00
Michael
3d7d8fa28b Increase default timeout to 30 seconds in Synology DSM (#116836)
increase default timeout to 30s and use it consequently
2024-05-05 15:07:18 +02:00
Joost Lekkerkerker
486bb6d89f Use parametrize in drop connect sensor tests (#107078)
* Use parametrize in drop connect sensor tests

* Use parametrize in drop connect sensor tests

* Make common helper

* Assert the whole entity state

* fix

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: jbouwh <jan@jbsoft.nl>
2024-05-05 14:10:34 +02:00
Jan Bouwhuis
9fd31f6c92 Correct stale docstring on mqtt config flow method (#116848) 2024-05-05 14:06:13 +02:00
Joost Lekkerkerker
7d5aa03bf0 Move Totalconnect coordinator to separate module (#116368)
* Move Totalconnect coordinator to separate module

* Move Totalconnect coordinator to separate module

* Move Totalconnect coordinator to separate module
2024-05-05 13:05:36 +02:00
Maciej Bieniek
7e11fec761 Migrate properties to instance variables in NAM coordinator (#116703)
* Migrate properties to instance variables

* Fix unique_id type

* Update homeassistant/components/nam/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-05 13:04:01 +02:00
J. Nick Koston
b4bac7705e Ensure all synology_dsm coordinators handle expired sessions (#116796)
* Ensure all synology_dsm coordinators handle expired sessions

* Ensure all synology_dsm coordinators handle expired sessions

* Ensure all synology_dsm coordinators handle expired sessions

* handle cancellation

* add a debug log message

---------

Co-authored-by: mib1185 <mail@mib85.de>
2024-05-05 12:09:57 +02:00
Michael
f5394dc3a3 Store runtime data inside the config entry in Android TV Remote (#116824) 2024-05-05 08:59:19 +02:00
Paulus Schoutsen
33e9a6bd58 Hide conversation agents that are exposed as agent entities (#116813) 2024-05-04 19:09:38 -05:00
Michael
59349d2859 Store runtime data inside the config entry in System Monitor (#116816)
* replace optional timeout by sane default

* SystemMonitorConfigEntry noz needed in repairs.py
2024-05-05 02:03:57 +02:00
Mr. Bubbles
95ddb734ed Store runtime data inside the config entry in Bring (#116820) 2024-05-05 01:57:00 +02:00
Michael
e66581e3a2 Store runtime data inside the config entry in Certificate Expiry (#116819)
replace optional timeout by sane default
2024-05-05 01:33:24 +02:00
Michael
ddf9d6c53a Store runtime data inside the config entry in Local ToDo (#116818)
store runtime data inside the config entry
2024-05-05 01:10:34 +02:00
J. Nick Koston
0380116ef6 Improve logging of _TrackPointUTCTime objects (#116711) 2024-05-04 17:35:44 -05:00
Michael
910c991a58 Store runtime data inside the config entry in Sun (#116808)
* store runtime data inside the config entry

* move to entry.async_on_unload()
2024-05-04 23:39:12 +02:00
Michael
90a3c2e357 Store runtime data inside the config entry in NUT (#116771)
* store runtime data inside the config entry

* remove unsued constants

* add test for InvalidDeviceAutomationConfig exception

* assert entry

* add more specific type hint
2024-05-04 23:08:01 +02:00
Michael
4a25e67234 Store runtime data inside the config entry in Pi-Hole (#116806) 2024-05-04 22:52:13 +02:00
Michael
55ffc82be1 Store runtime data inside the config entry in Speedtest.net (#116802) 2024-05-04 22:32:53 +02:00
Michael
65120e5789 Store runtime data inside the config entry in VLC telnet (#116803)
store runtime data inside the config entry
2024-05-04 21:52:53 +02:00
Michael
64b5881652 Store runtime data inside the config entry in OpenWeatherMap (#116788) 2024-05-04 21:19:50 +02:00
Jan Bouwhuis
8bc5a798ca Fix IMAP config entry setup (#116797) 2024-05-04 13:18:26 -05:00
Erik Montnemery
1e72e9e0b2 Add workaround for data entry flow show progress (#116704)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-05-04 13:17:21 -05:00
Patrick Decat
ac12d2a463 fix UnboundLocalError on modified_statistic_ids in compile_statistics (#116795)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-04 13:16:58 -05:00
Michael
f143ed9eeb Store runtime data inside the config entry in SamsungTV (#116787) 2024-05-04 19:12:31 +02:00
Michael
ec46d4d644 Store runtime data inside the config entry in Nextcloud (#116790) 2024-05-04 19:03:25 +02:00
Michael
831282c3ba Store runtime data inside the config entry in Met.no (#116767) 2024-05-04 18:59:01 +02:00
Joost Lekkerkerker
985fd49909 Remove suggested UoM from Opower (#116728) 2024-05-04 10:29:42 -05:00
J. Nick Koston
a2a8cf6361 Bump aiohttp-isal to 0.3.1 (#116720) 2024-05-04 10:29:00 -05:00
J. Nick Koston
a444b832ed Bump bluetooth-adapters to 0.19.2 (#116785) 2024-05-04 10:26:14 -05:00
Maciej Bieniek
19eb51deeb Move Brother DataUpdateCoordinator to the coordinator module (#116772)
* Store data in config_entry.runtime_data

* Update homeassistant/components/brother/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Fix setdefault

* Do not include ignored and disabled

* Check loaded entries

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-04 16:29:08 +02:00
Maciej Bieniek
63484fdadd Store BraviaTV data in config_entry.runtime_data (#116778) 2024-05-04 15:50:33 +02:00
mkmer
2132b170f2 Update unique_id to string in Honeywell (#116726)
* Update unique_id to string

* Update homeassistant/components/honeywell/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/honeywell/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/honeywell/climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Add typing for devices

* Add tests

* Use methods to verify unique_id

* Update tests/components/honeywell/test_climate.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-05-04 14:18:50 +02:00
Marc Mueller
f9d95efac0 Improve CoordinatorWeatherEntity generic typing (#116760) 2024-05-04 14:02:23 +02:00
Michael
8238cd9f22 Store runtime data inside the config entry in Shelly (#116763) 2024-05-04 12:41:25 +02:00
Michael
e5543e3b95 Store runtime data inside the config entry in DWD (#116764) 2024-05-04 12:36:28 +02:00
Sid
a5df229715 Bump ruff to 0.4.3 (#116749) 2024-05-04 11:56:40 +02:00
Sean Chen
ac0eabad9f Fix UpdateCoordinator types in CoordinatorWeatherEntity constructor (#116747) 2024-05-04 10:32:37 +02:00
mtielen
8ec1576c67 Fix active state mapping in wolflink (#116659)
* Fix active state mapping for certain entities
2024-05-04 09:23:40 +01:00
Joost Lekkerkerker
45d44ac49e Fix Bosch-SHC switch state (#116721) 2024-05-03 23:54:27 +02:00
Robert Svensson
81a269f4f5 Use runtime_data in Axis integration (#116729)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-05-03 21:52:37 +02:00
Jan-Philipp Benecke
ce8cea86a2 Use ConfigEntry runtime_data in Discovergy (#116671) 2024-05-03 21:29:35 +02:00
Franck Nijhof
ab8a811c9f 2024.5.1 (#116696) 2024-05-03 17:17:43 +02:00
Allen Porter
9b4099950c Cleanup OpenAI and Ollama conversation entities (#116714) 2024-05-03 10:59:08 -04:00
Maciej Bieniek
1eed5442e2 Bump nettigo-air-monitor to version 3.0.1 (#116699)
Bump nettigo-air-monitor to version 3.0.1

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-03 14:36:42 +02:00
Erik Montnemery
e9b9d2d545 Convert recorder entity registry tests to use async API (#116448)
* Convert recorder entity registry tests to use async API

* Address review comment

* Make sure recorder is patch is set up before hass fixture
2024-05-03 14:10:58 +02:00
Erik Montnemery
f309064a7f Convert sensor recorder tests to use async API (#116373)
* Convert sensor recorder tests to use async API

* Fix accidentally renamed test

* Avoid unnecessary calls to async_wait_recording_done

* Avoid auto-commits for every state change

* Make sure recorder patches are set up before hass fixture
2024-05-03 14:07:38 +02:00
Maciej Bieniek
3c3a948c33 EntityDescription doesn't need to be generic for NextDNS binary sensor and switch platforms (#116697) 2024-05-03 13:56:38 +02:00
Guido Schmitz
cb26e3c633 Use ConfigEntry runtime_data in devolo Home Control (#116672) 2024-05-03 13:55:04 +02:00
Maciej Bieniek
5274165007 Use runtime_data to store NextDNS data (#116691)
* Use runtime_data to store data

* Use data type instead of CoordinatorDataT

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-03 13:39:10 +02:00
Franck Nijhof
9d2fd8217f Bump version to 2024.5.1 2024-05-03 13:38:38 +02:00
Guido Schmitz
79d50a0685 Add test for HA stop to devolo Home Control (#116682)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-05-03 13:36:15 +02:00
Felipe Martins Diel
7e8cbafc6f Fix BroadlinkRemote._learn_command() (#116692) 2024-05-03 13:36:03 +02:00
Marc Mueller
a4f9a64588 Fix fyta test timezone handling (#116689) 2024-05-03 13:36:00 +02:00
J. Nick Koston
7a56ba1506 Block dreame_vacuum versions older than 1.0.4 (#116673) 2024-05-03 13:35:56 +02:00
Glenn Waters
66bb3ecac9 Bump env_canada lib to 0.6.2 (#116662) 2024-05-03 13:35:53 +02:00
J. Nick Koston
ac302f38b1 Bump habluetooth to 2.8.1 (#116661) 2024-05-03 13:35:49 +02:00
puddly
abeb65e43d Bump ZHA dependency bellows to 0.38.4 (#116660)
Bump ZHA dependencies

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-05-03 13:35:46 +02:00
Galorhallen
c36fd5550b Bump govee-light-local library and fix wrong information for Govee lights (#116651) 2024-05-03 13:35:42 +02:00
Robert Svensson
6be25c784d Bump aiounifi to v77 (#116639) 2024-05-03 13:35:38 +02:00
Marc Mueller
c338f1b964 Add constraint for tuf (#116627) 2024-05-03 13:35:35 +02:00
Kevin Stillhammer
8193b82f4a Bump pywaze to 1.0.1 (#116621)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-03 13:35:31 +02:00
Ståle Storø Hauknes
7c1502fa05 Bump Airthings BLE to 0.8.0 (#116616)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-03 13:35:27 +02:00
Matthias Alphart
575a3da772 Fix inheritance order for KNX notify (#116600) 2024-05-03 13:35:23 +02:00
Joost Lekkerkerker
0e488ef505 Improve coordinator in Ondilo ico (#116596)
* Improve coordinator in Ondilo ico

* Improve coordinator in Ondilo ico
2024-05-03 13:35:19 +02:00
Ståle Storø Hauknes
fabbe2f28f Fix Airthings BLE model names (#116579) 2024-05-03 13:35:16 +02:00
Tomasz
99ab8d2956 Bump sanix to 1.0.6 (#116570)
dependency version bump
2024-05-03 13:35:12 +02:00
Marcel van der Veldt
523de94184 Fix Matter startup when Matter bridge is present (#116569) 2024-05-03 13:35:09 +02:00
Glenn Waters
65839067e3 Bump elkm1_lib to 2.2.7 (#116564)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-03 13:35:05 +02:00
Glenn Waters
5da6f83d10 Bump upb_lib to 0.5.6 (#116558) 2024-05-03 13:35:02 +02:00
Jan Bouwhuis
ea6a9b8316 Fix MQTT discovery cooldown too short with large setup (#116550)
* Fix MQTT discovery cooldown too short with large setup

* Set to 5 sec

* Only change the discovery cooldown

* Fire immediatly when teh debouncing period is over
2024-05-03 13:34:58 +02:00
J. Nick Koston
49de59432e Add a lock to homekit_controller platform loads (#116539) 2024-05-03 13:34:55 +02:00
GraceGRD
624e4a2b48 Bump opentherm_gw to 2.2.0 (#116527) 2024-05-03 13:34:52 +02:00
MatthewFlamm
4e4ac79595 Fix nws forecast coordinators and remove legacy forecast handling (#115857)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-03 13:34:48 +02:00
Marc Mueller
28ab45d5d8 Fix snapcast test warning (#116687) 2024-05-03 13:29:05 +02:00
Marc Mueller
15b24dfbc2 Fix fyta test warning (#116688) 2024-05-03 13:28:36 +02:00
Marcel van der Veldt
217795865b Fix Matter startup when Matter bridge is present (#116569) 2024-05-03 13:27:01 +02:00
Maciej Bieniek
309b3451b6 Move NAM Data Update Coordinator to the coordinator module (#116686)
Move Data Update Coordinator to the coordinator module

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-03 13:13:56 +02:00
Felipe Martins Diel
453ce0fc4e Fix BroadlinkRemote._learn_command() (#116692) 2024-05-03 13:11:22 +02:00
Galorhallen
fd398a3b3c Bump govee-light-local library and fix wrong information for Govee lights (#116651) 2024-05-03 13:07:45 +02:00
Marc Mueller
4a2b595cc8 Fix fyta test timezone handling (#116689) 2024-05-03 13:07:12 +02:00
MatthewFlamm
6413376ccb Fix nws forecast coordinators and remove legacy forecast handling (#115857)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-03 13:06:40 +02:00
J. Nick Koston
ee7f818fcd Block dreame_vacuum versions older than 1.0.4 (#116673) 2024-05-03 12:17:01 +02:00
J. Nick Koston
2b2b46c774 Bump habluetooth to 3.0.1 (#116663) 2024-05-03 12:15:51 +02:00
Maciej Bieniek
395fe0f47f Bump imgw_pib to version 1.0.1 (#116630)
Bump imgw_pib to version 1.0.1

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-03 11:44:51 +02:00
Jan Bouwhuis
84308c9e53 Add title feature to notify entity platform (#116426)
* 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>
2024-05-03 11:17:28 +02:00
J. Nick Koston
ecdad19296 Drop pyserial-asyncio from zha (#116638) 2024-05-03 02:12:28 -05:00
Erik Montnemery
27fcf72275 Convert history tests to use async API (#116447)
* Convert history tests to use async API

* Add new fixture to help patch recorder

* Modify

* Modify

* Update tests/conftest.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Rename fixture

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-03 08:14:46 +02:00
Allen Porter
897794f53b Clean up small changes from OpenAI conversation entity change (#116395)
Small cleanups in OpenAI conversation
2024-05-02 19:38:12 -05:00
J. Nick Koston
c07f02534b Migrate bluetooth to use the singleton helper (#116629) 2024-05-02 19:35:16 -05:00
puddly
007b15dc8b Bump ZHA dependency bellows to 0.38.4 (#116660)
Bump ZHA dependencies

Co-authored-by: TheJulianJES <TheJulianJES@users.noreply.github.com>
2024-05-02 19:31:28 -05:00
Marc-Olivier Arsenault
0e23d0439b Add ecobee ventilator 20 min timer (#115969)
* add 20 min timer Ecobee

* modify local value with estimated time

* add ecobee test switch

* removed manual setting of data

* Add no throttle updates

* add more test cases

* move timezone calculation in update function

* update attribute based on feedback

* use timezone for time comparaison

* add location data to tests

* remove is_on function

* update python-ecobee-api lib

* remove uncessary checks

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-03 02:08:25 +02:00
Glenn Waters
a3791fde09 Bump env_canada lib to 0.6.2 (#116662) 2024-05-02 18:17:41 -05:00
J. Nick Koston
43a0c880eb Bump habluetooth to 2.8.1 (#116661) 2024-05-02 18:15:56 -05:00
Jan Bouwhuis
5ddf21e4da Cleanup MQTT sensor last_reset_topic config parameter a year after removal (#116657) 2024-05-03 00:04:58 +02:00
Erik Montnemery
b013d6ade9 Fix flaky hassio test (#116658) 2024-05-02 16:24:14 -05:00
J. Nick Koston
a1a314f63a Replace pyserial-asyncio with pyserial-asyncio-fast in serial (#116636) 2024-05-02 16:23:47 -05:00
Jan Bouwhuis
cbf853a84f Improve docstring on roborock image entity method (#116654)
* Improve docstring on roborock image entity method

* Update homeassistant/components/roborock/image.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* More line breaks

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-02 23:09:52 +02:00
Jan Bouwhuis
2ec9728edb Cleanup unused class attr for MQTT config flow (#116653) 2024-05-02 23:09:16 +02:00
Jon Deeming
949ef49c09 Add vesync Vital 100S UK & EU Model mappings (#115948)
Add Vital 100S UK & EU Model mappings, fixes devices not being retrieved via VeSync APIs, using existing 100S device
2024-05-02 22:57:28 +02:00
Jan Bouwhuis
41b688645a Refactor group state logic (#116318)
* Refactor group state logic

* Fix

* Add helper and tests for groups with entity platforms multiple ON states

* Adress comments

* Do not store object and avoid linear search

* User dataclass, cleanup multiline ternary

* Add test cases for grouped groups

* Remove dead code

* typo in comment

* Update metjod and module docstr
2024-05-02 21:55:46 +02:00
Marc Mueller
8e7026d643 Use runtime_data for airnow (#116619) 2024-05-02 21:00:05 +02:00
Marc Mueller
f2b7733e8c Use runtime_data for airthings (#116622)
Co-authored-by: Matthias Alphart <farmio@alphart.net>
2024-05-02 20:59:34 +02:00
Marc Mueller
1c65aacde5 Use runtime_data for airq (#116620) 2024-05-02 20:58:37 +02:00
Jan Bouwhuis
bedd5c1cef Cleanup removed MQTT broker settings (#116633) 2024-05-02 20:37:21 +02:00
Robert Svensson
ecc431e231 Bump aiounifi to v77 (#116639) 2024-05-02 19:53:17 +02:00
Marc Mueller
3133dea803 Use runtime_data for aftership (#116618) 2024-05-02 18:38:52 +02:00
Marc Mueller
d19dac7290 Use runtime_data for airtouch5 (#116625) 2024-05-02 18:36:35 +02:00
Kevin Stillhammer
bf709bae9c Bump pywaze to 1.0.1 (#116621)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-02 09:54:06 -05:00
Marc Mueller
0977ad017d Use runtime_data for airthings_ble (#116623)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-02 09:38:01 -05:00
Ståle Storø Hauknes
adfd63be8c Bump Airthings BLE to 0.8.0 (#116616)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-02 09:37:02 -05:00
Maciej Bieniek
37d9ed899d Add binary_sensor platform to IMGW-PIB integration (#116624)
* Add binary_sensor platform

* Add tests

* Remove state attributes

* Remove attrs from strings.json

* Use base entity class

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-02 16:16:26 +02:00
Marc Mueller
1ec7a515d2 Add constraint for tuf (#116627) 2024-05-02 09:12:26 -05:00
Joost Lekkerkerker
a2bd045c9d Improve coordinator in Ondilo ico (#116596)
* Improve coordinator in Ondilo ico

* Improve coordinator in Ondilo ico
2024-05-02 15:57:47 +02:00
Marc Mueller
1fc8fdf9ff Use runtime_data for august (#116610) 2024-05-02 07:39:02 -05:00
Marc Mueller
ef242f2883 Use runtime_data for bond (#116611) 2024-05-02 07:38:59 -05:00
Marc Mueller
6bb2ab519f Use runtime_data for co2signal (#116612) 2024-05-02 14:04:21 +02:00
Matthias Alphart
70ae082281 Use entry.runtime_data in Fronius (#116604) 2024-05-02 13:42:48 +02:00
Marc Mueller
63a45035dd Use runtime_data for ambient_station (#116608) 2024-05-02 13:42:16 +02:00
Marc Mueller
5e8c9d66fb Use runtime_data for airvisual_pro (#116607) 2024-05-02 13:41:32 +02:00
Marc Mueller
64d9fac6db Use runtime_data for acmeda (#116606) 2024-05-02 13:40:49 +02:00
Matthias Alphart
8eb1970721 Fix inheritance order for KNX notify (#116600) 2024-05-02 11:44:32 +02:00
Franck Nijhof
10bc66ac77 Merge branch 'master' into dev 2024-05-02 11:22:38 +02:00
blob810
1170ce1296 Add shutter tilt support for Shelly Wave Shutter QNSH-001P10 (#116211)
* Add shutter tilt support for Shelly Wave Shutter QNSH-001P10

* Add shelly_europe_ltd_qnsh_001p10_state.json fixture

* Update test_discovery.py

* Load shelly wave shutter 001p10 node fixture

* Update test_discovery.py

Check if entity of first node exists.

* Update test_discovery.py

Add additional comments

* Clean whitespace

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-02 11:02:35 +02:00
dependabot[bot]
71c5f33e69 Bump codecov/codecov-action from 4.3.0 to 4.3.1 (#116592)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4.3.0 to 4.3.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4.3.0...v4.3.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-02 10:24:36 +02:00
dependabot[bot]
9c3a4c5365 Bump sigstore/cosign-installer from 3.4.0 to 3.5.0 (#115399)
Bumps [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/sigstore/cosign-installer/releases)
- [Commits](https://github.com/sigstore/cosign-installer/compare/v3.4.0...v3.5.0)

---
updated-dependencies:
- dependency-name: sigstore/cosign-installer
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-02 10:18:44 +02:00
Thomas55555
86637f7171 Address late review for Husqvarna Automower (#116536)
* Address late review for Husqvarna Automower

* fix wrong base entity
2024-05-02 10:05:45 +02:00
David Knowles
67e199fb2f Bump pydrawise to 2024.4.1 (#116449)
* Bump pydrawise to 2024.4.1

* Fix typing errors

* Use assert instead of cast

* Remove unused import
2024-05-02 07:56:27 +02:00
Glenn Waters
62a87b8430 Bump elkm1_lib to 2.2.7 (#116564)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-01 19:51:04 -05:00
J. Nick Koston
657c9ec25b Add a lock to homekit_controller platform loads (#116539) 2024-05-01 19:23:43 -05:00
Ståle Storø Hauknes
713ce0dd17 Fix Airthings BLE model names (#116579) 2024-05-01 19:19:40 -05:00
Tomasz
afbe0ce096 Bump sanix to 1.0.6 (#116570)
dependency version bump
2024-05-02 00:21:40 +02:00
Marc Mueller
2cb3a31db1 Improve fitbit generic coordinator typing (#116562) 2024-05-02 00:00:47 +02:00
Marc Mueller
86f96db9b0 Improve asuswrt decorator typing (#116563) 2024-05-02 00:00:30 +02:00
GraceGRD
aa1af37d1b Bump opentherm_gw to 2.2.0 (#116527) 2024-05-01 16:13:09 -05:00
Marc Mueller
8bc214b185 Improve airly generic coordinator typing (#116561) 2024-05-01 22:41:11 +02:00
Marc Mueller
bd24ce8d4d Improve tankerkoenig generic coordinator typing (#116560) 2024-05-01 22:33:07 +02:00
Glenn Waters
fa920fd910 Bump upb_lib to 0.5.6 (#116558) 2024-05-01 15:32:56 -05:00
J. Nick Koston
041456759f Remove duplicate mid handling in MQTT (#116531) 2024-05-01 15:18:44 -05:00
Joost Lekkerkerker
e68901235b Store runtime data in entry in Analytics Insights (#116441) 2024-05-01 22:13:38 +02:00
G Johansson
3bf67f3ddd Use config entry runtime data in Trafikverket Train (#116556) 2024-05-01 22:08:19 +02:00
G Johansson
b089f89f14 Use config entry runtime data in Trafikverket Ferry (#116557) 2024-05-01 22:05:47 +02:00
G Johansson
5e9a864f5b Use config entry runtime data in Sensibo (#116530)
* Use config entry runtime data in Sensibo

* Add typing

* Fixes coordinator

* Move import
2024-05-01 22:02:36 +02:00
G Johansson
b2c1cd3e2a Use config entry runtime data in Trafikverket Camera (#116552) 2024-05-01 21:59:07 +02:00
G Johansson
6cb703aa1d Use config entry runtime data in Trafikverket Weather (#116554) 2024-05-01 21:58:21 +02:00
Michael
054fb5af31 Store runtime data inside the config entry in PegelOnline (#116534) 2024-05-01 21:54:05 +02:00
Michael
a4139f1a61 Store runtime data inside the config entry in Proximity (#116533) 2024-05-01 21:51:47 +02:00
Michael
ad61e5f237 Store runtime data inside the config entry in Tankerkoenig (#116532) 2024-05-01 21:48:31 +02:00
Marc Mueller
a25e202ef0 Use runtime data for FritzBox Call Monitor (#116553) 2024-05-01 21:27:34 +02:00
Jan Bouwhuis
7fd60ddba4 Fix MQTT discovery cooldown too short with large setup (#116550)
* Fix MQTT discovery cooldown too short with large setup

* Set to 5 sec

* Only change the discovery cooldown

* Fire immediatly when teh debouncing period is over
2024-05-01 21:19:55 +02:00
G Johansson
ef2ae7b600 Use runtime data in Yale Smart Alarm (#116548) 2024-05-01 21:13:29 +02:00
Maciej Bieniek
ae6a497cd1 Add diagnostics platform to IMGW-PIB integration (#116551)
* Add diagnostics

* Add tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-01 21:06:22 +02:00
Michael
c5cac8fed4 Store runtime data inside the config entry in AVM Fritz!Smarthome (#116523) 2024-05-01 20:51:39 +02:00
J. Nick Koston
f73c55b434 Ensure mqtt handler is restored if its already registered in bootstrap test (#116549) 2024-05-01 20:22:18 +02:00
J. Nick Koston
573cd8e94a Ensure mock mqtt handler is cleaned up after test_bootstrap_dependencies (#116544) 2024-05-01 19:45:47 +02:00
Marcel van der Veldt
1db770ab3a Add blocklist for known Matter devices with faulty transitions (#116524) 2024-05-01 18:30:59 +02:00
J. Nick Koston
0b08ae7e44 Reduce timestamp function call overhead in core states (#116517)
* Reduce timestamp function call overhead in core states

The recorder or the websocket_api will always call the timestamps, so we will set the timestamp values when creating the State to avoid the function call overhead in the property we know will always be called.

* Reduce timestamp function call overhead in core states

The recorder or the websocket_api will always call the timestamps, so we will set the timestamp values when creating the State to avoid the function call overhead in the property we know will always be called.

* reduce scope of change since last_reported is not called in websocket_api

* reduce scope of change since last_reported is not called in websocket_api
2024-05-01 11:04:20 -05:00
J. Nick Koston
25df41475a Simplify MQTT mid handling (#116522)
* Simplify MQTT mid handling

switch from asyncio.Event to asyncio.Future

* preen

* preen

* preen
2024-05-01 11:03:10 -05:00
J. Nick Koston
2fe17acaf7 Bump yalexs to 3.1.0 (#116511)
changelog: https://github.com/bdraco/yalexs/compare/v3.0.1...v3.1.0
2024-05-01 11:01:54 -05:00
Maciej Bieniek
9e8f7b5618 Store GIOS runtime data in entry (#116510)
Use entry.runtime_data

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-01 17:28:20 +02:00
J. Nick Koston
2ad6353bf8 Fix stop event cleanup when reloading MQTT (#116525) 2024-05-01 10:22:50 -05:00
G Johansson
51f9e661a4 Workday only update once a day (#116419)
* Workday only update once a day

* Fix tests
2024-05-01 17:11:47 +02:00
Joost Lekkerkerker
b7a138b02a Improve scrape strings (#116519) 2024-05-01 16:22:25 +02:00
puddly
07e608d815 Bump ZHA dependencies (#116509) 2024-05-01 16:00:17 +02:00
Marcel van der Veldt
0b340e1477 Bump python matter server library to 5.10.0 (#116514) 2024-05-01 15:42:53 +02:00
J. Nick Koston
c39d3b501e Fix non-thread-safe operations in ihc (#116513) 2024-05-01 15:23:33 +02:00
J. Nick Koston
61a7bc7aab Fix blocking I/O to import modules in mysensors (#116516) 2024-05-01 15:22:50 +02:00
Maciej Bieniek
c46be022c8 Add IMGW-PIB integration (#116468)
* Add sensor platform

* Add tests

* Fix icons.json

* Use entry.runtime_data

* Remove validate_input function

* Change abort reason to cannot_connect

* Remove unnecessary square brackets

* Move _attr_attribution outside the constructor

* Use native_value property

* Use is with ENUMs

* Import SOURCE_USER

* Change test name

* Use freezer.tick

* Tests refactoring

* Remove test_setup_entry

* Test creating entry after error

* Add missing async_block_till_done

* Fix translation key

* Remove coordinator type annotation

* Enable strict typing

* Assert config entry unique_id

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-01 14:38:36 +02:00
Bram Kragten
53d5960f49 Update frontend to 20240501.0 (#116503) 2024-05-01 12:53:45 +02:00
Luke Lashley
835ce919f4 Fix roborock image crashes (#116487) 2024-05-01 11:56:02 +02:00
Marcel van der Veldt
8230bfcf8f Some fixes for the Matter light discovery schema (#116108)
* Fix discovery schema for light platform

* fix switch platform discovery schema

* extend light tests

* Update switch.py

* clarify comment

* use parameter for supported_color_modes
2024-05-01 11:46:52 +02:00
Joost Lekkerkerker
ac608ef86a Remove unused argument from DWD coordinator (#116496) 2024-05-01 11:19:26 +02:00
wittypluck
7a10959e58 Use websocket client to test device removal in Unifi (#116309)
* Use websocket client to test device removal from registry

* Rename client to ws_client to avoid confusion with Unifi clients

* Use remove_device helper
2024-05-01 08:46:03 +02:00
max2697
58c7a97149 Bump opower to 0.4.4 (#116489) 2024-05-01 07:11:47 +02:00
J. Nick Koston
6cf1c5c1f2 Hold a lock to prevent concurrent setup of config entries (#116482) 2024-04-30 18:47:12 -05:00
Jan Bouwhuis
3c7cbf5794 Add test MQTT subscription is completed when birth message is sent (#116476) 2024-04-30 18:15:46 -05:00
J. Nick Koston
2401580b6f Make a copy of capability_attributes instead of making a new dict (#116477) 2024-04-30 17:54:33 -05:00
Bram Kragten
d39707ee4f Update frontend to 20240430.0 (#116481) 2024-05-01 00:46:25 +02:00
Richard Kroegel
0d0865e783 Bump bimmer_connected to 0.15.2 (#116424)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-04-30 22:49:28 +02:00
J. Nick Koston
d524baafd2 Fix non-thread-safe operation in roon volume callback (#116475) 2024-04-30 22:47:27 +02:00
puddly
963d8d6a76 Change SkyConnect integration type back to hardware and fix multi-PAN migration bug (#116474)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-30 22:47:17 +02:00
Robert Resch
1641df18ce Store runtime data in entry in Ecovacs (#116445) 2024-04-30 22:44:56 +02:00
J. Nick Koston
2e9b1916c0 Ensure MQTT resubscribes happen before birth message (#116471) 2024-04-30 22:31:40 +02:00
J. Nick Koston
6c446b4e59 Fix local_todo blocking the event loop (#116473) 2024-04-30 22:31:09 +02:00
G Johansson
23a8b29bfe Bring sensibo to full coverage (again) (#116469) 2024-04-30 21:31:52 +02:00
Christopher Bailey
c7a84b1c7b Bump pydantic constraint (#116401)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-30 13:13:56 -05:00
J. Nick Koston
9995207817 Avoid re-encoding the message id as bytes for every event/state change (#116460) 2024-04-30 12:02:28 -05:00
J. Nick Koston
fbe1781ebc Bump bluetooth-adapters to 0.19.1 (#116465) 2024-04-30 11:53:55 -05:00
J. Nick Koston
6be2b334d8 Avoid netloc ipaddress re-encoding to construct ingress urls (#116431) 2024-04-30 11:44:25 -05:00
J. Nick Koston
ff104f54b5 Small performance improvements to ingress forwarding (#116457) 2024-04-30 11:43:58 -05:00
andarotajo
1e63665bf2 Mock dwdwfsapi in all tests that use it (#116414)
* Mock dwdwfsapi in all tests

* Add mocking for config entries

* Fix assertions in init test
2024-04-30 18:08:15 +02:00
epenet
a440783208 Store runtime data in entry in renault (#116454) 2024-04-30 17:39:03 +02:00
epenet
0005f8400d Move Renault service registration (#116459)
* Move Renault service registration

* Hassfest
2024-04-30 17:10:40 +02:00
Maciej Bieniek
f9b1b371e9 Remove entity description mixin in NextDNS (#116456)
Remove entity description mixin

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-04-30 16:05:49 +02:00
J. Nick Koston
feb6cfdd56 Add pydantic to skip-binary (#116406) 2024-04-30 09:00:06 -05:00
epenet
8291769361 Store runtime data in entry in onewire (#116450)
* Store runtime data in entry in onewire

* Adjust
2024-04-30 15:55:20 +02:00
Joost Lekkerkerker
a12301f696 Fix zoneminder async v2 (#116451) 2024-04-30 08:07:15 -05:00
Joost Lekkerkerker
6f406603a6 Store runtime data in entry in Withings (#116439)
* Add entry runtime data to Withings

* Store runtime data in entry in Withings

* Fix

* Fix

* Update homeassistant/components/withings/coordinator.py

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-04-30 13:00:11 +02:00
epenet
ad84ff18eb Use remove_device helper in tests (1/2) (#116240)
* Use remove_device helper in tests

* Update test_tag.py

* Update test_tag.py
2024-04-30 12:52:33 +02:00
epenet
a3942e019b Use remove_device helper in tests (2/2) (#116442)
Use remove_device helper in tests (part 2)
2024-04-30 12:50:35 +02:00
Joost Lekkerkerker
d84d2109c2 Add user id to coordinator name in Withings (#116440)
* Add user id to coordinator name in Withings

* Add user id to coordinator name in Withings

* Fix
2024-04-30 12:41:34 +02:00
Marc Mueller
dace9b32de Store runtime data inside ConfigEntry (#115669) 2024-04-30 11:29:43 +02:00
dontinelli
258e20bfc4 Update fyta async_migrate_entry (#116433)
Update async_migrate_entry __init__.py
2024-04-30 10:02:31 +02:00
Joost Lekkerkerker
fd8287bc15 Set Synology camera device name as entity name (#109123) 2024-04-30 09:49:35 +02:00
Joost Lekkerkerker
59d618bed1 Fix zoneminder async (#116436) 2024-04-30 09:48:58 +02:00
Graham Wetzler
b777947978 Bump smart_meter_texas to 0.5.5 (#116321) 2024-04-30 09:47:06 +02:00
Collin Fair
7184543f12 Fix stale prayer times from islamic-prayer-times (#115683) 2024-04-30 09:18:09 +02:00
G Johansson
822646749d Remove entity category "system" check from entity registry (#116412) 2024-04-30 04:01:12 +02:00
Marc Mueller
8233b621f0 Update pytest to 8.2.0 (#116379) 2024-04-29 21:50:11 +02:00
Guy Sie
f5700279d3 Add Open Home Foundation link (#116405) 2024-04-29 21:28:47 +02:00
Robert Resch
630ddd6a8c Revert "Remove strict connection" (#116416) 2024-04-29 21:26:40 +02:00
Thomas55555
f001e8524a Add Workarea cutting height to Husqvarna Automower (#116115)
* add work_area cutting_height

* add

* add default work_area

* ruff/mypy

* better names

* fit to api bump

* tweaks

* more tweaks

* layout

* address review

* change entity name

* tweak test

* cleanup entities

* fix for mowers with no workareas

* assure not other entities get deleted

* sort & remove one callback

* remove typing callbacks

* rename entity to entity_entry
2024-04-29 21:10:45 +02:00
Michael
c5953045d4 Add error translations to AVM Fritz!Tools (#116413) 2024-04-29 20:48:54 +02:00
rale
a6fdd4e1e2 Report webOS media player state (#113774)
* support for webos media player state

* add test coverage and don't use assumed state if media player state is available

* fallback to assumed state if media state isn't available

Co-authored-by: Shay Levy <levyshay1@gmail.com>

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-04-29 21:43:46 +03:00
Michael
50d83bbdbf Fix error handling in Shell Command integration (#116409)
* raise proper HomeAssistantError on command timeout

* raise proper HomeAssistantError on non-utf8 command output

* add error translation and test it

* Update homeassistant/components/shell_command/strings.json

* Update tests/components/shell_command/test_init.py

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-04-29 20:19:14 +02:00
Joost Lekkerkerker
d1c58467c5 Remove semicolon in Modbus (#116399) 2024-04-29 20:13:36 +02:00
Robert Resch
dfc198cae0 Remove strict connection (#116396) 2024-04-29 19:33:31 +02:00
Bram Kragten
b3c1a86194 Update frontend to 20240429.0 (#116404) 2024-04-29 18:34:20 +02:00
Steve Easley
420d6a2d9d Fix jvcprojector command timeout with some projectors (#116392)
* Fix projector timeout in pyprojector lib v1.0.10

* Fix projector timeout by increasing time between power command and refresh.

* Bump jvcprojector lib to ensure unknown power states are handled
2024-04-29 18:25:16 +02:00
dontinelli
180e178a69 Store access token in entry for Fyta (#116260)
* save access_token and expiration date in ConfigEntry

* add MINOR_VERSION and async_migrate_entry

* shorten reading of expiration from config entry

* add additional consts and test for config entry migration

* Update homeassistant/components/fyta/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/fyta/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* omit check for datetime data type

* Update homeassistant/components/fyta/__init__.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/fyta/coordinator.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-29 17:09:07 +02:00
dontinelli
8ed10c7c4f Bump fyta_cli to 0.4.1 (#115918)
* bump fyta_cli to 0.4.0

* Update PLANT_STATUS and add PLANT_MEASUREMENT_STATUS

* bump fyta_cli to v0.4.0

* minor adjustments of states to API documentation
2024-04-29 17:08:36 +02:00
J. Nick Koston
8bfcaf3524 Add service to log all the current asyncio Tasks to the profiler (#116389)
* Add service to log all the current asyncio Tasks to the profiler

I have been helping users look for a task leaks, and need a
way to examine tasks at run time as trying to get someone to
run Home Assistant and attach aiomonitor is too difficult in
many cases.

* cover
2024-04-29 10:03:35 -05:00
J. Nick Koston
f1e5bbcbca Fix grammar in internal function comments (#116387)
https://github.com/home-assistant/core/pull/116339#discussion_r1582610474
2024-04-29 17:01:15 +02:00
Mr. Bubbles
3d750414f1 Deprecate YAML configuration of Habitica (#116374)
Add deprecation issue for yaml import
2024-04-29 17:00:13 +02:00
Joost Lekkerkerker
eec1dafe11 Fix typo in Switchbot cloud (#116388) 2024-04-29 16:58:02 +02:00
mkmer
f5b4637da8 Address late review in Honeywell (#115702)
Pass honeywell_data
2024-04-29 16:16:46 +02:00
Allen Porter
f1dda8ef63 Add Ollama Conversation Agent Entity (#116363)
* Add ConversationEntity to OLlama integration

* Add assist_pipeline dependencies
2024-04-29 10:15:46 -04:00
J. Nick Koston
eced3b0f57 Fix usb scan delaying shutdown (#116390)
If the integration page is accessed right before shutdown it
can trigger the usb scan debouncer which was not marked as
background so shutdown would wait for the scan to finish
2024-04-29 10:07:48 -04:00
J. Nick Koston
81d2f5b791 Small cleanups to climate entity feature compat (#116361)
* Small cleanups to climate entity feature compat

Fix some duplicate property fetches, avoid generating a new
enum every time supported_features was fetched if there was
no modifier

* param

* param
2024-04-29 15:43:55 +02:00
Shay Levy
d1f88ffd1e Prevent Shelly raising in a task (#116355)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-29 08:03:57 -05:00
Marc Mueller
8ac493fcf4 Update types packages (#116382) 2024-04-29 14:50:00 +02:00
Marc Mueller
6c9f277bbe Update uv to 0.1.39 (#116381) 2024-04-29 14:48:13 +02:00
Marc Mueller
de65e6b5d1 Update respx to 0.21.1 (#116380) 2024-04-29 14:45:57 +02:00
Marc Mueller
e060e90858 Update pipdeptree to 2.19.0 (#116376) 2024-04-29 14:44:04 +02:00
Marc Mueller
26fad0b786 Update pytest-xdist to 3.6.1 (#116377) 2024-04-29 14:42:57 +02:00
Marc Mueller
fd52348d57 Update freezegun to 1.5.0 (#116375) 2024-04-29 14:40:47 +02:00
Mr. Bubbles
0b8838cab8 Add icons and translations to Habitica (#116204)
* refactor habitica sensors, add strings and icon translations

* Change sensor names

* remove max_health as it is a fixed value

* remove SENSOR_TYPES

* removed wrong sensor

* Move Data coordinator to separate module

* add coordinator.py to coveragerc

* add deprecation warning for task sensors

* remove unused imports and logger

* Revert "add deprecation warning for task sensors"

This reverts commit 9e58053f3b.

* Update homeassistant/components/habitica/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/habitica/strings.json

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Revert "Move Data coordinator to separate module"

This reverts commit f5c8c3c886.

* Revert "add coordinator.py to coveragerc"

This reverts commit 8ae07a4786.

* rename Mana max. to Max. mana

* deprecation for yaml import

* move SensorType definition before TASK_TYPES

* Revert "deprecation for yaml import"

This reverts commit 2a1d58ee5f.

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-29 12:51:38 +02:00
Marco van 't Wout
b426c4133d Improve error handling for HTTP errors on Growatt Server (#110633)
* Update dependency growattServer for improved error details

Updating to latest version. Since version 1.3.1 it will raise requests.exceptions.HTTPError for unexpected API responses such as HTTP 405 (rate limiting/firewall)

* Improve error details by raising ConfigEntryAuthFailed

Previous code was returning None which the caller couldn't handle

* Use a more appropiate exception type

* Update homeassistant/components/growatt_server/sensor.py

* Update homeassistant/components/growatt_server/sensor.py

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-29 12:02:49 +02:00
Martin Hjelmare
0e0ea0017e Add matter during onboarding (#116163)
* Add matter during onboarding

* test_zeroconf_not_onboarded_running

* test_zeroconf_not_onboarded_installed

* test_zeroconf_not_onboarded_not_installed

* test_zeroconf_discovery_not_onboarded_not_supervisor

* Clean up

* Add udp address

* Test zeroconf udp info too

* test_addon_installed_failures_zeroconf

* test_addon_running_failures_zeroconf

* test_addon_not_installed_failures_zeroconf

* Clean up stale changes

* Set unique id for discovery step

* Fix tests for background flow

* Fix flow running in background

* Test already discovered zeroconf

* Mock unload entry
2024-04-29 10:59:36 +02:00
Austin Mroczek
8153ff78bf Add Button for TotalConnect (#114530)
* add button for totalconnect

* test button for totalconnect

* change to zone.can_be_bypassed

* Update homeassistant/components/totalconnect/button.py

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>

* Update homeassistant/components/totalconnect/button.py

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>

* Update homeassistant/components/totalconnect/button.py

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>

* remove unused logging

* Update homeassistant/components/totalconnect/button.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* Update homeassistant/components/totalconnect/button.py

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>

* fix button and test

* Revert "bump total_connect_client to 2023.12.1"

This reverts commit 189b7dcd89cf3cc8309dacc92ba47927cfbbdef3.

* bump total_connect_client to 2023.12.1

* use ZoneEntity for Bypass button

* use LocationEntity for PanelButton

* fix typing

* add translation_key for panel buttons

* mock clear_bypass instead of disarm

* use paramaterize

* use snapshot

* sentence case in strings

* remove un-needed stuff

* Update homeassistant/components/totalconnect/button.py

* Apply suggestions from code review

* Fix

---------

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-29 09:47:05 +02:00
Erik Montnemery
0425b7aa6d Reduce scope of test fixtures for the pylint plugin tests (#116207) 2024-04-29 08:21:31 +02:00
J. Nick Koston
381ffe6eed Use built-in aiohttp timeout instead of asyncio.timeout in media_player (#116364)
* Use built-in aiohttp timeout instead of asyncio.timeout in media_player

Avoids having two timeouts running to fetch images

* fix mock
2024-04-29 07:38:40 +02:00
Austin Mroczek
8c73c1e1a5 Bump total_connect_client to 2024.4 (#116360) 2024-04-28 21:02:10 -05:00
J. Nick Koston
164403de20 Add thread safety checks to async_create_task (#116339)
* 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
2024-04-28 18:29:00 -04:00
J. Nick Koston
b8ddf51e28 Avoid creating tasks to update universal media player (#116350)
* Avoid creating tasks to update universal media player

Nothing was being awaited in async_update. This entity has polling
disabled and there was no reason to implement manual updates since
the state is always coming from other entities

* manual update
2024-04-28 18:17:26 -04:00
J. Nick Koston
e215270c05 Remove eager_start argument from internal _async_add_hass_job function (#116310) 2024-04-28 16:30:19 -05:00
J. Nick Koston
cdfd0aa7d4 Fix incorrect call to async_schedule_update_ha_state in manual_mqtt (#116348) 2024-04-28 12:55:28 -05:00
J. Nick Koston
66a9430410 Fix incorrect call to async_schedule_update_ha_state in generic_hygrostat (#116349) 2024-04-28 12:55:17 -05:00
J. Nick Koston
48d620ce94 Fix another case of homeassistant_alerts delaying shutdown (#116352) 2024-04-28 12:54:53 -05:00
J. Nick Koston
ab2ea6100c Speed up singleton decorator so it can be used more places (#116292) 2024-04-28 12:11:08 -05:00
epenet
48b1678075 Add test helper to remove device (#116234)
* Add test helper to remove device

* Rename

* Fix signature
2024-04-28 18:50:15 +02:00
J. Nick Koston
3bcce2197c Fix incorrect call to async_schedule_update_ha_state in command_line switch (#116347) 2024-04-28 18:36:01 +02:00
J. Nick Koston
9ca1d204b6 Fix shelly delaying shutdown (#116346) 2024-04-28 11:19:38 -05:00
J. Nick Koston
62ab67376f Fix bond update delaying shutdown when push updated are not available (#116344)
If push updates are not available, bond could delay shutdown. The update
task should have been marked as a background task
2024-04-28 17:57:08 +02:00
J. Nick Koston
ddf58b6905 Fix homeassistant_alerts delaying shutdown (#116340) 2024-04-28 10:36:03 -05:00
Joost Lekkerkerker
7a4aa3c40c Fix Netatmo indoor sensor (#116342)
* Debug netatmo indoor sensor

* Debug netatmo indoor sensor

* Fix
2024-04-28 17:34:27 +02:00
Jan Bouwhuis
986df70fe3 Refactor group setup (#116317)
* Refactor group setup

* Add @callback decorator and remove commented out code

* Keep set, add default on state
2024-04-28 16:32:17 +02:00
J. Nick Koston
ad0aabe9a1 Fix some flapping sonos tests (#116343) 2024-04-28 09:21:32 -05:00
J. Nick Koston
6ccb165d8e Fix bluetooth adapter discovery delaying startup and shutdown (#116335) 2024-04-28 08:57:31 -05:00
J. Nick Koston
bf91ab6e2b Fix sonos events delaying shutdown (#116337) 2024-04-28 08:54:34 -05:00
J. Nick Koston
c3aa238a33 Fix wemo push updates delaying shutdown (#116333) 2024-04-28 08:14:45 -05:00
J. Nick Koston
006040270c Fix august delaying shutdown (#116329) 2024-04-28 08:14:30 -05:00
J. Nick Koston
66e86170b1 Make storage load tasks background tasks to avoid delaying shutdown (#116332) 2024-04-28 08:14:15 -05:00
J. Nick Koston
ce42ad187c Fix unifiprotect delaying shutdown if websocket if offline (#116331) 2024-04-28 08:14:04 -05:00
J. Nick Koston
3f0c0a72db Prevent setup retry from delaying shutdown (#116328) 2024-04-28 08:13:51 -05:00
J. Nick Koston
76639252c9 Make discovery flow tasks background tasks (#116327) 2024-04-28 08:13:37 -05:00
J. Nick Koston
5d59b4cddd Remove unneeded TYPE_CHECKING guard in core async_set (#116311) 2024-04-27 19:34:17 -05:00
Jan Bouwhuis
43dc5415de Fix no will published when mqtt is down (#116319) 2024-04-27 18:42:38 -05:00
J. Nick Koston
50405fae5f Add a cache to _verify_event_type_length_or_raise (#116312)
Most of the time the events being fired are the same so we can
skip the python code in this function
2024-04-27 18:42:29 -05:00
IceBotYT
9fb01f3956 Convert Linear to use a base entity (#116133)
* Convert Linear to use a base entity

* Convert Linear to use a base entity

* Remove str cast in coordinator

* More minor fixes
2024-04-27 23:11:52 +02:00
wittypluck
3fd863bd7c Unifi: enable statistics for PoE port power sensor (#116308)
Add SensorStateClass.MEASUREMENT to PoE port power sensor
2024-04-27 22:21:08 +02:00
J. Nick Koston
cf682c0c44 Use more shorthand attrs in emonitor (#116307) 2024-04-27 14:24:02 -05:00
David Knowles
83b5ecb36f Increase the Hydrawise refresh frequency from 120s to 30s (#116298) 2024-04-27 20:46:58 +02:00
J. Nick Koston
cbcfd71f3d Reduce number of time calls needed to write state (#116297) 2024-04-27 13:17:31 -05:00
J. Nick Koston
f295172d07 Add a fast path for _stringify_state when state is already a str (#116295) 2024-04-27 10:48:17 -05:00
J. Nick Koston
eea66921bb Avoid update call in entity state write if there is no customize data (#116296) 2024-04-27 10:48:05 -05:00
Erik Montnemery
b94b93cc63 Make freezegun find event.time_tracker_utcnow (#116284) 2024-04-27 07:08:56 -05:00
J. Nick Koston
7715bee6b0 Fix script in restart mode that is fired from the same trigger (#116247) 2024-04-27 07:08:29 -05:00
hopkins-tk
a37d274b37 Fix Aseko binary sensors names (#116251)
* Fix Aseko binary sensors names

* Fix add missing key to strings.json

* Fix remove setting shorthand translation key attribute

* Update homeassistant/components/aseko_pool_live/strings.json

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-04-27 10:02:52 +02:00
J. Nick Koston
b403c9f92e Move thread safety check in area_registry sooner (#116265)
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.
2024-04-27 09:26:35 +02:00
epenet
c1572d9600 Handle invalid device type in onewire (#116153)
* Make device type optional in onewire

* Add comment
2024-04-27 09:26:26 +02:00
On Freund
97d151d1c6 Avoid blocking the event loop when unloading Monoprice (#116141)
* Avoid blocking the event loop when unloading Monoprice

* Code review suggestions
2024-04-27 09:26:11 +02:00
J. Nick Koston
244433aeca Move thread safety check in entity_registry sooner (#116263)
* 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
2024-04-27 09:25:19 +02:00
Marc Mueller
4a79e750a1 Add HA version to cache key (#116159)
* Add HA version to cache key

* Add comment
2024-04-27 09:25:08 +02:00
J. Nick Koston
09ebbfa0e1 Move thread safety check in device_registry sooner (#116264)
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.
2024-04-27 09:24:55 +02:00
Raman Gupta
8bae614d4e Bump zwave-js-server-python to 0.55.4 (#116278) 2024-04-27 09:24:23 +02:00
Joakim Plate
ff4b8fa5e3 Don't create event entries for lighting4 rfxtrx devices (#115716)
These have no standardized command need to be reworked
in the backing library to support exposing as events.

Fixes #115545
2024-04-27 09:24:11 +02:00
Erik Montnemery
a25b2168a3 Reduce scope of ZHA test fixtures (#116208) 2024-04-26 09:08:58 -05:00
Erik Montnemery
aa65f21be7 Fix flapping recorder tests (#116239) 2024-04-26 09:05:23 -05:00
Erik Montnemery
c9301850be Reduce scope of bluetooth test fixtures (#116210) 2024-04-26 09:03:49 -05:00
Brett Adams
e909074dfb Breakfix to handle null value in Teslemetry (#116206)
* Fixes

* Remove unused test
2024-04-26 15:44:13 +02:00
Paul Bottein
63dffbcce1 Update frontend to 20240426.0 (#116230) 2024-04-26 15:40:32 +02:00
Erik Montnemery
10be8f9683 Simplify timezone setting in recorder test (#116220) 2024-04-26 15:14:23 +02:00
Bram Kragten
b582d51a8a Remove myself as codeowner for Harmony (#116241)
* Remove myself as codeowner

* Update CODEOWNERS

* Format
2024-04-26 14:31:37 +02:00
Aidan Timson
7c64658aa9 Fix state classes for ovo energy sensors (#116225)
* Fix state classes for ovo energy sensors

* Restore monetary values

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-04-26 14:03:16 +02:00
Erik Montnemery
56f2f10a17 Fix flapping trafikverket tests (#116238)
* Fix flapping trafikverket tests

* Fix copy-paste mistake
2024-04-26 13:49:43 +02:00
Erik Montnemery
09a18459ff Restore default timezone after electric_kiwi sensor tests (#116217) 2024-04-26 12:28:40 +02:00
Robert Resch
67f6a84f5d Use None as default value for strict connection cloud store (#116219) 2024-04-26 11:22:04 +02:00
dependabot[bot]
49d8ac0811 Bump github/codeql-action from 3.25.2 to 3.25.3 (#116209)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.25.2 to 3.25.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.25.2...v3.25.3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 08:50:58 +02:00
Sid
e662e3b65c Bump ruff to 0.4.2 (#116201)
* Bump ruff to 0.4.2

* review comments
2024-04-26 08:48:32 +02:00
Erik Montnemery
623d34e1e0 Remove early return when validating entity registry items (#116160) 2024-04-26 08:38:24 +02:00
Erik Montnemery
764b34ab62 Reduce scope of bootstrap test fixture to module (#116195) 2024-04-25 22:00:07 -05:00
Erik Montnemery
db8597a742 Reduce scope of JSON/XML test fixtures (#116197) 2024-04-25 19:12:36 -05:00
Jan Bouwhuis
372c6c7874 Use existing monotonic timestamp on mqtt messages for debugging (#116196) 2024-04-25 19:09:54 -05:00
Joost Lekkerkerker
4a1e1bd1b9 Improve linear coordinator (#116167)
* Improve linear coordinator

* Fix

* Fix
2024-04-25 22:57:29 +02:00
Thomas55555
ccc2f6c5b5 Add strict typing to husqvarna automower (#115374) 2024-04-25 15:39:42 -05:00
J. Nick Koston
421dbe1356 Bump bluetooth-auto-recovery to 1.4.2 (#116192) 2024-04-25 15:37:38 -05:00
Joost Lekkerkerker
860ac450c4 Use snapshots in Linear diagnostics tests (#116169)
* Use snapshots in Linear diagnostics tests

* Use snapshots in Linear diagnostics tests
2024-04-25 22:23:13 +02:00
Patrick Frazer
1e06054344 Bump dropmqttapi to 1.0.3 (#116179) 2024-04-25 15:00:21 -05:00
Anrijs
8649489117 Add support for Aranet radiation devices (#115239)
* sensor: added radiation dose sensor type and units

* Add support for Aranet Radiation devices

* Fix Aranet Radiation CI issues

* Revert "sensor: added radiation dose sensor type and units"

This reverts commit 28736a7da7.

* aranet4: bump version to 2.3.3

* aranet radiation: remove removed sesnor consts

* aranet radiation: use radioactive icon by default

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-04-25 22:38:20 +03:00
Thomas55555
a8b41c90c5 Bump aioautomower to 2024.4.4 (#116185) 2024-04-25 14:36:00 -05:00
Erik Montnemery
9d33965bc9 Fix flaky traccar_server tests (#116191) 2024-04-25 21:20:24 +02:00
J. Nick Koston
8523df952e Fix smartthings doing I/O in the event loop to import platforms (#116190) 2024-04-25 14:07:07 -05:00
Maciej Bieniek
51bceb1c99 Fix climate entity creation when Shelly WallDisplay uses external relay as actuator (#115216)
* Fix climate entity creation when Shelly WallDisplay uses external relay as actuator

* More comments

* Wrap condition into function

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-04-25 21:06:52 +02:00
Michael Hansen
b3124aa7ed Update Ollama model names list (#116172) 2024-04-25 20:35:29 +02:00
Luke Lashley
cc79129587 Make Roborock listener update thread safe (#116184)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-04-25 13:26:11 -05:00
Joakim Plate
316f58404d Update rfxtrx to 0.31.1 (#116125) 2024-04-25 20:58:13 +03:00
rappenze
18be38d19f Bump pyfibaro to 0.7.8 (#116126) 2024-04-25 20:57:15 +03:00
J. Nick Koston
1e95476fa8 Bump govee-ble to 0.31.2 (#116177)
changelog: https://github.com/Bluetooth-Devices/govee-ble/compare/v0.31.0...v0.31.2

Fixes some unrelated BLE devices being detected as a GVH5106
2024-04-25 20:56:33 +03:00
On Freund
0467fca316 Bump pyrisco to 0.6.1 (#116182) 2024-04-25 20:43:31 +03:00
J. Nick Koston
98eb9a4067 Revert orjson to 3.9.15 due to segmentation faults (#116168) 2024-04-25 11:15:57 -05:00
Jan Bouwhuis
855bb57d5e Revert "Return specific group state if there is one" (#116176)
Revert "Return specific group state if there is one (#115866)"

This reverts commit 350ca48d4c.
2024-04-25 17:32:42 +02:00
Erik Montnemery
6bff0c384f Remove deprecation warnings for relative_time (#116144)
* Remove deprecation warnings for relative_time

* Update homeassistant/helpers/template.py

Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>

---------

Co-authored-by: Simon <80467011+sorgfresser@users.noreply.github.com>
2024-04-25 13:02:18 +02:00
Erik Montnemery
2e88ba40ff Fix lying docstring for relative_time template function (#116146)
* 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>
2024-04-25 13:01:41 +02:00
Marc Mueller
e2c60e9333 Update mypy to 1.10.0 (#116158) 2024-04-25 12:27:34 +02:00
dependabot[bot]
1e1e5ccc7a Bump actions/download-artifact from 4.1.6 to 4.1.7 (#116148)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 11:23:15 +02:00
Paul Bottein
ce4db445e8 Update unlocked icon for locks (#116157) 2024-04-25 11:21:19 +02:00
dependabot[bot]
1241d70b3b Bump actions/checkout from 4.1.3 to 4.1.4 (#116147)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.3 to 4.1.4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.3...v4.1.4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 10:52:57 +02:00
Erik Montnemery
59dc394ac7 Fix language in strict connection guard page (#116154) 2024-04-25 10:48:32 +02:00
Chris Roberts
12c2ed5c4d Add play/pause functionality for Vizio Smartcast media_player entities (#108896)
* Add play/pause functionality to vizio integration

Leverages existing pyvizio functionality. My impression is that it also
works for soundbars based on https://github.com/exiva/Vizio_SmartCast_API/issues/19.

* Set vizio assumed_state to True

The Vizio API is only capable of indicating whether the device is on
or off and not whether it's playing/paused/idle. Setting assumed_state
to True gives us separate Play and Pause buttons versus the (useless)
merged Play/Pause button we would get otherwise.
2024-04-25 08:25:10 +02:00
Franck Nijhof
f2fe62d159 Bump version to 2024.6.0dev0 (#116120) 2024-04-24 23:16:48 +02:00
prabhjotsbhatia-ca
79d6c2e75a Add all supported languages to Google Translate and remove unsupported ones (#107404)
* Adding supported language codes from Google Translate

Added all languages that Google Translate supports.

* Corrected alphabetical order of languages

* Remove languages not actually supported for speech

Previously I added languages supported by Google Translate. Based on comments received, I manually verified each language, and  removed languages that are not actually supported for speech in Google Translate.

* Add instructions to update the list of supported languages

Added instructions as suggested so as to facilitate easier update on this list.

* Reformat comment in const.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-24 20:51:46 +02:00
3700 changed files with 127079 additions and 48514 deletions

View File

@@ -137,6 +137,7 @@ tests: &tests
- tests/syrupy.py
- tests/test_util/**
- tests/testing_config/**
- tests/typing.py
- tests/util/**
other: &other

View File

@@ -58,13 +58,18 @@ omit =
homeassistant/components/airvisual/sensor.py
homeassistant/components/airvisual_pro/__init__.py
homeassistant/components/airvisual_pro/sensor.py
homeassistant/components/aladdin_connect/__init__.py
homeassistant/components/aladdin_connect/api.py
homeassistant/components/aladdin_connect/application_credentials.py
homeassistant/components/aladdin_connect/cover.py
homeassistant/components/aladdin_connect/sensor.py
homeassistant/components/alarmdecoder/__init__.py
homeassistant/components/alarmdecoder/alarm_control_panel.py
homeassistant/components/alarmdecoder/binary_sensor.py
homeassistant/components/alarmdecoder/entity.py
homeassistant/components/alarmdecoder/sensor.py
homeassistant/components/alpha_vantage/sensor.py
homeassistant/components/amazon_polly/*
homeassistant/components/ambiclimate/climate.py
homeassistant/components/ambient_station/__init__.py
homeassistant/components/ambient_station/binary_sensor.py
homeassistant/components/ambient_station/entity.py
@@ -82,6 +87,9 @@ omit =
homeassistant/components/aprilaire/climate.py
homeassistant/components/aprilaire/coordinator.py
homeassistant/components/aprilaire/entity.py
homeassistant/components/apsystems/__init__.py
homeassistant/components/apsystems/coordinator.py
homeassistant/components/apsystems/sensor.py
homeassistant/components/aqualogic/*
homeassistant/components/aquostv/media_player.py
homeassistant/components/arcam_fmj/__init__.py
@@ -120,7 +128,6 @@ omit =
homeassistant/components/baf/switch.py
homeassistant/components/baidu/tts.py
homeassistant/components/bang_olufsen/__init__.py
homeassistant/components/bang_olufsen/const.py
homeassistant/components/bang_olufsen/entity.py
homeassistant/components/bang_olufsen/media_player.py
homeassistant/components/bang_olufsen/util.py
@@ -192,7 +199,6 @@ omit =
homeassistant/components/comelit/__init__.py
homeassistant/components/comelit/alarm_control_panel.py
homeassistant/components/comelit/climate.py
homeassistant/components/comelit/const.py
homeassistant/components/comelit/coordinator.py
homeassistant/components/comelit/cover.py
homeassistant/components/comelit/humidifier.py
@@ -255,9 +261,6 @@ omit =
homeassistant/components/dormakaba_dkey/sensor.py
homeassistant/components/dovado/*
homeassistant/components/downloader/__init__.py
homeassistant/components/dsmr_reader/__init__.py
homeassistant/components/dsmr_reader/definitions.py
homeassistant/components/dsmr_reader/sensor.py
homeassistant/components/dte_energy_bridge/sensor.py
homeassistant/components/dublin_bus_transport/sensor.py
homeassistant/components/dunehd/__init__.py
@@ -269,7 +272,6 @@ omit =
homeassistant/components/duotecno/entity.py
homeassistant/components/duotecno/light.py
homeassistant/components/duotecno/switch.py
homeassistant/components/dwd_weather_warnings/const.py
homeassistant/components/dwd_weather_warnings/coordinator.py
homeassistant/components/dwd_weather_warnings/sensor.py
homeassistant/components/dweet/*
@@ -326,8 +328,7 @@ omit =
homeassistant/components/elmax/__init__.py
homeassistant/components/elmax/alarm_control_panel.py
homeassistant/components/elmax/binary_sensor.py
homeassistant/components/elmax/common.py
homeassistant/components/elmax/const.py
homeassistant/components/elmax/coordinator.py
homeassistant/components/elmax/cover.py
homeassistant/components/elmax/switch.py
homeassistant/components/elv/*
@@ -370,7 +371,6 @@ omit =
homeassistant/components/epson/media_player.py
homeassistant/components/eq3btsmart/__init__.py
homeassistant/components/eq3btsmart/climate.py
homeassistant/components/eq3btsmart/const.py
homeassistant/components/eq3btsmart/entity.py
homeassistant/components/eq3btsmart/models.py
homeassistant/components/escea/__init__.py
@@ -462,8 +462,8 @@ omit =
homeassistant/components/freebox/camera.py
homeassistant/components/freebox/home_base.py
homeassistant/components/freebox/switch.py
homeassistant/components/fritz/common.py
homeassistant/components/fritz/device_tracker.py
homeassistant/components/fritz/coordinator.py
homeassistant/components/fritz/entity.py
homeassistant/components/fritz/services.py
homeassistant/components/fritz/switch.py
homeassistant/components/fritzbox_callmonitor/__init__.py
@@ -473,10 +473,6 @@ omit =
homeassistant/components/frontier_silicon/browse_media.py
homeassistant/components/frontier_silicon/media_player.py
homeassistant/components/futurenow/light.py
homeassistant/components/fyta/__init__.py
homeassistant/components/fyta/coordinator.py
homeassistant/components/fyta/entity.py
homeassistant/components/fyta/sensor.py
homeassistant/components/garadget/cover.py
homeassistant/components/garages_amsterdam/__init__.py
homeassistant/components/garages_amsterdam/binary_sensor.py
@@ -505,7 +501,6 @@ omit =
homeassistant/components/gpsd/sensor.py
homeassistant/components/greenwave/light.py
homeassistant/components/growatt_server/__init__.py
homeassistant/components/growatt_server/const.py
homeassistant/components/growatt_server/sensor.py
homeassistant/components/growatt_server/sensor_types/*
homeassistant/components/gstreamer/media_player.py
@@ -519,6 +514,7 @@ omit =
homeassistant/components/guardian/util.py
homeassistant/components/guardian/valve.py
homeassistant/components/habitica/__init__.py
homeassistant/components/habitica/coordinator.py
homeassistant/components/habitica/sensor.py
homeassistant/components/harman_kardon_avr/media_player.py
homeassistant/components/harmony/data.py
@@ -684,6 +680,7 @@ omit =
homeassistant/components/konnected/panel.py
homeassistant/components/konnected/switch.py
homeassistant/components/kostal_plenticore/__init__.py
homeassistant/components/kostal_plenticore/coordinator.py
homeassistant/components/kostal_plenticore/helper.py
homeassistant/components/kostal_plenticore/select.py
homeassistant/components/kostal_plenticore/sensor.py
@@ -731,7 +728,6 @@ omit =
homeassistant/components/lookin/sensor.py
homeassistant/components/loqed/sensor.py
homeassistant/components/luci/device_tracker.py
homeassistant/components/luftdaten/sensor.py
homeassistant/components/lupusec/__init__.py
homeassistant/components/lupusec/alarm_control_panel.py
homeassistant/components/lupusec/binary_sensor.py
@@ -761,6 +757,7 @@ omit =
homeassistant/components/matrix/__init__.py
homeassistant/components/matrix/notify.py
homeassistant/components/matter/__init__.py
homeassistant/components/matter/fan.py
homeassistant/components/meater/__init__.py
homeassistant/components/meater/sensor.py
homeassistant/components/medcom_ble/__init__.py
@@ -787,7 +784,7 @@ omit =
homeassistant/components/microbees/application_credentials.py
homeassistant/components/microbees/binary_sensor.py
homeassistant/components/microbees/button.py
homeassistant/components/microbees/const.py
homeassistant/components/microbees/climate.py
homeassistant/components/microbees/coordinator.py
homeassistant/components/microbees/cover.py
homeassistant/components/microbees/entity.py
@@ -795,7 +792,7 @@ omit =
homeassistant/components/microbees/sensor.py
homeassistant/components/microbees/switch.py
homeassistant/components/microsoft/tts.py
homeassistant/components/mikrotik/hub.py
homeassistant/components/mikrotik/coordinator.py
homeassistant/components/mill/climate.py
homeassistant/components/mill/sensor.py
homeassistant/components/minio/minio_helper.py
@@ -806,10 +803,10 @@ omit =
homeassistant/components/mochad/switch.py
homeassistant/components/modem_callerid/button.py
homeassistant/components/modem_callerid/sensor.py
homeassistant/components/moehlenhoff_alpha2/__init__.py
homeassistant/components/moehlenhoff_alpha2/binary_sensor.py
homeassistant/components/moehlenhoff_alpha2/climate.py
homeassistant/components/moehlenhoff_alpha2/sensor.py
homeassistant/components/moehlenhoff_alpha2/coordinator.py
homeassistant/components/monzo/__init__.py
homeassistant/components/monzo/api.py
homeassistant/components/motion_blinds/__init__.py
homeassistant/components/motion_blinds/coordinator.py
homeassistant/components/motion_blinds/cover.py
@@ -919,9 +916,8 @@ omit =
homeassistant/components/notion/util.py
homeassistant/components/nsw_fuel_station/sensor.py
homeassistant/components/nuki/__init__.py
homeassistant/components/nuki/binary_sensor.py
homeassistant/components/nuki/coordinator.py
homeassistant/components/nuki/lock.py
homeassistant/components/nuki/sensor.py
homeassistant/components/nx584/alarm_control_panel.py
homeassistant/components/oasa_telematics/sensor.py
homeassistant/components/obihai/__init__.py
@@ -934,11 +930,12 @@ omit =
homeassistant/components/ohmconnect/sensor.py
homeassistant/components/ombi/*
homeassistant/components/omnilogic/__init__.py
homeassistant/components/omnilogic/common.py
homeassistant/components/omnilogic/coordinator.py
homeassistant/components/omnilogic/sensor.py
homeassistant/components/omnilogic/switch.py
homeassistant/components/ondilo_ico/__init__.py
homeassistant/components/ondilo_ico/api.py
homeassistant/components/ondilo_ico/coordinator.py
homeassistant/components/ondilo_ico/sensor.py
homeassistant/components/onkyo/media_player.py
homeassistant/components/onvif/__init__.py
@@ -961,7 +958,6 @@ omit =
homeassistant/components/opengarage/sensor.py
homeassistant/components/openhardwaremonitor/sensor.py
homeassistant/components/openhome/__init__.py
homeassistant/components/openhome/const.py
homeassistant/components/openhome/media_player.py
homeassistant/components/opensensemap/air_quality.py
homeassistant/components/opentherm_gw/__init__.py
@@ -973,9 +969,10 @@ omit =
homeassistant/components/openuv/coordinator.py
homeassistant/components/openuv/sensor.py
homeassistant/components/openweathermap/__init__.py
homeassistant/components/openweathermap/coordinator.py
homeassistant/components/openweathermap/repairs.py
homeassistant/components/openweathermap/sensor.py
homeassistant/components/openweathermap/weather.py
homeassistant/components/openweathermap/weather_update_coordinator.py
homeassistant/components/opnsense/__init__.py
homeassistant/components/opnsense/device_tracker.py
homeassistant/components/opower/__init__.py
@@ -985,7 +982,7 @@ omit =
homeassistant/components/oru/*
homeassistant/components/orvibo/switch.py
homeassistant/components/osoenergy/__init__.py
homeassistant/components/osoenergy/const.py
homeassistant/components/osoenergy/binary_sensor.py
homeassistant/components/osoenergy/sensor.py
homeassistant/components/osoenergy/water_heater.py
homeassistant/components/osramlightify/light.py
@@ -1022,6 +1019,7 @@ omit =
homeassistant/components/permobil/entity.py
homeassistant/components/permobil/sensor.py
homeassistant/components/philips_js/__init__.py
homeassistant/components/philips_js/coordinator.py
homeassistant/components/philips_js/light.py
homeassistant/components/philips_js/media_player.py
homeassistant/components/philips_js/remote.py
@@ -1030,7 +1028,6 @@ omit =
homeassistant/components/picotts/tts.py
homeassistant/components/pilight/base_class.py
homeassistant/components/pilight/binary_sensor.py
homeassistant/components/pilight/const.py
homeassistant/components/pilight/light.py
homeassistant/components/pilight/switch.py
homeassistant/components/ping/__init__.py
@@ -1049,11 +1046,6 @@ omit =
homeassistant/components/point/alarm_control_panel.py
homeassistant/components/point/binary_sensor.py
homeassistant/components/point/sensor.py
homeassistant/components/poolsense/__init__.py
homeassistant/components/poolsense/binary_sensor.py
homeassistant/components/poolsense/coordinator.py
homeassistant/components/poolsense/entity.py
homeassistant/components/poolsense/sensor.py
homeassistant/components/powerwall/__init__.py
homeassistant/components/progettihwsw/__init__.py
homeassistant/components/progettihwsw/binary_sensor.py
@@ -1080,7 +1072,6 @@ omit =
homeassistant/components/quantum_gateway/device_tracker.py
homeassistant/components/qvr_pro/*
homeassistant/components/rabbitair/__init__.py
homeassistant/components/rabbitair/const.py
homeassistant/components/rabbitair/coordinator.py
homeassistant/components/rabbitair/entity.py
homeassistant/components/rabbitair/fan.py
@@ -1103,6 +1094,7 @@ omit =
homeassistant/components/rainmachine/__init__.py
homeassistant/components/rainmachine/binary_sensor.py
homeassistant/components/rainmachine/button.py
homeassistant/components/rainmachine/coordinator.py
homeassistant/components/rainmachine/select.py
homeassistant/components/rainmachine/sensor.py
homeassistant/components/rainmachine/switch.py
@@ -1125,7 +1117,6 @@ omit =
homeassistant/components/renson/__init__.py
homeassistant/components/renson/binary_sensor.py
homeassistant/components/renson/button.py
homeassistant/components/renson/const.py
homeassistant/components/renson/coordinator.py
homeassistant/components/renson/entity.py
homeassistant/components/renson/fan.py
@@ -1194,13 +1185,11 @@ omit =
homeassistant/components/schluter/*
homeassistant/components/screenlogic/binary_sensor.py
homeassistant/components/screenlogic/climate.py
homeassistant/components/screenlogic/const.py
homeassistant/components/screenlogic/coordinator.py
homeassistant/components/screenlogic/entity.py
homeassistant/components/screenlogic/light.py
homeassistant/components/screenlogic/number.py
homeassistant/components/screenlogic/sensor.py
homeassistant/components/screenlogic/services.py
homeassistant/components/screenlogic/switch.py
homeassistant/components/scsgate/*
homeassistant/components/sendgrid/notify.py
@@ -1253,7 +1242,6 @@ omit =
homeassistant/components/smappee/switch.py
homeassistant/components/smarty/*
homeassistant/components/sms/__init__.py
homeassistant/components/sms/const.py
homeassistant/components/sms/coordinator.py
homeassistant/components/sms/gateway.py
homeassistant/components/sms/notify.py
@@ -1347,6 +1335,7 @@ omit =
homeassistant/components/supla/*
homeassistant/components/surepetcare/__init__.py
homeassistant/components/surepetcare/binary_sensor.py
homeassistant/components/surepetcare/coordinator.py
homeassistant/components/surepetcare/entity.py
homeassistant/components/surepetcare/sensor.py
homeassistant/components/swiss_hydrological_data/sensor.py
@@ -1375,6 +1364,7 @@ omit =
homeassistant/components/switchbot_cloud/climate.py
homeassistant/components/switchbot_cloud/coordinator.py
homeassistant/components/switchbot_cloud/entity.py
homeassistant/components/switchbot_cloud/sensor.py
homeassistant/components/switchbot_cloud/switch.py
homeassistant/components/switchmate/switch.py
homeassistant/components/syncthing/__init__.py
@@ -1433,12 +1423,11 @@ omit =
homeassistant/components/tensorflow/image_processing.py
homeassistant/components/tfiac/climate.py
homeassistant/components/thermoworks_smoke/sensor.py
homeassistant/components/thethingsnetwork/*
homeassistant/components/thingspeak/*
homeassistant/components/thinkingcleaner/*
homeassistant/components/thomson/device_tracker.py
homeassistant/components/tibber/__init__.py
homeassistant/components/tibber/notify.py
homeassistant/components/tibber/coordinator.py
homeassistant/components/tibber/sensor.py
homeassistant/components/tikteck/light.py
homeassistant/components/tile/__init__.py
@@ -1544,8 +1533,9 @@ omit =
homeassistant/components/v2c/coordinator.py
homeassistant/components/v2c/entity.py
homeassistant/components/v2c/number.py
homeassistant/components/v2c/sensor.py
homeassistant/components/v2c/switch.py
homeassistant/components/vallox/__init__.py
homeassistant/components/vallox/coordinator.py
homeassistant/components/vasttrafik/sensor.py
homeassistant/components/velbus/__init__.py
homeassistant/components/velbus/binary_sensor.py
@@ -1560,9 +1550,8 @@ omit =
homeassistant/components/velux/__init__.py
homeassistant/components/velux/cover.py
homeassistant/components/velux/light.py
homeassistant/components/venstar/__init__.py
homeassistant/components/venstar/binary_sensor.py
homeassistant/components/venstar/climate.py
homeassistant/components/venstar/coordinator.py
homeassistant/components/venstar/sensor.py
homeassistant/components/verisure/__init__.py
homeassistant/components/verisure/alarm_control_panel.py
@@ -1595,7 +1584,6 @@ omit =
homeassistant/components/vlc_telnet/media_player.py
homeassistant/components/vodafone_station/__init__.py
homeassistant/components/vodafone_station/button.py
homeassistant/components/vodafone_station/const.py
homeassistant/components/vodafone_station/coordinator.py
homeassistant/components/vodafone_station/device_tracker.py
homeassistant/components/vodafone_station/sensor.py
@@ -1620,10 +1608,8 @@ omit =
homeassistant/components/watttime/__init__.py
homeassistant/components/watttime/sensor.py
homeassistant/components/weatherflow/__init__.py
homeassistant/components/weatherflow/const.py
homeassistant/components/weatherflow/sensor.py
homeassistant/components/weatherflow_cloud/__init__.py
homeassistant/components/weatherflow_cloud/const.py
homeassistant/components/weatherflow_cloud/coordinator.py
homeassistant/components/weatherflow_cloud/weather.py
homeassistant/components/wiffi/__init__.py
@@ -1641,6 +1627,7 @@ omit =
homeassistant/components/xbox/base_sensor.py
homeassistant/components/xbox/binary_sensor.py
homeassistant/components/xbox/browse_media.py
homeassistant/components/xbox/coordinator.py
homeassistant/components/xbox/media_player.py
homeassistant/components/xbox/remote.py
homeassistant/components/xbox/sensor.py
@@ -1673,10 +1660,7 @@ omit =
homeassistant/components/xs1/*
homeassistant/components/yale_smart_alarm/__init__.py
homeassistant/components/yale_smart_alarm/alarm_control_panel.py
homeassistant/components/yale_smart_alarm/binary_sensor.py
homeassistant/components/yale_smart_alarm/button.py
homeassistant/components/yale_smart_alarm/entity.py
homeassistant/components/yale_smart_alarm/lock.py
homeassistant/components/yalexs_ble/__init__.py
homeassistant/components/yalexs_ble/binary_sensor.py
homeassistant/components/yalexs_ble/entity.py
@@ -1717,10 +1701,6 @@ omit =
homeassistant/components/zeroconf/models.py
homeassistant/components/zeroconf/usage.py
homeassistant/components/zestimate/sensor.py
homeassistant/components/zeversolar/__init__.py
homeassistant/components/zeversolar/coordinator.py
homeassistant/components/zeversolar/entity.py
homeassistant/components/zeversolar/sensor.py
homeassistant/components/zha/core/cluster_handlers/*
homeassistant/components/zha/core/device.py
homeassistant/components/zha/core/gateway.py

View File

@@ -5,9 +5,11 @@
"postCreateCommand": "script/setup",
"postStartCommand": "script/bootstrap",
"containerEnv": {
"DEVCONTAINER": "1",
"PYTHONASYNCIODEBUG": "1"
},
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Port 5683 udp is used by Shelly integration
"appPort": ["8123:8123", "5683:5683/udp"],
"runArgs": ["-e", "GIT_EDITOR=code --wait"],
@@ -20,12 +22,15 @@
"visualstudioexptteam.vscodeintellicode",
"redhat.vscode-yaml",
"esbenp.prettier-vscode",
"GitHub.vscode-pull-request-github"
"GitHub.vscode-pull-request-github",
"GitHub.copilot"
],
// Please keep this file in sync with settings in home-assistant/.vscode/settings.default.json
"settings": {
"python.experiments.optOutFrom": ["pythonTestAdapter"],
"python.pythonPath": "/usr/local/bin/python",
"python.defaultInterpreterPath": "/home/vscode/.local/ha-venv/bin/python",
"python.pythonPath": "/home/vscode/.local/ha-venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.testing.pytestArgs": ["--no-cov"],
"editor.formatOnPaste": false,
"editor.formatOnSave": true,

View File

@@ -10,7 +10,7 @@ on:
env:
BUILD_TYPE: core
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.12.3"
PIP_TIMEOUT: 60
UV_HTTP_TIMEOUT: 60
UV_SYSTEM_PYTHON: "true"
@@ -27,7 +27,7 @@ jobs:
publish: ${{ steps.version.outputs.publish }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
with:
fetch-depth: 0
@@ -90,7 +90,7 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Download nightly wheels of frontend
if: needs.init.outputs.channel == 'dev'
@@ -175,7 +175,7 @@ jobs:
sed -i "s|pykrakenapi|# pykrakenapi|g" requirements_all.txt
- name: Download translations
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: translations
@@ -190,7 +190,7 @@ jobs:
echo "${{ github.sha }};${{ github.ref }};${{ github.event_name }};${{ github.actor }}" > rootfs/OFFICIAL_IMAGE
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -242,7 +242,7 @@ jobs:
- green
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set build additional args
run: |
@@ -256,7 +256,7 @@ jobs:
fi
- name: Login to GitHub Container Registry
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -279,7 +279,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Initialize git
uses: home-assistant/actions/helpers/git-init@master
@@ -320,23 +320,23 @@ jobs:
registry: ["ghcr.io/home-assistant", "docker.io/homeassistant"]
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Install Cosign
uses: sigstore/cosign-installer@v3.4.0
uses: sigstore/cosign-installer@v3.5.0
with:
cosign-release: "v2.2.3"
- name: Login to DockerHub
if: matrix.registry == 'docker.io/homeassistant'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
if: matrix.registry == 'ghcr.io/home-assistant'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.2.0
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
@@ -450,7 +450,7 @@ jobs:
if: github.repository_owner == 'home-assistant' && needs.init.outputs.publish == 'true'
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
@@ -458,7 +458,7 @@ jobs:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Download translations
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: translations

View File

@@ -36,9 +36,9 @@ env:
CACHE_VERSION: 8
UV_CACHE_VERSION: 1
MYPY_CACHE_VERSION: 8
HA_SHORT_VERSION: "2024.5"
DEFAULT_PYTHON: "3.12"
ALL_PYTHON_VERSIONS: "['3.12']"
HA_SHORT_VERSION: "2024.6"
DEFAULT_PYTHON: "3.12.3"
ALL_PYTHON_VERSIONS: "['3.12.3']"
# 10.3 is the oldest supported version
# - 10.3.32 is the version currently shipped with Synology (as of 17 Feb 2022)
# 10.6 is the current long-term-support
@@ -89,11 +89,13 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Generate partial Python venv restore key
id: generate_python_cache_key
run: >-
echo "key=venv-${{ env.CACHE_VERSION }}-${{
run: |
# Include HA_SHORT_VERSION to force the immediate creation
# of a new uv cache entry after a version bump.
echo "key=venv-${{ env.CACHE_VERSION }}-${{ env.HA_SHORT_VERSION }}-${{
hashFiles('requirements_test.txt', 'requirements_test_pre_commit.txt') }}-${{
hashFiles('requirements.txt') }}-${{
hashFiles('requirements_all.txt') }}-${{
@@ -224,7 +226,7 @@ jobs:
- info
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -270,7 +272,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
id: python
@@ -310,7 +312,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
id: python
@@ -349,7 +351,7 @@ jobs:
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
id: python
@@ -443,7 +445,7 @@ jobs:
python-version: ${{ fromJSON(needs.info.outputs.python_versions) }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
@@ -520,7 +522,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -552,7 +554,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -585,7 +587,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -609,14 +611,14 @@ jobs:
run: |
. venv/bin/activate
python --version
pylint --ignore-missing-annotations=y --ignore-wrong-coordinator-module=y homeassistant
pylint --ignore-missing-annotations=y homeassistant
- name: Run pylint (partially)
if: needs.info.outputs.test_full_suite == 'false'
shell: bash
run: |
. venv/bin/activate
python --version
pylint --ignore-missing-annotations=y --ignore-wrong-coordinator-module=y homeassistant/components/${{ needs.info.outputs.integrations_glob }}
pylint --ignore-missing-annotations=y homeassistant/components/${{ needs.info.outputs.integrations_glob }}
mypy:
name: Check mypy
@@ -629,7 +631,7 @@ jobs:
- base
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -702,7 +704,7 @@ jobs:
ffmpeg \
libgammu-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
@@ -763,7 +765,7 @@ jobs:
ffmpeg \
libgammu-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
@@ -785,7 +787,7 @@ jobs:
run: |
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
- name: Download pytest_buckets
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: pytest_buckets
- name: Compile English translations
@@ -879,7 +881,7 @@ jobs:
ffmpeg \
libmariadb-dev-compat
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
@@ -1002,7 +1004,7 @@ jobs:
ffmpeg \
postgresql-server-dev-14
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
@@ -1097,14 +1099,14 @@ jobs:
timeout-minutes: 10
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Download all coverage artifacts
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
pattern: coverage-*
- name: Upload coverage to Codecov
if: needs.info.outputs.test_full_suite == 'true'
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.4.1
with:
fail_ci_if_error: true
flags: full-suite
@@ -1144,7 +1146,7 @@ jobs:
ffmpeg \
libgammu-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
@@ -1231,14 +1233,14 @@ jobs:
timeout-minutes: 10
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Download all coverage artifacts
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
pattern: coverage-*
- name: Upload coverage to Codecov
if: needs.info.outputs.test_full_suite == 'false'
uses: codecov/codecov-action@v4.3.0
uses: codecov/codecov-action@v4.4.1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -21,14 +21,14 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.25.2
uses: github/codeql-action/init@v3.25.6
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.25.2
uses: github/codeql-action/analyze@v3.25.6
with:
category: "/language:python"

View File

@@ -10,7 +10,7 @@ on:
- "**strings.json"
env:
DEFAULT_PYTHON: "3.11"
DEFAULT_PYTHON: "3.12.3"
jobs:
upload:
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0

View File

@@ -17,7 +17,7 @@ on:
- "script/gen_requirements_all.py"
env:
DEFAULT_PYTHON: "3.12"
DEFAULT_PYTHON: "3.12.3"
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name}}
@@ -32,7 +32,7 @@ jobs:
architectures: ${{ steps.info.outputs.architectures }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
@@ -118,15 +118,15 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Download env_file
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: requirements_diff
@@ -156,20 +156,20 @@ jobs:
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.3
uses: actions/checkout@v4.1.6
- name: Download env_file
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: requirements_diff
- name: Download requirements_all_wheels
uses: actions/download-artifact@v4.1.6
uses: actions/download-artifact@v4.1.7
with:
name: requirements_all_wheels
@@ -211,7 +211,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_old-cython.txt"
@@ -226,7 +226,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"
@@ -240,7 +240,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"
@@ -254,7 +254,7 @@ jobs:
wheels-key: ${{ secrets.WHEELS_KEY }}
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev;nasm"
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf
skip-binary: aiohttp;charset-normalizer;grpcio;SQLAlchemy;protobuf;pydantic
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtac"

1
.gitignore vendored
View File

@@ -34,6 +34,7 @@ Icon
# GITHUB Proposed Python stuff:
*.py[cod]
__pycache__
# C extensions
*.so

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.1
rev: v0.4.6
hooks:
- id: ruff
args:
@@ -8,11 +8,11 @@ repos:
- id: ruff-format
files: ^((homeassistant|pylint|script|tests)/.+)?[^/]+\.(py|pyi)$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
args:
- --ignore-words-list=additionals,alle,alot,astroid,bund,caf,convencional,currenty,datas,farenheit,falsy,fo,frequence,haa,hass,iif,incomfort,ines,ist,nam,nd,pres,pullrequests,resset,rime,ser,serie,te,technik,ue,unsecure,vor,withing,zar
- --ignore-words-list=astroid,checkin,currenty,hass,iif,incomfort,lookin,nam,NotIn,pres,ser,ue
- --skip="./.*,*.csv,*.json,*.ambr"
- --quiet-level=2
exclude_types: [csv, json, html]
@@ -61,15 +61,15 @@ repos:
name: mypy
entry: script/run-in-env.sh mypy
language: script
types: [python]
types_or: [python, pyi]
require_serial: true
files: ^(homeassistant|pylint)/.+\.(py|pyi)$
- id: pylint
name: pylint
entry: script/run-in-env.sh pylint -j 0 --ignore-missing-annotations=y
language: script
types: [python]
files: ^homeassistant/.+\.py$
types_or: [python, pyi]
files: ^homeassistant/.+\.(py|pyi)$
- id: gen_requirements_all
name: gen_requirements_all
entry: script/run-in-env.sh python3 -m script.gen_requirements_all

View File

@@ -48,6 +48,7 @@ homeassistant.components.adax.*
homeassistant.components.adguard.*
homeassistant.components.aftership.*
homeassistant.components.air_quality.*
homeassistant.components.airgradient.*
homeassistant.components.airly.*
homeassistant.components.airnow.*
homeassistant.components.airq.*
@@ -65,7 +66,6 @@ homeassistant.components.alexa.*
homeassistant.components.alpha_vantage.*
homeassistant.components.amazon_polly.*
homeassistant.components.amberelectric.*
homeassistant.components.ambiclimate.*
homeassistant.components.ambient_network.*
homeassistant.components.ambient_station.*
homeassistant.components.amcrest.*
@@ -84,6 +84,7 @@ homeassistant.components.api.*
homeassistant.components.apple_tv.*
homeassistant.components.apprise.*
homeassistant.components.aprs.*
homeassistant.components.apsystems.*
homeassistant.components.aqualogic.*
homeassistant.components.aquostv.*
homeassistant.components.aranet.*
@@ -162,7 +163,6 @@ homeassistant.components.easyenergy.*
homeassistant.components.ecovacs.*
homeassistant.components.ecowitt.*
homeassistant.components.efergy.*
homeassistant.components.electrasmart.*
homeassistant.components.electric_kiwi.*
homeassistant.components.elgato.*
homeassistant.components.elkm1.*
@@ -235,6 +235,7 @@ homeassistant.components.homeworks.*
homeassistant.components.http.*
homeassistant.components.huawei_lte.*
homeassistant.components.humidifier.*
homeassistant.components.husqvarna_automower.*
homeassistant.components.hydrawise.*
homeassistant.components.hyperion.*
homeassistant.components.ibeacon.*
@@ -243,6 +244,7 @@ homeassistant.components.image.*
homeassistant.components.image_processing.*
homeassistant.components.image_upload.*
homeassistant.components.imap.*
homeassistant.components.imgw_pib.*
homeassistant.components.input_button.*
homeassistant.components.input_select.*
homeassistant.components.input_text.*
@@ -299,6 +301,7 @@ homeassistant.components.minecraft_server.*
homeassistant.components.mjpeg.*
homeassistant.components.modbus.*
homeassistant.components.modem_callerid.*
homeassistant.components.monzo.*
homeassistant.components.moon.*
homeassistant.components.mopeka.*
homeassistant.components.motionmount.*
@@ -337,7 +340,6 @@ homeassistant.components.persistent_notification.*
homeassistant.components.pi_hole.*
homeassistant.components.ping.*
homeassistant.components.plugwise.*
homeassistant.components.poolsense.*
homeassistant.components.powerwall.*
homeassistant.components.private_ble_device.*
homeassistant.components.prometheus.*
@@ -425,6 +427,7 @@ homeassistant.components.tcp.*
homeassistant.components.technove.*
homeassistant.components.tedee.*
homeassistant.components.text.*
homeassistant.components.thethingsnetwork.*
homeassistant.components.threshold.*
homeassistant.components.tibber.*
homeassistant.components.tile.*

4
.vscode/tasks.json vendored
View File

@@ -103,7 +103,7 @@
{
"label": "Install all Requirements",
"type": "shell",
"command": "pip3 install -r requirements_all.txt",
"command": "uv pip install -r requirements_all.txt",
"group": {
"kind": "build",
"isDefault": true
@@ -117,7 +117,7 @@
{
"label": "Install all Test Requirements",
"type": "shell",
"command": "pip3 install -r requirements_test_all.txt",
"command": "uv pip install -r requirements_test_all.txt",
"group": {
"kind": "build",
"isDefault": true

View File

@@ -56,6 +56,8 @@ build.json @home-assistant/supervisor
/tests/components/agent_dvr/ @ispysoftware
/homeassistant/components/air_quality/ @home-assistant/core
/tests/components/air_quality/ @home-assistant/core
/homeassistant/components/airgradient/ @airgradienthq @joostlek
/tests/components/airgradient/ @airgradienthq @joostlek
/homeassistant/components/airly/ @bieniu
/tests/components/airly/ @bieniu
/homeassistant/components/airnow/ @asymworks
@@ -78,8 +80,8 @@ build.json @home-assistant/supervisor
/tests/components/airzone/ @Noltari
/homeassistant/components/airzone_cloud/ @Noltari
/tests/components/airzone_cloud/ @Noltari
/homeassistant/components/aladdin_connect/ @mkmer
/tests/components/aladdin_connect/ @mkmer
/homeassistant/components/aladdin_connect/ @swcloudgenie
/tests/components/aladdin_connect/ @swcloudgenie
/homeassistant/components/alarm_control_panel/ @home-assistant/core
/tests/components/alarm_control_panel/ @home-assistant/core
/homeassistant/components/alert/ @home-assistant/core @frenck
@@ -88,8 +90,6 @@ build.json @home-assistant/supervisor
/tests/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh
/homeassistant/components/amberelectric/ @madpilot
/tests/components/amberelectric/ @madpilot
/homeassistant/components/ambiclimate/ @danielhiversen
/tests/components/ambiclimate/ @danielhiversen
/homeassistant/components/ambient_network/ @thomaskistler
/tests/components/ambient_network/ @thomaskistler
/homeassistant/components/ambient_station/ @bachya
@@ -127,8 +127,10 @@ build.json @home-assistant/supervisor
/tests/components/aprilaire/ @chamberlain2007
/homeassistant/components/aprs/ @PhilRW
/tests/components/aprs/ @PhilRW
/homeassistant/components/aranet/ @aschmitz @thecode
/tests/components/aranet/ @aschmitz @thecode
/homeassistant/components/apsystems/ @mawoka-myblock @SonnenladenGmbH
/tests/components/apsystems/ @mawoka-myblock @SonnenladenGmbH
/homeassistant/components/aranet/ @aschmitz @thecode @anrijs
/tests/components/aranet/ @aschmitz @thecode @anrijs
/homeassistant/components/arcam_fmj/ @elupus
/tests/components/arcam_fmj/ @elupus
/homeassistant/components/arris_tg2492lg/ @vanbalken
@@ -161,6 +163,8 @@ build.json @home-assistant/supervisor
/tests/components/awair/ @ahayworth @danielsjf
/homeassistant/components/axis/ @Kane610
/tests/components/axis/ @Kane610
/homeassistant/components/azure_data_explorer/ @kaareseras
/tests/components/azure_data_explorer/ @kaareseras
/homeassistant/components/azure_devops/ @timmo001
/tests/components/azure_devops/ @timmo001
/homeassistant/components/azure_event_hub/ @eavanvalkenburg
@@ -338,8 +342,8 @@ build.json @home-assistant/supervisor
/tests/components/drop_connect/ @ChandlerSystems @pfrazer
/homeassistant/components/dsmr/ @Robbie1221 @frenck
/tests/components/dsmr/ @Robbie1221 @frenck
/homeassistant/components/dsmr_reader/ @sorted-bits @glodenox
/tests/components/dsmr_reader/ @sorted-bits @glodenox
/homeassistant/components/dsmr_reader/ @sorted-bits @glodenox @erwindouna
/tests/components/dsmr_reader/ @sorted-bits @glodenox @erwindouna
/homeassistant/components/duotecno/ @cereal2nd
/tests/components/duotecno/ @cereal2nd
/homeassistant/components/dwd_weather_warnings/ @runningman84 @stephan192 @andarotajo
@@ -550,14 +554,14 @@ build.json @home-assistant/supervisor
/tests/components/group/ @home-assistant/core
/homeassistant/components/guardian/ @bachya
/tests/components/guardian/ @bachya
/homeassistant/components/habitica/ @ASMfreaK @leikoilja
/tests/components/habitica/ @ASMfreaK @leikoilja
/homeassistant/components/habitica/ @ASMfreaK @leikoilja @tr4nt0r
/tests/components/habitica/ @ASMfreaK @leikoilja @tr4nt0r
/homeassistant/components/hardkernel/ @home-assistant/core
/tests/components/hardkernel/ @home-assistant/core
/homeassistant/components/hardware/ @home-assistant/core
/tests/components/hardware/ @home-assistant/core
/homeassistant/components/harmony/ @ehendrix23 @bramkragten @bdraco @mkeesey @Aohzan
/tests/components/harmony/ @ehendrix23 @bramkragten @bdraco @mkeesey @Aohzan
/homeassistant/components/harmony/ @ehendrix23 @bdraco @mkeesey @Aohzan
/tests/components/harmony/ @ehendrix23 @bdraco @mkeesey @Aohzan
/homeassistant/components/hassio/ @home-assistant/supervisor
/tests/components/hassio/ @home-assistant/supervisor
/homeassistant/components/hdmi_cec/ @inytar
@@ -650,6 +654,8 @@ build.json @home-assistant/supervisor
/tests/components/image_upload/ @home-assistant/core
/homeassistant/components/imap/ @jbouwh
/tests/components/imap/ @jbouwh
/homeassistant/components/imgw_pib/ @bieniu
/tests/components/imgw_pib/ @bieniu
/homeassistant/components/improv_ble/ @emontnemery
/tests/components/improv_ble/ @emontnemery
/homeassistant/components/incomfort/ @zxdavb
@@ -690,6 +696,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/iqvia/ @bachya
/tests/components/iqvia/ @bachya
/homeassistant/components/irish_rail_transport/ @ttroy50
/homeassistant/components/isal/ @bdraco
/tests/components/isal/ @bdraco
/homeassistant/components/islamic_prayer_times/ @engrbm87 @cpfair
/tests/components/islamic_prayer_times/ @engrbm87 @cpfair
/homeassistant/components/iss/ @DurgNomis-drol
@@ -865,6 +873,8 @@ build.json @home-assistant/supervisor
/tests/components/moehlenhoff_alpha2/ @j-a-n
/homeassistant/components/monoprice/ @etsinko @OnFreund
/tests/components/monoprice/ @etsinko @OnFreund
/homeassistant/components/monzo/ @jakemartin-icl
/tests/components/monzo/ @jakemartin-icl
/homeassistant/components/moon/ @fabaff @frenck
/tests/components/moon/ @fabaff @frenck
/homeassistant/components/mopeka/ @bdraco
@@ -1271,8 +1281,6 @@ build.json @home-assistant/supervisor
/tests/components/smappee/ @bsmappee
/homeassistant/components/smart_meter_texas/ @grahamwetzler
/tests/components/smart_meter_texas/ @grahamwetzler
/homeassistant/components/smartthings/ @andrewsayre
/tests/components/smartthings/ @andrewsayre
/homeassistant/components/smarttub/ @mdz
/tests/components/smarttub/ @mdz
/homeassistant/components/smarty/ @z0mbieprocess
@@ -1359,8 +1367,8 @@ build.json @home-assistant/supervisor
/tests/components/switchbee/ @jafar-atili
/homeassistant/components/switchbot/ @danielhiversen @RenierM26 @murtas @Eloston @dsypniewski
/tests/components/switchbot/ @danielhiversen @RenierM26 @murtas @Eloston @dsypniewski
/homeassistant/components/switchbot_cloud/ @SeraphicRav
/tests/components/switchbot_cloud/ @SeraphicRav
/homeassistant/components/switchbot_cloud/ @SeraphicRav @laurence-presland
/tests/components/switchbot_cloud/ @SeraphicRav @laurence-presland
/homeassistant/components/switcher_kis/ @thecode
/tests/components/switcher_kis/ @thecode
/homeassistant/components/switchmate/ @danielhiversen @qiz-li
@@ -1413,7 +1421,8 @@ build.json @home-assistant/supervisor
/tests/components/thermobeacon/ @bdraco
/homeassistant/components/thermopro/ @bdraco @h3ss
/tests/components/thermopro/ @bdraco @h3ss
/homeassistant/components/thethingsnetwork/ @fabaff
/homeassistant/components/thethingsnetwork/ @angelnu
/tests/components/thethingsnetwork/ @angelnu
/homeassistant/components/thread/ @home-assistant/core
/tests/components/thread/ @home-assistant/core
/homeassistant/components/tibber/ @danielhiversen
@@ -1477,8 +1486,6 @@ build.json @home-assistant/supervisor
/tests/components/unifi/ @Kane610
/homeassistant/components/unifi_direct/ @tofuSCHNITZEL
/homeassistant/components/unifiled/ @florisvdk
/homeassistant/components/unifiprotect/ @AngellusMortis @bdraco
/tests/components/unifiprotect/ @AngellusMortis @bdraco
/homeassistant/components/upb/ @gwww
/tests/components/upb/ @gwww
/homeassistant/components/upc_connect/ @pvizeli @fabaff

View File

@@ -5,7 +5,7 @@
We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
identity and expression, level of experience, education, socioeconomic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

View File

@@ -12,7 +12,7 @@ ENV \
ARG QEMU_CPU
# Install uv
RUN pip3 install uv==0.1.35
RUN pip3 install uv==0.1.43
WORKDIR /usr/src

View File

@@ -35,21 +35,30 @@ RUN \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install uv
RUN pip3 install uv
WORKDIR /usr/src
# Setup hass-release
RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
&& pip3 install -e hass-release/
&& uv pip install --system -e hass-release/
WORKDIR /workspaces
USER vscode
ENV VIRTUAL_ENV="/home/vscode/.local/ha-venv"
RUN uv venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
WORKDIR /tmp
# Install Python dependencies from requirements
COPY requirements.txt ./
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
RUN pip3 install -r requirements.txt
RUN uv pip install -r requirements.txt
COPY requirements_test.txt requirements_test_pre_commit.txt ./
RUN pip3 install -r requirements_test.txt
RUN rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/
RUN uv pip install -r requirements_test.txt
WORKDIR /workspaces
# Set the default shell to bash instead of sh
ENV SHELL /bin/bash

View File

@@ -7,6 +7,8 @@ Check out `home-assistant.io <https://home-assistant.io>`__ for `a
demo <https://demo.home-assistant.io>`__, `installation instructions <https://home-assistant.io/getting-started/>`__,
`tutorials <https://home-assistant.io/getting-started/automation/>`__ and `documentation <https://home-assistant.io/docs/>`__.
This is a project of the `Open Home Foundation <https://www.openhomefoundation.org/>`__.
|screenshot-states|
Featured integrations
@@ -25,4 +27,4 @@ of a component, check the `Home Assistant help section <https://home-assistant.i
.. |screenshot-states| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-states.png
:target: https://demo.home-assistant.io
.. |screenshot-integrations| image:: https://raw.githubusercontent.com/home-assistant/core/dev/.github/assets/screenshot-integrations.png
:target: https://home-assistant.io/integrations/
:target: https://home-assistant.io/integrations/

View File

@@ -3,6 +3,7 @@
from __future__ import annotations
import argparse
from contextlib import suppress
import faulthandler
import os
import sys
@@ -208,8 +209,10 @@ def main() -> int:
exit_code = runner.run(runtime_conf)
faulthandler.disable()
if os.path.getsize(fault_file_name) == 0:
os.remove(fault_file_name)
# It's possible for the fault file to disappear, so suppress obvious errors
with suppress(FileNotFoundError):
if os.path.getsize(fault_file_name) == 0:
os.remove(fault_file_name)
check_threads()

View File

@@ -28,15 +28,14 @@ from .const import ACCESS_TOKEN_EXPIRATION, GROUP_ID_ADMIN, REFRESH_TOKEN_EXPIRA
from .mfa_modules import MultiFactorAuthModule, auth_mfa_module_from_config
from .models import AuthFlowResult
from .providers import AuthProvider, LoginFlow, auth_provider_from_config
from .session import SessionManager
EVENT_USER_ADDED = "user_added"
EVENT_USER_UPDATED = "user_updated"
EVENT_USER_REMOVED = "user_removed"
_MfaModuleDict = dict[str, MultiFactorAuthModule]
_ProviderKey = tuple[str, str | None]
_ProviderDict = dict[_ProviderKey, AuthProvider]
type _MfaModuleDict = dict[str, MultiFactorAuthModule]
type _ProviderKey = tuple[str, str | None]
type _ProviderDict = dict[_ProviderKey, AuthProvider]
class InvalidAuthError(Exception):
@@ -181,7 +180,6 @@ class AuthManager:
self._remove_expired_job = HassJob(
self._async_remove_expired_refresh_tokens, job_type=HassJobType.Callback
)
self.session = SessionManager(hass, self)
async def async_setup(self) -> None:
"""Set up the auth manager."""
@@ -192,7 +190,6 @@ class AuthManager:
)
)
self._async_track_next_refresh_token_expiration()
await self.session.async_setup()
@property
def auth_providers(self) -> list[AuthProvider]:
@@ -519,6 +516,13 @@ class AuthManager:
for revoke_callback in callbacks:
revoke_callback()
@callback
def async_set_expiry(
self, refresh_token: models.RefreshToken, *, enable_expiry: bool
) -> None:
"""Enable or disable expiry of a refresh token."""
self._store.async_set_expiry(refresh_token, enable_expiry=enable_expiry)
@callback
def _async_remove_expired_refresh_tokens(self, _: datetime | None = None) -> None:
"""Remove expired refresh tokens."""

View File

@@ -62,6 +62,7 @@ class AuthStore:
self._store = Store[dict[str, list[dict[str, Any]]]](
hass, STORAGE_VERSION, STORAGE_KEY, private=True, atomic_writes=True
)
self._token_id_to_user_id: dict[str, str] = {}
async def async_get_groups(self) -> list[models.Group]:
"""Retrieve all users."""
@@ -135,7 +136,10 @@ class AuthStore:
async def async_remove_user(self, user: models.User) -> None:
"""Remove a user."""
self._users.pop(user.id)
user = self._users.pop(user.id)
for refresh_token_id in user.refresh_tokens:
del self._token_id_to_user_id[refresh_token_id]
user.refresh_tokens.clear()
self._async_schedule_save()
async def async_update_user(
@@ -218,7 +222,9 @@ class AuthStore:
kwargs["client_icon"] = client_icon
refresh_token = models.RefreshToken(**kwargs)
user.refresh_tokens[refresh_token.id] = refresh_token
token_id = refresh_token.id
user.refresh_tokens[token_id] = refresh_token
self._token_id_to_user_id[token_id] = user.id
self._async_schedule_save()
return refresh_token
@@ -226,19 +232,17 @@ class AuthStore:
@callback
def async_remove_refresh_token(self, refresh_token: models.RefreshToken) -> None:
"""Remove a refresh token."""
for user in self._users.values():
if user.refresh_tokens.pop(refresh_token.id, None):
self._async_schedule_save()
break
refresh_token_id = refresh_token.id
if user_id := self._token_id_to_user_id.get(refresh_token_id):
del self._users[user_id].refresh_tokens[refresh_token_id]
del self._token_id_to_user_id[refresh_token_id]
self._async_schedule_save()
@callback
def async_get_refresh_token(self, token_id: str) -> models.RefreshToken | None:
"""Get refresh token by id."""
for user in self._users.values():
refresh_token = user.refresh_tokens.get(token_id)
if refresh_token is not None:
return refresh_token
if user_id := self._token_id_to_user_id.get(token_id):
return self._users[user_id].refresh_tokens.get(token_id)
return None
@callback
@@ -277,6 +281,21 @@ class AuthStore:
)
self._async_schedule_save()
@callback
def async_set_expiry(
self, refresh_token: models.RefreshToken, *, enable_expiry: bool
) -> None:
"""Enable or disable expiry of a refresh token."""
if enable_expiry:
if refresh_token.expire_at is None:
refresh_token.expire_at = (
refresh_token.last_used_at or dt_util.utcnow()
).timestamp() + REFRESH_TOKEN_EXPIRATION
self._async_schedule_save()
else:
refresh_token.expire_at = None
self._async_schedule_save()
async def async_load(self) -> None: # noqa: C901
"""Load the users."""
if self._loaded:
@@ -290,8 +309,6 @@ class AuthStore:
perm_lookup = PermissionLookup(ent_reg, dev_reg)
self._perm_lookup = perm_lookup
now_ts = dt_util.utcnow().timestamp()
if data is None or not isinstance(data, dict):
self._set_defaults()
return
@@ -445,14 +462,6 @@ class AuthStore:
else:
last_used_at = None
if (
expire_at := rt_dict.get("expire_at")
) is None and token_type == models.TOKEN_TYPE_NORMAL:
if last_used_at:
expire_at = last_used_at.timestamp() + REFRESH_TOKEN_EXPIRATION
else:
expire_at = now_ts + REFRESH_TOKEN_EXPIRATION
token = models.RefreshToken(
id=rt_dict["id"],
user=users[rt_dict["user_id"]],
@@ -469,7 +478,7 @@ class AuthStore:
jwt_key=rt_dict["jwt_key"],
last_used_at=last_used_at,
last_used_ip=rt_dict.get("last_used_ip"),
expire_at=expire_at,
expire_at=rt_dict.get("expire_at"),
version=rt_dict.get("version"),
)
if "credential_id" in rt_dict:
@@ -478,9 +487,18 @@ class AuthStore:
self._groups = groups
self._users = users
self._build_token_id_to_user_id()
self._async_schedule_save(INITIAL_LOAD_SAVE_DELAY)
@callback
def _build_token_id_to_user_id(self) -> None:
"""Build a map of token id to user id."""
self._token_id_to_user_id = {
token_id: user_id
for user_id, user in self._users.items()
for token_id in user.refresh_tokens
}
@callback
def _async_schedule_save(self, delay: float = DEFAULT_SAVE_DELAY) -> None:
"""Save users."""
@@ -574,6 +592,7 @@ class AuthStore:
read_only_group = _system_read_only_group()
groups[read_only_group.id] = read_only_group
self._groups = groups
self._build_token_id_to_user_id()
def _system_admin_group() -> models.Group:

View File

@@ -16,6 +16,7 @@ from homeassistant.data_entry_flow import FlowResult
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.importlib import async_import_module
from homeassistant.util.decorator import Registry
from homeassistant.util.hass_dict import HassKey
MULTI_FACTOR_AUTH_MODULES: Registry[str, type[MultiFactorAuthModule]] = Registry()
@@ -29,7 +30,7 @@ MULTI_FACTOR_AUTH_MODULE_SCHEMA = vol.Schema(
extra=vol.ALLOW_EXTRA,
)
DATA_REQS = "mfa_auth_module_reqs_processed"
DATA_REQS: HassKey[set[str]] = HassKey("mfa_auth_module_reqs_processed")
_LOGGER = logging.getLogger(__name__)

View File

@@ -88,7 +88,7 @@ class NotifySetting:
target: str | None = attr.ib(default=None)
_UsersDict = dict[str, NotifySetting]
type _UsersDict = dict[str, NotifySetting]
@MULTI_FACTOR_AUTH_MODULES.register("notify")

View File

@@ -4,17 +4,17 @@ from collections.abc import Mapping
# MyPy doesn't support recursion yet. So writing it out as far as we need.
ValueType = (
type ValueType = (
# Example: entities.all = { read: true, control: true }
Mapping[str, bool] | bool | None
)
# Example: entities.domains = { light: … }
SubCategoryDict = Mapping[str, ValueType]
type SubCategoryDict = Mapping[str, ValueType]
SubCategoryType = SubCategoryDict | bool | None
type SubCategoryType = SubCategoryDict | bool | None
CategoryType = (
type CategoryType = (
# Example: entities.domains
Mapping[str, SubCategoryType]
# Example: entities.all
@@ -24,4 +24,4 @@ CategoryType = (
)
# Example: { entities: … }
PolicyType = Mapping[str, CategoryType]
type PolicyType = Mapping[str, CategoryType]

View File

@@ -10,8 +10,8 @@ from .const import SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str], ValueType | None]
SubCatLookupType = dict[str, LookupFunc]
type LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str], ValueType | None]
type SubCatLookupType = dict[str, LookupFunc]
def lookup_all(

View File

@@ -17,13 +17,14 @@ from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.importlib import async_import_module
from homeassistant.util import dt as dt_util
from homeassistant.util.decorator import Registry
from homeassistant.util.hass_dict import HassKey
from ..auth_store import AuthStore
from ..const import MFA_SESSION_EXPIRATION
from ..models import AuthFlowResult, Credentials, RefreshToken, User, UserMeta
_LOGGER = logging.getLogger(__name__)
DATA_REQS = "auth_prov_reqs_processed"
DATA_REQS: HassKey[set[str]] = HassKey("auth_prov_reqs_processed")
AUTH_PROVIDERS: Registry[str, type[AuthProvider]] = Registry()

View File

@@ -28,8 +28,8 @@ from .. import InvalidAuthError
from ..models import AuthFlowResult, Credentials, RefreshToken, UserMeta
from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
IPAddress = IPv4Address | IPv6Address
IPNetwork = IPv4Network | IPv6Network
type IPAddress = IPv4Address | IPv6Address
type IPNetwork = IPv4Network | IPv6Network
CONF_TRUSTED_NETWORKS = "trusted_networks"
CONF_TRUSTED_USERS = "trusted_users"

View File

@@ -1,205 +0,0 @@
"""Session auth module."""
from __future__ import annotations
from datetime import datetime, timedelta
import secrets
from typing import TYPE_CHECKING, Final, TypedDict
from aiohttp.web import Request
from aiohttp_session import Session, get_session, new_session
from cryptography.fernet import Fernet
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers.event import async_call_later
from homeassistant.helpers.storage import Store
from homeassistant.util import dt as dt_util
from .models import RefreshToken
if TYPE_CHECKING:
from . import AuthManager
TEMP_TIMEOUT = timedelta(minutes=5)
TEMP_TIMEOUT_SECONDS = TEMP_TIMEOUT.total_seconds()
SESSION_ID = "id"
STORAGE_VERSION = 1
STORAGE_KEY = "auth.session"
class StrictConnectionTempSessionData:
"""Data for accessing unauthorized resources for a short period of time."""
__slots__ = ("cancel_remove", "absolute_expiry")
def __init__(self, cancel_remove: CALLBACK_TYPE) -> None:
"""Initialize the temp session data."""
self.cancel_remove: Final[CALLBACK_TYPE] = cancel_remove
self.absolute_expiry: Final[datetime] = dt_util.utcnow() + TEMP_TIMEOUT
class StoreData(TypedDict):
"""Data to store."""
unauthorized_sessions: dict[str, str]
key: str
class SessionManager:
"""Session manager."""
def __init__(self, hass: HomeAssistant, auth: AuthManager) -> None:
"""Initialize the strict connection manager."""
self._auth = auth
self._hass = hass
self._temp_sessions: dict[str, StrictConnectionTempSessionData] = {}
self._strict_connection_sessions: dict[str, str] = {}
self._store = Store[StoreData](
hass, STORAGE_VERSION, STORAGE_KEY, private=True, atomic_writes=True
)
self._key: str | None = None
self._refresh_token_revoke_callbacks: dict[str, CALLBACK_TYPE] = {}
@property
def key(self) -> str:
"""Return the encryption key."""
if self._key is None:
self._key = Fernet.generate_key().decode()
self._async_schedule_save()
return self._key
async def async_validate_request_for_strict_connection_session(
self,
request: Request,
) -> bool:
"""Check if a request has a valid strict connection session."""
session = await get_session(request)
if session.new or session.empty:
return False
result = self.async_validate_strict_connection_session(session)
if result is False:
session.invalidate()
return result
@callback
def async_validate_strict_connection_session(
self,
session: Session,
) -> bool:
"""Validate a strict connection session."""
if not (session_id := session.get(SESSION_ID)):
return False
if token_id := self._strict_connection_sessions.get(session_id):
if self._auth.async_get_refresh_token(token_id):
return True
# refresh token is invalid, delete entry
self._strict_connection_sessions.pop(session_id)
self._async_schedule_save()
if data := self._temp_sessions.get(session_id):
if dt_util.utcnow() <= data.absolute_expiry:
return True
# session expired, delete entry
self._temp_sessions.pop(session_id).cancel_remove()
return False
@callback
def _async_register_revoke_token_callback(self, refresh_token_id: str) -> None:
"""Register a callback to revoke all sessions for a refresh token."""
if refresh_token_id in self._refresh_token_revoke_callbacks:
return
@callback
def async_invalidate_auth_sessions() -> None:
"""Invalidate all sessions for a refresh token."""
self._strict_connection_sessions = {
session_id: token_id
for session_id, token_id in self._strict_connection_sessions.items()
if token_id != refresh_token_id
}
self._async_schedule_save()
self._refresh_token_revoke_callbacks[refresh_token_id] = (
self._auth.async_register_revoke_token_callback(
refresh_token_id, async_invalidate_auth_sessions
)
)
async def async_create_session(
self,
request: Request,
refresh_token: RefreshToken,
) -> None:
"""Create new session for given refresh token.
Caller needs to make sure that the refresh token is valid.
By creating a session, we are implicitly revoking all other
sessions for the given refresh token as there is one refresh
token per device/user case.
"""
self._strict_connection_sessions = {
session_id: token_id
for session_id, token_id in self._strict_connection_sessions.items()
if token_id != refresh_token.id
}
self._async_register_revoke_token_callback(refresh_token.id)
session_id = await self._async_create_new_session(request)
self._strict_connection_sessions[session_id] = refresh_token.id
self._async_schedule_save()
async def async_create_temp_unauthorized_session(self, request: Request) -> None:
"""Create a temporary unauthorized session."""
session_id = await self._async_create_new_session(
request, max_age=int(TEMP_TIMEOUT_SECONDS)
)
@callback
def remove(_: datetime) -> None:
self._temp_sessions.pop(session_id, None)
self._temp_sessions[session_id] = StrictConnectionTempSessionData(
async_call_later(self._hass, TEMP_TIMEOUT_SECONDS, remove)
)
async def _async_create_new_session(
self,
request: Request,
*,
max_age: int | None = None,
) -> str:
session_id = secrets.token_hex(64)
session = await new_session(request)
session[SESSION_ID] = session_id
if max_age is not None:
session.max_age = max_age
return session_id
@callback
def _async_schedule_save(self, delay: float = 1) -> None:
"""Save sessions."""
self._store.async_delay_save(self._data_to_save, delay)
@callback
def _data_to_save(self) -> StoreData:
"""Return the data to store."""
return StoreData(
unauthorized_sessions=self._strict_connection_sessions,
key=self.key,
)
async def async_setup(self) -> None:
"""Set up session manager."""
data = await self._store.async_load()
if data is None:
return
self._key = data["key"]
self._strict_connection_sessions = data["unauthorized_sessions"]
for token_id in self._strict_connection_sessions.values():
self._async_register_revoke_token_callback(token_id)

View File

@@ -1,9 +1,11 @@
"""Block blocking calls being done in asyncio."""
import builtins
from contextlib import suppress
from http.client import HTTPConnection
import importlib
import sys
import threading
import time
from typing import Any
@@ -12,12 +14,21 @@ from .util.loop import protect_loop
_IN_TESTS = "unittest" in sys.modules
ALLOWED_FILE_PREFIXES = ("/proc",)
def _check_import_call_allowed(mapped_args: dict[str, Any]) -> bool:
# If the module is already imported, we can ignore it.
return bool((args := mapped_args.get("args")) and args[0] in sys.modules)
def _check_file_allowed(mapped_args: dict[str, Any]) -> bool:
# If the file is in /proc we can ignore it.
args = mapped_args["args"]
path = args[0] if type(args[0]) is str else str(args[0]) # noqa: E721
return path.startswith(ALLOWED_FILE_PREFIXES)
def _check_sleep_call_allowed(mapped_args: dict[str, Any]) -> bool:
#
# Avoid extracting the stack unless we need to since it
@@ -25,7 +36,7 @@ def _check_sleep_call_allowed(mapped_args: dict[str, Any]) -> bool:
# I/O and we are trying to avoid blocking calls.
#
# frame[0] is us
# frame[1] is check_loop
# frame[1] is raise_for_blocking_call
# frame[2] is protected_loop_func
# frame[3] is the offender
with suppress(ValueError):
@@ -35,21 +46,29 @@ def _check_sleep_call_allowed(mapped_args: dict[str, Any]) -> bool:
def enable() -> None:
"""Enable the detection of blocking calls in the event loop."""
loop_thread_id = threading.get_ident()
# Prevent urllib3 and requests doing I/O in event loop
HTTPConnection.putrequest = protect_loop( # type: ignore[method-assign]
HTTPConnection.putrequest
HTTPConnection.putrequest, loop_thread_id=loop_thread_id
)
# Prevent sleeping in event loop. Non-strict since 2022.02
time.sleep = protect_loop(
time.sleep, strict=False, check_allowed=_check_sleep_call_allowed
time.sleep,
strict=False,
check_allowed=_check_sleep_call_allowed,
loop_thread_id=loop_thread_id,
)
# Currently disabled. pytz doing I/O when getting timezone.
# Prevent files being opened inside the event loop
# builtins.open = protect_loop(builtins.open)
if not _IN_TESTS:
# Prevent files being opened inside the event loop
builtins.open = protect_loop( # type: ignore[assignment]
builtins.open,
strict_core=False,
strict=False,
check_allowed=_check_file_allowed,
loop_thread_id=loop_thread_id,
)
# unittest uses `importlib.import_module` to do mocking
# so we cannot protect it if we are running tests
importlib.import_module = protect_loop(
@@ -57,4 +76,5 @@ def enable() -> None:
strict_core=False,
strict=False,
check_allowed=_check_import_call_allowed,
loop_thread_id=loop_thread_id,
)

View File

@@ -9,6 +9,7 @@ from functools import partial
from itertools import chain
import logging
import logging.handlers
import mimetypes
from operator import contains, itemgetter
import os
import platform
@@ -62,6 +63,7 @@ from .components import (
)
from .components.sensor import recorder as sensor_recorder # noqa: F401
from .const import (
BASE_PLATFORMS,
FORMAT_DATETIME,
KEY_DATA_LOGGING as DATA_LOGGING,
REQUIRED_NEXT_PYTHON_HA_RELEASE,
@@ -84,19 +86,23 @@ from .helpers import (
template,
translation,
)
from .helpers.dispatcher import async_dispatcher_send
from .helpers.dispatcher import async_dispatcher_send_internal
from .helpers.storage import get_internal_store_manager
from .helpers.system_info import async_get_system_info
from .helpers.typing import ConfigType
from .setup import (
BASE_PLATFORMS,
DATA_SETUP_STARTED,
# _setup_started is marked as protected to make it clear
# that it is not part of the public API and should not be used
# by integrations. It is only used for internal tracking of
# which integrations are being set up.
_setup_started,
async_get_setup_timings,
async_notify_setup_error,
async_set_domains_to_be_loaded,
async_setup_component,
)
from .util.async_ import create_eager_task
from .util.hass_dict import HassKey
from .util.logging import async_activate_log_queue_handler
from .util.package import async_get_user_site, is_virtual_env
@@ -116,7 +122,7 @@ SETUP_ORDER_SORT_KEY = partial(contains, BASE_PLATFORMS)
ERROR_LOG_FILENAME = "home-assistant.log"
# hass.data key for logging information.
DATA_REGISTRIES_LOADED = "bootstrap_registries_loaded"
DATA_REGISTRIES_LOADED: HassKey[None] = HassKey("bootstrap_registries_loaded")
LOG_SLOW_STARTUP_INTERVAL = 60
SLOW_STARTUP_CHECK_INTERVAL = 1
@@ -128,8 +134,15 @@ COOLDOWN_TIME = 60
DEBUGGER_INTEGRATIONS = {"debugpy"}
# Core integrations are unconditionally loaded
CORE_INTEGRATIONS = {"homeassistant", "persistent_notification"}
LOGGING_INTEGRATIONS = {
# Integrations that are loaded right after the core is set up
LOGGING_AND_HTTP_DEPS_INTEGRATIONS = {
# isal is loaded right away before `http` to ensure if its
# enabled, that `isal` is up to date.
"isal",
# Set log levels
"logger",
# Error logging
@@ -208,8 +221,8 @@ CRITICAL_INTEGRATIONS = {
}
SETUP_ORDER = (
# Load logging as soon as possible
("logging", LOGGING_INTEGRATIONS),
# Load logging and http deps as soon as possible
("logging, http deps", LOGGING_AND_HTTP_DEPS_INTEGRATIONS),
# Setup frontend and recorder
("frontend, recorder", {*FRONTEND_INTEGRATIONS, *RECORDER_INTEGRATIONS}),
# Start up debuggers. Start these first in case they want to wait.
@@ -366,23 +379,24 @@ def open_hass_ui(hass: core.HomeAssistant) -> None:
)
def _init_blocking_io_modules_in_executor() -> None:
"""Initialize modules that do blocking I/O in executor."""
# Cache the result of platform.uname().processor in the executor.
# Multiple modules call this function at startup which
# executes a blocking subprocess call. This is a problem for the
# asyncio event loop. By priming the cache of uname we can
# avoid the blocking call in the event loop.
_ = platform.uname().processor
# Initialize the mimetypes module to avoid blocking calls
# to the filesystem to load the mime.types file.
mimetypes.init()
async def async_load_base_functionality(hass: core.HomeAssistant) -> None:
"""Load the registries and cache the result of platform.uname().processor."""
"""Load the registries and modules that will do blocking I/O."""
if DATA_REGISTRIES_LOADED in hass.data:
return
hass.data[DATA_REGISTRIES_LOADED] = None
def _cache_uname_processor() -> None:
"""Cache the result of platform.uname().processor in the executor.
Multiple modules call this function at startup which
executes a blocking subprocess call. This is a problem for the
asyncio event loop. By primeing the cache of uname we can
avoid the blocking call in the event loop.
"""
_ = platform.uname().processor
# Load the registries and cache the result of platform.uname().processor
translation.async_setup(hass)
entity.async_setup(hass)
template.async_setup(hass)
@@ -395,7 +409,7 @@ async def async_load_base_functionality(hass: core.HomeAssistant) -> None:
create_eager_task(floor_registry.async_load(hass)),
create_eager_task(issue_registry.async_load(hass)),
create_eager_task(label_registry.async_load(hass)),
hass.async_add_executor_job(_cache_uname_processor),
hass.async_add_executor_job(_init_blocking_io_modules_in_executor),
create_eager_task(template.async_load_custom_templates(hass)),
create_eager_task(restore_state.async_load(hass)),
create_eager_task(hass.config_entries.async_initialize()),
@@ -414,6 +428,9 @@ async def async_from_config_dict(
start = monotonic()
hass.config_entries = config_entries.ConfigEntries(hass, config)
# Prime custom component cache early so we know if registry entries are tied
# to a custom integration
await loader.async_get_custom_components(hass)
await async_load_base_functionality(hass)
# Set up core.
@@ -422,7 +439,11 @@ async def async_from_config_dict(
if not all(
await asyncio.gather(
*(
create_eager_task(async_setup_component(hass, domain, config))
create_eager_task(
async_setup_component(hass, domain, config),
name=f"bootstrap setup {domain}",
loop=hass.loop,
)
for domain in CORE_INTEGRATIONS
)
)
@@ -676,7 +697,7 @@ class _WatchPendingSetups:
if remaining_with_setup_started:
_LOGGER.debug("Integration remaining: %s", remaining_with_setup_started)
elif waiting_tasks := self._hass._active_tasks: # pylint: disable=protected-access
elif waiting_tasks := self._hass._active_tasks: # noqa: SLF001
_LOGGER.debug("Waiting on tasks: %s", waiting_tasks)
self._async_dispatch(remaining_with_setup_started)
if (
@@ -696,7 +717,7 @@ class _WatchPendingSetups:
def _async_dispatch(self, remaining_with_setup_started: dict[str, float]) -> None:
"""Dispatch the signal."""
if remaining_with_setup_started or not self._previous_was_empty:
async_dispatcher_send(
async_dispatcher_send_internal(
self._hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
)
self._previous_was_empty = not remaining_with_setup_started
@@ -913,9 +934,7 @@ async def _async_set_up_integrations(
hass: core.HomeAssistant, config: dict[str, Any]
) -> None:
"""Set up all the integrations."""
setup_started: dict[tuple[str, str | None], float] = {}
hass.data[DATA_SETUP_STARTED] = setup_started
watcher = _WatchPendingSetups(hass, setup_started)
watcher = _WatchPendingSetups(hass, _setup_started(hass))
watcher.async_start()
domains_to_setup, integration_cache = await _async_resolve_domains_to_setup(
@@ -982,7 +1001,7 @@ async def _async_set_up_integrations(
except TimeoutError:
_LOGGER.warning(
"Setup timed out for stage 1 waiting on %s - moving forward",
hass._active_tasks, # pylint: disable=protected-access
hass._active_tasks, # noqa: SLF001
)
# Add after dependencies when setting up stage 2 domains
@@ -998,7 +1017,7 @@ async def _async_set_up_integrations(
except TimeoutError:
_LOGGER.warning(
"Setup timed out for stage 2 waiting on %s - moving forward",
hass._active_tasks, # pylint: disable=protected-access
hass._active_tasks, # noqa: SLF001
)
# Wrap up startup
@@ -1009,7 +1028,7 @@ async def _async_set_up_integrations(
except TimeoutError:
_LOGGER.warning(
"Setup timed out for bootstrap waiting on %s - moving forward",
hass._active_tasks, # pylint: disable=protected-access
hass._active_tasks, # noqa: SLF001
)
watcher.async_stop()

View File

@@ -5,9 +5,7 @@ from __future__ import annotations
from dataclasses import dataclass, field
from functools import partial
from jaraco.abode.automation import Automation as AbodeAuto
from jaraco.abode.client import Client as Abode
from jaraco.abode.devices.base import Device as AbodeDev
from jaraco.abode.exceptions import (
AuthenticationException as AbodeAuthenticationException,
Exception as AbodeException,
@@ -29,11 +27,11 @@ from homeassistant.const import (
)
from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, ServiceCall
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv, entity
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.dispatcher import dispatcher_send
from homeassistant.helpers.typing import ConfigType
from .const import ATTRIBUTION, CONF_POLLING, DOMAIN, LOGGER
from .const import CONF_POLLING, DOMAIN, LOGGER
SERVICE_SETTINGS = "change_setting"
SERVICE_CAPTURE_IMAGE = "capture_image"
@@ -83,6 +81,12 @@ class AbodeSystem:
logout_listener: CALLBACK_TYPE | None = None
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Abode component."""
setup_hass_services(hass)
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Abode integration from a config entry."""
username = entry.data[CONF_USERNAME]
@@ -111,7 +115,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
await setup_hass_events(hass)
await hass.async_add_executor_job(setup_hass_services, hass)
await hass.async_add_executor_job(setup_abode_events, hass)
return True
@@ -119,10 +122,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
hass.services.async_remove(DOMAIN, SERVICE_SETTINGS)
hass.services.async_remove(DOMAIN, SERVICE_CAPTURE_IMAGE)
hass.services.async_remove(DOMAIN, SERVICE_TRIGGER_AUTOMATION)
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
await hass.async_add_executor_job(hass.data[DOMAIN].abode.events.stop)
@@ -175,15 +174,15 @@ def setup_hass_services(hass: HomeAssistant) -> None:
signal = f"abode_trigger_automation_{entity_id}"
dispatcher_send(hass, signal)
hass.services.register(
hass.services.async_register(
DOMAIN, SERVICE_SETTINGS, change_setting, schema=CHANGE_SETTING_SCHEMA
)
hass.services.register(
hass.services.async_register(
DOMAIN, SERVICE_CAPTURE_IMAGE, capture_image, schema=CAPTURE_IMAGE_SCHEMA
)
hass.services.register(
hass.services.async_register(
DOMAIN, SERVICE_TRIGGER_AUTOMATION, trigger_automation, schema=AUTOMATION_SCHEMA
)
@@ -247,108 +246,3 @@ def setup_abode_events(hass: HomeAssistant) -> None:
hass.data[DOMAIN].abode.events.add_event_callback(
event, partial(event_callback, event)
)
class AbodeEntity(entity.Entity):
"""Representation of an Abode entity."""
_attr_attribution = ATTRIBUTION
_attr_has_entity_name = True
def __init__(self, data: AbodeSystem) -> None:
"""Initialize Abode entity."""
self._data = data
self._attr_should_poll = data.polling
async def async_added_to_hass(self) -> None:
"""Subscribe to Abode connection status updates."""
await self.hass.async_add_executor_job(
self._data.abode.events.add_connection_status_callback,
self.unique_id,
self._update_connection_status,
)
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from Abode connection status updates."""
await self.hass.async_add_executor_job(
self._data.abode.events.remove_connection_status_callback, self.unique_id
)
def _update_connection_status(self) -> None:
"""Update the entity available property."""
self._attr_available = self._data.abode.events.connected
self.schedule_update_ha_state()
class AbodeDevice(AbodeEntity):
"""Representation of an Abode device."""
def __init__(self, data: AbodeSystem, device: AbodeDev) -> None:
"""Initialize Abode device."""
super().__init__(data)
self._device = device
self._attr_unique_id = device.uuid
async def async_added_to_hass(self) -> None:
"""Subscribe to device events."""
await super().async_added_to_hass()
await self.hass.async_add_executor_job(
self._data.abode.events.add_device_callback,
self._device.id,
self._update_callback,
)
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from device events."""
await super().async_will_remove_from_hass()
await self.hass.async_add_executor_job(
self._data.abode.events.remove_all_device_callbacks, self._device.id
)
def update(self) -> None:
"""Update device state."""
self._device.refresh()
@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return the state attributes."""
return {
"device_id": self._device.id,
"battery_low": self._device.battery_low,
"no_response": self._device.no_response,
"device_type": self._device.type,
}
@property
def device_info(self) -> DeviceInfo:
"""Return device registry information for this entity."""
return DeviceInfo(
identifiers={(DOMAIN, self._device.id)},
manufacturer="Abode",
model=self._device.type,
name=self._device.name,
)
def _update_callback(self, device: AbodeDev) -> None:
"""Update the device state."""
self.schedule_update_ha_state()
class AbodeAutomation(AbodeEntity):
"""Representation of an Abode automation."""
def __init__(self, data: AbodeSystem, automation: AbodeAuto) -> None:
"""Initialize for Abode automation."""
super().__init__(data)
self._automation = automation
self._attr_name = automation.name
self._attr_unique_id = automation.automation_id
self._attr_extra_state_attributes = {
"type": "CUE automation",
}
def update(self) -> None:
"""Update automation state."""
self._automation.refresh()

View File

@@ -17,8 +17,9 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
async def async_setup_entry(

View File

@@ -22,8 +22,9 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.enum import try_parse_enum
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
async def async_setup_entry(

View File

@@ -19,8 +19,9 @@ from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import Throttle
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN, LOGGER
from .entity import AbodeDevice
MIN_TIME_BETWEEN_UPDATES = timedelta(seconds=90)

View File

@@ -10,8 +10,9 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
async def async_setup_entry(

View File

@@ -0,0 +1,115 @@
"""Support for Abode Security System entities."""
from jaraco.abode.automation import Automation as AbodeAuto
from jaraco.abode.devices.base import Device as AbodeDev
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import Entity
from . import AbodeSystem
from .const import ATTRIBUTION, DOMAIN
class AbodeEntity(Entity):
"""Representation of an Abode entity."""
_attr_attribution = ATTRIBUTION
_attr_has_entity_name = True
def __init__(self, data: AbodeSystem) -> None:
"""Initialize Abode entity."""
self._data = data
self._attr_should_poll = data.polling
async def async_added_to_hass(self) -> None:
"""Subscribe to Abode connection status updates."""
await self.hass.async_add_executor_job(
self._data.abode.events.add_connection_status_callback,
self.unique_id,
self._update_connection_status,
)
self.hass.data[DOMAIN].entity_ids.add(self.entity_id)
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from Abode connection status updates."""
await self.hass.async_add_executor_job(
self._data.abode.events.remove_connection_status_callback, self.unique_id
)
def _update_connection_status(self) -> None:
"""Update the entity available property."""
self._attr_available = self._data.abode.events.connected
self.schedule_update_ha_state()
class AbodeDevice(AbodeEntity):
"""Representation of an Abode device."""
def __init__(self, data: AbodeSystem, device: AbodeDev) -> None:
"""Initialize Abode device."""
super().__init__(data)
self._device = device
self._attr_unique_id = device.uuid
async def async_added_to_hass(self) -> None:
"""Subscribe to device events."""
await super().async_added_to_hass()
await self.hass.async_add_executor_job(
self._data.abode.events.add_device_callback,
self._device.id,
self._update_callback,
)
async def async_will_remove_from_hass(self) -> None:
"""Unsubscribe from device events."""
await super().async_will_remove_from_hass()
await self.hass.async_add_executor_job(
self._data.abode.events.remove_all_device_callbacks, self._device.id
)
def update(self) -> None:
"""Update device state."""
self._device.refresh()
@property
def extra_state_attributes(self) -> dict[str, str]:
"""Return the state attributes."""
return {
"device_id": self._device.id,
"battery_low": self._device.battery_low,
"no_response": self._device.no_response,
"device_type": self._device.type,
}
@property
def device_info(self) -> DeviceInfo:
"""Return device registry information for this entity."""
return DeviceInfo(
identifiers={(DOMAIN, self._device.id)},
manufacturer="Abode",
model=self._device.type,
name=self._device.name,
)
def _update_callback(self, device: AbodeDev) -> None:
"""Update the device state."""
self.schedule_update_ha_state()
class AbodeAutomation(AbodeEntity):
"""Representation of an Abode automation."""
def __init__(self, data: AbodeSystem, automation: AbodeAuto) -> None:
"""Initialize for Abode automation."""
super().__init__(data)
self._automation = automation
self._attr_name = automation.name
self._attr_unique_id = automation.automation_id
self._attr_extra_state_attributes = {
"type": "CUE automation",
}
def update(self) -> None:
"""Update automation state."""
self._automation.refresh()

View File

@@ -23,8 +23,9 @@ from homeassistant.util.color import (
color_temperature_mired_to_kelvin,
)
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
async def async_setup_entry(

View File

@@ -10,8 +10,9 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
async def async_setup_entry(

View File

@@ -27,8 +27,9 @@ from homeassistant.const import LIGHT_LUX, PERCENTAGE, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeDevice
ABODE_TEMPERATURE_UNIT_HA_UNIT = {
UNIT_FAHRENHEIT: UnitOfTemperature.FAHRENHEIT,

View File

@@ -13,8 +13,9 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AbodeAutomation, AbodeDevice, AbodeSystem
from . import AbodeSystem
from .const import DOMAIN
from .entity import AbodeAutomation, AbodeDevice
DEVICE_TYPES = [TYPE_SWITCH, TYPE_VALVE]

View File

@@ -33,7 +33,10 @@ class AccuWeatherData:
coordinator_daily_forecast: AccuWeatherDailyForecastDataUpdateCoordinator
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
type AccuWeatherConfigEntry = ConfigEntry[AccuWeatherData]
async def async_setup_entry(hass: HomeAssistant, entry: AccuWeatherConfigEntry) -> bool:
"""Set up AccuWeather as config entry."""
api_key: str = entry.data[CONF_API_KEY]
name: str = entry.data[CONF_NAME]
@@ -64,9 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await coordinator_observation.async_config_entry_first_refresh()
await coordinator_daily_forecast.async_config_entry_first_refresh()
entry.async_on_unload(entry.add_update_listener(update_listener))
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AccuWeatherData(
entry.runtime_data = AccuWeatherData(
coordinator_observation=coordinator_observation,
coordinator_daily_forecast=coordinator_daily_forecast,
)
@@ -84,16 +85,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(
hass: HomeAssistant, entry: AccuWeatherConfigEntry
) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update listener."""
await hass.config_entries.async_reload(entry.entry_id)
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -5,21 +5,19 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssistant
from . import AccuWeatherData
from .const import DOMAIN
from . import AccuWeatherConfigEntry, AccuWeatherData
TO_REDACT = {CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: AccuWeatherConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
accuweather_data: AccuWeatherData = hass.data[DOMAIN][config_entry.entry_id]
accuweather_data: AccuWeatherData = config_entry.runtime_data
return {
"config_entry_data": async_redact_data(dict(config_entry.data), TO_REDACT),

View File

@@ -12,7 +12,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_PARTS_PER_CUBIC_METER,
PERCENTAGE,
@@ -28,7 +27,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import AccuWeatherData
from . import AccuWeatherConfigEntry
from .const import (
API_METRIC,
ATTR_CATEGORY,
@@ -38,7 +37,6 @@ from .const import (
ATTR_SPEED,
ATTR_VALUE,
ATTRIBUTION,
DOMAIN,
MAX_FORECAST_DAYS,
)
from .coordinator import (
@@ -458,17 +456,16 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AccuWeatherConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add AccuWeather entities from a config_entry."""
accuweather_data: AccuWeatherData = hass.data[DOMAIN][entry.entry_id]
observation_coordinator: AccuWeatherObservationDataUpdateCoordinator = (
accuweather_data.coordinator_observation
entry.runtime_data.coordinator_observation
)
forecast_daily_coordinator: AccuWeatherDailyForecastDataUpdateCoordinator = (
accuweather_data.coordinator_daily_forecast
entry.runtime_data.coordinator_daily_forecast
)
sensors: list[AccuWeatherSensor | AccuWeatherForecastSensor] = [

View File

@@ -9,6 +9,7 @@ from accuweather.const import ENDPOINT
from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback
from . import AccuWeatherConfigEntry
from .const import DOMAIN
@@ -22,9 +23,11 @@ def async_register(
async def system_health_info(hass: HomeAssistant) -> dict[str, Any]:
"""Get info for the info page."""
remaining_requests = list(hass.data[DOMAIN].values())[
0
].coordinator_observation.accuweather.requests_remaining
config_entry: AccuWeatherConfigEntry = hass.config_entries.async_entries(DOMAIN)[0]
remaining_requests = (
config_entry.runtime_data.coordinator_observation.accuweather.requests_remaining
)
return {
"can_reach_server": system_health.async_check_can_reach_url(hass, ENDPOINT),

View File

@@ -21,7 +21,6 @@ from homeassistant.components.weather import (
Forecast,
WeatherEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
UnitOfLength,
UnitOfPrecipitationDepth,
@@ -31,10 +30,9 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import TimestampDataUpdateCoordinator
from homeassistant.util.dt import utc_from_timestamp
from . import AccuWeatherData
from . import AccuWeatherConfigEntry, AccuWeatherData
from .const import (
API_METRIC,
ATTR_DIRECTION,
@@ -42,7 +40,6 @@ from .const import (
ATTR_VALUE,
ATTRIBUTION,
CONDITION_MAP,
DOMAIN,
)
from .coordinator import (
AccuWeatherDailyForecastDataUpdateCoordinator,
@@ -53,20 +50,18 @@ PARALLEL_UPDATES = 1
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AccuWeatherConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add a AccuWeather weather entity from a config_entry."""
accuweather_data: AccuWeatherData = hass.data[DOMAIN][entry.entry_id]
async_add_entities([AccuWeatherEntity(accuweather_data)])
async_add_entities([AccuWeatherEntity(entry.runtime_data)])
class AccuWeatherEntity(
CoordinatorWeatherEntity[
AccuWeatherObservationDataUpdateCoordinator,
AccuWeatherDailyForecastDataUpdateCoordinator,
TimestampDataUpdateCoordinator,
TimestampDataUpdateCoordinator,
]
):
"""Define an AccuWeather entity."""

View File

@@ -4,30 +4,35 @@ from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .hub import PulseHub
CONF_HUBS = "hubs"
PLATFORMS = [Platform.COVER, Platform.SENSOR]
type AcmedaConfigEntry = ConfigEntry[PulseHub]
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_setup_entry(
hass: HomeAssistant, config_entry: AcmedaConfigEntry
) -> bool:
"""Set up Rollease Acmeda Automate hub from a config entry."""
hub = PulseHub(hass, config_entry)
if not await hub.async_setup():
return False
hass.data.setdefault(DOMAIN, {})[config_entry.entry_id] = hub
config_entry.runtime_data = hub
await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_unload_entry(
hass: HomeAssistant, config_entry: AcmedaConfigEntry
) -> bool:
"""Unload a config entry."""
hub = hass.data[DOMAIN][config_entry.entry_id]
hub = config_entry.runtime_data
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
@@ -36,7 +41,4 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
if not await hub.async_reset():
return False
if unload_ok:
hass.data[DOMAIN].pop(config_entry.entry_id)
return unload_ok

View File

@@ -9,24 +9,23 @@ from homeassistant.components.cover import (
CoverEntity,
CoverEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AcmedaConfigEntry
from .base import AcmedaBase
from .const import ACMEDA_HUB_UPDATE, DOMAIN
from .const import ACMEDA_HUB_UPDATE
from .helpers import async_add_acmeda_entities
from .hub import PulseHub
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AcmedaConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Acmeda Rollers from a config entry."""
hub: PulseHub = hass.data[DOMAIN][config_entry.entry_id]
hub = config_entry.runtime_data
current: set[int] = set()

View File

@@ -2,6 +2,8 @@
from __future__ import annotations
from typing import TYPE_CHECKING
from aiopulse import Roller
from homeassistant.config_entries import ConfigEntry
@@ -11,17 +13,20 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN, LOGGER
if TYPE_CHECKING:
from . import AcmedaConfigEntry
@callback
def async_add_acmeda_entities(
hass: HomeAssistant,
entity_class: type,
config_entry: ConfigEntry,
config_entry: AcmedaConfigEntry,
current: set[int],
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add any new entities."""
hub = hass.data[DOMAIN][config_entry.entry_id]
hub = config_entry.runtime_data
LOGGER.debug("Looking for new %s on: %s", entity_class.__name__, hub.host)
api = hub.api.rollers

View File

@@ -3,25 +3,24 @@
from __future__ import annotations
from homeassistant.components.sensor import SensorDeviceClass, SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AcmedaConfigEntry
from .base import AcmedaBase
from .const import ACMEDA_HUB_UPDATE, DOMAIN
from .const import ACMEDA_HUB_UPDATE
from .helpers import async_add_acmeda_entities
from .hub import PulseHub
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AcmedaConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Acmeda Rollers from a config entry."""
hub: PulseHub = hass.data[DOMAIN][config_entry.entry_id]
hub = config_entry.runtime_data
current: set[int] = set()

View File

@@ -7,7 +7,7 @@ from dataclasses import dataclass
from adguardhome import AdGuardHome, AdGuardHomeConnectionError
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.const import (
CONF_HOST,
CONF_NAME,
@@ -43,6 +43,7 @@ SERVICE_REFRESH_SCHEMA = vol.Schema(
)
PLATFORMS = [Platform.SENSOR, Platform.SWITCH]
type AdGuardConfigEntry = ConfigEntry[AdGuardData]
@dataclass
@@ -53,7 +54,7 @@ class AdGuardData:
version: str
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AdGuardConfigEntry) -> bool:
"""Set up AdGuard Home from a config entry."""
session = async_get_clientsession(hass, entry.data[CONF_VERIFY_SSL])
adguard = AdGuardHome(
@@ -71,7 +72,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except AdGuardHomeConnectionError as exception:
raise ConfigEntryNotReady from exception
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AdGuardData(adguard, version)
entry.runtime_data = AdGuardData(adguard, version)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@@ -116,17 +117,20 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AdGuardConfigEntry) -> bool:
"""Unload AdGuard Home config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
if not hass.data[DOMAIN]:
loaded_entries = [
entry
for entry in hass.config_entries.async_entries(DOMAIN)
if entry.state == ConfigEntryState.LOADED
]
if len(loaded_entries) == 1:
# This is the last loaded instance of AdGuard, deregister any services
hass.services.async_remove(DOMAIN, SERVICE_ADD_URL)
hass.services.async_remove(DOMAIN, SERVICE_REMOVE_URL)
hass.services.async_remove(DOMAIN, SERVICE_ENABLE_URL)
hass.services.async_remove(DOMAIN, SERVICE_DISABLE_URL)
hass.services.async_remove(DOMAIN, SERVICE_REFRESH)
del hass.data[DOMAIN]
return unload_ok

View File

@@ -4,11 +4,11 @@ from __future__ import annotations
from adguardhome import AdGuardHomeError
from homeassistant.config_entries import SOURCE_HASSIO, ConfigEntry
from homeassistant.config_entries import SOURCE_HASSIO
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity import Entity
from . import AdGuardData
from . import AdGuardConfigEntry, AdGuardData
from .const import DOMAIN, LOGGER
@@ -21,7 +21,7 @@ class AdGuardHomeEntity(Entity):
def __init__(
self,
data: AdGuardData,
entry: ConfigEntry,
entry: AdGuardConfigEntry,
) -> None:
"""Initialize the AdGuard Home entity."""
self._entry = entry

View File

@@ -10,12 +10,11 @@ from typing import Any
from adguardhome import AdGuardHome
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, UnitOfTime
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdGuardData
from . import AdGuardConfigEntry, AdGuardData
from .const import DOMAIN
from .entity import AdGuardHomeEntity
@@ -85,11 +84,11 @@ SENSORS: tuple[AdGuardHomeEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
entry: AdGuardConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdGuard Home sensor based on a config entry."""
data: AdGuardData = hass.data[DOMAIN][entry.entry_id]
data = entry.runtime_data
async_add_entities(
[AdGuardHomeSensor(data, entry, description) for description in SENSORS],
@@ -105,7 +104,7 @@ class AdGuardHomeSensor(AdGuardHomeEntity, SensorEntity):
def __init__(
self,
data: AdGuardData,
entry: ConfigEntry,
entry: AdGuardConfigEntry,
description: AdGuardHomeEntityDescription,
) -> None:
"""Initialize AdGuard Home sensor."""

View File

@@ -10,11 +10,10 @@ from typing import Any
from adguardhome import AdGuardHome, AdGuardHomeError
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdGuardData
from . import AdGuardConfigEntry, AdGuardData
from .const import DOMAIN, LOGGER
from .entity import AdGuardHomeEntity
@@ -79,11 +78,11 @@ SWITCHES: tuple[AdGuardHomeSwitchEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
entry: AdGuardConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdGuard Home switch based on a config entry."""
data: AdGuardData = hass.data[DOMAIN][entry.entry_id]
data = entry.runtime_data
async_add_entities(
[AdGuardHomeSwitch(data, entry, description) for description in SWITCHES],
@@ -99,7 +98,7 @@ class AdGuardHomeSwitch(AdGuardHomeEntity, SwitchEntity):
def __init__(
self,
data: AdGuardData,
entry: ConfigEntry,
entry: AdGuardConfigEntry,
description: AdGuardHomeSwitchEntityDescription,
) -> None:
"""Initialize AdGuard Home switch."""

View File

@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/ads",
"iot_class": "local_push",
"loggers": ["pyads"],
"requirements": ["pyads==3.2.2"]
"requirements": ["pyads==3.4.0"]
}

View File

@@ -12,9 +12,11 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.debounce import Debouncer
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import ADVANTAGE_AIR_RETRY, DOMAIN
from .const import ADVANTAGE_AIR_RETRY
from .models import AdvantageAirData
type AdvantageAirDataConfigEntry = ConfigEntry[AdvantageAirData]
ADVANTAGE_AIR_SYNC_INTERVAL = 15
PLATFORMS = [
Platform.BINARY_SENSOR,
@@ -31,7 +33,9 @@ _LOGGER = logging.getLogger(__name__)
REQUEST_REFRESH_DELAY = 0.5
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(
hass: HomeAssistant, entry: AdvantageAirDataConfigEntry
) -> bool:
"""Set up Advantage Air config."""
ip_address = entry.data[CONF_IP_ADDRESS]
port = entry.data[CONF_PORT]
@@ -61,19 +65,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = AdvantageAirData(coordinator, api)
entry.runtime_data = AdvantageAirData(coordinator, api)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(
hass: HomeAssistant, entry: AdvantageAirDataConfigEntry
) -> bool:
"""Unload Advantage Air Config."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -6,12 +6,11 @@ from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from . import AdvantageAirDataConfigEntry
from .entity import AdvantageAirAcEntity, AdvantageAirZoneEntity
from .models import AdvantageAirData
@@ -20,12 +19,12 @@ PARALLEL_UPDATES = 0
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir Binary Sensor platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[BinarySensorEntity] = []
if aircons := instance.coordinator.data.get("aircons"):

View File

@@ -16,19 +16,18 @@ from homeassistant.components.climate import (
ClimateEntityFeature,
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, UnitOfTemperature
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdvantageAirDataConfigEntry
from .const import (
ADVANTAGE_AIR_AUTOFAN_ENABLED,
ADVANTAGE_AIR_STATE_CLOSE,
ADVANTAGE_AIR_STATE_OFF,
ADVANTAGE_AIR_STATE_ON,
ADVANTAGE_AIR_STATE_OPEN,
DOMAIN as ADVANTAGE_AIR_DOMAIN,
)
from .entity import AdvantageAirAcEntity, AdvantageAirZoneEntity
from .models import AdvantageAirData
@@ -76,12 +75,12 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir climate platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[ClimateEntity] = []
if aircons := instance.coordinator.data.get("aircons"):

View File

@@ -8,15 +8,11 @@ from homeassistant.components.cover import (
CoverEntity,
CoverEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
ADVANTAGE_AIR_STATE_CLOSE,
ADVANTAGE_AIR_STATE_OPEN,
DOMAIN as ADVANTAGE_AIR_DOMAIN,
)
from . import AdvantageAirDataConfigEntry
from .const import ADVANTAGE_AIR_STATE_CLOSE, ADVANTAGE_AIR_STATE_OPEN
from .entity import AdvantageAirThingEntity, AdvantageAirZoneEntity
from .models import AdvantageAirData
@@ -25,12 +21,12 @@ PARALLEL_UPDATES = 0
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir cover platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[CoverEntity] = []
if aircons := instance.coordinator.data.get("aircons"):

View File

@@ -5,10 +5,9 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from . import AdvantageAirDataConfigEntry
TO_REDACT = [
"dealerPhoneNumber",
@@ -25,10 +24,10 @@ TO_REDACT = [
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: AdvantageAirDataConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
data = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id].coordinator.data
data = config_entry.runtime_data.coordinator.data
# Return only the relevant children
return {

View File

@@ -3,11 +3,11 @@
from typing import Any
from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdvantageAirDataConfigEntry
from .const import ADVANTAGE_AIR_STATE_ON, DOMAIN as ADVANTAGE_AIR_DOMAIN
from .entity import AdvantageAirEntity, AdvantageAirThingEntity
from .models import AdvantageAirData
@@ -15,12 +15,12 @@ from .models import AdvantageAirData
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir light platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[LightEntity] = []
if my_lights := instance.coordinator.data.get("myLights"):

View File

@@ -1,11 +1,10 @@
"""Select platform for Advantage Air integration."""
from homeassistant.components.select import SelectEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from . import AdvantageAirDataConfigEntry
from .entity import AdvantageAirAcEntity
from .models import AdvantageAirData
@@ -14,12 +13,12 @@ ADVANTAGE_AIR_INACTIVE = "Inactive"
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir select platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
if aircons := instance.coordinator.data.get("aircons"):
async_add_entities(AdvantageAirMyZone(instance, ac_key) for ac_key in aircons)

View File

@@ -12,13 +12,13 @@ from homeassistant.components.sensor import (
SensorEntity,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PERCENTAGE, EntityCategory, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import ADVANTAGE_AIR_STATE_OPEN, DOMAIN as ADVANTAGE_AIR_DOMAIN
from . import AdvantageAirDataConfigEntry
from .const import ADVANTAGE_AIR_STATE_OPEN
from .entity import AdvantageAirAcEntity, AdvantageAirZoneEntity
from .models import AdvantageAirData
@@ -31,12 +31,12 @@ PARALLEL_UPDATES = 0
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir sensor platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[SensorEntity] = []
if aircons := instance.coordinator.data.get("aircons"):

View File

@@ -3,15 +3,14 @@
from typing import Any
from homeassistant.components.switch import SwitchDeviceClass, SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdvantageAirDataConfigEntry
from .const import (
ADVANTAGE_AIR_AUTOFAN_ENABLED,
ADVANTAGE_AIR_STATE_OFF,
ADVANTAGE_AIR_STATE_ON,
DOMAIN as ADVANTAGE_AIR_DOMAIN,
)
from .entity import AdvantageAirAcEntity, AdvantageAirThingEntity
from .models import AdvantageAirData
@@ -19,12 +18,12 @@ from .models import AdvantageAirData
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir switch platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
entities: list[SwitchEntity] = []
if aircons := instance.coordinator.data.get("aircons"):

View File

@@ -1,11 +1,11 @@
"""Advantage Air Update platform."""
from homeassistant.components.update import UpdateEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AdvantageAirDataConfigEntry
from .const import DOMAIN as ADVANTAGE_AIR_DOMAIN
from .entity import AdvantageAirEntity
from .models import AdvantageAirData
@@ -13,12 +13,12 @@ from .models import AdvantageAirData
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AdvantageAirDataConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AdvantageAir update platform."""
instance: AdvantageAirData = hass.data[ADVANTAGE_AIR_DOMAIN][config_entry.entry_id]
instance = config_entry.runtime_data
async_add_entities([AdvantageAirApp(instance)])

View File

@@ -1,5 +1,6 @@
"""The AEMET OpenData component."""
from dataclasses import dataclass
import logging
from aemet_opendata.exceptions import AemetError, TownNotFound
@@ -11,19 +12,23 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import aiohttp_client
from .const import (
CONF_STATION_UPDATES,
DOMAIN,
ENTRY_NAME,
ENTRY_WEATHER_COORDINATOR,
PLATFORMS,
)
from .const import CONF_STATION_UPDATES, PLATFORMS
from .coordinator import WeatherUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
type AemetConfigEntry = ConfigEntry[AemetData]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
@dataclass
class AemetData:
"""Aemet runtime data."""
name: str
coordinator: WeatherUpdateCoordinator
async def async_setup_entry(hass: HomeAssistant, entry: AemetConfigEntry) -> bool:
"""Set up AEMET OpenData as config entry."""
name = entry.data[CONF_NAME]
api_key = entry.data[CONF_API_KEY]
@@ -44,11 +49,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
weather_coordinator = WeatherUpdateCoordinator(hass, aemet)
await weather_coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = {
ENTRY_NAME: name,
ENTRY_WEATHER_COORDINATOR: weather_coordinator,
}
entry.runtime_data = AemetData(name=name, coordinator=weather_coordinator)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@@ -64,9 +65,4 @@ async def async_update_options(hass: HomeAssistant, entry: ConfigEntry) -> None:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -55,8 +55,6 @@ CONF_STATION_UPDATES = "station_updates"
PLATFORMS = [Platform.SENSOR, Platform.WEATHER]
DEFAULT_NAME = "AEMET"
DOMAIN = "aemet"
ENTRY_NAME = "name"
ENTRY_WEATHER_COORDINATOR = "weather_coordinator"
ATTR_API_CONDITION = "condition"
ATTR_API_FORECAST_CONDITION = "condition"

View File

@@ -7,7 +7,6 @@ from typing import Any
from aemet_opendata.const import AOD_COORDS
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
@@ -16,8 +15,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from .const import DOMAIN, ENTRY_WEATHER_COORDINATOR
from .coordinator import WeatherUpdateCoordinator
from . import AemetConfigEntry
TO_REDACT_CONFIG = [
CONF_API_KEY,
@@ -32,11 +30,10 @@ TO_REDACT_COORD = [
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: AemetConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
aemet_entry = hass.data[DOMAIN][config_entry.entry_id]
coordinator: WeatherUpdateCoordinator = aemet_entry[ENTRY_WEATHER_COORDINATOR]
coordinator = config_entry.runtime_data.coordinator
return {
"api_data": coordinator.aemet.raw_data(),

View File

@@ -56,6 +56,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import dt as dt_util
from . import AemetConfigEntry
from .const import (
ATTR_API_CONDITION,
ATTR_API_FORECAST_CONDITION,
@@ -87,9 +88,6 @@ from .const import (
ATTR_API_WIND_SPEED,
ATTRIBUTION,
CONDITIONS_MAP,
DOMAIN,
ENTRY_NAME,
ENTRY_WEATHER_COORDINATOR,
)
from .coordinator import WeatherUpdateCoordinator
from .entity import AemetEntity
@@ -360,13 +358,13 @@ WEATHER_SENSORS: Final[tuple[AemetSensorEntityDescription, ...]] = (
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AemetConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AEMET OpenData sensor entities based on a config entry."""
domain_data = hass.data[DOMAIN][config_entry.entry_id]
name: str = domain_data[ENTRY_NAME]
coordinator: WeatherUpdateCoordinator = domain_data[ENTRY_WEATHER_COORDINATOR]
domain_data = config_entry.runtime_data
name = domain_data.name
coordinator = domain_data.coordinator
async_add_entities(
AemetSensor(

View File

@@ -18,7 +18,6 @@ from homeassistant.components.weather import (
SingleCoordinatorWeatherEntity,
WeatherEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
UnitOfPrecipitationDepth,
UnitOfPressure,
@@ -28,32 +27,24 @@ from homeassistant.const import (
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
ATTRIBUTION,
CONDITIONS_MAP,
DOMAIN,
ENTRY_NAME,
ENTRY_WEATHER_COORDINATOR,
)
from . import AemetConfigEntry
from .const import ATTRIBUTION, CONDITIONS_MAP
from .coordinator import WeatherUpdateCoordinator
from .entity import AemetEntity
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AemetConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AEMET OpenData weather entity based on a config entry."""
domain_data = hass.data[DOMAIN][config_entry.entry_id]
weather_coordinator = domain_data[ENTRY_WEATHER_COORDINATOR]
domain_data = config_entry.runtime_data
name = domain_data.name
weather_coordinator = domain_data.coordinator
async_add_entities(
[
AemetWeather(
domain_data[ENTRY_NAME], config_entry.unique_id, weather_coordinator
)
],
[AemetWeather(name, config_entry.unique_id, weather_coordinator)],
False,
)

View File

@@ -10,16 +10,14 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
PLATFORMS: list[Platform] = [Platform.SENSOR]
type AfterShipConfigEntry = ConfigEntry[AfterShip]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AfterShipConfigEntry) -> bool:
"""Set up AfterShip from a config entry."""
hass.data.setdefault(DOMAIN, {})
session = async_get_clientsession(hass)
aftership = AfterShip(api_key=entry.data[CONF_API_KEY], session=session)
@@ -28,7 +26,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except AfterShipException as err:
raise ConfigEntryNotReady from err
hass.data[DOMAIN][entry.entry_id] = aftership
entry.runtime_data = aftership
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@@ -37,7 +35,4 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -8,7 +8,6 @@ from typing import Any, Final
from pyaftership import AfterShip, AfterShipException
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, ServiceCall
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import (
@@ -18,6 +17,7 @@ from homeassistant.helpers.dispatcher import (
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import Throttle
from . import AfterShipConfigEntry
from .const import (
ADD_TRACKING_SERVICE_SCHEMA,
ATTR_TRACKINGS,
@@ -41,11 +41,11 @@ PLATFORM_SCHEMA: Final = cv.removed(DOMAIN, raise_if_present=False)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AfterShipConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AfterShip sensor entities based on a config entry."""
aftership: AfterShip = hass.data[DOMAIN][config_entry.entry_id]
aftership = config_entry.runtime_data
async_add_entities([AfterShipSensor(aftership, config_entry.title)], True)

View File

@@ -10,18 +10,20 @@ from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import CONNECTION, DOMAIN as AGENT_DOMAIN, SERVER_URL
from .const import DOMAIN as AGENT_DOMAIN, SERVER_URL
ATTRIBUTION = "ispyconnect.com"
DEFAULT_BRAND = "Agent DVR by ispyconnect.com"
PLATFORMS = [Platform.ALARM_CONTROL_PANEL, Platform.CAMERA]
AgentDVRConfigEntry = ConfigEntry[Agent]
async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_setup_entry(
hass: HomeAssistant, config_entry: AgentDVRConfigEntry
) -> bool:
"""Set up the Agent component."""
hass.data.setdefault(AGENT_DOMAIN, {})
server_origin = config_entry.data[SERVER_URL]
agent_client = Agent(server_origin, async_get_clientsession(hass))
@@ -34,9 +36,11 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
if not agent_client.is_available:
raise ConfigEntryNotReady
config_entry.async_on_unload(agent_client.close)
await agent_client.get_devices()
hass.data[AGENT_DOMAIN][config_entry.entry_id] = {CONNECTION: agent_client}
config_entry.runtime_data = agent_client
device_registry = dr.async_get(hass)
@@ -54,15 +58,8 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> b
return True
async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) -> bool:
async def async_unload_entry(
hass: HomeAssistant, config_entry: AgentDVRConfigEntry
) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
config_entry, PLATFORMS
)
await hass.data[AGENT_DOMAIN][config_entry.entry_id][CONNECTION].close()
if unload_ok:
hass.data[AGENT_DOMAIN].pop(config_entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(config_entry, PLATFORMS)

View File

@@ -6,7 +6,6 @@ from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntity,
AlarmControlPanelEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_HOME,
@@ -17,7 +16,8 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import CONNECTION, DOMAIN as AGENT_DOMAIN
from . import AgentDVRConfigEntry
from .const import DOMAIN as AGENT_DOMAIN
CONF_HOME_MODE_NAME = "home"
CONF_AWAY_MODE_NAME = "away"
@@ -28,13 +28,11 @@ CONST_ALARM_CONTROL_PANEL_NAME = "Alarm Panel"
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AgentDVRConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Agent DVR Alarm Control Panels."""
async_add_entities(
[AgentBaseStation(hass.data[AGENT_DOMAIN][config_entry.entry_id][CONNECTION])]
)
async_add_entities([AgentBaseStation(config_entry.runtime_data)])
class AgentBaseStation(AlarmControlPanelEntity):
@@ -45,6 +43,7 @@ class AgentBaseStation(AlarmControlPanelEntity):
| AlarmControlPanelEntityFeature.ARM_AWAY
| AlarmControlPanelEntityFeature.ARM_NIGHT
)
_attr_code_arm_required = False
_attr_has_entity_name = True
_attr_name = None

View File

@@ -7,7 +7,6 @@ from agent import AgentError
from homeassistant.components.camera import CameraEntityFeature
from homeassistant.components.mjpeg import MjpegCamera, filter_urllib3_logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity_platform import (
@@ -15,12 +14,8 @@ from homeassistant.helpers.entity_platform import (
async_get_current_platform,
)
from .const import (
ATTRIBUTION,
CAMERA_SCAN_INTERVAL_SECS,
CONNECTION,
DOMAIN as AGENT_DOMAIN,
)
from . import AgentDVRConfigEntry
from .const import ATTRIBUTION, CAMERA_SCAN_INTERVAL_SECS, DOMAIN as AGENT_DOMAIN
SCAN_INTERVAL = timedelta(seconds=CAMERA_SCAN_INTERVAL_SECS)
@@ -43,14 +38,14 @@ CAMERA_SERVICES = {
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AgentDVRConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Agent cameras."""
filter_urllib3_logging()
cameras = []
server = hass.data[AGENT_DOMAIN][config_entry.entry_id][CONNECTION]
server = config_entry.runtime_data
if not server.devices:
_LOGGER.warning("Could not fetch cameras from Agent server")
return
@@ -80,11 +75,11 @@ class AgentCamera(MjpegCamera):
"""Initialize as a subclass of MjpegCamera."""
self.device = device
self._removed = False
self._attr_unique_id = f"{device._client.unique}_{device.typeID}_{device.id}"
self._attr_unique_id = f"{device.client.unique}_{device.typeID}_{device.id}"
super().__init__(
name=device.name,
mjpeg_url=f"{device.client._server_url}{device.mjpeg_image_url}&size={device.mjpegStreamWidth}x{device.mjpegStreamHeight}",
still_image_url=f"{device.client._server_url}{device.still_image_url}&size={device.mjpegStreamWidth}x{device.mjpegStreamHeight}",
mjpeg_url=f"{device.client._server_url}{device.mjpeg_image_url}&size={device.mjpegStreamWidth}x{device.mjpegStreamHeight}", # noqa: SLF001
still_image_url=f"{device.client._server_url}{device.still_image_url}&size={device.mjpegStreamWidth}x{device.mjpegStreamHeight}", # noqa: SLF001
)
self._attr_device_info = DeviceInfo(
identifiers={(AGENT_DOMAIN, self.unique_id)},

View File

@@ -9,4 +9,3 @@ SERVICE_UPDATE = "update"
SIGNAL_UPDATE_AGENT = "agent_update"
ATTRIBUTION = "Data provided by ispyconnect.com"
SERVER_URL = "server_url"
CONNECTION = "connection"

View File

@@ -18,6 +18,7 @@ from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType, StateType
from . import group as group_pre_import # noqa: F401
from .const import DOMAIN
_LOGGER: Final = logging.getLogger(__name__)
@@ -33,8 +34,6 @@ ATTR_PM_10: Final = "particulate_matter_10"
ATTR_PM_2_5: Final = "particulate_matter_2_5"
ATTR_SO2: Final = "sulphur_dioxide"
DOMAIN: Final = "air_quality"
ENTITY_ID_FORMAT: Final = DOMAIN + ".{}"
SCAN_INTERVAL: Final = timedelta(seconds=30)

View File

@@ -0,0 +1,5 @@
"""Constants for the air_quality entity platform."""
from typing import Final
DOMAIN: Final = "air_quality"

View File

@@ -1,5 +1,7 @@
"""Describe group states."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.core import HomeAssistant, callback
@@ -7,10 +9,12 @@ from homeassistant.core import HomeAssistant, callback
if TYPE_CHECKING:
from homeassistant.components.group import GroupIntegrationRegistry
from .const import DOMAIN
@callback
def async_describe_on_off_states(
hass: HomeAssistant, registry: "GroupIntegrationRegistry"
hass: HomeAssistant, registry: GroupIntegrationRegistry
) -> None:
"""Describe group on off states."""
registry.exclude_domain()
registry.exclude_domain(DOMAIN)

View File

@@ -0,0 +1,57 @@
"""The Airgradient integration."""
from __future__ import annotations
from airgradient import AirGradientClient
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
from .coordinator import AirGradientConfigCoordinator, AirGradientMeasurementCoordinator
PLATFORMS: list[Platform] = [Platform.SELECT, Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Airgradient from a config entry."""
client = AirGradientClient(
entry.data[CONF_HOST], session=async_get_clientsession(hass)
)
measurement_coordinator = AirGradientMeasurementCoordinator(hass, client)
config_coordinator = AirGradientConfigCoordinator(hass, client)
await measurement_coordinator.async_config_entry_first_refresh()
await config_coordinator.async_config_entry_first_refresh()
device_registry = dr.async_get(hass)
device_registry.async_get_or_create(
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, measurement_coordinator.serial_number)},
manufacturer="AirGradient",
model=measurement_coordinator.data.model,
serial_number=measurement_coordinator.data.serial_number,
sw_version=measurement_coordinator.data.firmware_version,
)
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = {
"measurement": measurement_coordinator,
"config": config_coordinator,
}
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok

View File

@@ -0,0 +1,102 @@
"""Config flow for Airgradient."""
from typing import Any
from airgradient import AirGradientClient, AirGradientError, ConfigurationControl
from awesomeversion import AwesomeVersion
from mashumaro import MissingField
import voluptuous as vol
from homeassistant.components import zeroconf
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_HOST, CONF_MODEL
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
MIN_VERSION = AwesomeVersion("3.1.1")
class AirGradientConfigFlow(ConfigFlow, domain=DOMAIN):
"""AirGradient config flow."""
def __init__(self) -> None:
"""Initialize the config flow."""
self.data: dict[str, Any] = {}
self.client: AirGradientClient | None = None
async def set_configuration_source(self) -> None:
"""Set configuration source to local if it hasn't been set yet."""
assert self.client
config = await self.client.get_config()
if config.configuration_control is ConfigurationControl.NOT_INITIALIZED:
await self.client.set_configuration_control(ConfigurationControl.LOCAL)
async def async_step_zeroconf(
self, discovery_info: zeroconf.ZeroconfServiceInfo
) -> ConfigFlowResult:
"""Handle zeroconf discovery."""
self.data[CONF_HOST] = host = discovery_info.host
self.data[CONF_MODEL] = discovery_info.properties["model"]
await self.async_set_unique_id(discovery_info.properties["serialno"])
self._abort_if_unique_id_configured(updates={CONF_HOST: host})
if AwesomeVersion(discovery_info.properties["fw_ver"]) < MIN_VERSION:
return self.async_abort(reason="invalid_version")
session = async_get_clientsession(self.hass)
self.client = AirGradientClient(host, session=session)
await self.client.get_current_measures()
self.context["title_placeholders"] = {
"model": self.data[CONF_MODEL],
}
return await self.async_step_discovery_confirm()
async def async_step_discovery_confirm(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Confirm discovery."""
if user_input is not None:
await self.set_configuration_source()
return self.async_create_entry(
title=self.data[CONF_MODEL],
data={CONF_HOST: self.data[CONF_HOST]},
)
self._set_confirm_only()
return self.async_show_form(
step_id="discovery_confirm",
description_placeholders={
"model": self.data[CONF_MODEL],
},
)
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a flow initialized by the user."""
errors: dict[str, str] = {}
if user_input:
session = async_get_clientsession(self.hass)
self.client = AirGradientClient(user_input[CONF_HOST], session=session)
try:
current_measures = await self.client.get_current_measures()
except AirGradientError:
errors["base"] = "cannot_connect"
except MissingField:
return self.async_abort(reason="invalid_version")
else:
await self.async_set_unique_id(current_measures.serial_number)
self._abort_if_unique_id_configured()
await self.set_configuration_source()
return self.async_create_entry(
title=current_measures.model,
data={CONF_HOST: user_input[CONF_HOST]},
)
return self.async_show_form(
step_id="user",
data_schema=vol.Schema({vol.Required(CONF_HOST): str}),
errors=errors,
)

View File

@@ -0,0 +1,7 @@
"""Constants for the Airgradient integration."""
import logging
DOMAIN = "airgradient"
LOGGER = logging.getLogger(__package__)

View File

@@ -0,0 +1,57 @@
"""Define an object to manage fetching AirGradient data."""
from datetime import timedelta
from airgradient import AirGradientClient, AirGradientError, Config, Measures
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import LOGGER
class AirGradientCoordinator[_DataT](DataUpdateCoordinator[_DataT]):
"""Class to manage fetching AirGradient data."""
_update_interval: timedelta
config_entry: ConfigEntry
def __init__(self, hass: HomeAssistant, client: AirGradientClient) -> None:
"""Initialize coordinator."""
super().__init__(
hass,
logger=LOGGER,
name=f"AirGradient {client.host}",
update_interval=self._update_interval,
)
self.client = client
assert self.config_entry.unique_id
self.serial_number = self.config_entry.unique_id
async def _async_update_data(self) -> _DataT:
try:
return await self._update_data()
except AirGradientError as error:
raise UpdateFailed(error) from error
async def _update_data(self) -> _DataT:
raise NotImplementedError
class AirGradientMeasurementCoordinator(AirGradientCoordinator[Measures]):
"""Class to manage fetching AirGradient data."""
_update_interval = timedelta(minutes=1)
async def _update_data(self) -> Measures:
return await self.client.get_current_measures()
class AirGradientConfigCoordinator(AirGradientCoordinator[Config]):
"""Class to manage fetching AirGradient data."""
_update_interval = timedelta(minutes=5)
async def _update_data(self) -> Config:
return await self.client.get_config()

View File

@@ -0,0 +1,20 @@
"""Base class for AirGradient entities."""
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import AirGradientCoordinator
class AirGradientEntity(CoordinatorEntity[AirGradientCoordinator]):
"""Defines a base AirGradient entity."""
_attr_has_entity_name = True
def __init__(self, coordinator: AirGradientCoordinator) -> None:
"""Initialize airgradient entity."""
super().__init__(coordinator)
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, coordinator.serial_number)},
)

View File

@@ -0,0 +1,15 @@
{
"entity": {
"sensor": {
"total_volatile_organic_component_index": {
"default": "mdi:molecule"
},
"nitrogen_index": {
"default": "mdi:molecule"
},
"pm003_count": {
"default": "mdi:blur"
}
}
}
}

View File

@@ -0,0 +1,11 @@
{
"domain": "airgradient",
"name": "AirGradient",
"codeowners": ["@airgradienthq", "@joostlek"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/airgradient",
"integration_type": "device",
"iot_class": "local_polling",
"requirements": ["airgradient==0.4.3"],
"zeroconf": ["_airgradient._tcp.local."]
}

View File

@@ -0,0 +1,124 @@
"""Support for AirGradient select entities."""
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from airgradient import AirGradientClient, Config
from airgradient.models import ConfigurationControl, TemperatureUnit
from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .coordinator import AirGradientConfigCoordinator, AirGradientMeasurementCoordinator
from .entity import AirGradientEntity
@dataclass(frozen=True, kw_only=True)
class AirGradientSelectEntityDescription(SelectEntityDescription):
"""Describes AirGradient select entity."""
value_fn: Callable[[Config], str | None]
set_value_fn: Callable[[AirGradientClient, str], Awaitable[None]]
requires_display: bool = False
CONFIG_CONTROL_ENTITY = AirGradientSelectEntityDescription(
key="configuration_control",
translation_key="configuration_control",
options=[ConfigurationControl.CLOUD.value, ConfigurationControl.LOCAL.value],
entity_category=EntityCategory.CONFIG,
value_fn=lambda config: config.configuration_control
if config.configuration_control is not ConfigurationControl.NOT_INITIALIZED
else None,
set_value_fn=lambda client, value: client.set_configuration_control(
ConfigurationControl(value)
),
)
PROTECTED_SELECT_TYPES: tuple[AirGradientSelectEntityDescription, ...] = (
AirGradientSelectEntityDescription(
key="display_temperature_unit",
translation_key="display_temperature_unit",
options=[x.value for x in TemperatureUnit],
entity_category=EntityCategory.CONFIG,
value_fn=lambda config: config.temperature_unit,
set_value_fn=lambda client, value: client.set_temperature_unit(
TemperatureUnit(value)
),
requires_display=True,
),
)
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up AirGradient select entities based on a config entry."""
config_coordinator: AirGradientConfigCoordinator = hass.data[DOMAIN][
entry.entry_id
]["config"]
measurement_coordinator: AirGradientMeasurementCoordinator = hass.data[DOMAIN][
entry.entry_id
]["measurement"]
entities = [AirGradientSelect(config_coordinator, CONFIG_CONTROL_ENTITY)]
entities.extend(
AirGradientProtectedSelect(config_coordinator, description)
for description in PROTECTED_SELECT_TYPES
if (
description.requires_display
and measurement_coordinator.data.model.startswith("I")
)
)
async_add_entities(entities)
class AirGradientSelect(AirGradientEntity, SelectEntity):
"""Defines an AirGradient select entity."""
entity_description: AirGradientSelectEntityDescription
coordinator: AirGradientConfigCoordinator
def __init__(
self,
coordinator: AirGradientConfigCoordinator,
description: AirGradientSelectEntityDescription,
) -> None:
"""Initialize AirGradient select."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@property
def current_option(self) -> str | None:
"""Return the state of the select."""
return self.entity_description.value_fn(self.coordinator.data)
async def async_select_option(self, option: str) -> None:
"""Change the selected option."""
await self.entity_description.set_value_fn(self.coordinator.client, option)
await self.coordinator.async_request_refresh()
class AirGradientProtectedSelect(AirGradientSelect):
"""Defines a protected AirGradient select entity."""
async def async_select_option(self, option: str) -> None:
"""Change the selected option."""
if (
self.coordinator.data.configuration_control
is not ConfigurationControl.LOCAL
):
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="no_local_configuration",
)
await super().async_select_option(option)

View File

@@ -0,0 +1,183 @@
"""Support for AirGradient sensors."""
from collections.abc import Callable
from dataclasses import dataclass
from airgradient.models import Measures
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONCENTRATION_PARTS_PER_MILLION,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from .const import DOMAIN
from .coordinator import AirGradientMeasurementCoordinator
from .entity import AirGradientEntity
@dataclass(frozen=True, kw_only=True)
class AirGradientSensorEntityDescription(SensorEntityDescription):
"""Describes AirGradient sensor entity."""
value_fn: Callable[[Measures], StateType]
SENSOR_TYPES: tuple[AirGradientSensorEntityDescription, ...] = (
AirGradientSensorEntityDescription(
key="pm01",
device_class=SensorDeviceClass.PM1,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.pm01,
),
AirGradientSensorEntityDescription(
key="pm02",
device_class=SensorDeviceClass.PM25,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.pm02,
),
AirGradientSensorEntityDescription(
key="pm10",
device_class=SensorDeviceClass.PM10,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.pm10,
),
AirGradientSensorEntityDescription(
key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.ambient_temperature,
),
AirGradientSensorEntityDescription(
key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.relative_humidity,
),
AirGradientSensorEntityDescription(
key="signal_strength",
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
value_fn=lambda status: status.signal_strength,
),
AirGradientSensorEntityDescription(
key="tvoc",
translation_key="total_volatile_organic_component_index",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.total_volatile_organic_component_index,
),
AirGradientSensorEntityDescription(
key="nitrogen_index",
translation_key="nitrogen_index",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.nitrogen_index,
),
AirGradientSensorEntityDescription(
key="co2",
device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.rco2,
),
AirGradientSensorEntityDescription(
key="pm003",
translation_key="pm003_count",
native_unit_of_measurement="particles/dL",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda status: status.pm003_count,
),
AirGradientSensorEntityDescription(
key="nox_raw",
translation_key="raw_nitrogen",
native_unit_of_measurement="ticks",
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
value_fn=lambda status: status.raw_nitrogen,
),
AirGradientSensorEntityDescription(
key="tvoc_raw",
translation_key="raw_total_volatile_organic_component",
native_unit_of_measurement="ticks",
state_class=SensorStateClass.MEASUREMENT,
entity_registry_enabled_default=False,
value_fn=lambda status: status.raw_total_volatile_organic_component,
),
)
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Set up AirGradient sensor entities based on a config entry."""
coordinator: AirGradientMeasurementCoordinator = hass.data[DOMAIN][entry.entry_id][
"measurement"
]
listener: Callable[[], None] | None = None
not_setup: set[AirGradientSensorEntityDescription] = set(SENSOR_TYPES)
@callback
def add_entities() -> None:
"""Add new entities based on the latest data."""
nonlocal not_setup, listener
sensor_descriptions = not_setup
not_setup = set()
sensors = []
for description in sensor_descriptions:
if description.value_fn(coordinator.data) is None:
not_setup.add(description)
else:
sensors.append(AirGradientSensor(coordinator, description))
if sensors:
async_add_entities(sensors)
if not_setup:
if not listener:
listener = coordinator.async_add_listener(add_entities)
elif listener:
listener()
add_entities()
class AirGradientSensor(AirGradientEntity, SensorEntity):
"""Defines an AirGradient sensor."""
entity_description: AirGradientSensorEntityDescription
coordinator: AirGradientMeasurementCoordinator
def __init__(
self,
coordinator: AirGradientMeasurementCoordinator,
description: AirGradientSensorEntityDescription,
) -> None:
"""Initialize airgradient sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.serial_number}-{description.key}"
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self.entity_description.value_fn(self.coordinator.data)

View File

@@ -0,0 +1,66 @@
{
"config": {
"flow_title": "{model}",
"step": {
"user": {
"data": {
"host": "[%key:common::config_flow::data::host%]"
},
"data_description": {
"host": "The hostname or IP address of the Airgradient device."
}
},
"discovery_confirm": {
"description": "Do you want to setup {model}?"
}
},
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
"invalid_version": "This firmware version is unsupported. Please upgrade the firmware of the device to at least version 3.1.1."
},
"error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"unknown": "[%key:common::config_flow::error::unknown%]"
}
},
"entity": {
"select": {
"configuration_control": {
"name": "Configuration source",
"state": {
"cloud": "Cloud",
"local": "Local"
}
},
"display_temperature_unit": {
"name": "Display temperature unit",
"state": {
"c": "Celsius",
"f": "Fahrenheit"
}
}
},
"sensor": {
"total_volatile_organic_component_index": {
"name": "Total VOC index"
},
"nitrogen_index": {
"name": "Nitrogen index"
},
"pm003_count": {
"name": "PM0.3"
},
"raw_total_volatile_organic_component": {
"name": "Raw total VOC"
},
"raw_nitrogen": {
"name": "Raw nitrogen"
}
}
},
"exceptions": {
"no_local_configuration": {
"message": "Device should be configured with local configuration to be able to change settings."
}
}
}

View File

@@ -19,8 +19,10 @@ PLATFORMS = [Platform.SENSOR]
_LOGGER = logging.getLogger(__name__)
type AirlyConfigEntry = ConfigEntry[AirlyDataUpdateCoordinator]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AirlyConfigEntry) -> bool:
"""Set up Airly as config entry."""
api_key = entry.data[CONF_API_KEY]
latitude = entry.data[CONF_LATITUDE]
@@ -62,8 +64,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = coordinator
entry.runtime_data = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
@@ -79,11 +80,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AirlyConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -55,7 +55,7 @@ def set_update_interval(instances_count: int, requests_remaining: int) -> timede
return interval
class AirlyDataUpdateCoordinator(DataUpdateCoordinator):
class AirlyDataUpdateCoordinator(DataUpdateCoordinator[dict[str, str | float | int]]):
"""Define an object to hold Airly data."""
def __init__(

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
@@ -14,17 +13,16 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from . import AirlyDataUpdateCoordinator
from .const import DOMAIN
from . import AirlyConfigEntry
TO_REDACT = {CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE, CONF_UNIQUE_ID}
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: AirlyConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: AirlyDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data
return {
"config_entry": async_redact_data(config_entry.as_dict(), TO_REDACT),

View File

@@ -12,7 +12,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
CONF_NAME,
@@ -25,7 +24,7 @@ from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import AirlyDataUpdateCoordinator
from . import AirlyConfigEntry, AirlyDataUpdateCoordinator
from .const import (
ATTR_ADVICE,
ATTR_API_ADVICE,
@@ -174,12 +173,14 @@ SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
hass: HomeAssistant,
entry: AirlyConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Airly sensor entities based on a config entry."""
name = entry.data[CONF_NAME]
coordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
async_add_entities(
(

View File

@@ -9,6 +9,7 @@ from airly import Airly
from homeassistant.components import system_health
from homeassistant.core import HomeAssistant, callback
from . import AirlyConfigEntry
from .const import DOMAIN
@@ -22,8 +23,10 @@ def async_register(
async def system_health_info(hass: HomeAssistant) -> dict[str, Any]:
"""Get info for the info page."""
requests_remaining = list(hass.data[DOMAIN].values())[0].airly.requests_remaining
requests_per_day = list(hass.data[DOMAIN].values())[0].airly.requests_per_day
config_entry: AirlyConfigEntry = hass.config_entries.async_entries(DOMAIN)[0]
requests_remaining = config_entry.runtime_data.airly.requests_remaining
requests_per_day = config_entry.runtime_data.airly.requests_per_day
return {
"can_reach_server": system_health.async_check_can_reach_url(

View File

@@ -15,14 +15,16 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
from .const import DOMAIN # noqa: F401
from .coordinator import AirNowDataUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
PLATFORMS = [Platform.SENSOR]
type AirNowConfigEntry = ConfigEntry[AirNowDataUpdateCoordinator]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: AirNowConfigEntry) -> bool:
"""Set up AirNow from a config entry."""
api_key = entry.data[CONF_API_KEY]
latitude = entry.data[CONF_LATITUDE]
@@ -44,8 +46,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
await coordinator.async_config_entry_first_refresh()
# Store Entity and Initialize Platforms
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = coordinator
entry.runtime_data = coordinator
# Listen for option changes
entry.async_on_unload(entry.add_update_listener(update_listener))
@@ -87,14 +88,9 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: AirNowConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:

View File

@@ -82,7 +82,7 @@ class AirNowConfigFlow(ConfigFlow, domain=DOMAIN):
errors["base"] = "invalid_auth"
except InvalidLocation:
errors["base"] = "invalid_location"
except Exception: # pylint: disable=broad-except
except Exception:
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
else:

View File

@@ -8,6 +8,7 @@ ATTR_API_CATEGORY = "Category"
ATTR_API_CAT_LEVEL = "Number"
ATTR_API_CAT_DESCRIPTION = "Name"
ATTR_API_O3 = "O3"
ATTR_API_PM10 = "PM10"
ATTR_API_PM25 = "PM2.5"
ATTR_API_POLLUTANT = "Pollutant"
ATTR_API_REPORT_DATE = "DateObserved"

View File

@@ -5,7 +5,6 @@ from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
@@ -14,8 +13,7 @@ from homeassistant.const import (
)
from homeassistant.core import HomeAssistant
from . import AirNowDataUpdateCoordinator
from .const import DOMAIN
from . import AirNowConfigEntry
ATTR_LATITUDE_CAP = "Latitude"
ATTR_LONGITUDE_CAP = "Longitude"
@@ -40,10 +38,10 @@ TO_REDACT = {
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
hass: HomeAssistant, entry: AirNowConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: AirNowDataUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
coordinator = entry.runtime_data
return async_redact_data(
{

View File

@@ -4,6 +4,9 @@
"aqi": {
"default": "mdi:blur"
},
"pm10": {
"default": "mdi:blur"
},
"pm25": {
"default": "mdi:blur"
},

View File

@@ -13,7 +13,6 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_TIME,
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
@@ -26,12 +25,13 @@ from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from homeassistant.util.dt import get_time_zone
from . import AirNowDataUpdateCoordinator
from . import AirNowConfigEntry, AirNowDataUpdateCoordinator
from .const import (
ATTR_API_AQI,
ATTR_API_AQI_DESCRIPTION,
ATTR_API_AQI_LEVEL,
ATTR_API_O3,
ATTR_API_PM10,
ATTR_API_PM25,
ATTR_API_REPORT_DATE,
ATTR_API_REPORT_HOUR,
@@ -88,6 +88,15 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
.isoformat(),
},
),
AirNowEntityDescription(
key=ATTR_API_PM10,
translation_key="pm10",
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.PM10,
value_fn=lambda data: data.get(ATTR_API_PM10),
extra_state_attributes_fn=None,
),
AirNowEntityDescription(
key=ATTR_API_PM25,
translation_key="pm25",
@@ -116,11 +125,11 @@ SENSOR_TYPES: tuple[AirNowEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: AirNowConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up AirNow sensor entities based on a config entry."""
coordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data
entities = [AirNowSensor(coordinator, description) for description in SENSOR_TYPES]

View File

@@ -36,7 +36,7 @@
"name": "[%key:component::sensor::entity_component::ozone::name%]"
},
"station": {
"name": "PM2.5 reporting station",
"name": "Reporting station",
"state_attributes": {
"lat": { "name": "[%key:common::config_flow::data::latitude%]" },
"long": { "name": "[%key:common::config_flow::data::longitude%]" }

Some files were not shown because too many files have changed in this diff Show More