Compare commits

..

791 Commits

Author SHA1 Message Date
Daniel Hjelseth Høyer
a1bfc46e6c Mill connection
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2024-12-18 21:04:23 +01:00
Daniel Hjelseth Høyer
9e41f7c9ba Mill device id
Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2024-12-18 20:02:02 +01:00
Jan-Philipp Benecke
5014f305bf Mark docs-removal-instructions for SABnzbd as done (#133446) 2024-12-17 20:57:04 +01:00
benjamin-dcs
b124ebeb1f Differentiate File integration entries by prefixing the title with the platform instead (#131016)
Differentiate File integration entries by prefixes the title with the platform
2024-12-17 20:54:30 +01:00
jimmyd-be
935bf3fb11 Bump renson-endura-delta to 1.7.2 (#129491) 2024-12-17 20:49:42 +01:00
Louis Christ
9c26654db7 Use entity services in bluesound integration (#129266) 2024-12-17 20:44:38 +01:00
Klaas Schoute
c9ca1f63ea Allow only single instance of energyzero integration (#133443) 2024-12-17 20:44:24 +01:00
Jan-Philipp Benecke
5e5bebd7eb Remove unused constants from SABnzbd (#133445) 2024-12-17 20:43:53 +01:00
Richard Kroegel
8bbbbb00d5 Limit unique_id migration to platform for BMW (#131582) 2024-12-17 20:43:09 +01:00
Mick Vleeshouwer
a7ba63bf86 Add missing CozyTouch servers to ConfigFlow expection handler in Overkiz (#131696) 2024-12-17 20:22:07 +01:00
G Johansson
d785c4b0b1 Add optional category in OptionsFlow to holiday (#129514) 2024-12-17 20:20:26 +01:00
Mick Vleeshouwer
e9e8228f07 Improve empty state handling for SomfyThermostat in Overkiz (#131700) 2024-12-17 20:18:16 +01:00
Erik Montnemery
d22668a166 Don't run recorder data migration on new databases (#133412)
* Don't run recorder data migration on new databases

* Add tests
2024-12-17 20:02:12 +01:00
Erik Montnemery
633433709f Clean up backups after manual backup (#133434)
* Clean up backups after manual backup

* Address review comments
2024-12-17 20:00:02 +01:00
Artur Pragacz
af1222e97b Distinct sources per zone in Onkyo (#130547) 2024-12-17 19:31:25 +01:00
epenet
b5f6734197 Simplify modern_forms config flow (part 2) (#130494) 2024-12-17 19:23:54 +01:00
Kevin Stillhammer
98d5020690 Support units and filters in async_get_travel_times_service for waze_travel_time (#130776) 2024-12-17 18:00:23 +01:00
DrBlokmeister
da85c497bf Add transmission download path to events + add_torrent service (#121371)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-17 17:48:54 +01:00
Norbert Rittel
1de8d63a63 Remove three duplicated space characters in strings.json (#133436) 2024-12-17 17:48:18 +01:00
Erik Montnemery
89eda9e068 Don't raise when removing non-existing cloud backup (#133429) 2024-12-17 17:47:17 +01:00
Norbert Rittel
3341e3d95b Fix two occurrences of "HomeAssistant" adding the missing space (#133435) 2024-12-17 17:43:56 +01:00
Erik Montnemery
25a63863cb Adapt hassio backup agent to supervisor changes (#133428) 2024-12-17 17:21:13 +01:00
Matthias Alphart
44a86f537f Add quality scale for Fronius (#131770) 2024-12-17 17:12:11 +01:00
Jan-Philipp Benecke
d9fb5a7582 Record current IQS state for SABnzbd (#131656)
* Record current IQS state for SAbnzbd

* Convert review comments to IQS comments
2024-12-17 17:10:04 +01:00
Krisjanis Lejejs
a14aca31e5 Add MFA login flow support for cloud component (#132497)
* Add MFA login flow support for cloud component

* Add tests for cloud MFA login

* Update code to reflect used package changes

* Update code to use underlying package changes

* Remove unused change

* Fix login required parameters

* Fix parameter validation

* Use cv.has_at_least_one_key for param validation

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-12-17 16:44:50 +01:00
Franck Nijhof
5b1c5bf9f6 Record current IQS scale for Tailwind (#133158)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-17 16:34:48 +01:00
Josef Zweck
a9f6982ac0 Mark acaia as platinum quality (#131723)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-17 15:45:16 +01:00
Josef Zweck
9cc5f7ff84 Mark lamarzocco as platinum quality (#131609) 2024-12-17 15:41:34 +01:00
Erik Montnemery
4adfd52dc0 Improve hassio backup agent test coverage (#133426) 2024-12-17 15:08:03 +01:00
Erik Montnemery
8b3cd41396 Improve hassio backup agent test coverage (#133424) 2024-12-17 13:55:04 +01:00
Cyrill Raccaud
89946348df Add reconfigure to Cookidoo integration (#133144)
* add reconfigure

* merge steps

* comments
2024-12-17 13:54:07 +01:00
Erik Montnemery
a4588c80d5 Bump aiohasupervisor to version 0.2.2b2 (#133417)
* Bump aiohasupervisor to version 0.2.2b2

* Update test
2024-12-17 13:18:26 +01:00
epenet
e61142c2c2 Check if requirement is typed in strict_typing IQS validation (#133415)
* Check if requirement is typed in strict_typing IQS validation

* Apply suggestions from code review

* Apply suggestions from code review

* Return a list

* Adjust

* Improve
2024-12-17 12:53:27 +01:00
G Johansson
637614299c Fix strptime in python_script (#133159)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-12-17 12:41:18 +01:00
epenet
991864b38c Fix schema translation checks for nested config-flow sections (#133392) 2024-12-17 12:02:53 +01:00
Jonas Fors Lellky
ce0117b2b8 Fix fan setpoints for flexit_bacnet (#133388) 2024-12-17 11:36:45 +01:00
Arie Catsman
084ef20695 Add quality_scale.yaml to enphase_envoy (#132489) 2024-12-17 11:33:04 +01:00
epenet
0dbd5bffe6 Fix incorrect schema in config tests (#133404) 2024-12-17 11:26:51 +01:00
G Johansson
d8e853941a Bump holidays to 0.63 (#133391) 2024-12-17 11:10:38 +01:00
dotvav
c0264f73b0 Add palazzetti status sensor (#131348)
* Add status sensor

* Lower the case of strings keys

* Make const Final

* Fix typo

* Fix typo

* Merge similar statuses

* Increase readability

* Update snapshot
2024-12-17 10:17:50 +01:00
Jan Bouwhuis
ac6d718094 Fix mqtt reconfigure flow (#133315)
* FIx mqtt reconfigure flow

* Follow up on code review
2024-12-17 09:37:46 +01:00
Manu
9ca9e787b2 Add tests for Habitica integration (#131780)
* Add tests for Habitica integration

* update iqs
2024-12-17 09:07:18 +01:00
Vivien Chene
fc9d32ef65 Fix issue when no data, where the integer sensor value is given a string (#132123)
* Fix issue when no data, where the integer sensor value is given a string

* Use None and not '0'
2024-12-17 08:57:43 +01:00
Marc Mueller
2d8e693cdb Update mypy-dev to 1.14.0a7 (#133390) 2024-12-17 07:34:59 +01:00
Ludovic BOUÉ
1512cd5fb7 Add Matter battery replacement description (#132974) 2024-12-17 00:03:32 +01:00
G Johansson
73e3e91af2 Nord Pool iqs platinum (#133389) 2024-12-16 23:54:56 +01:00
Dan Raper
a374c7e4ca Add reauth flow to Ohme (#133275)
* Add reauth flow to ohme

* Reuse config flow user step for reauth

* Tidying up

* Add common _validate_account method for reauth and user config flow steps

* Add reauth fail test
2024-12-16 23:54:33 +01:00
Franck Nijhof
9cdc36681a Remove setup entry mock assert from LaMetric config flow (#133387) 2024-12-16 23:01:24 +01:00
Marc Mueller
8c67819f50 Update axis to v64 (#133385) 2024-12-16 22:40:00 +01:00
Michael Hansen
308200781f Add required domain to vacuum intents (#133166) 2024-12-16 21:49:15 +01:00
Franck Nijhof
3a622218f4 Improvements to the LaMetric config flow tests (#133383) 2024-12-16 21:47:31 +01:00
G Johansson
40182fc197 Load sun via entity component (#132598)
* Load sun via entity component

* Remove unique id

* Remove entity registry
2024-12-16 21:35:55 +01:00
dontinelli
2da7a93139 Add switch platform to local_slide (#133369) 2024-12-16 20:53:17 +01:00
Alexandre CUER
6a54edce19 Gives a friendly name to emoncms entities if unit is not specified (#133358) 2024-12-16 19:26:47 +01:00
Erik Montnemery
34ab3e033f Remove support for live recorder data post migration of entity IDs (#133370) 2024-12-16 19:23:05 +01:00
Simon
e6e9788ecd Add quality scale to ElevenLabs (#133276) 2024-12-16 19:18:09 +01:00
Joakim Sørensen
482ad6fbee Increase backup upload timeout (#132990) 2024-12-16 19:12:15 +01:00
Maciej Bieniek
77fb440ed4 Bump imgw-pib to version 1.0.7 (#133364) 2024-12-16 19:06:06 +01:00
epenet
239767ee62 Set default min/max color temperature in mqtt lights (#133356) 2024-12-16 17:48:59 +01:00
Andrew Sayre
cefb4a4ccc Add HEOS reconfigure flow (#133326)
* Add reconfig flow

* Add reconfigure tests

* Mark reconfigure_flow done

* Review feedback

* Update tests to always end in terminal state

* Correct test name and docstring
2024-12-16 10:08:14 -06:00
Åke Strandberg
5adb7f4542 Translate exception messages in myUplink (#131626)
* Translate exceptions

* Add one more translation

* Adding more translations

* Make message easier to understand for end-user

* Clarify message

* Address review comments
2024-12-16 15:42:15 +01:00
Erik Montnemery
14f4f8aeb5 Update hassio backup agents on mount added or removed (#133344)
* Update hassio backup agents on mount added or removed

* Address review comments
2024-12-16 15:37:29 +01:00
Maikel Punie
a34992c0b5 Velbus add PARALLEL_UPDATES to all platforms (#133155) 2024-12-16 15:13:50 +01:00
Matthias Alphart
6f278fb856 Remove custom "unknown" state from Fronius Enum sensor (#133361) 2024-12-16 14:13:19 +01:00
Assaf Inbal
a953abf5c3 Add reauth flow to Ituran (#132755) 2024-12-16 14:00:06 +01:00
Maikel Punie
38fdfba169 Velbus finish config-flow-test-coverage (#133149)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-16 13:56:17 +01:00
Åke Strandberg
0a0f482702 Update myuplink quality scale (#133083)
Updated documentation
2024-12-16 13:39:46 +01:00
Guido Schmitz
cc27c95bad Use unique_id in devolo Home Network tests (#133147) 2024-12-16 13:35:55 +01:00
Franck Nijhof
836fd94a56 Record current IQS state for LaMetric (#133040) 2024-12-16 13:31:13 +01:00
Manu
34911a78bd Add Habitica quality scale record (#131429)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-16 13:17:38 +01:00
Abílio Costa
739832691e Add Idasen Desk quality scale record (#132368) 2024-12-16 13:14:01 +01:00
epenet
cd2cc1d99f Reduce false-positives in test-before-setup IQS check (#133349) 2024-12-16 13:10:15 +01:00
epenet
4b3893eadf Set default min/max color temperature in homekit_controller lights (#133334) 2024-12-16 12:26:29 +01:00
jb101010-2
d062171be3 Suez_water: mark reached bronze scale level (#133352) 2024-12-16 12:19:21 +01:00
epenet
9667a12030 Set default min/max color temperature in matter lights (#133340) 2024-12-16 10:32:57 +01:00
Jan-Philipp Benecke
d78a24ba33 Use ConfigEntry.runtime_data in Twitch (#133337)
* Use `ConfigEntry.runtime_data` in Twitch

* Process code review

* Process code review
2024-12-16 09:54:01 +01:00
epenet
f2674f3262 Set default min/max color temperature in deconz lights (#133333) 2024-12-16 09:49:18 +01:00
Erik Montnemery
06f6869da5 Avoid string manipulations in hassio backup reader/writer (#133339) 2024-12-16 09:47:49 +01:00
epenet
22d03afb9b Set default min/max color temperature in wemo lights (#133338) 2024-12-16 09:08:37 +01:00
Franck Nijhof
3129151ea9 Merge branch 'master' into dev 2024-12-16 07:52:34 +00:00
Chris Talkington
4566ebbb3d Add reconfigure flow to Roku (#132986)
* add reconfigure flow to roku

* Update strings.json

* aimplify

* Apply suggestions from code review

Co-authored-by: Josef Zweck <josef@zweck.dev>

* Update test_config_flow.py

* Update config_flow.py

* Update config_flow.py

---------

Co-authored-by: Josef Zweck <josef@zweck.dev>
2024-12-16 08:51:01 +01:00
epenet
5f2b1bd622 Set default min/max color temperature in demo lights (#133330) 2024-12-16 08:45:59 +01:00
epenet
909eb045cc Set default min/max color temperature in abode lights (#133331) 2024-12-16 08:27:10 +01:00
Marc Mueller
66dcd38701 Update docker base image to 2024.12.1 (#133323) 2024-12-16 08:10:37 +01:00
Paulus Schoutsen
e24dc33259 Conversation: Use [] when we know key exists (#133305) 2024-12-15 21:45:50 +01:00
Josef Zweck
0030a970a1 Split coordinator in lamarzocco (#133208) 2024-12-15 21:31:18 +01:00
Josef Zweck
89387760d3 Cleanup tests for tedee (#133306) 2024-12-15 20:44:28 +01:00
Simone Chemelli
5cc8d9e105 Full test coverage for Vodafone Station button platform (#133281) 2024-12-15 20:27:19 +01:00
Allen Porter
b77e42e8f3 Increase test coverage for google tasks init (#133252) 2024-12-15 20:23:56 +01:00
Matthias Alphart
81c12db6cd Fix missing Fronius data_description translation for reconfigure flow (#133304) 2024-12-15 20:19:56 +01:00
Jan Bouwhuis
2003fc7ae0 Adjust MQTT tests not to assert on deprecated color_temp attribute (#133198) 2024-12-15 19:42:54 +01:00
Allen Porter
6ca5f3e828 Mark Google Tasks test-before-setup quality scale rule as done (#133298) 2024-12-15 19:42:22 +01:00
Matthias Alphart
be6ed05aa2 Improve Fronius tests (#132872) 2024-12-15 19:40:51 +01:00
Norbert Rittel
544ebcf310 Fix typo "configurered" in MQTT (#133295) 2024-12-15 19:35:50 +01:00
Bouwe Westerdijk
9e8a158c89 Bump plugwise to v1.6.4 and adapt (#133293) 2024-12-15 19:35:36 +01:00
J. Nick Koston
e81add5a06 Set code_arm_required to False for homekit_controller (#133284) 2024-12-15 19:28:29 +01:00
G Johansson
6d6445bfcf Update quality scale for Nord Pool (#133282) 2024-12-15 19:28:10 +01:00
Michael
e951511132 Allow load_verify_locations with only cadata passed (#133299) 2024-12-15 19:26:46 +01:00
Tomer Shemesh
2a49378f4c Refactor Onkyo tests to patch underlying pyeiscp library (#132653)
* Refactor Onkyo tests to patch underlying pyeiscp library instead of home assistant methods

* limit test patches to specific component, move atches into conftest

* use patch.multiple and restrict patches to specific component

* use side effect instead of mocking method
2024-12-15 10:27:17 -07:00
Allen Porter
f069f340a3 Explicitly set PARALLEL_UPDATES for Google Tasks (#133296) 2024-12-15 17:53:36 +01:00
Conor Eager
042d4cd39b Bump starlink-grpc-core to 1.2.1 to fix missing ping (#133183) 2024-12-15 17:43:21 +01:00
G Johansson
51422a4502 Bump pynordpool 0.2.3 (#133277) 2024-12-15 17:41:43 +01:00
Norbert Rittel
95babbef21 Fix two typos in KEF strings (#133294) 2024-12-15 17:39:25 +01:00
Richard Kroegel
b4b6067e8e Use typed BMWConfigEntry (#133272) 2024-12-15 14:41:35 +01:00
Dan Raper
b13a54f605 Add button platform to Ohme (#133267)
* Add button platform and reauth flow

* CI fixes

* Test comment change

* Remove reauth from this PR

* Move is_supported_fn to OhmeEntityDescription

* Set parallel updates to 1

* Add coordinator refresh to button press

* Add exception handling to button async_press
2024-12-15 14:22:21 +01:00
Manu
c2ee020eee Update quality scale documentation rules in IronOS integration (#133245) 2024-12-15 13:14:32 +01:00
Jan Bouwhuis
16ad2d52c7 Improve MQTT json color_temp validation (#133174)
* Improve MQTT json color_temp validation

* Revert unrelated changes and assert on logs

* Typo
2024-12-15 13:07:10 +01:00
Erik Montnemery
74e4654c26 Revert "Improve recorder history queries (#131702)" (#133203) 2024-12-15 12:28:32 +01:00
Matthias Alphart
aa4b64386e Don't update existing Fronius config entries from config flow (#132886) 2024-12-15 12:25:35 +01:00
Claudio Ruggeri - CR-Tech
760c3ac98c Bump pymodbus version 3.7.4 (#133175)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-15 12:24:27 +01:00
Allen Porter
85ef2c0fb1 Mark Google Tasks action-exceptions quality scale as done (#133253) 2024-12-15 12:19:57 +01:00
Marc Mueller
d1e466e615 Update elevenlabs to 1.9.0 (#133264) 2024-12-15 12:19:25 +01:00
Richard Kroegel
8953ac1357 Improve BMW translations (#133236) 2024-12-15 12:16:10 +01:00
Norbert Rittel
ebc8ca8419 Replace "this" with "a" to fix Install Update action description (#133210) 2024-12-15 12:10:54 +01:00
Jan Bouwhuis
73cb3fa88d Fix lingering mqtt device_trigger unload entry test (#133202) 2024-12-15 11:55:33 +01:00
rappenze
14a61d94e2 Use entry.runtime_data in fibaro (#133235) 2024-12-15 11:49:23 +01:00
Manu
314076b85f Replace aiogithub dependency with pynecil update check (#133213) 2024-12-15 11:48:11 +01:00
rappenze
879d809e5a Enhance translation strings in fibaro (#133234) 2024-12-15 11:47:18 +01:00
Sid
412aa60e8f Fix enigma2 integration for devices not reporting MAC address (#133226) 2024-12-15 11:05:17 +01:00
Thomas55555
f8da2c3e5c Bump aioautomower to 2024.12.0 (#132962) 2024-12-15 11:04:11 +01:00
rappenze
80e4d7ee12 Fix fibaro climate hvac mode (#132508) 2024-12-15 11:02:26 +01:00
Marc Mueller
af6948a911 Fix pydantic warnings in purpleair (#133247) 2024-12-15 10:34:33 +01:00
Avi Miller
9494128395 Bump aiolifx to 1.1.2 and add new HomeKit product prefixes (#133191)
Signed-off-by: Avi Miller <me@dje.li>
2024-12-15 11:24:41 +02:00
jb101010-2
1b2cf68e82 Suez_water: store coordinator in runtime_data (#133204)
* Suez_water: store coordinator in runtime_data

* jhfg
2024-12-15 09:46:14 +01:00
Arie Catsman
229a68dc73 set PARALLEL_UPDATES to 1 for enphase_envoy (#132373)
* set PARALLEL_UPDATES to 1 for enphase_envoy

* move PARALLEL_UPDATES from _init_ to platform files.

* Implement review feedback

* set parrallel_update 0 for read-only platforms
2024-12-15 09:27:14 +01:00
J. Nick Koston
2117e35d53 Bump yalexs-ble to 2.5.5 (#133229)
changelog: https://github.com/bdraco/yalexs-ble/compare/v2.5.4...v2.5.5
2024-12-14 23:06:26 +02:00
Matthias Alphart
74aa1a8f7e Update Fronius translations (#132876)
* Remove exception translation that's handled by configflow errors dict

* Remove entity name translations handled by device class

* Add data_description for Fronius config flow

* Remove unnecessary exception case

* review suggestion
2024-12-14 21:47:27 +01:00
Jan Bouwhuis
4dc1405e99 Bump incomfort-client to v0.6.4 (#133205) 2024-12-14 20:51:30 +01:00
Manu
35d5a16a3c Bump pynecil to 2.1.0 (#133211) 2024-12-14 20:47:06 +01:00
jb101010-2
79ecb4a87c Suez_water: add removal instructions (#133206) 2024-12-14 20:43:27 +01:00
YogevBokobza
ff1df757b1 Switcher move _async_call_api to entity.py (#132877)
* Switcher move _async_call_api to entity.py

* fix based on requested changes

* fix based on requested changes
2024-12-14 21:06:36 +02:00
Dan Raper
9e2a3ea0e5 Add Ohme integration (#132574) 2024-12-14 18:12:44 +01:00
Erik Montnemery
980b8a91e6 Revert "Simplify recorder RecorderRunsManager" (#133201)
Revert "Simplify recorder RecorderRunsManager (#131785)"

This reverts commit cf0ee63507.
2024-12-14 14:21:19 +01:00
dontinelli
d85d986075 Add button entity to slide_local (#133141)
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-12-14 12:19:42 +01:00
dontinelli
06391d4635 Add reconfiguration to slide_local (#133182)
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-12-14 12:10:28 +01:00
Sid
ca1bcbf5d5 Bump openwebifpy to 4.3.0 (#133188) 2024-12-14 12:07:38 +01:00
Joost Lekkerkerker
d2dfba3116 Improve Slide Local device tests (#133197) 2024-12-14 12:00:28 +01:00
IceBotYT
bce6127264 Bump nice-go to 1.0.0 (#133185)
* Bump Nice G.O. to 1.0.0

* Mypy

* Pytest
2024-12-14 09:36:15 +01:00
J. Nick Koston
165ca5140c Bump uiprotect to 7.0.2 (#132975) 2024-12-13 20:05:41 -06:00
J. Nick Koston
1aabbec3dd Bump yalexs-ble to 2.5.4 (#133172) 2024-12-13 22:37:26 +01:00
Sid
0c8db8c8d6 Add eheimdigital integration (#126757)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-12-13 22:29:18 +01:00
Michael Hansen
f06fda8023 Add response slot to HassRespond intent (#133162) 2024-12-13 15:19:43 -05:00
Michael Hansen
50b897bdaa Add STT error code for cloud authentication failure (#133170) 2024-12-13 14:59:46 -05:00
Franck Nijhof
e13fa8346a Update debugpy to 1.8.11 (#133169) 2024-12-13 20:15:05 +01:00
Sid
8b6495f456 Bump ruff to 0.8.3 (#133163) 2024-12-13 19:06:44 +01:00
Franck Nijhof
a812b594aa Fix Tailwind config entry typing in async_unload_entry signature (#133153) 2024-12-13 16:55:30 +01:00
epenet
1fbe880c5f Deprecate light constants (#132680)
* Deprecate light constants

* Reference deprecated values in MQTT light

* Reference deprecated values in test_recorder

* Adjust

* Adjust

* Add specific test
2024-12-13 16:52:47 +01:00
Jan Bouwhuis
97da8481d2 Add reconfigure flow to MQTT (#132246)
* Add reconfigure flow for MQTT integration

* Add test and translation strings

* Update quality scale configuration

* Do not cache ConfigEntry in flow

* Make sorce condition explictit

* Rework from suggested changes

* Do not allow reconfigure_entry and reconfigure_entry_data to be `None`
2024-12-13 16:11:45 +01:00
Maikel Punie
f03f24f036 Velbus test before setup (#133069)
* Velbus test before setup

* Update homeassistant/components/velbus/__init__.py

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

* Add the connect named argument to make it clear we are testing the connection

* Correctly cleanup after the test

* Sync code for velbusaio 2024.12.2

* follow up

* rename connect_task to scan_task

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-13 16:05:20 +01:00
Christopher Fenner
5f91676df0 Bump PyViCare to 2.38.0 (#133126) 2024-12-13 16:02:13 +01:00
dontinelli
d6c81830a4 Fix missing password for slide_local (#133142) 2024-12-13 15:42:40 +01:00
epenet
8080ad14bf Add warning when light entities do not provide kelvin attributes or properties (#132723) 2024-12-13 15:34:02 +01:00
Klaas Schoute
067daad70e Set quality scale to silver for Powerfox integration (#133095) 2024-12-13 15:29:34 +01:00
Guido Schmitz
579ac01eb1 Fix typos in devolo Home Network tests (#133139) 2024-12-13 15:26:02 +01:00
Maikel Punie
5d8e997319 Bump velbusaio to 2024.12.2 (#133130)
* Bump velbusaio to 2024.12.2

* mistakely pushed this file
2024-12-13 13:49:00 +01:00
Cyrill Raccaud
fe46fd24bd Improve data description and title for Cookidoo integration (#133106)
* fix data description typo for cookidoo

* use placeholder for cookidoo as it is non-translatable

* set title of language step

* fix for reauth

* fix reauth
2024-12-13 13:34:17 +01:00
Joost Lekkerkerker
b4e065d331 Bump yt-dlp to 2024.12.13 (#133129) 2024-12-13 13:30:22 +01:00
epenet
a131497e1f Reduce functools.partial with ServiceCall.hass in easyenergy (#133133) 2024-12-13 13:30:05 +01:00
epenet
4a5e47d2f0 Replace functools.partial with ServiceCall.hass in tibber (#133132) 2024-12-13 13:29:42 +01:00
epenet
c7adc98408 Replace functools.partial with ServiceCall.hass in unifiprotect (#133131) 2024-12-13 13:28:54 +01:00
epenet
f816a0667c Reduce functools.partial with ServiceCall.hass in energyzero (#133134) 2024-12-13 13:28:11 +01:00
Franck Nijhof
684667e8e7 Update open-meteo to v0.3.2 (#133122) 2024-12-13 13:24:46 +01:00
Jan-Philipp Benecke
d658073246 Make Twitch sensor state and attributes translatable (#133127) 2024-12-13 13:01:55 +01:00
Martijn Russchen
81c8d7153b Push Nibe package to 2.14.0 (#133125) 2024-12-13 12:50:50 +01:00
Marc Mueller
7e2d3eb482 Add contact vip info to fritzbox_callmonitor sensor (#132913) 2024-12-13 11:59:55 +01:00
Ludovic BOUÉ
c0f6535d11 Fix typo in WaterHeaterEntityDescription name (#132888) 2024-12-13 11:11:47 +01:00
Cyrill Raccaud
91f7afc2c5 Cookidoo reauth config flow for silver (#133110)
* reauth

* add check for duplicate email in reauth

* fix reauth double email check

* parametrize tests

* check reauth double entry data as well
2024-12-13 10:40:23 +01:00
Allen Porter
7f3373d233 Add a quality scale for Google Tasks (#131497)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-13 10:27:35 +01:00
Joost Lekkerkerker
c0ef60bb98 Bump aiowithings to 3.1.4 (#133117) 2024-12-13 10:22:46 +01:00
Franck Nijhof
fb5cca877b Fix failing CI due to Russound Rio incorrect IQS (#133118) 2024-12-13 10:12:35 +01:00
G Johansson
8cde404997 Raise issue for deprecated imperial unit system (#130979) 2024-12-13 10:05:46 +01:00
epenet
8b579d83ce Add data/data_description translation checks (#131705) 2024-12-13 09:50:10 +01:00
epenet
f7b6f4b927 Replace functools.partial with ServiceCall.hass in knx (#133111) 2024-12-13 09:48:24 +01:00
Jan Rieger
3d93561e0a Remove native_unit_of_measurement from rfxtrx counters (#133108) 2024-12-13 09:47:39 +01:00
Andrew Sayre
566843591e Remove HEOS yaml import (#133082) 2024-12-13 09:46:52 +01:00
Robert Resch
2cd4ebbfb2 Bump deebot-client to 9.4.0 (#133114) 2024-12-13 09:45:38 +01:00
Stefan Agner
9ab69aa41c Add mWh as unit of measurement for Matter energy sensors (#133005) 2024-12-13 09:33:58 +01:00
epenet
a0e49ebc97 Use internal min/max mireds in template (#133113) 2024-12-13 09:33:40 +01:00
epenet
899fb091fc Simplify access to hass in service calls (#133062) 2024-12-13 09:31:21 +01:00
Maikel Punie
f9f37b9932 Velbus docs quality bump (#133070) 2024-12-13 09:23:53 +01:00
Marc Mueller
e4cca3fe40 Update devcontainer to Python 3.13 (#132313) 2024-12-13 09:22:01 +01:00
Martin Weinelt
11b65b1eb3 Bump watchdog to 6.0.0 (#132895) 2024-12-13 09:21:14 +01:00
jb101010-2
e3d14e6993 Bump pysuezV2 to 1.3.5 (#133076) 2024-12-13 09:01:48 +01:00
Åke Strandberg
53439d6e2a Handle step size correctly in myuplink number platform (#133016) 2024-12-13 08:55:44 +01:00
David Bonnes
de89be0512 Bugfix to use evohome's new hostname (#133085) 2024-12-13 08:54:14 +01:00
Brandon Rothweiler
8bd2c183e2 Bump py-aosmith to 1.0.12 (#133100) 2024-12-13 08:46:15 +01:00
epenet
263eb41e79 Remove unused constant from blink (#133109) 2024-12-13 08:24:18 +01:00
Klaas Schoute
0ffb588d5c Move config entry type of energyzero integration (#133094)
Move config_entry type to coordinator file
2024-12-13 07:53:25 +01:00
dependabot[bot]
09b06f839d Bump github/codeql-action from 3.27.7 to 3.27.9 (#133104) 2024-12-13 07:47:40 +01:00
epenet
72cc1f4d39 Use correct ATTR_KELVIN constant in yeelight tests (#133088) 2024-12-13 06:51:55 +01:00
Allen Porter
2af5c5ecda Update Rainbird quality scale grading on the Silver quality checks (#131498)
* Grade Rainbird on the Silver quality scale

* Remove done comments

* Update quality_scale.yaml

* Update config-flow-test-coverage
2024-12-12 20:26:30 -08:00
epenet
bf9788b9c4 Fix CI failure in russound_rio (#133081)
* Fix CI in russound_rio

* Adjust
2024-12-12 22:16:28 +01:00
epenet
2cff7526d0 Add test-before-setup rule to quality_scale validation (#132255)
* Add test-before-setup rule to quality_scale validation

* Use ast_parse_module

* Add rules_done

* Add Config argument
2024-12-12 22:15:49 +01:00
Franck Nijhof
61b1b50c34 Improve Solar.Forecast configuration flow tests (#133077) 2024-12-12 21:19:05 +01:00
epenet
aa7e024853 Migrate lifx light tests to use Kelvin (#133020) 2024-12-12 21:17:52 +01:00
epenet
d02bceb6f3 Migrate alexa color_temp handlers to use Kelvin (#132995) 2024-12-12 21:17:31 +01:00
epenet
b9a7307df8 Refactor light reproduce state to use kelvin attribute (#132854) 2024-12-12 21:17:05 +01:00
Noah Husby
d79dc8d22f Add source zone exclusion to Russound RIO (#130392)
* Add source zone exclusion to Russound RIO

* Ruff format
2024-12-12 22:13:37 +02:00
Franck Nijhof
839f06b2dc Small improvements to the AdGuard tests (#133073) 2024-12-12 21:12:11 +01:00
Maikel Punie
3baa432bae Use runtime_data in velbus (#132988) 2024-12-12 20:48:01 +01:00
epenet
b189bc6146 Migrate smartthings light tests to use Kelvin (#133022) 2024-12-12 20:38:49 +01:00
epenet
708084d300 Migrate switch_as_x light tests to use Kelvin (#133023) 2024-12-12 20:38:13 +01:00
epenet
7c9992f5d3 Migrate demo light tests to use Kelvin (#133003) 2024-12-12 20:37:32 +01:00
Franck Nijhof
483688dba2 Promote Twente Milieu quality scale to silver (#133074) 2024-12-12 20:32:59 +01:00
epenet
e276f8ee89 Migrate zwave_js light tests to use Kelvin (#133034) 2024-12-12 20:32:39 +01:00
epenet
de35bfce77 Migrate yeelight light tests to use Kelvin (#133033) 2024-12-12 20:29:15 +01:00
epenet
f0391f4963 Migrate tradfri light tests to use Kelvin (#133030) 2024-12-12 20:28:42 +01:00
epenet
fd811c85e9 Migrate wemo light tests to use Kelvin (#133031) 2024-12-12 20:28:08 +01:00
Cyrill Raccaud
56db536883 Add Cookidoo integration (#129800) 2024-12-12 20:23:14 +01:00
epenet
55fa717f10 Migrate flux_led light tests to use Kelvin (#133009) 2024-12-12 20:18:27 +01:00
dontinelli
c164507952 Add new integration slide_local (#132632)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-12 20:18:19 +01:00
epenet
798f3a34f3 Migrate abode light tests to use Kelvin (#133001) 2024-12-12 20:17:45 +01:00
epenet
a358491970 Migrate wiz light tests to use Kelvin (#133032) 2024-12-12 20:16:54 +01:00
Erik Montnemery
ad15786115 Add support for subentries to config entries (#117355)
* Add support for subentries to config entries

* Improve error handling and test coverage

* Include subentry_id in subentry containers

* Auto-generate subentry_id and add optional unique_id

* Tweak

* Update tests

* Fix stale docstring

* Address review comments

* Typing tweaks

* Add methods to ConfigEntries to add and remove subentry

* Improve ConfigSubentryData typed dict

* Update test snapshots

* Adjust tests

* Fix unique_id logic

* Allow multiple subentries with None unique_id

* Add number of subentries to config entry JSON representation

* Add subentry translation support

* Allow integrations to implement multiple subentry flows

* Update translations schema

* Adjust exception text

* Change subentry flow init step to user

* Prevent creating a subentry with colliding unique_id

* Update tests

* Address review comments

* Remove duplicaetd unique_id collision check

* Remove change from the future

* Improve test coverage

* Add default value for unique_id
2024-12-12 20:16:18 +01:00
Marc Mueller
32c1b519ad Improve auth generic typing (#133061) 2024-12-12 20:14:56 +01:00
Klaas Schoute
ce70cb9e33 Use ConfigEntry runtime_data in easyEnergy (#133053) 2024-12-12 20:13:41 +01:00
epenet
40c3dd2095 Migrate group light tests to use Kelvin (#133010) 2024-12-12 20:08:07 +01:00
Franck Nijhof
3c7502dd5d Explicitly pass config entry to coordinator in Tailwind (#133065) 2024-12-12 19:46:35 +01:00
Franck Nijhof
b8ce1b010f Update demetriek to v1.1.0 (#133064) 2024-12-12 19:39:24 +01:00
Andrew Sayre
1205178702 Add HEOS quality scale (#132311) 2024-12-12 19:32:00 +01:00
Bram Kragten
a6b785d937 Update frontend to 20241127.8 (#133066) 2024-12-12 19:11:07 +01:00
Martin Hjelmare
39e4719a43 Fix backup strategy retention filter (#133060)
* Fix lint

* Update tests

* Fix backup strategy retention filter
2024-12-12 18:47:37 +01:00
epenet
e7a43cfe09 Migrate deconz light tests to use Kelvin (#133002) 2024-12-12 18:13:24 +01:00
Maikel Punie
0726809228 Bump velbusaio to 2024.12.1 (#133056) 2024-12-12 17:00:11 +01:00
Erik Montnemery
3d201690ce Fix load of backup store (#133024)
* Fix load of backup store

* Tweak type annotations in test

* Fix tests

* Remove the new test

* Remove snapshots
2024-12-12 16:54:21 +01:00
epenet
0b18e51a13 Remove reference to self.min/max_mireds in mqtt light (#133055) 2024-12-12 16:49:50 +01:00
epenet
2ce2765e67 Adjust light test helpers to use Kelvin, and cleanup unused helpers (#133048)
Cleanup light test helper methods
2024-12-12 16:49:25 +01:00
epenet
33c799b2d0 Migrate mqtt light tests to use Kelvin (#133035) 2024-12-12 16:42:10 +01:00
Marc Mueller
5c6e4ad191 Use PEP 695 TypeVar syntax (#133049) 2024-12-12 16:01:57 +01:00
Marc Mueller
0a748252e7 Improve Callable annotations (#133050) 2024-12-12 15:14:28 +01:00
epenet
839312c65c Migrate homekit light tests to use Kelvin (#133011) 2024-12-12 15:11:52 +01:00
epenet
37f2bde6f5 Migrate esphome light tests to use Kelvin (#133008) 2024-12-12 15:11:34 +01:00
epenet
6d042d987f Migrate emulated_hue light tests to use Kelvin (#133006) 2024-12-12 15:11:13 +01:00
Robert Resch
006b3b0e22 Bump uv to 0.5.8 (#133036) 2024-12-12 14:51:15 +01:00
Franck Nijhof
f05d18ea70 Small test improvements to Tailwind tests (#133051) 2024-12-12 14:42:05 +01:00
Sid
dc18e62e1e Bump ruff to 0.8.2 (#133041) 2024-12-12 14:38:55 +01:00
Marc Mueller
4b5d717898 Fix music_assistant decorator typing (#133044) 2024-12-12 14:35:11 +01:00
Franck Nijhof
8e15287662 Add data descriptions to Twente Milieu config flow (#133046) 2024-12-12 14:26:34 +01:00
Marc Mueller
2e133df549 Improve husqvarna_automower decorator typing (#133047) 2024-12-12 14:26:17 +01:00
Krisjanis Lejejs
c18cbf5994 Bump hass-nabucasa from 0.86.0 to 0.87.0 (#133043) 2024-12-12 14:25:54 +01:00
Franck Nijhof
bcaf1dc20b Clean up Elgato config flow tests (#133045) 2024-12-12 14:24:38 +01:00
Franck Nijhof
6005b6d01c Explicitly pass config entry to coordinator in Elgato (#133014)
* Explicitly pass config entry to coordinator in Elgato

* Make it noice!

* Apply suggestions from code review

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

* Adjustment from review comment

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-12 13:55:57 +01:00
epenet
7bdf034b93 Migrate template light tests to use Kelvin (#133025) 2024-12-12 13:54:22 +01:00
Franck Nijhof
5c80ddb891 Fix LaMetric config flow for cloud import path (#133039) 2024-12-12 13:49:17 +01:00
Erik Montnemery
85d4572a17 Adjust backup agent platform (#132944)
* Adjust backup agent platform

* Adjust according to discussion

* Clean up the local agent dict too

* Add test

* Update kitchen_sink

* Apply suggestions from code review

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

* Adjust tests

* Clean up

* Fix kitchen sink reload

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-12-12 13:41:56 +01:00
Franck Nijhof
f2aaf2ac4a Small test cleanups in Twente Milieu (#133028) 2024-12-12 12:55:25 +01:00
epenet
52491bb75e Migrate tplink light tests to use Kelvin (#133026) 2024-12-12 12:52:01 +01:00
Simone Chemelli
ded7cee6e5 fix AndroidTV logging when disconnected (#132919) 2024-12-12 11:42:00 +01:00
Klaas Schoute
0006672489 Improve diagnostics code of EnergyZero integration (#133019) 2024-12-12 11:39:55 +01:00
Klaas Schoute
a9d71e0a5f Add reconfigure flow for Powerfox integration (#132260) 2024-12-12 11:34:36 +01:00
epenet
0e45ccb956 Migrate google_assistant color_temp handlers to use Kelvin (#132997) 2024-12-12 11:13:24 +01:00
Franck Nijhof
7dc31dec3b Fix config entry import in Twente Milieu diagnostic (#133017) 2024-12-12 10:52:03 +01:00
Erik Montnemery
a30c942fa7 Don't use kitchen_sink integration in config entries tests (#133012) 2024-12-12 10:42:27 +01:00
Klaas Schoute
d49b1b2d6b Use ConfigEntry runtime_data in EnergyZero (#132979) 2024-12-12 10:28:41 +01:00
Maikel Punie
4a7039f51d Bump velbusaio to 2024.12.0 (#132989) 2024-12-12 10:25:21 +01:00
Franck Nijhof
0377dc5b5a Move coordinator for TwenteMilieu into own module (#133000) 2024-12-12 10:18:11 +01:00
epenet
bb610acb86 Migrate elgato light tests to use Kelvin (#133004) 2024-12-12 09:53:55 +01:00
Franck Nijhof
85d4c48d6f Set parallel updates in Elgato (#132998) 2024-12-12 09:53:26 +01:00
Michael Hansen
053f03ac58 Change warning to debug for VAD timeout (#132987) 2024-12-12 09:03:05 +01:00
Chris Talkington
0d4780e91b Set parallel updates for roku (#132892)
* Set parallel updates for roku

* Update sensor.py

* Update media_player.py

* Update remote.py

* Update select.py

* Update media_player.py

* Update remote.py

* Update select.py

* Update remote.py

* Update media_player.py
2024-12-12 08:00:24 +01:00
Noah Husby
2d0c4e4a59 Improve config flow test coverage for Russound RIO (#132981) 2024-12-12 07:56:29 +01:00
Noah Husby
e39897ff9a Enforce strict typing for Russound RIO (#132982) 2024-12-12 07:55:29 +01:00
Tom
7e071d1fc6 Introduce parallel updates for Plugwise (#132940)
* Plugwise indicate parallel updates

* Update homeassistant/components/plugwise/number.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-12 07:49:08 +01:00
Christopher Fenner
b02ccd0813 Add missing body height icon in Withings integration (#132991)
Update icons.json
2024-12-12 07:47:57 +01:00
J. Nick Koston
eea781f34a Bump led-ble to 1.1.1 (#132977)
changelog: https://github.com/Bluetooth-Devices/led-ble/compare/v1.0.2...v1.1.1
2024-12-11 23:46:31 -05:00
Åke Strandberg
95f48963d4 Set strict typing for myuplink (#132972)
Set strict typing
2024-12-11 23:11:11 +01:00
Åke Strandberg
4c5965ffc9 Add reconfiguration flow to myuplink (#132970)
* Add reconfiguration flow

* Tick reconfiguration-flow rule
2024-12-11 22:47:14 +01:00
Erik Montnemery
8e991fc92f Merge feature branch with backup changes to dev (#132954)
* Reapply "Make WS command backup/generate send events" (#131530)

This reverts commit 9b8316df3f.

* MVP implementation of Backup sync agents (#126122)

* init sync agent

* add syncing

* root import

* rename list to info and add sync state

* Add base backup class

* Revert unneded change

* adjust tests

* move to kitchen_sink

* split

* move

* Adjustments

* Adjustment

* update

* Tests

* Test unknown agent

* adjust

* Adjust for different test environments

* Change /info WS to contain a dictinary

* reorder

* Add websocket command to trigger sync from the supervisor

* cleanup

* Make mypy happier

---------

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

* Make BackupSyncMetadata model a dataclass (#130555)

Make backup BackupSyncMetadata model a dataclass

* Rename backup sync agent to backup agent (#130575)

* Rename sync agent module to agent

* Rename BackupSyncAgent to BackupAgent

* Fix test typo

* Rename async_get_backup_sync_agents to async_get_backup_agents

* Rename and clean up remaining sync things

* Update kitchen sink

* Apply suggestions from code review

* Update test_manager.py

---------

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

* Add additional options to WS command backup/generate (#130530)

* Add additional options to WS command backup/generate

* Improve test

* Improve test

* Align parameter names in backup/agents/* WS commands (#130590)

* Allow setting password for backups (#110630)

* Allow setting password for backups

* use is_hassio from helpers

* move it

* Fix getting psw

* Fix restoring with psw

* Address review comments

* Improve docstring

* Adjust kitchen sink

* Adjust

---------

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

* Export relevant names from backup integration (#130596)

* Tweak backup agent interface (#130613)

* Tweak backup agent interface

* Adjust kitchen_sink

* Test kitchen sink backup (#130609)

* Test agents_list_backups

* Test agents_info

* Test agents_download

* Export Backup from manager

* Test agents_upload

* Update tests after rebase

* Use backup domain

* Remove WS command backup/upload (#130588)

* Remove WS command backup/upload

* Disable failing kitchen_sink test

* Make local backup a backup agent (#130623)

* Make local backup a backup agent

* Adjust

* Adjust

* Adjust

* Adjust tests

* Adjust

* Adjust

* Adjust docstring

* Adjust

* Protect members of CoreLocalBackupAgent

* Remove redundant check for file

* Make the backup.create service use the first local agent

* Add BackupAgent.async_get_backup

* Fix some TODOs

* Add support for downloading backup from a remote agent

* Fix restore

* Fix test

* Adjust kitchen_sink test

* Remove unused method BackupManager.async_get_backup_path

* Re-enable kitchen sink test

* Remove BaseBackupManager.async_upload_backup

* Support restore from remote agent

* Fix review comments

* Include backup agent error in response to WS command backup/info (#130884)

* Adjust code related to WS command backup/info (#130890)

* Include backup agent error in response to WS command backup/details (#130892)

* Remove LOCAL_AGENT_ID constant from backup manager (#130895)

* Add backup config storage (#130871)

* Add base for backup config

* Allow updating backup config

* Test loading backup config

* Add backup config update method

* Add temporary check for BackupAgent.async_remove_backup (#130893)

* Rename backup slug to backup_id (#130902)

* Improve backup websocket API tests (#130912)

* Improve backup websocket API tests

* Add missing snapshot

* Fix tests leaving files behind

* Improve backup manager backup creation tests (#130916)

* Remove class backup.backup.LocalBackup (#130919)

* Add agent delete backup (#130921)

* Add backup agent delete backup

* Remove agents delete websocket command

* Update docstring

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

---------

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

* Disable core local backup agent in hassio (#130933)

* Rename remove backup to delete backup (#130940)

* Rename remove backup to delete backup

* Revert "backup/delete"

* Refactor BackupManager (#130947)

* Refactor BackupManager

* Adjust

* Adjust backup creation

* Copy in executor

* Fix BackupManager.async_get_backup (#130975)

* Fix typo in backup tests (#130978)

* Adjust backup NewBackup class (#130976)

* Remove class backup.BackupUploadMetadata (#130977)

Remove class backup.BackupMetadata

* Report backup size in bytes instead of MB (#131028)

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

* Speed up CI for feature branch (#131030)

* Speed up CI for feature branch

* adjust

* fix

* fix

* fix

* fix

* Rename remove to delete in backup websocket type (#131023)

* Revert "Speed up CI for feature branch" (#131074)

Revert "Speed up CI for feature branch (#131030)"

This reverts commit 791280506d.

* Rename class BaseBackup to AgentBackup (#131083)

* Rename class BaseBackup to AgentBackup

* Update tests

* Speed up CI for backup feature branch (#131079)

* Add backup platform to the hassio integration (#130991)

* Add backup platform to the hassio integration

* Add hassio to after_dependencies of backup

* Address review comments

* Remove redundant hassio parametrization of tests

* Add tests

* Address review comments

* Bump CI cache version

* Revert "Bump CI cache version"

This reverts commit 2ab4d2b179.

* Extend backup info class AgentBackup (#131110)

* Extend backup info class AgentBackup

* Update kitchen sink

* Update kitchen sink test

* Update kitchen sink test

* Exclude cloud and hassio from core files (#131117)

* Remove unnecessary **kwargs from backup API (#131124)

* Fix backup tests (#131128)

* Freeze backup dataclasses (#131122)

* Protect CoreLocalBackupAgent.load_backups (#131126)

* Use backup metadata v2 in core/container backups (#131125)

* Extend backup creation API (#131121)

* Extend backup creation API

* Add tests

* Fix merge

* Fix merge

* Return agent errors when deleting a backup (#131142)

* Return agent errors when deleting a backup

* Remove redundant calls to dict.keys()

* Add enum type for backup folder (#131158)

* Add method AgentBackup.from_dict (#131164)

* Remove WS command backup/agents/list_backups (#131163)

* Handle backup schedule (#131127)

* Add backup schedule handling

* Fix unrelated incorrect type annotation in test

* Clarify delay save

* Make the backup time compatible with the recorder nightly job

* Update create backup parameters

* Use typed dict for create backup parameters

* Simplify schedule state

* Group create backup parameters

* Move parameter

* Fix typo

* Use Folder model

* Handle deserialization of folders better

* Fail on attempt to include addons or folders in core backup (#131204)

* Fix AgentBackup test (#131201)

* Add options to WS command backup/restore (#131194)

* Add options to WS command backup/restore

* Add tests

* Fix test

* Teach core backup to restore only database or only settings (#131225)

* Exclude tmp_backups/*.tar from backups (#131243)

* Add WS command backup/subscribe_events (#131250)

* Clean up temporary directory after restoring backup (#131263)

* Improve hassio backup agent list (#131268)

* Include `last_automatic_backup` in reply to backup/info (#131293)

Include last_automatic_backup in reply to backup/info

* Handle backup delete after config (#131259)

* Handle delete after copies

* Handle delete after days

* Add some test examples

* Test config_delete_after_logic

* Test config_delete_after_copies_logic

* Test more delete after days

* Add debug logs

* Always delete the oldest backup first

* Never remove the last backup

* Clean up words

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

* Fix after cleaning words

* Use utcnow

* Remove duplicate guard

* Simplify sorting

* Delete backups even if there are agent errors on get backups

---------

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

* Rename backup delete after to backup retention (#131364)

* Rename backup delete after to backup retention

* Tweak

* Remove length limit on `agent_ids` when configuring backup (#132057)

Remove length limit on agent_ids when configuring backup

* Rename backup retention_config to retention (#132068)

* Modify backup agent API to be stream oriented (#132090)

* Modify backup agent API to be stream oriented

* Fix tests

* Adjust after code review

* Remove no longer needed pylint override

* Improve test coverage

* Change BackupAgent API to work with AsyncIterator objects

* Don't close files in the event loop

* Don't close files in the event loop

* Fix backup manager create backup log (#132174)

* Fix debug log level (#132186)

* Add cloud backup agent (#129621)

* Init cloud backup sync

* Add more metadata

* Fix typo

* Adjust to base changes

* Don't raise on list if more than one backup is available

* Adjust to base branch

* Fetch always and verify on download

* Update homeassistant/components/cloud/backup.py

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

* Adjust to base branch changes

* Not required anymore

* Workaround

* Fix blocking event loop

* Fix

* Add some tests

* some tests

* Add cloud backup delete functionality

* Enable check

* Fix ruff

* Use fixture

* Use iter_chunks instead

* Remove read

* Remove explicit export of read_backup

* Align with BackupAgent API changes

* Improve test coverage

* Improve error handling

* Adjust docstrings

* Catch aiohttp.ClientError bubbling up from hass_nabucasa

* Improve iteration

---------

Co-authored-by: Erik <erik@montnemery.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Krisjanis Lejejs <krisjanis.lejejs@gmail.com>

* Extract file receiver from `BackupManager.async_receive_backup` to util (#132271)

* Extract file receiver from BackupManager.async_receive_backup to util

* Apply suggestions from code review

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

---------

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

* Make sure backup directory exists (#132269)

* Make sure backup directory exists

* Hand off directory creation to executor

* Use mkdir's exist_ok feeature

* Organize BackupManager instance attributes (#132277)

* Don't store received backups in a TempDir (#132272)

* Don't store received backups in a TempDir

* Fix tests

* Make sure backup directory exists

* Address review comments

* Fix tests

* Rewrite backup manager state handling (#132375)

* Rewrite backup manager state handling

* Address review comments

* Modify backup reader/writer API to be stream oriented (#132464)

* Internalize backup tasks (#132482)

* Internalize backup tasks

* Update test after rebase

* Handle backup error during automatic backup (#132511)

* Improve backup manager state logging (#132549)

* Fix backup manager state when restore completes (#132548)

* Remove WS command backup/agents/download (#132664)

* Add WS command backup/generate_with_stored_settings (#132671)

* Add WS command backup/generate_with_stored_settings

* Register the new command, add tests

* Refactor local agent backup tests (#132683)

* Refactor test_load_backups

* Refactor test loading agents

* Refactor test_delete_backup

* Refactor test_upload

* Clean up duplicate tests

* Refactor backup manager receive tests (#132701)

* Refactor backup manager receive tests

* Clean up

* Refactor pre and post platform tests (#132708)

* Refactor backup pre platform test

* Refactor backup post platform test

* Bump aiohasupervisor to version 0.2.2b0 (#132704)

* Bump aiohasupervisor to version 0.2.2b0

* Adjust tests

* Publish event when manager is idle after creating backup (#132724)

* Handle busy backup manager when uploading backup (#132736)

* Adjust hassio backup agent to supervisor changes (#132732)

* Adjust hassio backup agent to supervisor changes

* Fix typo

* Refactor test for create backup with wrong parameters (#132763)

* Refactor test not loading bad backup platforms (#132769)

* Improve receive backup coverage (#132758)

* Refactor initiate backup test (#132829)

* Rename Backup to ManagerBackup (#132841)

* Refactor backup config (#132845)

* Refactor backup config

* Remove unnecessary condition

* Adjust tests

* Improve initiate backup test (#132858)

* Store the time of automatic backup attempts (#132860)

* Store the time of automatic backup attempts

* Address review comments

* Update test

* Update cloud test

* Save agent failures when creating backups (#132850)

* Save agent failures when creating backups

* Update tests

* Store KnownBackups

* Add test

* Only clear known_backups on no error, add tests

* Address review comments

* Store known backups as a list

* Update tests

* Track all backups created with backup strategy settings (#132916)

* Track all backups created with saved settings

* Rename

* Add explicit call to save the store

* Don't register service backup.create in HassOS installations (#132932)

* Revert changes to action service backup.create (#132938)

* Fix logic for cleaning up temporary backup file (#132934)

* Fix logic for cleaning up temporary backup file

* Reduce scope of patch

* Fix with_strategy_settings info not sent over websocket (#132939)

* Fix with_strategy_settings info not sent over websocket

* Fix kitchen sink tests

* Fix cloud and hassio tests

* Revert backup ci changes (#132955)

Revert changes speeding up CI

* Fix revert of CI changes (#132960)

---------

Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
Co-authored-by: Krisjanis Lejejs <krisjanis.lejejs@gmail.com>
2024-12-11 21:49:34 +01:00
G Johansson
a1e4b3b0af Update quality scale for nordpool (#132964)
* Update quality scale for nordpool

* more
2024-12-11 21:23:26 +01:00
Noah Husby
d43d84a67f Add parallel updates & use typed config entry for Russound RIO (#132958) 2024-12-11 21:07:29 +01:00
Josef Zweck
525614b7cd Bump pylamarzocco to 1.4.0 (#132917)
* Bump pylamarzocco to 1.4.0

* update device snapshot
2024-12-11 21:52:20 +02:00
Franck Nijhof
73e68971e8 Remove port from Elgato configuration flow (#132961) 2024-12-11 20:48:55 +01:00
Marc Mueller
833557fad5 Trigger full ci run on global mypy config change (#132909) 2024-12-11 19:16:49 +01:00
epenet
0e8fe1eb41 Improve coverage in light reproduce state (#132929) 2024-12-11 19:15:36 +01:00
Allen Porter
fa05cc5e70 Add quality scale for nest integration (#131330)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-12-11 19:04:16 +01:00
Noah Husby
096d653059 Record current IQS state for Russound RIO (#131219) 2024-12-11 19:03:43 +01:00
Jan Bouwhuis
3a7fc15656 Add Dutch locale on supported Alexa interfaces (#132936) 2024-12-11 19:01:20 +01:00
Matthias Alphart
233d927c01 Update xknx to 3.4.0 (#132943) 2024-12-11 18:56:21 +01:00
Michael Hansen
94260147d7 Fix pipeline conversation language (#132896) 2024-12-11 18:52:02 +01:00
Robert Resch
502a221feb Set go2rtc quality scale to internal (#132945) 2024-12-11 17:20:49 +01:00
epenet
39f8de0159 Fix mqtt light attributes (#132941) 2024-12-11 17:18:54 +01:00
Maikel Punie
00ab5db661 Split the velbus services code in its own file (#131375) 2024-12-11 16:41:48 +01:00
epenet
0d71828def Migrate mqtt lights to use Kelvin (#132828)
* Migrate mqtt lights to use Kelvin

* Adjust restore_cache tests

* Adjust tests
2024-12-11 16:11:14 +01:00
jb101010-2
ee4db13c2a Add data description to suez_water config flow (#132466)
* Suez_water: config flow data_descriptions

* Rename counter by meter

* Use placeholders
2024-12-11 15:52:43 +01:00
Simone Chemelli
555d7f1ea4 Guard Vodafone Station updates against bad data (#132921)
guard Vodafone Station updates against bad data
2024-12-11 15:40:18 +01:00
epenet
1753382307 Adjust lifx to use local _ATTR_COLOR_TEMP constant (#132840) 2024-12-11 14:11:29 +00:00
Åke Strandberg
05b23d081b Set quality_scale for myUplink to Silver (#132923) 2024-12-11 13:09:33 +00:00
Maikel Punie
f974479970 Velbus add quality_scale.yaml (#131377)
Co-authored-by: Allen Porter <allen.porter@gmail.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-11 13:53:14 +01:00
Matthias Alphart
ecfa888918 Create quality_scale.yaml from integration scaffold script (#132199)
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
2024-12-11 13:52:53 +01:00
Åke Strandberg
7103b7fd80 Use snapshot tests for remaining myuplink platforms (#132915)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-11 13:01:02 +01:00
Marc Mueller
dc8b7cfede Allow bytearray for mqtt payload type (#132906) 2024-12-11 11:51:16 +01:00
Simon Lamon
b26583b0bf Bump python-linkplay to v0.1.1 (#132091) 2024-12-11 11:12:05 +01:00
shapournemati-iotty
beda273721 upgrade iottycloud lib to 0.3.0 (#132836) 2024-12-11 10:52:47 +01:00
Marc Mueller
0e8961276f Enable pydantic.v1 mypy plugin (#132907) 2024-12-11 10:50:42 +01:00
epenet
9c9e82a93e Migrate zha lights to use Kelvin (#132816) 2024-12-11 09:58:08 +01:00
epenet
7ef3e92e2d Migrate tasmota lights to use Kelvin (#132798) 2024-12-11 09:57:29 +01:00
G Johansson
2bb05296b8 Add remaining test coverage to yale_smart_alarm (#132869) 2024-12-11 09:46:53 +01:00
epenet
b780f31e63 Migrate flux to use Kelvin over Mireds (#132839) 2024-12-11 08:55:23 +01:00
Robert Resch
af838077cc Fix docker hassfest (#132823) 2024-12-11 08:55:00 +01:00
shapournemati-iotty
5e17721568 Remove old codeowner no longer working on the integration (#132807) 2024-12-11 08:53:19 +01:00
epenet
4ff41ed2f8 Refactor light significant change to use kelvin attribute (#132853) 2024-12-11 08:42:48 +01:00
dependabot[bot]
f0f0b4b8fa Bump github/codeql-action from 3.27.6 to 3.27.7 (#132900)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-11 08:24:25 +01:00
Ludovic BOUÉ
9f40074d66 Fix typo in water heater integration (#132891)
Fix typo in water heater componant
2024-12-11 07:36:09 +01:00
Chris Talkington
73feeacc39 Use runtime_data for roku (#132781)
* use runtime_data for roku

* unload cleanup

* tweaks

* tweaks

* fix tests

* fix tests

* Update config_flow.py

* Update config_flow.py
2024-12-11 06:55:58 +01:00
Allen Porter
355e80aa56 Test the google tasks api connection in setup (#132657)
Improve google tasks setup
2024-12-10 19:01:50 -08:00
Marc Mueller
77debcbe8b Update numpy to 2.2.0 (#132874) 2024-12-10 22:28:30 +01:00
Jonas Fors Lellky
b46392041f Add model_id to flexit (bacnet) entity (#132875)
* Add model_id to flexit (bacnet) entity

* Add model to mock
2024-12-10 21:44:00 +01:00
epenet
fb3ffaf18d Migrate demo lights to use Kelvin (#132837)
* Migrate demo lights to use Kelvin

* Adjust google_assistant tests
2024-12-10 20:59:12 +01:00
Manu
1b300a4389 Set config-flow rule in IQS to todo in Bring integration (#132855)
Set config-flow rule in IQS to todo
2024-12-10 20:52:39 +01:00
G Johansson
5dc2757324 Add quality scale to Nord Pool (#132415)
* Add quality scale to Nord Pool

* Update

* a

* fix
2024-12-10 19:35:21 +01:00
G Johansson
76b73fa9b1 Use floats instead of datetime in statistics (#132746)
* Use floats instead of datetime in statistics

* check if debug log
2024-12-10 19:03:43 +01:00
Stefano Angeleri
7fb5b17ac5 Bump pydaikin to 2.13.8 (#132759) 2024-12-10 19:29:28 +02:00
J. Nick Koston
d2303eb83f Bump pydantic to 2.10.3 and update required deps (#131963) 2024-12-10 18:27:40 +01:00
G Johansson
f99239538c Add retry to api calls in Nord Pool (#132768) 2024-12-10 19:26:49 +02:00
Markus Jacobsen
dba405dd88 Bump mozart-api to 4.1.1.116.4 (#132859)
Bump API
2024-12-10 19:21:59 +02:00
Markus Jacobsen
d4546c94b0 Add beolink_join source_id parameter to Bang & Olufsen (#132377)
* Add source as parameter to beolink join service

* Add beolink join source and responses

* Improve comment
Add translation

* Remove result from beolink join custom action

* Cleanup

* Use options selector instead of string for source ID
Fix test docstring

* Update options

* Use translation dict for source ids
Add input validation
Add tests for invalid sources
Improve source id description

* Use list instead of translation dict
Remove platform prefixes
Add test for Beolink Converter source

* Fix source_id naming and order
2024-12-10 11:01:12 -06:00
Allen Porter
8fd64d2ca4 Add a quality scale for fitbit integration (#131326)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-10 17:04:00 +01:00
Tom
2b17037edc Plugwise improve platform tests (#132748) 2024-12-10 16:43:08 +01:00
epenet
6a323a1d3c Fix wrong name attribute in mqtt ignore list (#132831) 2024-12-10 15:32:08 +01:00
epenet
7014317e9e Cleanup unnecessary mired attributes in esphome (#132833)
* Cleanup unnecessary mired attributes in esphome

* Adjust
2024-12-10 15:29:33 +01:00
Guido Schmitz
0a786394f5 Add data descriptions to devolo Home Control (#132703) 2024-12-10 15:15:57 +01:00
David Knowles
9614a8d1ca Pass an application identifier to the Hydrawise API (#132779) 2024-12-10 14:23:14 +01:00
Josef Zweck
1a60f0e668 Bump aioacaia to 0.1.11 (#132838) 2024-12-10 14:22:49 +01:00
Matthias Alphart
9551a12c9c Add exception translations for Fronius (#132830)
* Add exception translations for Fronius

* Update sensor.py
2024-12-10 13:58:02 +01:00
epenet
416a4c02b4 Migrate hue lights to use Kelvin (#132835) 2024-12-10 13:55:28 +01:00
Xiretza
6f3a230524 spaceapi: fix sensor values (#132099) 2024-12-10 13:47:20 +01:00
Robert Resch
25d092c8eb Bump deebot-client to 9.3.0 (#132834) 2024-12-10 13:31:22 +01:00
epenet
95107cf670 Add check for typed ConfigEntry in quality scale validation (#132028) 2024-12-10 13:07:08 +01:00
Åke Strandberg
46d4081ec6 Address review comment on myuplink tests (#132819) 2024-12-10 12:58:42 +01:00
Franck Nijhof
71d7e14032 Update wled to v0.21.0 (#132822) 2024-12-10 12:46:56 +01:00
Åke Strandberg
f6621023c2 Improve myuplink tests to reach full coverage for all modules (#131937) 2024-12-10 12:20:21 +01:00
epenet
03c6dab143 Add missing Kelvin attributes to mqtt ignore list (#132820) 2024-12-10 11:47:08 +01:00
Franck Nijhof
e343b69557 Update gotailwind to v0.3.0 (#132817) 2024-12-10 11:35:00 +01:00
Guido Schmitz
ea12a7c9a7 Remove config flow option to set mydevolo URL (#132821) 2024-12-10 11:27:58 +01:00
epenet
13a37da917 Migrate zwave_js lights to use Kelvin (#132818) 2024-12-10 11:01:22 +01:00
Norbert Rittel
b7018deebc Use "remove" in description of "Clear playlist" action (#132079) 2024-12-10 10:57:56 +01:00
epenet
28aa9c2fa3 Migrate vesync lights to use Kelvin (#132806) 2024-12-10 10:56:17 +01:00
Franck Nijhof
30e9c45c7f Update pvo to v2.2.0 (#132812) 2024-12-10 10:55:39 +01:00
epenet
611cef5cd1 Migrate xiaomi_miio lights to use Kelvin (#132811) 2024-12-10 10:41:38 +01:00
epenet
d724488376 Migrate yeelight lights to use Kelvin (#132814) 2024-12-10 10:29:32 +01:00
Åke Strandberg
be1c225c70 Address misc comments from myuplink quality scale review (#132802) 2024-12-10 10:20:30 +01:00
epenet
28d01d88a2 Migrate nanoleaf lights to use Kelvin (#132797) 2024-12-10 10:17:55 +01:00
epenet
4880849074 Migrate homematic lights to use Kelvin (#132794) 2024-12-10 10:17:40 +01:00
epenet
7b0a309fa7 Migrate template lights to use Kelvin (#132799) 2024-12-10 10:11:06 +01:00
epenet
36ce90177f Migrate tradfri lights to use Kelvin (#132800) 2024-12-10 10:09:55 +01:00
epenet
f0e7cb5794 Migrate tuya lights to use Kelvin (#132803) 2024-12-10 10:09:20 +01:00
epenet
bd6df06248 Migrate wemo lights to use Kelvin (#132808) 2024-12-10 10:07:36 +01:00
epenet
e31e4c5d75 Migrate wiz lights to use Kelvin (#132809) 2024-12-10 10:07:02 +01:00
Maciej Bieniek
2a127d19dd Use UnitOfEnergy.KILO_CALORIE in Tractive integration (#131909) 2024-12-10 09:50:53 +01:00
YogevBokobza
790edea4a0 Bump aioswitcher to 5.1.0 (#132753)
* Bump aioswitcher to 5.0.0

* fix tests
2024-12-10 10:43:09 +02:00
Noah Husby
bcedb004be Add diagnostics platform to Russound RIO (#132776) 2024-12-10 09:40:51 +01:00
Assaf Inbal
3bf4ef095d bump pyituran to 0.1.4 (#132791) 2024-12-10 10:39:33 +02:00
Franck Nijhof
988ca114a0 Update ciso8601 to v2.3.2 (#132793) 2024-12-10 09:35:01 +01:00
epenet
b0b3f04a05 Migrate iglo lights to use Kelvin (#132796) 2024-12-10 09:34:15 +01:00
epenet
82692f9a8f Migrate mired attributes to kelvin in limitlessled (#132785) 2024-12-10 09:20:35 +01:00
epenet
a11bf5cce1 Migrate blebox lights to use Kelvin (#132787) 2024-12-10 08:43:07 +01:00
David Knowles
cd420aee88 Catch Hydrawise authorization errors in the correct place (#132727) 2024-12-10 08:38:34 +01:00
epenet
3d1258ddc1 Migrate eufy lights to use Kelvin (#132790) 2024-12-10 08:36:43 +01:00
Brett Adams
17521f25b6 Remove sleep and forbidden handling from Teslemetry (#132784) 2024-12-10 08:35:53 +01:00
epenet
1ee3b68824 Migrate homekit_controller lights to use Kelvin (#132792) 2024-12-10 08:28:38 +01:00
dependabot[bot]
53e528e9b6 Bump actions/attest-build-provenance from 2.0.1 to 2.1.0 (#132788)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-10 08:27:05 +01:00
David Rapan
397091cc7d Add Starlink usage sensors (#132738)
* Add usage metrics returned from history_stats

* Add upload and download usage sensors

* Add strings for upload and download usage sensors

* Add usage to test_diagnostics.ambr

* Add icons for upload and download usage sensors

* Add suggested_unit_of_measurement to GIGABYTES
2024-12-10 08:26:42 +01:00
G Johansson
580a8d66b2 Change fields allowed to change in options flow for Mold indicator (#132400) 2024-12-10 08:20:28 +01:00
epenet
e83a50b88d Migrate elgato lights to use Kelvin (#132789) 2024-12-10 08:15:47 +01:00
Paulus Schoutsen
5062a7fec8 Add new api to fetch sentence triggers (#132764)
* Add new api to fetch sentence triggers

* With latest packages
2024-12-09 23:21:27 -05:00
epenet
cd39e4ac80 Migrate abode lights to use Kelvin (#132690) 2024-12-09 23:51:27 +01:00
jb101010-2
f210b74790 Suez_water: close session after config flow (#132714) 2024-12-09 23:50:04 +01:00
G Johansson
b1c17334f6 Set Nord Pool device as a service (#132717) 2024-12-09 23:48:23 +01:00
epenet
020db5f822 Migrate matter lights to use Kelvin (#132685) 2024-12-09 23:43:45 +01:00
epenet
879e082b54 Migrate osramlightify lights to use Kelvin (#132688) 2024-12-09 23:17:57 +01:00
Norbert Rittel
d2478b4058 Use consistent UI name for system_log.clear action (#132083) 2024-12-09 23:16:23 +01:00
Norbert Rittel
bd4e21aa9d Improve description of 'vapid_email' field (#131349) 2024-12-09 23:15:23 +01:00
Franck Nijhof
1256a7ea96 Update demetriek to v1.0.0 (#132765) 2024-12-09 23:11:30 +01:00
Brett Adams
1929b368fe Remove legacy behavior from Teslemetry (#132760) 2024-12-09 23:11:23 +01:00
J. Nick Koston
f177336025 Add missing last_reported_timestamp to LazyState (#132761)
followup to #132752
2024-12-09 23:08:01 +01:00
epenet
be34d302df Use local ATTR_KELVIN constant in yeelight (#132731) 2024-12-09 23:04:32 +01:00
epenet
f2500e5a32 Remove deprecated supported features warning in MediaPlayer (#132365) 2024-12-09 23:03:55 +01:00
Richard Kroegel
772b047d44 Change BMW reauth/reconfigure to only allow password (#132767)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-09 23:00:38 +01:00
epenet
4cb23ce562 Migrate hive lights to use Kelvin (#132686) 2024-12-09 22:59:21 +01:00
epenet
dcbedb5ae5 Migrate smartthings lights to use Kelvin (#132699) 2024-12-09 22:55:06 +01:00
starkillerOG
abc79a9f1c Bump reolink-aio to 0.11.5 (#132757) 2024-12-09 22:53:17 +01:00
epenet
07d8778870 Remove old compatibility code (and add new warning) in lifx (#132730) 2024-12-09 22:49:47 +01:00
epenet
da0454e24e Migrate limitlessled lights to use Kelvin (#132689) 2024-12-09 22:40:16 +01:00
Norbert Rittel
2d4fe5853f Add clearer descriptions to all Timer actions (#132571)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-12-09 22:37:32 +01:00
Noah Husby
3a65d1b611 Mark Cambridge Audio quality scale as platinum (#132762) 2024-12-09 22:28:14 +01:00
Åke Strandberg
af7caeae53 Add quality scale to myUplink - reflect current state (#131686) 2024-12-09 22:20:23 +01:00
epenet
b139af9a9c Migrate deconz lights to use Kelvin (#132698)
* Use ATTR_COLOR_TEMP_KELVIN in kelvin light

* Adjust
2024-12-09 21:46:46 +01:00
J. Nick Koston
e4ba94f939 Fix LazyState compatibility with State under_cached_property change (#132752) 2024-12-09 21:41:08 +01:00
Noah Husby
aa7b69afd4 Add reconfigure flow to Cambridge Audio (#131091)
* Add reconfigure flow to Cambridge Audio

* Update

* Add reconfigure flow to Cambridge Audio

* Fix

* Add helper method to reconfigure tests

* Update quality scale
2024-12-09 20:39:09 +01:00
Assaf Inbal
d3fab7d87a Add Ituran integration (#129067) 2024-12-09 20:19:15 +01:00
Norbert Rittel
e91cb99512 Improve name and description of Include list, fix holidays keyword name (#132188)
* Improve description of Include list, fix the keyword name

* Use "Days to include / exclude" to make more user-friendly

* Reworded both descriptions as suggested

* Updated up the exclude description, re-added reference to docs
2024-12-09 20:18:21 +01:00
epenet
7ba5038509 Remove YAML support from cert_expiry (#132350)
* Deprecate yaml import in cert_expiry

* Simplify

* Do full cleanup

* Cleanup more
2024-12-09 20:15:46 +01:00
adam-the-hero
c6bcd5a036 Add Watergate Sonic Local Integration (#129686)
Co-authored-by: Mark Breen <markvader@users.noreply.github.com>
2024-12-09 19:40:13 +01:00
Tom
674d42d8a0 Plugwise improve exception translations (#132663) 2024-12-09 19:05:10 +01:00
Tom
0c08e88953 Improve Plugwise tests (#132677) 2024-12-09 19:00:51 +01:00
epenet
b1217f5792 Use ATTR_COLOR_TEMP_KELVIN in alexa (#132733) 2024-12-09 18:01:24 +01:00
Raphael Hehl
9d79d905a4 Bump uiprotect to 6.8.0 (#132735)
Update uiprotect to version 6.8.0
2024-12-09 17:44:13 +01:00
Simone Rescio
85ed1d2ac8 Revert "Bump pyezviz to 0.2.2.3" (#132715) 2024-12-09 17:19:10 +01:00
Bram Kragten
5b06acfabd Update frontend to 20241127.7 (#132729)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-12-09 17:10:52 +01:00
Joost Lekkerkerker
241026ef67 Bump yt-dlp to 2024.12.06 (#132684) 2024-12-09 17:09:17 +01:00
Michael Hansen
887f1621e5 Bump intents to 2024.12.9 (#132726) 2024-12-09 17:08:58 +01:00
epenet
46e513615e Migrate switchbot lights to use Kelvin (#132695) 2024-12-09 09:25:25 -06:00
epenet
a20347963e Migrate flux_led lights to use Kelvin (#132687) 2024-12-09 09:25:15 -06:00
David Rapan
21a2ce6b59 Add Starlink consumption sensors (#132262) 2024-12-09 16:19:23 +01:00
Marc Mueller
49800f9aaa Update pylint to 3.3.2 and astroid to 3.3.6 (#132718)
* Update pylint to 3.3.2 and astroid to 3.3.6

* Fix
2024-12-09 16:05:40 +01:00
G Johansson
3be0d0d085 Add myself as code owner to statistics (#132719) 2024-12-09 16:04:47 +01:00
epenet
786a417ac9 Use kelvin attributes in baf (#132725) 2024-12-09 09:00:59 -06:00
epenet
ac791bdd20 Migrate opple lights to use Kelvin (#132697) 2024-12-09 14:55:07 +00:00
Åke Strandberg
8d72443fd6 Set unique_id in myuplink config entry (#132672) 2024-12-09 15:47:40 +01:00
G Johansson
74eddce3d3 Change to module function in statistics (#132648) 2024-12-09 15:23:21 +01:00
epenet
72de5d0fa3 Fix reading of max mireds from Matter lights (#132710) 2024-12-09 15:14:24 +01:00
dotvav
bd0da03eb9 Palazzetti power control (#131833)
* Add number entity

* Catch exceptions

* Add test coverage

* Add translation

* Fix exception message

* Simplify number.py

* Remove dead code
2024-12-09 14:02:17 +01:00
G Johansson
4e2e6619d0 Increase test coverage in yale_smart_alarm (#132650) 2024-12-09 13:52:51 +01:00
Manu
f4e48c31bd Add binary platform to IronOS (#132691)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-09 13:37:38 +01:00
Jan-Philipp Benecke
4bb3d6123d Move SABnzbd action setup to async_setup (#132629) 2024-12-09 13:37:17 +01:00
epenet
549afbc27e Use ATTR_COLOR_TEMP_KELVIN in baf light (#132692) 2024-12-09 12:55:39 +01:00
epenet
b1791aae63 Use ATTR_COLOR_TEMP_KELVIN in emulated_hue light (#132693) 2024-12-09 12:53:24 +01:00
Bouwe Westerdijk
fa9ee2adc6 Bump plugwise to v1.6.3 (#132673) 2024-12-09 12:27:15 +01:00
Thomas55555
ad34082435 Set quality scale to silver for Husqvarna Automower (#132293) 2024-12-09 12:18:45 +01:00
Norbert Rittel
97cd3cd7dc Add slightly more detailed descriptions for Counter actions (#132576) 2024-12-09 11:51:58 +01:00
epenet
6cf10cd0b2 Remove deprecated supported features warning in Update (#132667) 2024-12-09 11:25:18 +01:00
Manu
ee8f720253 Add tip connected detection to IronOS (#131946)
* Add binary platform and tip connected detection to IronOS

* suggested changes

* fix

* fix mypy

* revert accidental overwriting

* Remove binary sensor

* snapshot
2024-12-09 10:50:37 +01:00
epenet
5e8012f3f5 Remove deprecated supported features warning in WaterHeater (#132668) 2024-12-09 10:48:40 +01:00
epenet
57d5d7d2f2 Remove deprecated supported features warning in Vacuum (#132670) 2024-12-09 10:47:38 +01:00
epenet
31150bf897 Remove deprecated supported features warning in Siren (#132666) 2024-12-09 10:19:07 +01:00
epenet
427db02029 Remove deprecated supported features warning in AlarmControlPanel (#132665) 2024-12-09 10:16:48 +01:00
epenet
24b1eeb900 Remove YAML support from vizio (#132351) 2024-12-09 10:15:01 +01:00
epenet
1ec91e7c89 Remove deprecated supported features warning in Lock (#132642) 2024-12-09 08:45:36 +01:00
epenet
9ef9f2fafb Remove deprecated supported features warning in Humidifier (#132641) 2024-12-09 08:32:49 +01:00
epenet
f7ce112653 Remove deprecated supported features warning in Remote (#132643) 2024-12-09 08:32:30 +01:00
G Johansson
e0bb044782 Remove not needed code check in yale_smart_alarm (#132649) 2024-12-09 08:31:42 +01:00
Franck Nijhof
eddb416f6d Remove Stookalert integration (#132569) 2024-12-09 08:30:18 +01:00
epenet
6c3e56748c Use ast_parse_module in parallel_updates IQS rule (#132646) 2024-12-09 08:29:31 +01:00
epenet
644b07d084 Remove deprecated supported features warning in Camera (#132640) 2024-12-09 08:24:09 +01:00
dependabot[bot]
206cac6811 Bump actions/attest-build-provenance from 2.0.0 to 2.0.1 (#132661)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 08:17:15 +01:00
Åke Strandberg
182c85cf23 Enable additional entities on myUplink model SMO20 (#131688)
* Add a couple of entities to SMO 20

* Enable additional entities on SMO20
2024-12-09 07:51:03 +01:00
Thomas55555
9f0356fcfe Increase test coverage in apsystems coordinator (#132631)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-09 00:20:53 +01:00
hahn-th
ed938ba315 Bump homematicip from 1.1.3 to 1.1.5 (#132537) 2024-12-08 23:38:23 +01:00
Bouwe Westerdijk
0b7447c562 Bump plugwise to v1.6.2 and adapt (#132608) 2024-12-08 23:36:55 +01:00
Ravaka Razafimanantsoa
ce8c5fc3a9 Fix API change for AC not supporting floats in SwitchBot Cloud (#132231) 2024-12-08 23:35:41 +01:00
Franck Nijhof
be10d79c75 Update twentemilieu to 2.2.0 (#132554) 2024-12-08 23:30:12 +01:00
Hugo Ideler
d166e5fdcc Bump nsapi to 3.1.2 (#132596) 2024-12-08 23:29:43 +01:00
Tom
421e2411d3 Plugwise Quality improvements (#132175) 2024-12-08 22:58:17 +01:00
G Johansson
a4ceed776e Add tests to Nord Pool (#132468) 2024-12-08 22:50:22 +01:00
puddly
2f0e6a6dc7 Bump ZHA dependencies (#132630) 2024-12-08 22:32:39 +02:00
Thomas55555
d32e69dcb6 Fix config flow in Husqvarna Automower (#132615) 2024-12-08 15:59:27 +01:00
mkmer
b40d8074c0 Use runtime_data in Whirlpool (#132613)
Use runtime_data in whirlpool
2024-12-08 15:46:44 +01:00
Robert Svensson
a8713af8b8 Bump aiounifi to v81 to fix partitioned cookies on python 3.13 (#132540) 2024-12-07 15:31:11 -06:00
Raphael Hehl
09908153f8 Bump uiprotect to 6.7.0 (#132565) 2024-12-07 19:22:35 +01:00
J. Nick Koston
e04fd48a05 Bump yalexs-ble to 2.5.2 (#132560) 2024-12-07 18:12:58 +01:00
Josef Zweck
b9002d0c64 Bump pylamarzocco to 1.3.3 (#132534) 2024-12-07 12:18:04 +01:00
Austin Mroczek
acf207ad1c bump total_connect_client to 2024.12 (#132531) 2024-12-07 10:43:55 +01:00
Jan-Philipp Benecke
35fa6e5121 Set PARALLEL_UPDATES in Bring sensor platform (#132538)
* Set IQS `parallel-updates` to todo in Bring integration

* Set parallel_updates in sensor
2024-12-07 09:57:18 +01:00
Artur Pragacz
61fbfc3d40 Use device area/floor in intent_script (#130644)
* Use device area/floor in intent_script

* Add test
2024-12-07 00:49:07 -05:00
Franck Nijhof
16484dcee5 Update debugpy to 1.8.8 (#132519) 2024-12-06 16:26:24 -06:00
Franck Nijhof
d2463b9e7b Update go2rtc-client to 0.1.2 (#132517) 2024-12-06 23:08:12 +01:00
J. Diego Rodríguez Royo
0d0ef6bf03 Add exception handlers to Home Connect action calls (#131895)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-06 22:58:13 +01:00
Tom
18e8b080e0 Plugwise add missing translation (#132239)
Co-authored-by: Bouwe Westerdijk <bouwe.s.westerdijk@gmail.com>
2024-12-06 22:56:45 +01:00
Duco Sebel
5f3bb7e89e Use build in unit of measurement in HomeWizard 'Water usage' sensor (#132261) 2024-12-06 22:55:39 +01:00
Alex
a248a6d991 Update pyrisco to 0.6.5 (#132493) 2024-12-06 15:43:57 -06:00
epenet
12be82fdbc Add parallel-updates rule to quality_scale validation (#132041) 2024-12-06 22:40:29 +01:00
J. Nick Koston
5bae000db5 Bump pycups to 2.0.4 (#132514) 2024-12-06 22:05:27 +01:00
G Johansson
f02989e631 Removes previously deprecated simulated integration (#132111) 2024-12-06 21:54:01 +01:00
Jan Rieger
4fe8a43cc9 Remove native_unit_of_measurement from Onewire counters (#132076) 2024-12-06 21:23:45 +01:00
Erwin Douna
3fb1b8e79a Fix PyTado dependency (#132510) 2024-12-06 21:13:26 +01:00
Erik Montnemery
552613d949 Remove support for live recorder data migration of event type IDs (#131826) 2024-12-06 21:08:08 +01:00
Erik Montnemery
d26d483a2f Improve recorder util resolve_period (#132264) 2024-12-06 21:06:56 +01:00
G Johansson
40239945c1 Remove not needed name from yale_smart_alarm (#132204) 2024-12-06 21:01:41 +01:00
epenet
9771998415 Cache AST module parsing in hassfest (#132244) 2024-12-06 20:55:34 +01:00
G Johansson
e54d929573 Small cleanup in sensibo (#132118) 2024-12-06 20:54:50 +01:00
G Johansson
0111205f81 Remove migration for tag (#132200) 2024-12-06 20:54:05 +01:00
dependabot[bot]
a661e60511 Bump actions/attest-build-provenance from 1.4.4 to 2.0.0 (#132332)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 20:50:13 +01:00
Brett Adams
71f5f4bcdd Remove default OAuth implementation from Tesla Fleet (#132431) 2024-12-06 20:43:37 +01:00
Brett Adams
b30795e1f4 Add more models to Tesla Fleet (#132430) 2024-12-06 20:42:52 +01:00
Manu
2fd3aac268 Add check for unique id mismatch in reauth of Bring integration (#132499) 2024-12-06 20:39:50 +01:00
epenet
1f8913d6cd Remove deprecated supported features warning in LightEntity (#132371) 2024-12-06 20:29:30 +01:00
epenet
23461d2cfd Add tests for media player support_* properties (#132458) 2024-12-06 20:26:50 +01:00
epenet
3c06fe1e21 Move light constants to separate module (#132473) 2024-12-06 20:25:17 +01:00
Manu
49621aedb0 Set parallel updates in Bring integration (#132504) 2024-12-06 20:22:48 +01:00
dependabot[bot]
4de179c4c1 Bump codecov/codecov-action from 5.0.7 to 5.1.1 (#132455)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-12-06 18:43:13 +01:00
Allen Porter
7630ea4f09 Fix google tasks due date timezone handling (#132498) 2024-12-06 16:58:48 +01:00
Bram Kragten
20e0913286 Update frontend to 20241127.6 (#132494) 2024-12-06 16:58:09 +01:00
Allen Porter
35438f65e5 Update exception handling for python3.13 for getpass.getuser() (#132449)
* Update exception handling for python3.13 for getpass.getuser()

* Add comment

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

* Cleanup trailing space

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-06 06:54:21 -08:00
Steven B.
1a0a2ebdb1 Bump tplink python-kasa dependency to 0.8.1 (#132472) 2024-12-06 15:27:52 +01:00
epenet
4b4c886438 Bump samsungtvws to 2.7.2 (#132474) 2024-12-06 12:23:07 +01:00
Bram Kragten
0d1abc31b5 Update frontend to 20241127.5 (#132475) 2024-12-06 12:22:42 +01:00
Robert Resch
773ad6529c Bump deebot-client to 9.2.0 (#132467) 2024-12-06 12:22:05 +01:00
G Johansson
2eaf206562 Implement new state property for vacuum which is using an enum (#126353)
* Implement new state property for vacuum which is using an enum

* Mod

* Mod init

* Mods

* Fix integrations

* Tests

* Fix state

* Add vacuum tests

* Fix last test

* Litterrobot tests

* Fixes

* Tests

* Fixes

* Fix VacuumEntity

* Mods

* Mods

* Mods

* Update demo

* LG

* Fix vacuum

* Fix Matter

* Fix deprecation version

* Mods

* Fixes

* Fix ruff

* Fix tests

* Fix roomba

* Fix breaking dates
2024-12-06 11:16:03 +01:00
Robert Resch
bd9aefda62 Point to the Ecovacs issue in the library for unspoorted devices (#132470)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-12-06 11:01:00 +01:00
epenet
b4d01dfd0c Adjust scope of zha global quirks fixture (#132463) 2024-12-06 10:11:52 +01:00
epenet
0c8ebbe588 Log warning on use of deprecated light constants (#132387) 2024-12-06 09:56:28 +01:00
epenet
4a7e6bc068 Fix flaky CI from azure_event_hub (#132461) 2024-12-06 09:55:00 +01:00
Petar Petrov
30f84f55a4 Handle Z-Wave JS S2 inclusion via Inclusion Controller (#132073)
* ZwaveJS: Handle S2 inclusion via Inclusion Controller

* improved tests
2024-12-06 09:35:48 +01:00
G Johansson
ce3db31b30 Fix nordpool dont have previous or next price (#132457) 2024-12-06 08:33:05 +01:00
dependabot[bot]
ff46b3a2bb Bump actions/cache from 4.1.2 to 4.2.0 (#132419) 2024-12-06 08:29:09 +01:00
Blake Bryant
ef55a8e665 Bump pydeako to 0.6.0 (#132432)
feat: update deako integration to use improved version of pydeako

Some things of note:
- simplified errors
- pydeako has introduced some connection improvements

See here: https://github.com/DeakoLights/pydeako/releases/tag/0.6.0
2024-12-06 08:28:02 +01:00
Joakim Sørensen
9058e00aef Bump hass-nabucasa from 0.85.0 to 0.86.0 (#132456)
Bump hass-nabucasa fro 0.85.0 to 0.86.0
2024-12-06 08:20:06 +01:00
Marc Mueller
60fd9d5027 Update mypy-dev to 1.14.0a6 (#132440) 2024-12-05 21:34:05 -06:00
Glenn Waters
28d6a21189 Bump upb-lib to 0.5.9 (#132411) 2024-12-05 21:32:33 -06:00
J. Nick Koston
909b13809e Bump aioesphomeapi to 28.0.0 (#132447) 2024-12-05 21:23:24 -06:00
J. Nick Koston
88eb611eef Fix deprecated call to mimetypes.guess_type in CachingStaticResource (#132299) 2024-12-05 21:52:48 -05:00
J. Nick Koston
edc857b365 Bump aiohttp to 3.11.10 (#132441) 2024-12-05 19:50:02 -06:00
Brett Adams
0aeb8f44f4 Bump tesla-fleet-api to 0.8.5 (#132339) 2024-12-05 23:04:02 +01:00
Jan Bouwhuis
3e98df707d Remove deprecated integration dte_energy_bridge (#132276)
* Remove deprecated integration dte_energy_bridge

* Update quality scale script and ran hassfest
2024-12-05 22:23:31 +01:00
epenet
841773bb68 Remove yaml import from hive (#132354)
* Raise issue on hive deprecated YAML configuration

* Remove YAML import
2024-12-05 22:16:18 +01:00
G Johansson
e7f44048e9 Remove _enable_turn_on_off_backwards_compatibility T-Z (#132423) 2024-12-05 21:48:02 +01:00
G Johansson
60563ae88a Remove _enable_turn_on_off_backwards_compatibility N-S (#132422) 2024-12-05 21:47:31 +01:00
G Johansson
ee6be6bfd6 Remove _enable_turn_on_off_backwards_compatibility G-M (#132418) 2024-12-05 21:47:13 +01:00
G Johansson
768c2b0f3d Remove _enable_turn_on_off_backwards_compatibility A-F (#132417)
Remove _enable_turn_on_off_backwards_compatibility A-G
2024-12-05 21:46:59 +01:00
epenet
b1379f6a89 Avoid access to self.context["source"] in integration config flows (#132355)
* Avoid access to `self.context["source"]` in integration config flows

* One more

* One more
2024-12-05 21:20:02 +01:00
epenet
b2ac16e95f Remove deprecated supported features warning in CoverEntity (#132367)
Cleanup magic numbers for cover supported features
2024-12-05 21:18:45 +01:00
Artur Pragacz
1ca2f3393c Add data description for Onkyo config flow (#132349) 2024-12-05 21:15:40 +01:00
Jan Bouwhuis
5fdd705edf Remove yaml import from incomfort integration after deprecation time (#132275)
* Remove yaml import from incomfort integration after deprecation time

* Cleanup CONFIG_SCHEMA

* restore missing DOMAIN import

* Import DOMAIN from const
2024-12-05 21:15:26 +01:00
robinostlund
f4896f7b09 Add missing UnitOfPower to sensor (#132352)
* Add missing UnitOfPower to sensor

* Update homeassistant/components/sensor/const.py

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

* adding to number

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-05 21:14:04 +01:00
Jan Bouwhuis
3a2460f9f9 Remove yaml import from feedreader integration (#132278)
* Remove yaml import from feedreader integration

* Update homeassistant/components/feedreader/config_flow.py

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

* Drop _max_entries class attribute

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-05 20:57:43 +01:00
epenet
e5851c20e9 Mark test-before-setup as exempt in mqtt (#132334) 2024-12-05 20:55:54 +01:00
G Johansson
c41cf570d3 Remove deprecated supported features warning in ClimateEntity (#132206)
* Remove deprecated features from ClimateEntity

* Remove not needed tests

* Remove add_to_platform_start
2024-12-05 20:37:17 +01:00
epenet
17afe1ae51 Remove deprecated supported features warning in FanEntity (#132369) 2024-12-05 20:32:59 +01:00
epenet
39abeb4600 Use typed config entry in husqvarna_automower (#132346) 2024-12-05 20:24:21 +01:00
Artur Pragacz
c38a33d330 Fix missing AV info in Onkyo (#132328)
Add additional AV info to Onkyo
2024-12-05 11:48:15 -06:00
Diogo Gomes
7de9e9d37a Removes references to croniter from utility_meter (#132364)
remove croniter
2024-12-05 11:45:04 -06:00
Franck Nijhof
52e6afdcca Merge branch 'master' into dev 2024-12-05 13:22:49 +01:00
epenet
13a59dee5a Remove dead code in fritzbox_callmonitor (#132353) 2024-12-05 10:26:11 +00:00
Josef Zweck
33ad27d569 Bump pylamarzocco to 1.3.2 (#132344) 2024-12-05 10:28:57 +01:00
epenet
9fd23a6d30 Revert "Pin rpds-py to 0.21.0 to fix CI" (#132331)
Revert "Pin rpds-py to 0.21.0 to fix CI (#132170)"

This reverts commit 7e07930342.
2024-12-05 08:41:53 +01:00
Tobias Perschon
5137b06ee7 Remove stale requirement for androidtv (#132319)
* removed stale pure-python-adb reference

Signed-off-by: Tobias Perschon <tobias@perschon.at>

* reverted wrong changes

Signed-off-by: Tobias Perschon <tobias@perschon.at>

* removed wrong file

Signed-off-by: Tobias Perschon <tobias@perschon.at>

* cosmetic update

Signed-off-by: Tobias Perschon <tobias@perschon.at>

---------

Signed-off-by: Tobias Perschon <tobias@perschon.at>
2024-12-05 02:53:33 +01:00
Artur Pragacz
f68b78d00e Add quality scale to Onkyo (#131322)
* Add quality scale to Onkyo

* Update homeassistant/components/onkyo/quality_scale.yaml

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

* docs limitations todo

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

* entity event setup

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-12-05 02:34:07 +01:00
Noah Husby
1456d5802d Fix runtime data in Cambridge Audio (#132285)
* Fix runtime data in Cambridge Audio

* Update
2024-12-04 17:20:27 -06:00
Alberto Geniola
84e6c0b9ac Bump elmax-api to 0.0.6.3 (#131876) 2024-12-04 23:59:40 +01:00
G Johansson
94b16da90f Set command_line quality scale to legacy (#132306) 2024-12-04 15:58:45 -06:00
mkmer
950563cf32 Use config_entry.runtime_data in Honeywell (#132297)
* Use entry.runtime_data

* switch

* create new type

* Extend ConfigEntry

* simplify runtime_data, clean up data types

* More config_entry types

* Yet more missing type changes
2024-12-04 21:54:12 +01:00
mkmer
437111453b Bump aiosomecomfort to 0.0.28 in Honeywell (#132294)
Bump aiosomecomfort
2024-12-04 21:49:23 +01:00
Jeff Terrace
106c5d4248 Add support for onvif tplink person and vehicle events (#130769)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-12-04 14:15:30 -06:00
Thomas55555
de0ffea52d Clean up common modules in Husqvarna Automower (#132290) 2024-12-04 20:28:43 +01:00
G Johansson
80ad154dcd Refactor template lock to only return LockState or None (#132093)
* Refactor template lock to only return LockState or None

* Test for false states

* Use strings
2024-12-04 20:04:50 +01:00
Thomas55555
e55d8b2d2b Check token scope earlier in Husqvarna Automower (#132289) 2024-12-04 19:50:15 +01:00
Manu
2977cf227e Add Bring! quality scale record (#131584) 2024-12-04 19:49:58 +01:00
J. Nick Koston
719cbd3070 Fix test_dump_log_object timeouts in the CI (#132234) 2024-12-04 19:30:48 +01:00
Thomas55555
bd40e1e7df Add quality scale for Husqvarna Automower (#131560) 2024-12-04 19:12:26 +01:00
Noah Husby
8910dbbcd1 Record current IQS state for Cambridge Audio (#131080) 2024-12-04 18:22:34 +01:00
Manu
bd1ad04dab Add ista EcoTrend quality scale record (#131580) 2024-12-04 18:20:59 +01:00
Klaas Schoute
d92dbbf58b Set new polling interval for Powerfox integration (#132263) 2024-12-04 17:26:04 +01:00
Tucker Kern
b3ff8f56b9 Refactor Snapcast client and group classes to use a common base clase (#124499)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-04 17:22:31 +01:00
Manu
b6b340ae63 Add IronOS quality scale record (#131598) 2024-12-04 17:18:21 +01:00
Michael Hansen
5c60cffd4d Bump intents to 2024.12.4 (#132274) 2024-12-04 11:02:00 -05:00
Jan Bouwhuis
8f43a71ff6 Ensure MQTT subscriptions can be made when the broker is disconnected (#132270) 2024-12-04 15:18:04 +01:00
Bram Kragten
02db5ec88f Update frontend to 20241127.4 (#132268) 2024-12-04 14:57:25 +01:00
Joost Lekkerkerker
d88f6dc6b9 Bump knocki to 0.4.2 (#129261) 2024-12-04 14:56:42 +01:00
dependabot[bot]
977d8fd1c8 Bump github/codeql-action from 3.27.5 to 3.27.6 (#132237)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-04 14:51:10 +01:00
Erik Montnemery
deab285db8 Improve tests of recorder util resolve_period (#132259) 2024-12-04 14:01:49 +01:00
Pete
a417d3dcf8 Fix recorder "year" period in leap year (#132167)
* FIX: make "year" period work in leap year

* Add test

* Set second and microsecond to non-zero in test start times

* FIX: better fix for leap year problem

* Revert "FIX: better fix for leap year problem"

This reverts commit 06aba46ec6.

---------

Co-authored-by: Erik <erik@montnemery.com>
2024-12-04 13:21:10 +01:00
Robert Resch
545a780fcb Bump deebot-client to 9.1.0 (#132253) 2024-12-04 11:50:55 +01:00
G Johansson
5a1d5802c4 Fix sensibo test coverage to 100% (#132202) 2024-12-04 11:19:11 +01:00
Klaas Schoute
f0c07d68c5 Catch exceptions on entry setup for Autarco integration (#132227) 2024-12-04 11:17:39 +01:00
G Johansson
db266d80ec Pass config entry to UpdateCoordinator in yale_smart_alarm (#132205) 2024-12-04 10:45:47 +01:00
epenet
8c6d638354 Improve discovery rule in IQS validation (#132251)
* Improve discovery rule in IQS validation

* Adjust fyta/powerfox
2024-12-04 10:43:44 +01:00
Christopher Masto
ea9301aa9e Fix Visual Studio Code tasks to use selected Python interpreter (#132219) 2024-12-04 10:39:54 +01:00
epenet
2ebc229d8d Use typed config entry in mastodon (#132249) 2024-12-04 09:54:29 +01:00
cnico
5600ad0d82 Fix blocking call in netdata (#132209)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-12-04 09:53:29 +01:00
epenet
cafd2092d4 Use typed config entry in fyta (#132248) 2024-12-04 09:52:31 +01:00
Jan-Philipp Benecke
6b7724c556 Track if intent was processed locally (#132166) 2024-12-04 09:52:15 +01:00
Klaas Schoute
ab1f03f392 Add diagnostics to Powerfox integration (#132226)
* Add diagnostics to Powerfox integration

* Update quality scale list
2024-12-04 09:37:17 +01:00
Joost Lekkerkerker
58d06ebc39 Bump yt-dlp to 2024.12.03 (#132220) 2024-12-04 09:35:53 +01:00
Jeff Terrace
ce11ac5ecd Bump onvif-zeep-async to 3.1.13 (#132229)
Bump onvif-zeep-async to 3.1.13.
2024-12-04 07:34:00 +01:00
Raphael Hehl
cb36184511 fix: unifiprotect prevent RTSP repair for third-party cameras (#132212)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-12-03 23:03:31 -06:00
Klaas Schoute
1fe2a928a2 Add reauthentication flow for Powerfox integration (#132225)
* Add reauthentication flow for Powerfox integration

* Update quality scale
2024-12-04 01:48:35 +01:00
LG-ThinQ-Integration
7a98497710 Bump thinqconnect to 1.0.2 (#132131)
Co-authored-by: yunseon.park <yunseon.park@lge.com>
2024-12-04 01:46:36 +01:00
Allen Porter
3ef9b71807 Add quality_scale.yaml for Google Photos integration (#131329)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-04 01:18:34 +01:00
Andrew Jackson
3b39c53479 Add quality scale for Mastodon (#131357) 2024-12-04 01:08:58 +01:00
dontinelli
c0303bc652 Add quality scale for fyta (#131508)
Co-authored-by: Josef Zweck <24647999+zweckj@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-04 00:59:57 +01:00
jb101010-2
2696405c63 Suez water add quality_scale.yaml (#131360)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-04 00:59:36 +01:00
Tom
9a17389cd0 Plugwise quality docs benchmark data update and removal (#132082) 2024-12-04 00:42:53 +01:00
Manu
c484568e75 Bump pynecil to v2.0.2 (#132221) 2024-12-04 00:40:41 +01:00
dontinelli
5b365fc0bd Add missing data description for solarlog (#131712) 2024-12-04 00:39:53 +01:00
Klaas Schoute
abd3466d19 Add powerfox integration (#131640) 2024-12-04 00:35:50 +01:00
Richard Kroegel
535b47789f Improve BMWDataUpdateCoordinator typing (#132087)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-04 00:33:45 +01:00
G Johansson
4deaeaeda0 Fix next mypy issue in airzone_cloud (#132217) 2024-12-03 23:08:08 +01:00
dontinelli
5ae875be77 Update test_config_flow for solarlog (#132104)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-03 22:29:58 +01:00
G Johansson
14897f921c Fix mypy issue in airzone cloud (#132208) 2024-12-03 22:25:29 +01:00
G Johansson
f31ff3ca14 Bump holidays to 0.62 (#132108) 2024-12-03 22:24:39 +01:00
Hugh Saunders
bb51837346 Generic Thermostat Add Target Min Max to UI config (#131168)
Currently you can configure the minium and maximum target temperatures
if you create a generic thermostat in YAML. If you create it via the
UI, there is no option to configure them, you just get the climate
domain defaults.

This commit adds minimum and maximum fields to the first stage of the
generic thermostat config flow, so that UI users can also set min and
max.

Min and max are important as usually users want to select target
temperatures within a relatively narrow band, while the defaults create
a wide band. The wide band makes it hard to be accurate enough with the
arc style temperatue selector on the thermostat card.
2024-12-03 22:23:04 +01:00
epenet
a405d2b724 Bump pytest to 8.3.4 (#132179) 2024-12-03 21:49:24 +01:00
Erik Montnemery
1a714276cc Remove support for live recorder data migration of entity IDs (#131952) 2024-12-03 14:43:33 -06:00
dontinelli
09d7fed6cd Add dhcp discovery for fyta (#132185)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-03 21:23:52 +01:00
G Johansson
b9e4855e05 Refactor roomba to set vacuums in vacuum file (#132102) 2024-12-03 21:18:54 +01:00
Michael Hansen
ab83ec61e0 Ensure entity names are not hassil templates (#132184) 2024-12-03 19:37:05 +01:00
lunmay
74b713fa97 Fix typo in exception message in google_photos integration (#132194) 2024-12-03 19:31:28 +01:00
Austin Mroczek
e401fee3da Add initial quality scale for TotalConnect (#132012) 2024-12-03 18:43:49 +01:00
epenet
6c98cd49ea Fix check dirty in Prepare dependencies CI (#132180) 2024-12-03 18:03:13 +01:00
Abílio Costa
208b14dd2b Use translations on NumberEntity unit_of_measurement property (#132095)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-12-03 17:08:09 +01:00
Raphael Hehl
13e4c51ce5 Bump uiprotect to 6.6.5 (#132147) 2024-12-03 17:03:43 +01:00
G Johansson
56fc8a1f92 Pass config entry directly to update coordinator in Sensibo (#132114) 2024-12-03 16:20:48 +01:00
Bram Kragten
92f38ef1a1 Update frontend to 20241127.3 (#132176) 2024-12-03 10:13:15 -05:00
J. Nick Koston
33db95f6be Bump PyJWT to 2.10.1 (#132100) 2024-12-03 16:03:43 +01:00
Jan-Philipp Benecke
7ae80b542a Use typed config entry in SABnzbd coordinator (#132098) 2024-12-03 15:48:56 +01:00
epenet
6fc4f45def Dump pip freeze in CI (#132173)
* Dump pip freeze in CI

* adjust

* adjust

* adjust

* Include python version
2024-12-03 15:24:05 +01:00
epenet
7c9b8552cb Reapply "bump hassil and intents" (#132138) (#132151)
This reverts commit 39b2cf6ed2.
2024-12-03 15:21:41 +01:00
Thomas55555
6a09474623 Catch InverterReturnedError in APSystems (#131930)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-03 15:11:15 +01:00
Josef Zweck
e3885b8117 Instantiate new httpx client for lamarzocco (#132016) 2024-12-03 15:10:58 +01:00
Maciej Bieniek
9e723752f8 Bump nettigo-air-monitor to version 4.0.0 (#132106) 2024-12-03 15:08:36 +01:00
epenet
7e07930342 Pin rpds-py to 0.21.0 to fix CI (#132170)
* Pin rpds-py==0.21.0 to fix CI

* Add carriage return
2024-12-03 15:01:35 +01:00
epenet
76ba3afeae Cleanup dead code in renault (#132172) 2024-12-03 14:33:40 +01:00
Michael Hansen
af5574f71c Bump voip-utils (#132110)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-12-03 14:08:55 +01:00
Bram Kragten
ff77ecd2ce Update frontend to 20241127.2 (#132109)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-12-03 14:08:31 +01:00
starkillerOG
f6beefced3 Improve Reolink config flow tests (#131693)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-03 13:50:50 +01:00
Richard Kroegel
f59cf8fa54 Set PARALLEL_UPDATES for all BMW platforms (#132088) 2024-12-03 13:36:41 +01:00
Jon Seager
3e64d148cc Bump pytouchlinesl to 0.3.0 (#132157) 2024-12-03 13:34:50 +01:00
Tobias Perschon
c4ba15bb8c Improve error logging for unifi-ap (#132141) 2024-12-03 13:34:13 +01:00
Tobias Perschon
bebbb87aa2 Bump unifi_ap to 0.0.2 (#132125) 2024-12-03 13:33:47 +01:00
Petar Petrov
3a19c2f47f Support Z-Wave JS abort S2 bootstrapping (#132140)
ZWaveJS: abort S2 bootstrapping when inclusion is canceled
2024-12-03 13:29:44 +01:00
epenet
ffccdbbcec Bump renault-api to 0.2.8 (#132135) 2024-12-03 13:10:55 +01:00
Jan Bouwhuis
d66a6d9596 Fix imap sensor in case of alternative empty search response (#132081) 2024-12-03 13:06:54 +01:00
Marcel van der Veldt
50936b4e28 Add support for features changing at runtime in Matter integration (#129426) 2024-12-03 13:06:18 +01:00
Tom
aeab8a0143 Plugwise fixes from quality review (#132158) 2024-12-03 12:34:03 +01:00
epenet
003d4d712a Bump syrupy to 4.8.0 (#132134) 2024-12-03 11:31:54 +01:00
mvn23
3e2bac96e6 Move set_room_setpoint to opentherm_gw hub (#132152) 2024-12-03 10:49:32 +01:00
epenet
39b2cf6ed2 Revert "bump hassil and intents" (#132138)
* Revert "Fix bad hassil tests on CI (#132132)"

This reverts commit 101bb091ba.

* Revert "Bump hassil and intents (#132092)"

This reverts commit e52182940b.
2024-12-03 09:37:33 +01:00
starkillerOG
bb7dc079ce Remove unneeded step from reauth in Reolink (#132143) 2024-12-03 09:11:44 +01:00
Paulus Schoutsen
101bb091ba Fix bad hassil tests on CI (#132132)
* Fix CI

* Fix whitespace

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-12-02 23:08:51 -06:00
G Johansson
03be1b9f38 Drop operating mode property in sharkiq (#132097) 2024-12-03 00:12:49 +01:00
G Johansson
5dadabe50c Add data description to Nord pool config flow (#132115) 2024-12-02 23:11:44 +01:00
starkillerOG
0e5b03b343 Rename 'Reolink IP NVR/camera' to 'Reolink' (#132113) 2024-12-02 22:39:48 +01:00
starkillerOG
db430beb5b Fix Reolink dispatcher ID for onvif fallback (#131953) 2024-12-02 22:18:24 +01:00
epenet
0a977d070b Improve Renault reauth test (#132077) 2024-12-02 21:57:45 +01:00
epenet
e1772d25f2 Cleanup dead code in renault coordinator (#132078) 2024-12-02 21:56:13 +01:00
Jan-Philipp Benecke
755d36d82f Mark trend sensor unavailable when source entity is unknown/unavailable (#132080) 2024-12-02 21:54:57 +01:00
Manu
32b8c8985e Fix type hints in IronOS coordinators (#132107)
Fix coordinators return type in IronOS
2024-12-02 21:41:13 +01:00
Michael Hansen
e52182940b Bump hassil and intents (#132092) 2024-12-02 14:09:35 -05:00
starkillerOG
d7cdb357dc Add Reolink quality scale yaml (#131123)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-02 15:39:44 +01:00
Josef Zweck
54c5d1002b Set connections on device for acaia (#132064) 2024-12-02 15:27:44 +01:00
Tom
13e9f1935d Record Plugwise Quality Scale (#131888)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-02 15:21:03 +01:00
David Knowles
92520fe365 Ensure Schlage config entry uniqueness (#131732)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-02 15:18:17 +01:00
starkillerOG
2f644eb61c Remove option to update settings using second config flow in Reolink (#131695) 2024-12-02 15:01:28 +01:00
dontinelli
4b9d89a480 Change wording in config flow dialog for fyta (#132075) 2024-12-02 14:57:47 +01:00
Marc Mueller
fe0f414e99 Update mypy-dev to 1.14.0a5 (#132063) 2024-12-02 14:40:13 +01:00
Duco Sebel
89ee49e50c Round status light brightness number in HomeWizard (#132069) 2024-12-02 14:04:39 +01:00
Abílio Costa
6db8fced60 Update buienradar sensors only after being added to HA (#131830)
* Update buienradar sensors only after being added to HA

* Move check to util

* Check for platform in sensor state property

* Move check to unit translation key property

* Add test for sensor check

* Properly handle added_to_hass

* Remove redundant comment
2024-12-02 13:52:59 +01:00
Mike Degatano
99063ba141 Reboot host to aiohasupervisor (#130391)
* Reboot host to aiohasupervisor

* Remove invalid test

* Remove unnecessary init
2024-12-02 13:34:39 +01:00
Jan Rieger
0c693b6ae1 Add translated native unit of measurement to Jellyfin (#132055) 2024-12-02 13:28:54 +01:00
dependabot[bot]
c610f16e90 Bump dawidd6/action-download-artifact from 6 to 7 (#132040)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-02 13:25:38 +01:00
Petar Petrov
29b48d02de Bump zwave-js-server-python to 0.60.0 (#132059) 2024-12-02 13:21:54 +01:00
Simone Rescio
a419fde0eb Bump pyezviz to 0.2.2.3 (#132060) 2024-12-02 13:18:53 +01:00
Josef Zweck
1cf00d9bbc Use format_mac correctly for acaia (#132062) 2024-12-02 12:38:39 +01:00
Manu
ea7f1b2a4e Add additional number entities to IronOS (#131943)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-12-02 12:35:36 +01:00
Marc Mueller
11a2a62144 Update livisi to 0.0.24 (#132058) 2024-12-02 12:33:54 +01:00
nasWebio
3d26fa7864 Bump webio_api to 0.1.11 (#131730) 2024-12-02 11:07:37 +01:00
ashionky
e37ae8bf8d Bump refoss to v1.2.5 (#132051) 2024-12-02 11:05:09 +01:00
Andrew Jackson
56ec70815c Add translated native unit of measurement - squeezebox (#131912) 2024-12-02 10:54:37 +01:00
Andrew Jackson
584bb7bca8 Add translated native unit of measurement - PiHole (#131915) 2024-12-02 10:51:50 +01:00
Andrew Jackson
79ed6d865f Add translated native unit of measurement - Transmission (#131913) 2024-12-02 10:51:32 +01:00
Andrew Jackson
66d0d2eb6c Add translated native unit of measurement - QBitTorrent (#131918)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-12-02 10:50:49 +01:00
epenet
8d1493036a Set PARALLEL_UPDATES in renault and bump quality scale (#132047) 2024-12-02 09:59:57 +01:00
TimL
5dc390b6b9 Bump psymlight v0.1.4 (#132045) 2024-12-02 09:24:49 +01:00
Andrew Sayre
4eb75a56e6 Use runtime data in HEOS (#132030)
* Adopt runtime_data

* Fix missing variable assignment

* Address PR feedback
2024-12-02 08:19:43 +01:00
dontinelli
4eb5734d73 Remove CONF_NAME from config entry in solarlog (#131738)
* Remove CONF_NAME from config entry

* Remove name from strings.json
2024-12-02 07:39:48 +01:00
epenet
5458ee2fa9 Use typed config entry in imap (#132029)
* Use typed config entry in imap

* Adjust
2024-12-02 07:28:29 +01:00
epenet
28eb4f3dff Use typed config entry in rainbird (#132031)
* Use typed config entry in rainbird

* Adjust
2024-12-02 07:27:47 +01:00
J. Nick Koston
80f28302a1 Bump yarl to 1.18.3 (#132025)
changelog: https://github.com/aio-libs/yarl/compare/v1.18.0...v1.18.3
2024-12-01 21:17:36 -05:00
Joost Lekkerkerker
782fff198c Handle not found playlists in Spotify (#132033)
* Handle not found playlists

* Handle not found playlists

* Handle not found playlists

* Handle not found playlists

* Handle not found playlists

* Update homeassistant/components/spotify/coordinator.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-12-01 21:17:07 -05:00
J. Nick Koston
b6458ff9b8 Bump cryptography to 44.0.0 and pyOpenSSL to 24.3.0 (#132035)
These should be bumped together to make sure we do not
have any incompatibility issues.

> Note: The Python Cryptographic Authority strongly suggests the use of pyca/cryptography where possible. If you are using pyOpenSSL for anything other than making a TLS connection you should move to cryptography and drop your pyOpenSSL dependency.
2024-12-01 21:06:14 -05:00
J. Nick Koston
c6cd7e38f7 Bump aiohttp to 3.11.9 (#132036)
changelog: https://github.com/aio-libs/aiohttp/compare/v3.11.8...v3.11.9
2024-12-01 21:05:45 -05:00
Yazan AbdAl-Rahman
c2e6f8e761 Improve service names and descriptions for 'remote_connect' and 'remote_disconnect' in Home Assistant Cloud (#131993)
* Rename and reword 'remote_connect' and 'remote_disconnect' services for clarity

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Trigger pipeline

* Apply suggestions from code review

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-12-01 20:56:15 -05:00
Joost Lekkerkerker
b17b1f6db8 Bump spotifyaio to 0.8.11 (#132032) 2024-12-01 23:05:34 +01:00
Joost Lekkerkerker
b94a47ceb2 Change library to livisi (#132001)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-12-01 15:41:01 -06:00
Joost Lekkerkerker
86f8b5893f Bump yt-dlp to 2024.11.18 (#132026) 2024-12-01 22:39:26 +01:00
Klaas Schoute
78ced997e2 Add reauthentication flow for Autarco integration (#131816) 2024-12-01 22:02:50 +01:00
Bouwe Westerdijk
bd8cd87fae Bugfix for Plugwise, small code optimization (#131990) 2024-12-01 22:01:19 +01:00
Charles Garwood
521505f9b5 Add additional data_descriptions for Fully Kiosk Browser fields (#131716) 2024-12-01 22:00:21 +01:00
Richard Kroegel
98734ebe4f Bump bimmer_connected to 0.17.2 (#132005) 2024-12-01 21:45:31 +01:00
David Knowles
ffc3aca41f Bump pydrawise to 2024.12.0 (#132015) 2024-12-01 21:44:14 +01:00
dotvav
8fdd095dab Add pre-commit VSCode task (#131637) 2024-12-01 21:43:09 +01:00
Norbert Rittel
36ca4e8866 Fix description of 'clear_completed_items' to use "remove" (#132014) 2024-12-01 21:42:16 +01:00
Richard Kroegel
e706a5ef27 Set parallel updates for BMW entities (#132019) 2024-12-01 21:37:35 +01:00
J. Nick Koston
82e190dc4b Bump propcache to 0.2.1 (#132022) 2024-12-01 21:37:03 +01:00
Norbert Rittel
bd3f432376 Clarify description of fan actions, fix typo (#132023) 2024-12-01 20:55:27 +01:00
Erik Montnemery
ff1702eefa Remove unnecessary assignment in Recorder._process_state_changed_event_into_session (#132011) 2024-12-01 13:40:40 -05:00
Erik Montnemery
cf0ee63507 Simplify recorder RecorderRunsManager (#131785) 2024-12-01 11:26:29 -06:00
Erik Montnemery
c54eed3607 Improve recorder migration logging (#132006) 2024-12-01 16:58:24 +01:00
epenet
a0541c7fe6 Improve renault config flow tests (#131698) 2024-12-01 16:55:43 +01:00
epenet
2b094ee25d Improve renault config-flow translation strings (#131706) 2024-12-01 16:54:05 +01:00
Jan Bouwhuis
3aae9b629f Add exception translation for entity action not supported (#131956) 2024-12-01 16:53:06 +01:00
epenet
c55a4e9584 Cleanup pylint obsolete import checks (#131904) 2024-12-01 16:49:51 +01:00
epenet
8343d7f348 Use typed ConfigEntry in twentemilieu (#131894) 2024-12-01 16:40:30 +01:00
epenet
fd42c01a21 Use typed ConfigEntry in tedee (#131893) 2024-12-01 16:40:06 +01:00
epenet
bc7cfb6761 Use typed ConfigEntry in lamarzocco (#131892) 2024-12-01 16:39:33 +01:00
Erik Montnemery
598ce1f3b0 Freeze integration setup timeout for recorder during non-live data migration (#131998) 2024-12-01 09:17:55 -06:00
J. Nick Koston
8878d0f0e1 Reduce time syscalls needed to insert new statistics (#131984) 2024-12-01 08:55:07 -06:00
Jan Bouwhuis
47aebabc51 Add final translations to mqtt exceptions (#131933) 2024-12-01 12:20:45 +01:00
Norbert Rittel
37972ec88e Match "delete" with "create" in the action descriptions (#131989) 2024-12-01 12:08:35 +01:00
Paulus Schoutsen
6103cea3f5 Make the full conversation input available to sentence triggers (#131982)
Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-11-30 22:04:29 -06:00
J. Nick Koston
ffeefd4856 Bump SQLAlchemy to 2.0.36 (#126683)
* Bump SQLAlchemy to 2.0.35

changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.35

* fix mocking

* adjust to .36

* remove ignored as these are now typed

* fix SQLAlchemy
2024-11-30 22:07:51 -05:00
Bouwe Westerdijk
44ed83a829 Bump plugwise to v1.6.1 (#131950) 2024-11-30 22:01:33 -05:00
J. Nick Koston
a0d5fda4b6 Reduce precision loss when converting HomeKit temperature (#131973) 2024-11-30 16:09:37 -06:00
J. Nick Koston
2b907ee56e Strip trailing spaces from HomeKit names (#131971) 2024-11-30 14:47:40 -06:00
Andy
bcdac7ed37 Add support for linked_doorbell_sensor to HomeKit locks (#131660)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-11-30 13:30:21 -06:00
starkillerOG
6da2515d7a Bump reolink_aio to 0.11.4 (#131957) 2024-11-30 10:32:53 -06:00
Josef Zweck
6c6980a550 Improvements for bluetooth device for lamarzocco (#131875) 2024-11-30 10:32:41 -06:00
Oliver
bd29aaffb8 Bump denonavr to v1.0.1 (#131882) 2024-11-30 10:27:31 -06:00
Glenn Vandeuren (aka Iondependent)
74522390ad Add config flow to NHC (#130554)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: VandeurenGlenn <8685280+VandeurenGlenn@users.noreply.github.com>
2024-11-30 12:16:12 +01:00
Andrew Jackson
92204e6c92 Bump aiomealie to 0.9.4 (#131951) 2024-11-30 12:15:19 +01:00
Glenn Vandeuren (aka Iondependent)
5d71533c7b Fix modbus state not dumped on restart (#131319)
* Fix modbus state not dumped on restart

* Update test_init.py

* Set event back  to stop

* Update test_init.py

---------

Co-authored-by: VandeurenGlenn <8685280+VandeurenGlenn@users.noreply.github.com>
2024-11-30 09:30:24 +01:00
karwosts
9209e43e4c Fix history stats count update immediately after change (#131856)
* Fix history stats count update immediately after change

* rerun CI
2024-11-30 00:43:31 -05:00
karwosts
2c1a754e5d Make uploaded images browsable in media (#131468)
* Make uploaded images browsable in media

* tests

* Update homeassistant/components/image_upload/media_source.py

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

* use executor

* more executor

* use thumbnail

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-11-30 06:25:59 +01:00
Josef Zweck
e8ced4fa12 Bump aioacaia to 0.1.10 (#131906) 2024-11-29 22:32:20 -05:00
Josef Zweck
d9cef1e708 Guard against hostname change in lamarzocco discovery (#131873)
* Guard against hostname change in lamarzocco discovery

* switch to abort_entries_match
2024-11-29 22:31:56 -05:00
Marcel van der Veldt
a760786faf Fix media player join action for Music Assistant integration (#131910)
* Fix media player join action for Music Assistant integration

* Add tests for join/unjoin

* add one more test
2024-11-29 22:11:57 -05:00
J. Diego Rodríguez Royo
8c6a24c368 Use HomeAssistant error in the right cases (#131923)
* Use the correct exceptions

* Improved exception strings
2024-11-29 22:11:15 -05:00
Manu
24bd61be3b Add missing state_class in IronOS (#131928)
Add missing state class in IronOS
2024-11-29 22:10:12 -05:00
Matthias Alphart
1abd2209b3 Fix KNX IP Secure tunnelling endpoint selection with keyfile (#131941) 2024-11-30 01:13:52 +01:00
epenet
aa206c7608 Use typed ConfigEntry in discovergy (#131891) 2024-11-29 20:28:18 +01:00
Sid
87020e8945 Bump ruff to 0.8.1 (#131927) 2024-11-29 20:23:57 +01:00
Manu
dd62fb387e Bump pynecil to v1.0.1 (#131935) 2024-11-29 20:23:10 +01:00
Raphael Hehl
c19038ced6 Bump uiprotect to 6.6.4 (#131931) 2024-11-29 12:47:33 -06:00
Jc2k
6144cc26ba Bump aiohomekit to 3.2.7 (#131924) 2024-11-29 11:29:10 -06:00
Allen Porter
920c958ec7 Add runtime_data rule to quality_scale hassfest validation (#131857)
* Add quality scale check for runtime_data

* Linter fixes

* Add developer documentation link

* Update script/hassfest/quality_scale_validation/runtime_data.py

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

* Update validation to check explicitly for ConfigEntry.runtime_data

* Update script/hassfest/quality_scale_validation/runtime_data.py

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

* Refine check for setting attributes

* Patch with changes from epenet

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-11-29 17:56:26 +01:00
epenet
0fc365a114 Add discovery rule to quality_scale hassfest validation (#131890) 2024-11-29 07:06:38 -08:00
David Knowles
954ac0d288 Ensure Schlage exceptions are translated (#131733) 2024-11-28 20:34:20 -08:00
epenet
28cfa37248 Add unique_config_entry rule to quality_scale hassfest validation (#131878)
* Add unique_config_entry rule to quality_scale hassfest validation

* Improve message
2024-11-28 20:08:43 -08:00
epenet
24f7bae5f2 Add documentation URL to quality_scale hassfest validation (#131879)
* Add documentation URL to quality_scale hassfest validation

* Adjust
2024-11-28 18:32:01 -08:00
Manu
8e12fbff88 Refactor calendars in Habitica (#131020)
* Refactor calendars

* changes
2024-11-28 18:31:38 -08:00
Robert Resch
5c8fb5ec2c Remove deprecated climate constants (#131798)
* Remove deprecated climate constants

* Fix

* Fix

* Fix

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-11-29 00:38:05 +01:00
Robert Resch
a68cf21179 Remove deprecated data entry flow constants (#131800)
* Remove deprecated data entry flow constants

* Fix

* Fix

* Fix

* Fix

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-11-29 00:37:26 +01:00
epenet
d596b4169d Add strict_typing rule to quality_scale hassfest validation (#131877)
* Add strict_typing rule to quality_scale hassfest validation

* Add acaia to .strict-typing
2024-11-28 22:05:34 +01:00
IceBotYT
8b467268df Add data descriptions to Nice G.O. config flow (#131865)
* Add data descriptions to Nice G.O. config flow

* Reference other strings instead
2024-11-28 12:09:01 -08:00
Richard Kroegel
6dd93253c6 Add captcha to BMW ConfigFlow (#131351)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-11-28 21:01:00 +01:00
Joost Lekkerkerker
9db6f0ffc4 Only download translation strings we have defined (#131864) 2024-11-28 20:52:51 +01:00
karwosts
889ac1552b Fix flaky test in history stats (#131869) 2024-11-28 20:51:23 +01:00
Bram Kragten
18db16b82c Update frontend to 20241127.1 (#131855) 2024-11-28 20:50:53 +01:00
Robert Resch
1f9ecfe839 Remove deprecated sensor constants (#131843) 2024-11-28 20:49:49 +01:00
Allen Porter
4d32fe97c3 Use ConfigEntry.runtime_data in Nest (#131871) 2024-11-28 20:45:27 +01:00
rd-blue
8feb6c7e06 Correction of prices update time in Tibber integration (with CLA now) (#131861)
correction of prices update time
2024-11-28 19:58:38 +01:00
Madhan
0b36a6d7f3 Bump PyMetEireann to 2024.11.0 (#131860)
Co-authored-by: Joostlek <joostlek@outlook.com>
2024-11-28 19:48:38 +01:00
epenet
837716b69e Add diagnostics rule to quality_scale hassfest validation (#131859) 2024-11-28 19:42:31 +01:00
Michael
1a9ab07742 Allow empty trigger sentence responses in conversations (#131849)
allow empty trigger sentence responses
2024-11-28 18:30:05 +01:00
Allen Porter
8862c5c4d8 Remove unnecessary hass.data defaults from Rainbird (#131858) 2024-11-28 09:16:58 -08:00
Joost Lekkerkerker
87320609dc Bump pyatv to 0.16.0 (#131852) 2024-11-28 11:04:00 -06:00
epenet
62e788c7da Add config flow rules to quality_scale hassfest validation (#131791)
* Add config flow rules to quality_scale hassfest validation

* Use integration.config_flow property
2024-11-28 17:58:56 +01:00
Erik Montnemery
bbce183faf Deprecate dt_util.utc_to_timestamp (#131787) 2024-11-28 17:00:20 +01:00
Robert Resch
0389800e2a Remove deprecated humidifier constants (#131844) 2024-11-28 16:59:11 +01:00
Robert Resch
0c5c09390c Remove deprecated fan constants (#131845) 2024-11-28 16:56:04 +01:00
Manu
57b099c2aa Add unit translations to Ista EcoTrend integration (#131768) 2024-11-28 16:55:07 +01:00
Robert Resch
ed408eb1a1 Remove deprecated device tracker constants (#131846) 2024-11-28 16:54:23 +01:00
Erik Montnemery
f7d2d06c9b Add comments in homeassistant/components/recorder/migration.py (#131820)
* Add comments in homeassistant/components/recorder/migration.py

* Update homeassistant/components/recorder/migration.py
2024-11-28 16:22:56 +01:00
Manu
3071aa2da1 Use common string for items unit in Bring (#131834) 2024-11-28 14:59:16 +01:00
Joost Lekkerkerker
474544abd8 Make wake word selection part of configuration (#131832) 2024-11-28 13:45:51 +01:00
Joost Lekkerkerker
dc064237ca Bump spotifyaio to 0.8.10 (#131827) 2024-11-28 13:45:10 +01:00
Robert Resch
a0584a0516 Remove deprecated switch constants (#131806)
* Remove deprecated switch constants

* Fix
2024-11-28 13:45:00 +01:00
Norbert Rittel
96dfa0e0cf Remove wrong plural "s" in 'todo.remove_item' action (#131814) 2024-11-28 13:44:40 +01:00
epenet
00d82363fe Delay "Split tests for full run" in CI (#131813)
Adjust split tests requirements in CI
2024-11-28 13:44:02 +01:00
epenet
c4e5b59326 Fix more flaky translation checks (#131824) 2024-11-28 13:41:30 +01:00
Erik Montnemery
d9832f8c3a Rename constant in tests/components/recorder/test_migration_from_schema_32.py (#131819) 2024-11-28 13:26:58 +01:00
epenet
f41bc98fe2 Cleanup deprecated exception in websocket tests (#131808) 2024-11-28 12:40:34 +01:00
Joost Lekkerkerker
3a76bfb857 Remove Spotify featured playlists and categories from media browser (#131758) 2024-11-28 12:34:06 +01:00
epenet
6ce5c89711 Fix group flaky test (#131815) 2024-11-28 12:29:38 +01:00
Franck Nijhof
9d387acb97 Ensure custom integrations are assigned the custom IQS scale (#131795) 2024-11-28 12:25:16 +01:00
Robert Resch
1d09a5bf89 Remove deprecated lock constants (#131812) 2024-11-28 12:21:13 +01:00
Robert Resch
a01e7cd6cf Remove deprecated number constants (#131810) 2024-11-28 12:20:43 +01:00
Robert Resch
3e0326dd66 Remove deprecated siren constants (#131807) 2024-11-28 12:14:43 +01:00
Robert Resch
4d27a32905 Remove deprecated cover constants (#131797) 2024-11-28 12:14:25 +01:00
Robert Resch
c5f68bcc58 Remove deprecated remote constants (#131809) 2024-11-28 12:14:06 +01:00
Robert Resch
3866176e1d Remove deprecated water heater constants (#131805) 2024-11-28 12:13:03 +01:00
Robert Resch
a67045ee6c Remove deprecated home assistant const constants (#131799) 2024-11-28 12:12:37 +01:00
Robert Resch
54ff6feadc Remove deprecated alarm control panel constants (#131790) 2024-11-28 12:11:08 +01:00
Robert Resch
fd14add67b Remove deprecated device registry constants (#131802) 2024-11-28 11:20:44 +01:00
Robert Resch
b28f352902 Remove deprecated binary sensor constants (#131793) 2024-11-28 11:08:18 +01:00
Robert Resch
fb152c7d22 Remove deprecated automation constants (#131792) 2024-11-28 11:07:00 +01:00
Robert Resch
be81fd86d3 Remvove deprecated core constants (#131803) 2024-11-28 11:06:04 +01:00
Robert Resch
28ec8272ee Remove deprecated camera constants (#131796) 2024-11-28 11:05:45 +01:00
Richard Kroegel
717f2ee206 Bump bimmer_connected to 0.17.0 (#131352) 2024-11-28 09:58:16 +01:00
epenet
5972da495a Bump samsungtvws to 2.7.1 (#131784) 2024-11-28 09:18:00 +01:00
Manu
2fcd9be3f2 Set parallel updates in IronOS integration (#131721) 2024-11-28 08:48:15 +01:00
David Knowles
a0ea9a1e83 Store Schlage runtime data in entry.runtime_data (#131731) 2024-11-28 08:29:29 +01:00
David Knowles
a831c37511 Enable strict typing for Schlage (#131734) 2024-11-28 08:29:15 +01:00
Jan Bouwhuis
d26c7a0536 Log warning if via_device reference not exists when creating or updating a device registry entry (#131746) 2024-11-28 08:27:24 +01:00
Manu
4257277086 Add units of measurement to Bring integration (#131763) 2024-11-28 08:13:15 +01:00
Manu
fe2bca51a4 Add translations for units of measurement to Habitica integration (#131761) 2024-11-28 08:12:52 +01:00
Manu
17236a5698 Remove unreachable code in Habitica (#131778) 2024-11-28 08:08:00 +01:00
Joost Lekkerkerker
39c2a529d1 Remove Spotify audio feature sensors (#131754) 2024-11-28 08:07:19 +01:00
TheJulianJES
0f5e0dd4bf Fix Home Connect microwave programs (#131782) 2024-11-28 08:06:31 +01:00
J. Nick Koston
eac6673c2b Bump orjson to 3.10.12 (#131752)
changelog: https://github.com/ijl/orjson/compare/3.10.11...3.10.12
2024-11-28 01:35:49 +01:00
Manu
bf4d6d2029 Fix rounding of attributes in Habitica integration (#131772) 2024-11-28 01:35:23 +01:00
puddly
f61a5b78cc Bump ZHA to 0.0.41 (#131776) 2024-11-28 01:34:57 +01:00
Marcel van der Veldt
cc9a97a5cf Bump music assistant client 1.0.8 (#131739) 2024-11-28 01:34:36 +01:00
J. Nick Koston
cf7acb5ae8 Bump aioesphomeapi to 27.0.3 (#131773) 2024-11-27 15:29:29 -08:00
J. Nick Koston
6edb2c0252 Bump uiprotect to 6.6.3 (#131764) 2024-11-27 15:55:51 -06:00
Josef Zweck
fb4d86196e Bump pylamarzocco to 1.2.12 (#131765) 2024-11-27 15:55:33 -06:00
Josef Zweck
44fc5c7871 Add missing data_description for lamarzocco OptionsFlow (#131708) 2024-11-27 22:37:15 +01:00
Allen Porter
c82e408138 Add a missing rainbird data description (#131740) 2024-11-27 22:36:17 +01:00
Marc Mueller
7110df04e6 Bump version to 2025.1.0dev0 (#131751) 2024-11-27 22:32:56 +01:00
J. Nick Koston
1635074aae Bump aiohttp to 3.11.8 (#131744) 2024-11-27 14:15:44 -06:00
Erik Montnemery
381d5453b1 Improve recorder history queries (#131702)
* Improve recorder history queries

* Remove some comments

* Update StatesManager._oldest_ts when adding pending state

* Update after review

* Improve tests

* Improve post-purge logic

* Avoid calling dt_util.utc_to_timestamp in new code

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-11-27 21:12:42 +01:00
1639 changed files with 61817 additions and 17621 deletions

View File

@@ -6,6 +6,7 @@ core: &core
- homeassistant/helpers/**
- homeassistant/package_constraints.txt
- homeassistant/util/**
- mypy.ini
- pyproject.toml
- requirements.txt
- setup.cfg
@@ -131,6 +132,7 @@ tests: &tests
- tests/components/conftest.py
- tests/components/diagnostics/**
- tests/components/history/**
- tests/components/light/common.py
- tests/components/logbook/**
- tests/components/recorder/**
- tests/components/repairs/**

View File

@@ -94,7 +94,7 @@ jobs:
- name: Download nightly wheels of frontend
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v6
uses: dawidd6/action-download-artifact@v7
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/frontend
@@ -105,7 +105,7 @@ jobs:
- name: Download nightly wheels of intents
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v6
uses: dawidd6/action-download-artifact@v7
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/intents-package
@@ -517,7 +517,7 @@ jobs:
tags: ${{ env.HASSFEST_IMAGE_TAG }}
- name: Run hassfest against core
run: docker run --rm -v ${{ github.workspace }}/homeassistant:/github/workspace/homeassistant ${{ env.HASSFEST_IMAGE_TAG }} --core-integrations-path=/github/workspace/homeassistant/components
run: docker run --rm -v ${{ github.workspace }}:/github/workspace ${{ env.HASSFEST_IMAGE_TAG }} --core-path=/github/workspace
- name: Push Docker image
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true'
@@ -531,7 +531,7 @@ jobs:
- name: Generate artifact attestation
if: needs.init.outputs.channel != 'dev' && needs.init.outputs.publish == 'true'
uses: actions/attest-build-provenance@ef244123eb79f2f7a7e75d99086184180e6d0018 # v1.4.4
uses: actions/attest-build-provenance@7668571508540a607bdfd90a87a560489fe372eb # v2.1.0
with:
subject-name: ${{ env.HASSFEST_IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}

View File

@@ -40,7 +40,7 @@ env:
CACHE_VERSION: 11
UV_CACHE_VERSION: 1
MYPY_CACHE_VERSION: 9
HA_SHORT_VERSION: "2024.12"
HA_SHORT_VERSION: "2025.1"
DEFAULT_PYTHON: "3.12"
ALL_PYTHON_VERSIONS: "['3.12', '3.13']"
# 10.3 is the oldest supported version
@@ -240,7 +240,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v4.1.2
uses: actions/cache@v4.2.0
with:
path: venv
key: >-
@@ -256,7 +256,7 @@ jobs:
uv pip install "$(cat requirements_test.txt | grep pre-commit)"
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v4.1.2
uses: actions/cache@v4.2.0
with:
path: ${{ env.PRE_COMMIT_CACHE }}
lookup-only: true
@@ -286,7 +286,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -295,7 +295,7 @@ jobs:
needs.info.outputs.pre-commit_cache_key }}
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
@@ -326,7 +326,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -335,7 +335,7 @@ jobs:
needs.info.outputs.pre-commit_cache_key }}
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
@@ -366,7 +366,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -375,7 +375,7 @@ jobs:
needs.info.outputs.pre-commit_cache_key }}
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
@@ -482,16 +482,15 @@ jobs:
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v4.1.2
uses: actions/cache@v4.2.0
with:
path: venv
lookup-only: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Restore uv wheel cache
if: steps.cache-venv.outputs.cache-hit != 'true'
uses: actions/cache@v4.1.2
uses: actions/cache@v4.2.0
with:
path: ${{ env.UV_CACHE_DIR }}
key: >-
@@ -531,6 +530,26 @@ jobs:
python -m script.gen_requirements_all ci
uv pip install -r requirements_all_pytest.txt -r requirements_test.txt
uv pip install -e . --config-settings editable_mode=compat
- name: Dump pip freeze
run: |
python -m venv venv
. venv/bin/activate
python --version
uv pip freeze >> pip_freeze.txt
- name: Upload pip_freeze artifact
uses: actions/upload-artifact@v4.4.3
with:
name: pip-freeze-${{ matrix.python-version }}
path: pip_freeze.txt
overwrite: true
- name: Remove pip_freeze
run: rm pip_freeze.txt
- name: Remove generated requirements_all
if: steps.cache-venv.outputs.cache-hit != 'true'
run: rm requirements_all_pytest.txt requirements_all_wheels_*.txt
- name: Check dirty
run: |
./script/check_dirty
hassfest:
name: Check hassfest
@@ -559,7 +578,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -592,7 +611,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -630,7 +649,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -673,7 +692,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -720,7 +739,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -772,7 +791,7 @@ jobs:
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -780,7 +799,7 @@ jobs:
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Restore mypy cache
uses: actions/cache@v4.1.2
uses: actions/cache@v4.2.0
with:
path: .mypy_cache
key: >-
@@ -819,6 +838,12 @@ jobs:
needs:
- info
- base
- gen-requirements-all
- hassfest
- lint-other
- lint-ruff
- lint-ruff-format
- mypy
name: Split tests for full run
steps:
- name: Install additional OS dependencies
@@ -840,7 +865,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -904,7 +929,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -1025,7 +1050,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -1154,7 +1179,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -1248,7 +1273,7 @@ jobs:
pattern: coverage-*
- name: Upload coverage to Codecov
if: needs.info.outputs.test_full_suite == 'true'
uses: codecov/codecov-action@v5.0.7
uses: codecov/codecov-action@v5.1.1
with:
fail_ci_if_error: true
flags: full-suite
@@ -1300,7 +1325,7 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.1.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
fail-on-cache-miss: true
@@ -1386,7 +1411,7 @@ jobs:
pattern: coverage-*
- name: Upload coverage to Codecov
if: needs.info.outputs.test_full_suite == 'false'
uses: codecov/codecov-action@v5.0.7
uses: codecov/codecov-action@v5.1.1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

View File

@@ -24,11 +24,11 @@ jobs:
uses: actions/checkout@v4.2.2
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.27.5
uses: github/codeql-action/init@v3.27.9
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.27.5
uses: github/codeql-action/analyze@v3.27.9
with:
category: "/language:python"

View File

@@ -197,33 +197,6 @@ jobs:
split -l $(expr $(expr $(cat requirements_all.txt | wc -l) + 1) / 3) requirements_all_wheels_${{ matrix.arch }}.txt requirements_all.txt
- name: Create requirements for cython<3
if: matrix.abi == 'cp312'
run: |
# Some dependencies still require 'cython<3'
# and don't yet use isolated build environments.
# Build these first.
# pydantic: https://github.com/pydantic/pydantic/issues/7689
touch requirements_old-cython.txt
cat homeassistant/package_constraints.txt | grep 'pydantic==' >> requirements_old-cython.txt
- name: Build wheels (old cython)
uses: home-assistant/wheels@2024.11.0
if: matrix.abi == 'cp312'
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
arch: ${{ matrix.arch }}
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;multidict;SQLAlchemy;propcache;protobuf;pydantic;pymicro-vad;yarl
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_old-cython.txt"
pip: "'cython<3'"
- name: Build wheels (part 1)
uses: home-assistant/wheels@2024.11.0
with:

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
rev: v0.8.3
hooks:
- id: ruff
args:

View File

@@ -41,6 +41,7 @@ homeassistant.util.unit_system
# --- Add components below this line ---
homeassistant.components
homeassistant.components.abode.*
homeassistant.components.acaia.*
homeassistant.components.accuweather.*
homeassistant.components.acer_projector.*
homeassistant.components.acmeda.*
@@ -136,6 +137,7 @@ homeassistant.components.co2signal.*
homeassistant.components.command_line.*
homeassistant.components.config.*
homeassistant.components.configurator.*
homeassistant.components.cookidoo.*
homeassistant.components.counter.*
homeassistant.components.cover.*
homeassistant.components.cpuspeed.*
@@ -168,6 +170,7 @@ homeassistant.components.easyenergy.*
homeassistant.components.ecovacs.*
homeassistant.components.ecowitt.*
homeassistant.components.efergy.*
homeassistant.components.eheimdigital.*
homeassistant.components.electrasmart.*
homeassistant.components.electric_kiwi.*
homeassistant.components.elevenlabs.*
@@ -268,6 +271,7 @@ homeassistant.components.ios.*
homeassistant.components.iotty.*
homeassistant.components.ipp.*
homeassistant.components.iqvia.*
homeassistant.components.iron_os.*
homeassistant.components.islamic_prayer_times.*
homeassistant.components.isy994.*
homeassistant.components.jellyfin.*
@@ -364,6 +368,7 @@ homeassistant.components.persistent_notification.*
homeassistant.components.pi_hole.*
homeassistant.components.ping.*
homeassistant.components.plugwise.*
homeassistant.components.powerfox.*
homeassistant.components.powerwall.*
homeassistant.components.private_ble_device.*
homeassistant.components.prometheus.*
@@ -400,11 +405,13 @@ homeassistant.components.romy.*
homeassistant.components.rpi_power.*
homeassistant.components.rss_feed_template.*
homeassistant.components.rtsp_to_webrtc.*
homeassistant.components.russound_rio.*
homeassistant.components.ruuvi_gateway.*
homeassistant.components.ruuvitag_ble.*
homeassistant.components.samsungtv.*
homeassistant.components.scene.*
homeassistant.components.schedule.*
homeassistant.components.schlage.*
homeassistant.components.scrape.*
homeassistant.components.script.*
homeassistant.components.search.*
@@ -437,7 +444,6 @@ homeassistant.components.ssdp.*
homeassistant.components.starlink.*
homeassistant.components.statistics.*
homeassistant.components.steamist.*
homeassistant.components.stookalert.*
homeassistant.components.stookwijzer.*
homeassistant.components.stream.*
homeassistant.components.streamlabswater.*

28
.vscode/tasks.json vendored
View File

@@ -16,7 +16,7 @@
{
"label": "Pytest",
"type": "shell",
"command": "python3 -m pytest --timeout=10 tests",
"command": "${command:python.interpreterPath} -m pytest --timeout=10 tests",
"dependsOn": ["Install all Test Requirements"],
"group": {
"kind": "test",
@@ -31,7 +31,7 @@
{
"label": "Pytest (changed tests only)",
"type": "shell",
"command": "python3 -m pytest --timeout=10 --picked",
"command": "${command:python.interpreterPath} -m pytest --timeout=10 --picked",
"group": {
"kind": "test",
"isDefault": true
@@ -56,6 +56,20 @@
},
"problemMatcher": []
},
{
"label": "Pre-commit",
"type": "shell",
"command": "pre-commit run --show-diff-on-failure",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Pylint",
"type": "shell",
@@ -75,7 +89,7 @@
"label": "Code Coverage",
"detail": "Generate code coverage report for a given integration.",
"type": "shell",
"command": "python3 -m pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing --durations-min=1 --durations=0 --numprocesses=auto",
"command": "${command:python.interpreterPath} -m pytest ./tests/components/${input:integrationName}/ --cov=homeassistant.components.${input:integrationName} --cov-report term-missing --durations-min=1 --durations=0 --numprocesses=auto",
"dependsOn": ["Compile English translations"],
"group": {
"kind": "test",
@@ -91,7 +105,7 @@
"label": "Update syrupy snapshots",
"detail": "Update syrupy snapshots for a given integration.",
"type": "shell",
"command": "python3 -m pytest ./tests/components/${input:integrationName} --snapshot-update",
"command": "${command:python.interpreterPath} -m pytest ./tests/components/${input:integrationName} --snapshot-update",
"dependsOn": ["Compile English translations"],
"group": {
"kind": "test",
@@ -149,7 +163,7 @@
"label": "Compile English translations",
"detail": "In order to test changes to translation files, the translation strings must be compiled into Home Assistant's translation directories.",
"type": "shell",
"command": "python3 -m script.translations develop --all",
"command": "${command:python.interpreterPath} -m script.translations develop --all",
"group": {
"kind": "build",
"isDefault": true
@@ -159,7 +173,7 @@
"label": "Run scaffold",
"detail": "Add new functionality to a integration using a scaffold.",
"type": "shell",
"command": "python3 -m script.scaffold ${input:scaffoldName} --integration ${input:integrationName}",
"command": "${command:python.interpreterPath} -m script.scaffold ${input:scaffoldName} --integration ${input:integrationName}",
"group": {
"kind": "build",
"isDefault": true
@@ -169,7 +183,7 @@
"label": "Create new integration",
"detail": "Use the scaffold to create a new integration.",
"type": "shell",
"command": "python3 -m script.scaffold integration",
"command": "${command:python.interpreterPath} -m script.scaffold integration",
"group": {
"kind": "build",
"isDefault": true

View File

@@ -284,6 +284,8 @@ build.json @home-assistant/supervisor
/tests/components/control4/ @lawtancool
/homeassistant/components/conversation/ @home-assistant/core @synesthesiam
/tests/components/conversation/ @home-assistant/core @synesthesiam
/homeassistant/components/cookidoo/ @miaucl
/tests/components/cookidoo/ @miaucl
/homeassistant/components/coolmaster/ @OnFreund
/tests/components/coolmaster/ @OnFreund
/homeassistant/components/counter/ @fabaff
@@ -385,6 +387,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/efergy/ @tkdrob
/tests/components/efergy/ @tkdrob
/homeassistant/components/egardia/ @jeroenterheerdt
/homeassistant/components/eheimdigital/ @autinerd
/tests/components/eheimdigital/ @autinerd
/homeassistant/components/electrasmart/ @jafar-atili
/tests/components/electrasmart/ @jafar-atili
/homeassistant/components/electric_kiwi/ @mikey0000
@@ -727,8 +731,8 @@ build.json @home-assistant/supervisor
/tests/components/ios/ @robbiet480
/homeassistant/components/iotawatt/ @gtdiehl @jyavenard
/tests/components/iotawatt/ @gtdiehl @jyavenard
/homeassistant/components/iotty/ @pburgio @shapournemati-iotty
/tests/components/iotty/ @pburgio @shapournemati-iotty
/homeassistant/components/iotty/ @shapournemati-iotty
/tests/components/iotty/ @shapournemati-iotty
/homeassistant/components/iperf3/ @rohankapoorcom
/homeassistant/components/ipma/ @dgomes
/tests/components/ipma/ @dgomes
@@ -753,6 +757,8 @@ build.json @home-assistant/supervisor
/tests/components/ista_ecotrend/ @tr4nt0r
/homeassistant/components/isy994/ @bdraco @shbatm
/tests/components/isy994/ @bdraco @shbatm
/homeassistant/components/ituran/ @shmuelzon
/tests/components/ituran/ @shmuelzon
/homeassistant/components/izone/ @Swamp-Ig
/tests/components/izone/ @Swamp-Ig
/homeassistant/components/jellyfin/ @j-stienstra @ctalkington
@@ -1004,6 +1010,8 @@ build.json @home-assistant/supervisor
/tests/components/nice_go/ @IceBotYT
/homeassistant/components/nightscout/ @marciogranzotto
/tests/components/nightscout/ @marciogranzotto
/homeassistant/components/niko_home_control/ @VandeurenGlenn
/tests/components/niko_home_control/ @VandeurenGlenn
/homeassistant/components/nilu/ @hfurubotten
/homeassistant/components/nina/ @DeerMaximum
/tests/components/nina/ @DeerMaximum
@@ -1045,6 +1053,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/octoprint/ @rfleming71
/tests/components/octoprint/ @rfleming71
/homeassistant/components/ohmconnect/ @robbiet480
/homeassistant/components/ohme/ @dan-r
/tests/components/ohme/ @dan-r
/homeassistant/components/ollama/ @synesthesiam
/tests/components/ollama/ @synesthesiam
/homeassistant/components/ombi/ @larssont
@@ -1131,6 +1141,8 @@ build.json @home-assistant/supervisor
/tests/components/point/ @fredrike
/homeassistant/components/poolsense/ @haemishkyd
/tests/components/poolsense/ @haemishkyd
/homeassistant/components/powerfox/ @klaasnicolaas
/tests/components/powerfox/ @klaasnicolaas
/homeassistant/components/powerwall/ @bdraco @jrester @daniel-simpson
/tests/components/powerwall/ @bdraco @jrester @daniel-simpson
/homeassistant/components/private_ble_device/ @Jc2k
@@ -1353,6 +1365,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/sleepiq/ @mfugate1 @kbickar
/tests/components/sleepiq/ @mfugate1 @kbickar
/homeassistant/components/slide/ @ualex73
/homeassistant/components/slide_local/ @dontinelli
/tests/components/slide_local/ @dontinelli
/homeassistant/components/slimproto/ @marcelveldt
/tests/components/slimproto/ @marcelveldt
/homeassistant/components/sma/ @kellerza @rklomp
@@ -1411,15 +1425,13 @@ build.json @home-assistant/supervisor
/tests/components/starline/ @anonym-tsk
/homeassistant/components/starlink/ @boswelja
/tests/components/starlink/ @boswelja
/homeassistant/components/statistics/ @ThomDietrich
/tests/components/statistics/ @ThomDietrich
/homeassistant/components/statistics/ @ThomDietrich @gjohansson-ST
/tests/components/statistics/ @ThomDietrich @gjohansson-ST
/homeassistant/components/steam_online/ @tkdrob
/tests/components/steam_online/ @tkdrob
/homeassistant/components/steamist/ @bdraco
/tests/components/steamist/ @bdraco
/homeassistant/components/stiebel_eltron/ @fucm
/homeassistant/components/stookalert/ @fwestenberg @frenck
/tests/components/stookalert/ @fwestenberg @frenck
/homeassistant/components/stookwijzer/ @fwestenberg
/tests/components/stookwijzer/ @fwestenberg
/homeassistant/components/stream/ @hunterjm @uvjustin @allenporter
@@ -1642,6 +1654,8 @@ build.json @home-assistant/supervisor
/tests/components/waqi/ @joostlek
/homeassistant/components/water_heater/ @home-assistant/core
/tests/components/water_heater/ @home-assistant/core
/homeassistant/components/watergate/ @adam-the-hero
/tests/components/watergate/ @adam-the-hero
/homeassistant/components/watson_tts/ @rutkai
/homeassistant/components/watttime/ @bachya
/tests/components/watttime/ @bachya

View File

@@ -13,7 +13,7 @@ ENV \
ARG QEMU_CPU
# Install uv
RUN pip3 install uv==0.5.4
RUN pip3 install uv==0.5.8
WORKDIR /usr/src

View File

@@ -1,4 +1,4 @@
FROM mcr.microsoft.com/devcontainers/python:1-3.12
FROM mcr.microsoft.com/devcontainers/python:1-3.13
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

View File

@@ -1,10 +1,10 @@
image: ghcr.io/home-assistant/{arch}-homeassistant
build_from:
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2024.11.0
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2024.11.0
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2024.11.0
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2024.11.0
i386: ghcr.io/home-assistant/i386-homeassistant-base:2024.11.0
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2024.12.1
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2024.12.1
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2024.12.1
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2024.12.1
i386: ghcr.io/home-assistant/i386-homeassistant-base:2024.12.1
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io

View File

@@ -115,7 +115,7 @@ class AuthManagerFlowManager(
*,
context: AuthFlowContext | None = None,
data: dict[str, Any] | None = None,
) -> LoginFlow:
) -> LoginFlow[Any]:
"""Create a login flow."""
auth_provider = self.auth_manager.get_auth_provider(*handler_key)
if not auth_provider:

View File

@@ -4,8 +4,9 @@ from __future__ import annotations
import logging
import types
from typing import Any
from typing import Any, Generic
from typing_extensions import TypeVar
import voluptuous as vol
from voluptuous.humanize import humanize_error
@@ -34,6 +35,12 @@ DATA_REQS: HassKey[set[str]] = HassKey("mfa_auth_module_reqs_processed")
_LOGGER = logging.getLogger(__name__)
_MultiFactorAuthModuleT = TypeVar(
"_MultiFactorAuthModuleT",
bound="MultiFactorAuthModule",
default="MultiFactorAuthModule",
)
class MultiFactorAuthModule:
"""Multi-factor Auth Module of validation function."""
@@ -71,7 +78,7 @@ class MultiFactorAuthModule:
"""Return a voluptuous schema to define mfa auth module's input."""
raise NotImplementedError
async def async_setup_flow(self, user_id: str) -> SetupFlow:
async def async_setup_flow(self, user_id: str) -> SetupFlow[Any]:
"""Return a data entry flow handler for setup module.
Mfa module should extend SetupFlow
@@ -95,11 +102,14 @@ class MultiFactorAuthModule:
raise NotImplementedError
class SetupFlow(data_entry_flow.FlowHandler):
class SetupFlow(data_entry_flow.FlowHandler, Generic[_MultiFactorAuthModuleT]):
"""Handler for the setup flow."""
def __init__(
self, auth_module: MultiFactorAuthModule, setup_schema: vol.Schema, user_id: str
self,
auth_module: _MultiFactorAuthModuleT,
setup_schema: vol.Schema,
user_id: str,
) -> None:
"""Initialize the setup flow."""
self._auth_module = auth_module

View File

@@ -162,7 +162,7 @@ class NotifyAuthModule(MultiFactorAuthModule):
return sorted(unordered_services)
async def async_setup_flow(self, user_id: str) -> SetupFlow:
async def async_setup_flow(self, user_id: str) -> NotifySetupFlow:
"""Return a data entry flow handler for setup module.
Mfa module should extend SetupFlow
@@ -268,7 +268,7 @@ class NotifyAuthModule(MultiFactorAuthModule):
await self.hass.services.async_call("notify", notify_service, data)
class NotifySetupFlow(SetupFlow):
class NotifySetupFlow(SetupFlow[NotifyAuthModule]):
"""Handler for the setup flow."""
def __init__(
@@ -280,8 +280,6 @@ class NotifySetupFlow(SetupFlow):
) -> None:
"""Initialize the setup flow."""
super().__init__(auth_module, setup_schema, user_id)
# to fix typing complaint
self._auth_module: NotifyAuthModule = auth_module
self._available_notify_services = available_notify_services
self._secret: str | None = None
self._count: int | None = None

View File

@@ -114,7 +114,7 @@ class TotpAuthModule(MultiFactorAuthModule):
self._users[user_id] = ota_secret # type: ignore[index]
return ota_secret
async def async_setup_flow(self, user_id: str) -> SetupFlow:
async def async_setup_flow(self, user_id: str) -> TotpSetupFlow:
"""Return a data entry flow handler for setup module.
Mfa module should extend SetupFlow
@@ -174,10 +174,9 @@ class TotpAuthModule(MultiFactorAuthModule):
return bool(pyotp.TOTP(ota_secret).verify(code, valid_window=1))
class TotpSetupFlow(SetupFlow):
class TotpSetupFlow(SetupFlow[TotpAuthModule]):
"""Handler for the setup flow."""
_auth_module: TotpAuthModule
_ota_secret: str
_url: str
_image: str

View File

@@ -5,8 +5,9 @@ from __future__ import annotations
from collections.abc import Mapping
import logging
import types
from typing import Any
from typing import Any, Generic
from typing_extensions import TypeVar
import voluptuous as vol
from voluptuous.humanize import humanize_error
@@ -46,6 +47,8 @@ AUTH_PROVIDER_SCHEMA = vol.Schema(
extra=vol.ALLOW_EXTRA,
)
_AuthProviderT = TypeVar("_AuthProviderT", bound="AuthProvider", default="AuthProvider")
class AuthProvider:
"""Provider of user authentication."""
@@ -105,7 +108,7 @@ class AuthProvider:
# Implement by extending class
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow:
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow[Any]:
"""Return the data flow for logging in with auth provider.
Auth provider should extend LoginFlow and return an instance.
@@ -192,12 +195,15 @@ async def load_auth_provider_module(
return module
class LoginFlow(FlowHandler[AuthFlowContext, AuthFlowResult, tuple[str, str]]):
class LoginFlow(
FlowHandler[AuthFlowContext, AuthFlowResult, tuple[str, str]],
Generic[_AuthProviderT],
):
"""Handler for the login flow."""
_flow_result = AuthFlowResult
def __init__(self, auth_provider: AuthProvider) -> None:
def __init__(self, auth_provider: _AuthProviderT) -> None:
"""Initialize the login flow."""
self._auth_provider = auth_provider
self._auth_module_id: str | None = None

View File

@@ -6,7 +6,7 @@ import asyncio
from collections.abc import Mapping
import logging
import os
from typing import Any, cast
from typing import Any
import voluptuous as vol
@@ -59,7 +59,9 @@ class CommandLineAuthProvider(AuthProvider):
super().__init__(*args, **kwargs)
self._user_meta: dict[str, dict[str, Any]] = {}
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow:
async def async_login_flow(
self, context: AuthFlowContext | None
) -> CommandLineLoginFlow:
"""Return a flow to login."""
return CommandLineLoginFlow(self)
@@ -133,7 +135,7 @@ class CommandLineAuthProvider(AuthProvider):
)
class CommandLineLoginFlow(LoginFlow):
class CommandLineLoginFlow(LoginFlow[CommandLineAuthProvider]):
"""Handler for the login flow."""
async def async_step_init(
@@ -145,9 +147,9 @@ class CommandLineLoginFlow(LoginFlow):
if user_input is not None:
user_input["username"] = user_input["username"].strip()
try:
await cast(
CommandLineAuthProvider, self._auth_provider
).async_validate_login(user_input["username"], user_input["password"])
await self._auth_provider.async_validate_login(
user_input["username"], user_input["password"]
)
except InvalidAuthError:
errors["base"] = "invalid_auth"

View File

@@ -305,7 +305,7 @@ class HassAuthProvider(AuthProvider):
await data.async_load()
self.data = data
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow:
async def async_login_flow(self, context: AuthFlowContext | None) -> HassLoginFlow:
"""Return a flow to login."""
return HassLoginFlow(self)
@@ -400,7 +400,7 @@ class HassAuthProvider(AuthProvider):
pass
class HassLoginFlow(LoginFlow):
class HassLoginFlow(LoginFlow[HassAuthProvider]):
"""Handler for the login flow."""
async def async_step_init(
@@ -411,7 +411,7 @@ class HassLoginFlow(LoginFlow):
if user_input is not None:
try:
await cast(HassAuthProvider, self._auth_provider).async_validate_login(
await self._auth_provider.async_validate_login(
user_input["username"], user_input["password"]
)
except InvalidAuth:

View File

@@ -4,7 +4,6 @@ from __future__ import annotations
from collections.abc import Mapping
import hmac
from typing import cast
import voluptuous as vol
@@ -36,7 +35,9 @@ class InvalidAuthError(HomeAssistantError):
class ExampleAuthProvider(AuthProvider):
"""Example auth provider based on hardcoded usernames and passwords."""
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow:
async def async_login_flow(
self, context: AuthFlowContext | None
) -> ExampleLoginFlow:
"""Return a flow to login."""
return ExampleLoginFlow(self)
@@ -93,7 +94,7 @@ class ExampleAuthProvider(AuthProvider):
return UserMeta(name=name, is_active=True)
class ExampleLoginFlow(LoginFlow):
class ExampleLoginFlow(LoginFlow[ExampleAuthProvider]):
"""Handler for the login flow."""
async def async_step_init(
@@ -104,7 +105,7 @@ class ExampleLoginFlow(LoginFlow):
if user_input is not None:
try:
cast(ExampleAuthProvider, self._auth_provider).async_validate_login(
self._auth_provider.async_validate_login(
user_input["username"], user_input["password"]
)
except InvalidAuthError:

View File

@@ -104,7 +104,9 @@ class TrustedNetworksAuthProvider(AuthProvider):
"""Trusted Networks auth provider does not support MFA."""
return False
async def async_login_flow(self, context: AuthFlowContext | None) -> LoginFlow:
async def async_login_flow(
self, context: AuthFlowContext | None
) -> TrustedNetworksLoginFlow:
"""Return a flow to login."""
assert context is not None
ip_addr = cast(IPAddress, context.get("ip_address"))
@@ -214,7 +216,7 @@ class TrustedNetworksAuthProvider(AuthProvider):
self.async_validate_access(ip_address(remote_ip))
class TrustedNetworksLoginFlow(LoginFlow):
class TrustedNetworksLoginFlow(LoginFlow[TrustedNetworksAuthProvider]):
"""Handler for the login flow."""
def __init__(
@@ -235,9 +237,7 @@ class TrustedNetworksLoginFlow(LoginFlow):
) -> AuthFlowResult:
"""Handle the step of the form."""
try:
cast(
TrustedNetworksAuthProvider, self._auth_provider
).async_validate_access(self._ip_address)
self._auth_provider.async_validate_access(self._ip_address)
except InvalidAuthError:
return self.async_abort(reason="not_allowed")

View File

@@ -1,6 +1,10 @@
"""Home Assistant module to handle restoring backups."""
from __future__ import annotations
from collections.abc import Iterable
from dataclasses import dataclass
import hashlib
import json
import logging
from pathlib import Path
@@ -14,7 +18,12 @@ import securetar
from .const import __version__ as HA_VERSION
RESTORE_BACKUP_FILE = ".HA_RESTORE"
KEEP_PATHS = ("backups",)
KEEP_BACKUPS = ("backups",)
KEEP_DATABASE = (
"home-assistant_v2.db",
"home-assistant_v2.db-wal",
)
_LOGGER = logging.getLogger(__name__)
@@ -24,6 +33,21 @@ class RestoreBackupFileContent:
"""Definition for restore backup file content."""
backup_file_path: Path
password: str | None
remove_after_restore: bool
restore_database: bool
restore_homeassistant: bool
def password_to_key(password: str) -> bytes:
"""Generate a AES Key from password.
Matches the implementation in supervisor.backups.utils.password_to_key.
"""
key: bytes = password.encode()
for _ in range(100):
key = hashlib.sha256(key).digest()
return key[:16]
def restore_backup_file_content(config_dir: Path) -> RestoreBackupFileContent | None:
@@ -32,20 +56,24 @@ def restore_backup_file_content(config_dir: Path) -> RestoreBackupFileContent |
try:
instruction_content = json.loads(instruction_path.read_text(encoding="utf-8"))
return RestoreBackupFileContent(
backup_file_path=Path(instruction_content["path"])
backup_file_path=Path(instruction_content["path"]),
password=instruction_content["password"],
remove_after_restore=instruction_content["remove_after_restore"],
restore_database=instruction_content["restore_database"],
restore_homeassistant=instruction_content["restore_homeassistant"],
)
except (FileNotFoundError, json.JSONDecodeError):
except (FileNotFoundError, KeyError, json.JSONDecodeError):
return None
def _clear_configuration_directory(config_dir: Path) -> None:
"""Delete all files and directories in the config directory except for the backups directory."""
keep_paths = [config_dir.joinpath(path) for path in KEEP_PATHS]
config_contents = sorted(
[entry for entry in config_dir.iterdir() if entry not in keep_paths]
def _clear_configuration_directory(config_dir: Path, keep: Iterable[str]) -> None:
"""Delete all files and directories in the config directory except entries in the keep list."""
keep_paths = [config_dir.joinpath(path) for path in keep]
entries_to_remove = sorted(
entry for entry in config_dir.iterdir() if entry not in keep_paths
)
for entry in config_contents:
for entry in entries_to_remove:
entrypath = config_dir.joinpath(entry)
if entrypath.is_file():
@@ -54,12 +82,15 @@ def _clear_configuration_directory(config_dir: Path) -> None:
shutil.rmtree(entrypath)
def _extract_backup(config_dir: Path, backup_file_path: Path) -> None:
def _extract_backup(
config_dir: Path,
restore_content: RestoreBackupFileContent,
) -> None:
"""Extract the backup file to the config directory."""
with (
TemporaryDirectory() as tempdir,
securetar.SecureTarFile(
backup_file_path,
restore_content.backup_file_path,
gzip=False,
mode="r",
) as ostf,
@@ -88,22 +119,41 @@ def _extract_backup(config_dir: Path, backup_file_path: Path) -> None:
f"homeassistant.tar{'.gz' if backup_meta["compressed"] else ''}",
),
gzip=backup_meta["compressed"],
key=password_to_key(restore_content.password)
if restore_content.password is not None
else None,
mode="r",
) as istf:
for member in istf.getmembers():
if member.name == "data":
continue
member.name = member.name.replace("data/", "")
_clear_configuration_directory(config_dir)
istf.extractall(
path=config_dir,
members=[
member
for member in securetar.secure_path(istf)
if member.name != "data"
],
path=Path(tempdir, "homeassistant"),
members=securetar.secure_path(istf),
filter="fully_trusted",
)
if restore_content.restore_homeassistant:
keep = list(KEEP_BACKUPS)
if not restore_content.restore_database:
keep.extend(KEEP_DATABASE)
_clear_configuration_directory(config_dir, keep)
shutil.copytree(
Path(tempdir, "homeassistant", "data"),
config_dir,
dirs_exist_ok=True,
ignore=shutil.ignore_patterns(*(keep)),
)
elif restore_content.restore_database:
for entry in KEEP_DATABASE:
entrypath = config_dir / entry
if entrypath.is_file():
entrypath.unlink()
elif entrypath.is_dir():
shutil.rmtree(entrypath)
for entry in KEEP_DATABASE:
shutil.copy(
Path(tempdir, "homeassistant", "data", entry),
config_dir,
)
def restore_backup(config_dir_path: str) -> bool:
@@ -119,8 +169,13 @@ def restore_backup(config_dir_path: str) -> bool:
backup_file_path = restore_content.backup_file_path
_LOGGER.info("Restoring %s", backup_file_path)
try:
_extract_backup(config_dir, backup_file_path)
_extract_backup(
config_dir=config_dir,
restore_content=restore_content,
)
except FileNotFoundError as err:
raise ValueError(f"Backup file {backup_file_path} does not exist") from err
if restore_content.remove_after_restore:
backup_file_path.unlink(missing_ok=True)
_LOGGER.info("Restore complete, restarting")
return True

View File

@@ -50,6 +50,12 @@ def _check_sleep_call_allowed(mapped_args: dict[str, Any]) -> bool:
return False
def _check_load_verify_locations_call_allowed(mapped_args: dict[str, Any]) -> bool:
# If only cadata is passed, we can ignore it
kwargs = mapped_args.get("kwargs")
return bool(kwargs and len(kwargs) == 1 and "cadata" in kwargs)
@dataclass(slots=True, frozen=True)
class BlockingCall:
"""Class to hold information about a blocking call."""
@@ -158,7 +164,7 @@ _BLOCKING_CALLS: tuple[BlockingCall, ...] = (
original_func=SSLContext.load_verify_locations,
object=SSLContext,
function="load_verify_locations",
check_allowed=None,
check_allowed=_check_load_verify_locations_call_allowed,
strict=False,
strict_core=False,
skip_for_tests=True,

View File

@@ -0,0 +1,5 @@
{
"domain": "slide",
"name": "Slide",
"integrations": ["slide", "slide_local"]
}

View File

@@ -9,18 +9,16 @@ from jaraco.abode.devices.light import Light
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_COLOR_TEMP_KELVIN,
ATTR_HS_COLOR,
DEFAULT_MAX_KELVIN,
DEFAULT_MIN_KELVIN,
ColorMode,
LightEntity,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.color import (
color_temperature_kelvin_to_mired,
color_temperature_mired_to_kelvin,
)
from . import AbodeSystem
from .const import DOMAIN
@@ -44,13 +42,13 @@ class AbodeLight(AbodeDevice, LightEntity):
_device: Light
_attr_name = None
_attr_max_color_temp_kelvin = DEFAULT_MAX_KELVIN
_attr_min_color_temp_kelvin = DEFAULT_MIN_KELVIN
def turn_on(self, **kwargs: Any) -> None:
"""Turn on the light."""
if ATTR_COLOR_TEMP in kwargs and self._device.is_color_capable:
self._device.set_color_temp(
int(color_temperature_mired_to_kelvin(kwargs[ATTR_COLOR_TEMP]))
)
if ATTR_COLOR_TEMP_KELVIN in kwargs and self._device.is_color_capable:
self._device.set_color_temp(kwargs[ATTR_COLOR_TEMP_KELVIN])
return
if ATTR_HS_COLOR in kwargs and self._device.is_color_capable:
@@ -85,10 +83,10 @@ class AbodeLight(AbodeDevice, LightEntity):
return None
@property
def color_temp(self) -> int | None:
def color_temp_kelvin(self) -> int | None:
"""Return the color temp of the light."""
if self._device.has_color:
return color_temperature_kelvin_to_mired(self._device.color_temp)
return int(self._device.color_temp)
return None
@property

View File

@@ -16,6 +16,9 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .coordinator import AcaiaConfigEntry
from .entity import AcaiaEntity
# Coordinator is used to centralize the data updates
PARALLEL_UPDATES = 0
@dataclass(kw_only=True, frozen=True)
class AcaiaBinarySensorEntityDescription(BinarySensorEntityDescription):

View File

@@ -25,5 +25,6 @@
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["aioacaia"],
"quality_scale": "platinum",
"requirements": ["aioacaia==0.1.11"]
}

View File

@@ -16,7 +16,7 @@ rules:
No custom actions are defined.
docs-high-level-description: done
docs-installation-instructions: done
docs-removal-instructions: todo
docs-removal-instructions: done
entity-event-setup:
status: exempt
comment: |

View File

@@ -21,6 +21,9 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .coordinator import AcaiaConfigEntry
from .entity import AcaiaEntity
# Coordinator is used to centralize the data updates
PARALLEL_UPDATES = 0
@dataclass(kw_only=True, frozen=True)
class AcaiaSensorEntityDescription(SensorEntityDescription):

View File

@@ -75,7 +75,6 @@ class AdaxDevice(ClimateEntity):
)
_attr_target_temperature_step = PRECISION_WHOLE
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, heater_data: dict[str, Any], adax_data_handler: Adax) -> None:
"""Initialize the heater."""

View File

@@ -102,7 +102,6 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
_attr_max_temp = 32
_attr_min_temp = 16
_attr_name = None
_enable_turn_on_off_backwards_compatibility = False
_support_preset = ClimateEntityFeature(0)
def __init__(self, instance: AdvantageAirData, ac_key: str) -> None:
@@ -261,7 +260,6 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
_attr_target_temperature_step = PRECISION_WHOLE
_attr_max_temp = 32
_attr_min_temp = 16
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, instance: AdvantageAirData, ac_key: str, zone_key: str) -> None:
"""Initialize an AdvantageAir Zone control."""

View File

@@ -95,7 +95,6 @@ class AirtouchAC(CoordinatorEntity, ClimateEntity):
| ClimateEntityFeature.TURN_ON
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, coordinator, ac_number, info):
"""Initialize the climate device."""
@@ -205,7 +204,6 @@ class AirtouchGroup(CoordinatorEntity, ClimateEntity):
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_hvac_modes = AT_GROUP_MODES
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, coordinator, group_number, info):
"""Initialize the climate device."""

View File

@@ -124,7 +124,6 @@ class Airtouch5ClimateEntity(ClimateEntity, Airtouch5Entity):
_attr_translation_key = DOMAIN
_attr_target_temperature_step = 1
_attr_name = None
_enable_turn_on_off_backwards_compatibility = False
class Airtouch5AC(Airtouch5ClimateEntity):

View File

@@ -136,7 +136,6 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
_attr_name = None
_speeds: dict[int, str] = {}
_speeds_reverse: dict[str, int] = {}
_enable_turn_on_off_backwards_compatibility = False
def __init__(
self,

View File

@@ -177,7 +177,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
_attr_name = None
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False
def _init_attributes(self) -> None:
"""Init common climate device attributes."""
@@ -194,12 +193,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)
if (
self.get_airzone_value(AZD_SPEED) is not None
and self.get_airzone_value(AZD_SPEEDS) is not None
):
self._initialize_fan_speeds()
@callback
def _handle_coordinator_update(self) -> None:
"""Update attributes when the coordinator updates."""
@@ -214,8 +207,6 @@ class AirzoneClimate(AirzoneEntity, ClimateEntity):
self._attr_hvac_action = HVAC_ACTION_LIB_TO_HASS[
self.get_airzone_value(AZD_ACTION)
]
if self.supported_features & ClimateEntityFeature.FAN_MODE:
self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED))
if self.get_airzone_value(AZD_POWER):
self._attr_hvac_mode = HVAC_MODE_LIB_TO_HASS[
self.get_airzone_value(AZD_MODE)
@@ -252,6 +243,22 @@ class AirzoneDeviceClimate(AirzoneClimate):
_speeds: dict[int, str]
_speeds_reverse: dict[str, int]
def _init_attributes(self) -> None:
"""Init common climate device attributes."""
super()._init_attributes()
if (
self.get_airzone_value(AZD_SPEED) is not None
and self.get_airzone_value(AZD_SPEEDS) is not None
):
self._initialize_fan_speeds()
@callback
def _async_update_attrs(self) -> None:
"""Update climate attributes."""
super()._async_update_attrs()
if self.supported_features & ClimateEntityFeature.FAN_MODE:
self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED))
def _initialize_fan_speeds(self) -> None:
"""Initialize fan speeds."""
azd_speeds: dict[int, int] = self.get_airzone_value(AZD_SPEEDS)

View File

@@ -4,7 +4,6 @@ from __future__ import annotations
import asyncio
from datetime import timedelta
from functools import partial
import logging
from typing import TYPE_CHECKING, Any, Final, final
@@ -27,11 +26,6 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ServiceValidationError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.config_validation import make_entity_service_schema
from homeassistant.helpers.deprecation import (
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.entity_platform import EntityPlatform
@@ -39,15 +33,7 @@ from homeassistant.helpers.frame import ReportBehavior, report_usage
from homeassistant.helpers.typing import ConfigType
from homeassistant.util.hass_dict import HassKey
from .const import ( # noqa: F401
_DEPRECATED_FORMAT_NUMBER,
_DEPRECATED_FORMAT_TEXT,
_DEPRECATED_SUPPORT_ALARM_ARM_AWAY,
_DEPRECATED_SUPPORT_ALARM_ARM_CUSTOM_BYPASS,
_DEPRECATED_SUPPORT_ALARM_ARM_HOME,
_DEPRECATED_SUPPORT_ALARM_ARM_NIGHT,
_DEPRECATED_SUPPORT_ALARM_ARM_VACATION,
_DEPRECATED_SUPPORT_ALARM_TRIGGER,
from .const import (
ATTR_CHANGED_BY,
ATTR_CODE_ARM_REQUIRED,
DOMAIN,
@@ -369,12 +355,7 @@ class AlarmControlPanelEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_A
@cached_property
def supported_features(self) -> AlarmControlPanelEntityFeature:
"""Return the list of supported features."""
features = self._attr_supported_features
if type(features) is int: # noqa: E721
new_features = AlarmControlPanelEntityFeature(features)
self._report_deprecated_supported_features_values(new_features)
return new_features
return features
return self._attr_supported_features
@final
@property
@@ -412,13 +393,3 @@ class AlarmControlPanelEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_A
self._alarm_control_panel_option_default_code = default_code
return
self._alarm_control_panel_option_default_code = None
# As we import constants of the const module here, we need to add the following
# functions to check for deprecated constants again
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())

View File

@@ -1,16 +1,8 @@
"""Provides the constants needed for component."""
from enum import IntFlag, StrEnum
from functools import partial
from typing import Final
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
DOMAIN: Final = "alarm_control_panel"
ATTR_CHANGED_BY: Final = "changed_by"
@@ -39,12 +31,6 @@ class CodeFormat(StrEnum):
NUMBER = "number"
# These constants are deprecated as of Home Assistant 2022.5, can be removed in 2025.1
# Please use the CodeFormat enum instead.
_DEPRECATED_FORMAT_TEXT: Final = DeprecatedConstantEnum(CodeFormat.TEXT, "2025.1")
_DEPRECATED_FORMAT_NUMBER: Final = DeprecatedConstantEnum(CodeFormat.NUMBER, "2025.1")
class AlarmControlPanelEntityFeature(IntFlag):
"""Supported features of the alarm control panel entity."""
@@ -56,27 +42,6 @@ class AlarmControlPanelEntityFeature(IntFlag):
ARM_VACATION = 32
# These constants are deprecated as of Home Assistant 2022.5
# Please use the AlarmControlPanelEntityFeature enum instead.
_DEPRECATED_SUPPORT_ALARM_ARM_HOME: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.ARM_HOME, "2025.1"
)
_DEPRECATED_SUPPORT_ALARM_ARM_AWAY: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.ARM_AWAY, "2025.1"
)
_DEPRECATED_SUPPORT_ALARM_ARM_NIGHT: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.ARM_NIGHT, "2025.1"
)
_DEPRECATED_SUPPORT_ALARM_TRIGGER: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.TRIGGER, "2025.1"
)
_DEPRECATED_SUPPORT_ALARM_ARM_CUSTOM_BYPASS: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.ARM_CUSTOM_BYPASS, "2025.1"
)
_DEPRECATED_SUPPORT_ALARM_ARM_VACATION: Final = DeprecatedConstantEnum(
AlarmControlPanelEntityFeature.ARM_VACATION, "2025.1"
)
CONDITION_TRIGGERED: Final = "is_triggered"
CONDITION_DISARMED: Final = "is_disarmed"
CONDITION_ARMED_HOME: Final = "is_armed_home"
@@ -84,10 +49,3 @@ CONDITION_ARMED_AWAY: Final = "is_armed_away"
CONDITION_ARMED_NIGHT: Final = "is_armed_night"
CONDITION_ARMED_VACATION: Final = "is_armed_vacation"
CONDITION_ARMED_CUSTOM_BYPASS: Final = "is_armed_custom_bypass"
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())

View File

@@ -317,6 +317,7 @@ class Alexa(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -403,6 +404,7 @@ class AlexaPowerController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -436,7 +438,7 @@ class AlexaPowerController(AlexaCapability):
elif self.entity.domain == remote.DOMAIN:
is_on = self.entity.state not in (STATE_OFF, STATE_UNKNOWN)
elif self.entity.domain == vacuum.DOMAIN:
is_on = self.entity.state == vacuum.STATE_CLEANING
is_on = self.entity.state == vacuum.VacuumActivity.CLEANING
elif self.entity.domain == timer.DOMAIN:
is_on = self.entity.state != STATE_IDLE
elif self.entity.domain == water_heater.DOMAIN:
@@ -469,6 +471,7 @@ class AlexaLockController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -523,6 +526,7 @@ class AlexaSceneController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -562,6 +566,7 @@ class AlexaBrightnessController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -611,6 +616,7 @@ class AlexaColorController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -669,6 +675,7 @@ class AlexaColorTemperatureController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -715,6 +722,7 @@ class AlexaSpeaker(AlexaCapability):
"fr-FR", # Not documented as of 2021-12-04, see PR #60489
"it-IT",
"ja-JP",
"nl-NL",
}
def name(self) -> str:
@@ -772,6 +780,7 @@ class AlexaStepSpeaker(AlexaCapability):
"es-ES",
"fr-FR", # Not documented as of 2021-12-04, see PR #60489
"it-IT",
"nl-NL",
}
def name(self) -> str:
@@ -801,6 +810,7 @@ class AlexaPlaybackController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -859,6 +869,7 @@ class AlexaInputController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -1104,6 +1115,7 @@ class AlexaThermostatController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -1245,6 +1257,7 @@ class AlexaPowerLevelController(AlexaCapability):
"fr-CA",
"fr-FR",
"it-IT",
"nl-NL",
"ja-JP",
}
@@ -1723,6 +1736,7 @@ class AlexaRangeController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -2066,6 +2080,7 @@ class AlexaToggleController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -2212,6 +2227,7 @@ class AlexaPlaybackStateReporter(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -2267,6 +2283,7 @@ class AlexaSeekController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -2360,6 +2377,7 @@ class AlexaEqualizerController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}
@@ -2470,6 +2488,7 @@ class AlexaCameraStreamController(AlexaCapability):
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}

View File

@@ -59,6 +59,7 @@ CONF_SUPPORTED_LOCALES = (
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
)

View File

@@ -359,7 +359,7 @@ async def async_api_set_color_temperature(
await hass.services.async_call(
entity.domain,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_KELVIN: kelvin},
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_COLOR_TEMP_KELVIN: kelvin},
blocking=False,
context=context,
)
@@ -376,14 +376,14 @@ async def async_api_decrease_color_temp(
) -> AlexaResponse:
"""Process a decrease color temperature request."""
entity = directive.entity
current = int(entity.attributes[light.ATTR_COLOR_TEMP])
max_mireds = int(entity.attributes[light.ATTR_MAX_MIREDS])
current = int(entity.attributes[light.ATTR_COLOR_TEMP_KELVIN])
min_kelvin = int(entity.attributes[light.ATTR_MIN_COLOR_TEMP_KELVIN])
value = min(max_mireds, current + 50)
value = max(min_kelvin, current - 500)
await hass.services.async_call(
entity.domain,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_COLOR_TEMP: value},
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_COLOR_TEMP_KELVIN: value},
blocking=False,
context=context,
)
@@ -400,14 +400,14 @@ async def async_api_increase_color_temp(
) -> AlexaResponse:
"""Process an increase color temperature request."""
entity = directive.entity
current = int(entity.attributes[light.ATTR_COLOR_TEMP])
min_mireds = int(entity.attributes[light.ATTR_MIN_MIREDS])
current = int(entity.attributes[light.ATTR_COLOR_TEMP_KELVIN])
max_kelvin = int(entity.attributes[light.ATTR_MAX_COLOR_TEMP_KELVIN])
value = max(min_mireds, current - 50)
value = min(max_kelvin, current + 500)
await hass.services.async_call(
entity.domain,
SERVICE_TURN_ON,
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_COLOR_TEMP: value},
{ATTR_ENTITY_ID: entity.entity_id, light.ATTR_COLOR_TEMP_KELVIN: value},
blocking=False,
context=context,
)
@@ -527,6 +527,7 @@ async def async_api_unlock(
"hi-IN",
"it-IT",
"ja-JP",
"nl-NL",
"pt-BR",
}:
msg = (

View File

@@ -110,7 +110,7 @@ def _setup_androidtv(
adb_log = f"using Python ADB implementation with adbkey='{adbkey}'"
else:
# Use "pure-python-adb" (communicate with ADB server)
# Communicate via ADB server
signer = None
adb_log = (
"using ADB server at"

View File

@@ -151,5 +151,5 @@ class AndroidTVEntity(Entity):
# Using "adb_shell" (Python ADB implementation)
self.exceptions = ADB_PYTHON_EXCEPTIONS
else:
# Using "pure-python-adb" (communicate with ADB server)
# Communicate via ADB server
self.exceptions = ADB_TCP_EXCEPTIONS

View File

@@ -6,10 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/androidtv",
"integration_type": "device",
"iot_class": "local_polling",
"loggers": ["adb_shell", "androidtv", "pure_python_adb"],
"requirements": [
"adb-shell[async]==0.4.4",
"androidtv[async]==0.0.75",
"pure-python-adb[async]==0.3.0.dev0"
]
"loggers": ["adb_shell", "androidtv"],
"requirements": ["adb-shell[async]==0.4.4", "androidtv[async]==0.0.75"]
}

View File

@@ -16,6 +16,7 @@ import time
from typing import Any, Literal, cast
import wave
import hass_nabucasa
import voluptuous as vol
from homeassistant.components import (
@@ -918,6 +919,11 @@ class PipelineRun:
)
except (asyncio.CancelledError, TimeoutError):
raise # expected
except hass_nabucasa.auth.Unauthenticated as src_error:
raise SpeechToTextError(
code="cloud-auth-failed",
message="Home Assistant Cloud authentication failed",
) from src_error
except Exception as src_error:
_LOGGER.exception("Unexpected error during speech-to-text")
raise SpeechToTextError(

View File

@@ -46,7 +46,6 @@ class AtagThermostat(AtagEntity, ClimateEntity):
_attr_supported_features = (
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.PRESET_MODE
)
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, coordinator: AtagDataUpdateCoordinator, atag_id: str) -> None:
"""Initialize an Atag climate device."""

View File

@@ -28,5 +28,5 @@
"documentation": "https://www.home-assistant.io/integrations/august",
"iot_class": "cloud_push",
"loggers": ["pubnub", "yalexs"],
"requirements": ["yalexs==8.10.0", "yalexs-ble==2.5.2"]
"requirements": ["yalexs==8.10.0", "yalexs-ble==2.5.5"]
}

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/aussie_broadband",
"iot_class": "cloud_polling",
"loggers": ["aussiebb"],
"requirements": ["pyaussiebb==0.0.15"]
"requirements": ["pyaussiebb==0.1.4"]
}

View File

@@ -4,11 +4,12 @@ from __future__ import annotations
import asyncio
from autarco import Autarco
from autarco import Autarco, AutarcoConnectionError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .coordinator import AutarcoDataUpdateCoordinator
@@ -25,7 +26,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: AutarcoConfigEntry) -> b
password=entry.data[CONF_PASSWORD],
session=async_get_clientsession(hass),
)
account_sites = await client.get_account()
try:
account_sites = await client.get_account()
except AutarcoConnectionError as err:
await client.close()
raise ConfigEntryNotReady from err
coordinators: list[AutarcoDataUpdateCoordinator] = [
AutarcoDataUpdateCoordinator(hass, client, site) for site in account_sites

View File

@@ -2,6 +2,7 @@
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from autarco import Autarco, AutarcoAuthenticationError, AutarcoConnectionError
@@ -20,6 +21,12 @@ DATA_SCHEMA = vol.Schema(
}
)
STEP_REAUTH_SCHEMA = vol.Schema(
{
vol.Required(CONF_PASSWORD): str,
}
)
class AutarcoConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Autarco."""
@@ -55,3 +62,40 @@ class AutarcoConfigFlow(ConfigFlow, domain=DOMAIN):
errors=errors,
data_schema=DATA_SCHEMA,
)
async def async_step_reauth(
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Handle re-authentication request from Autarco."""
return await self.async_step_reauth_confirm()
async def async_step_reauth_confirm(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle re-authentication confirmation."""
errors = {}
reauth_entry = self._get_reauth_entry()
if user_input is not None:
client = Autarco(
email=reauth_entry.data[CONF_EMAIL],
password=user_input[CONF_PASSWORD],
session=async_get_clientsession(self.hass),
)
try:
await client.get_account()
except AutarcoAuthenticationError:
errors["base"] = "invalid_auth"
except AutarcoConnectionError:
errors["base"] = "cannot_connect"
else:
return self.async_update_reload_and_abort(
reauth_entry,
data_updates=user_input,
)
return self.async_show_form(
step_id="reauth_confirm",
description_placeholders={"email": reauth_entry.data[CONF_EMAIL]},
data_schema=STEP_REAUTH_SCHEMA,
errors=errors,
)

View File

@@ -7,6 +7,7 @@ from typing import NamedTuple
from autarco import (
AccountSite,
Autarco,
AutarcoAuthenticationError,
AutarcoConnectionError,
Battery,
Inverter,
@@ -16,6 +17,7 @@ from autarco import (
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import DOMAIN, LOGGER, SCAN_INTERVAL
@@ -60,8 +62,10 @@ class AutarcoDataUpdateCoordinator(DataUpdateCoordinator[AutarcoData]):
inverters = await self.client.get_inverters(self.account_site.public_key)
if site.has_battery:
battery = await self.client.get_battery(self.account_site.public_key)
except AutarcoConnectionError as error:
raise UpdateFailed(error) from error
except AutarcoAuthenticationError as err:
raise ConfigEntryAuthFailed(err) from err
except AutarcoConnectionError as err:
raise UpdateFailed(err) from err
return AutarcoData(
solar=solar,
inverters=inverters,

View File

@@ -51,7 +51,7 @@ rules:
This integration only polls data using a coordinator.
Since the integration is read-only and poll-only (only provide sensor
data), there is no need to implement parallel updates.
reauthentication-flow: todo
reauthentication-flow: done
test-coverage: done
# Gold

View File

@@ -2,7 +2,7 @@
"config": {
"step": {
"user": {
"description": "Connect to your Autarco account to get information about your solar panels.",
"description": "Connect to your Autarco account, to get information about your sites.",
"data": {
"email": "[%key:common::config_flow::data::email%]",
"password": "[%key:common::config_flow::data::password%]"
@@ -11,6 +11,16 @@
"email": "The email address of your Autarco account.",
"password": "The password of your Autarco account."
}
},
"reauth_confirm": {
"title": "[%key:common::config_flow::title::reauth%]",
"description": "The password for {email} is no longer valid.",
"data": {
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"password": "[%key:component::autarco::config::step::user::data_description::password%]"
}
}
},
"error": {
@@ -18,7 +28,8 @@
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
}
},
"entity": {

View File

@@ -6,7 +6,6 @@ from abc import ABC, abstractmethod
import asyncio
from collections.abc import Callable, Mapping
from dataclasses import dataclass
from functools import partial
import logging
from typing import Any, Protocol, cast
@@ -51,12 +50,6 @@ from homeassistant.core import (
from homeassistant.exceptions import HomeAssistantError, ServiceNotFound, TemplateError
from homeassistant.helpers import condition
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.deprecation import (
DeprecatedConstant,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import ToggleEntity
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.issue_registry import (
@@ -86,12 +79,7 @@ from homeassistant.helpers.trace import (
trace_get,
trace_path,
)
from homeassistant.helpers.trigger import (
TriggerActionType,
TriggerData,
TriggerInfo,
async_initialize_triggers,
)
from homeassistant.helpers.trigger import async_initialize_triggers
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from homeassistant.util.dt import parse_datetime
@@ -137,20 +125,6 @@ class IfAction(Protocol):
"""AND all conditions."""
# AutomationActionType, AutomationTriggerData,
# and AutomationTriggerInfo are deprecated as of 2022.9.
# Can be removed in 2025.1
_DEPRECATED_AutomationActionType = DeprecatedConstant(
TriggerActionType, "TriggerActionType", "2025.1"
)
_DEPRECATED_AutomationTriggerData = DeprecatedConstant(
TriggerData, "TriggerData", "2025.1"
)
_DEPRECATED_AutomationTriggerInfo = DeprecatedConstant(
TriggerInfo, "TriggerInfo", "2025.1"
)
@bind_hass
def is_on(hass: HomeAssistant, entity_id: str) -> bool:
"""Return true if specified automation entity_id is on.
@@ -477,6 +451,7 @@ class UnavailableAutomationEntity(BaseAutomationEntity):
)
async def async_will_remove_from_hass(self) -> None:
"""Run when entity will be removed from hass."""
await super().async_will_remove_from_hass()
async_delete_issue(
self.hass, DOMAIN, f"{self.entity_id}_validation_{self._validation_status}"
@@ -1219,11 +1194,3 @@ def websocket_config(
"config": automation.raw_config,
},
)
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())

View File

@@ -29,7 +29,7 @@
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["axis"],
"requirements": ["axis==63"],
"requirements": ["axis==64"],
"ssdp": [
{
"manufacturer": "AXIS"

View File

@@ -5,36 +5,81 @@ from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.hassio import is_hassio
from homeassistant.helpers.typing import ConfigType
from .const import DATA_MANAGER, DOMAIN, LOGGER
from .agent import (
BackupAgent,
BackupAgentError,
BackupAgentPlatformProtocol,
LocalBackupAgent,
)
from .const import DATA_MANAGER, DOMAIN
from .http import async_register_http_views
from .manager import BackupManager
from .manager import (
BackupManager,
BackupPlatformProtocol,
BackupReaderWriter,
CoreBackupReaderWriter,
CreateBackupEvent,
ManagerBackup,
NewBackup,
WrittenBackup,
)
from .models import AddonInfo, AgentBackup, Folder
from .websocket import async_register_websocket_handlers
__all__ = [
"AddonInfo",
"AgentBackup",
"ManagerBackup",
"BackupAgent",
"BackupAgentError",
"BackupAgentPlatformProtocol",
"BackupPlatformProtocol",
"BackupReaderWriter",
"CreateBackupEvent",
"Folder",
"LocalBackupAgent",
"NewBackup",
"WrittenBackup",
]
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Backup integration."""
backup_manager = BackupManager(hass)
hass.data[DATA_MANAGER] = backup_manager
with_hassio = is_hassio(hass)
reader_writer: BackupReaderWriter
if not with_hassio:
reader_writer = CoreBackupReaderWriter(hass)
else:
# pylint: disable-next=import-outside-toplevel, hass-component-root-import
from homeassistant.components.hassio.backup import SupervisorBackupReaderWriter
reader_writer = SupervisorBackupReaderWriter(hass)
backup_manager = BackupManager(hass, reader_writer)
hass.data[DATA_MANAGER] = backup_manager
await backup_manager.async_setup()
async_register_websocket_handlers(hass, with_hassio)
if with_hassio:
if DOMAIN in config:
LOGGER.error(
"The backup integration is not supported on this installation method, "
"please remove it from your configuration"
)
return True
async def async_handle_create_service(call: ServiceCall) -> None:
"""Service handler for creating backups."""
await backup_manager.async_create_backup()
agent_id = list(backup_manager.local_backup_agents)[0]
await backup_manager.async_create_backup(
agent_ids=[agent_id],
include_addons=None,
include_all_addons=False,
include_database=True,
include_folders=None,
include_homeassistant=True,
name=None,
password=None,
)
hass.services.async_register(DOMAIN, "create", async_handle_create_service)
if not with_hassio:
hass.services.async_register(DOMAIN, "create", async_handle_create_service)
async_register_http_views(hass)

View File

@@ -0,0 +1,121 @@
"""Backup agents for the Backup integration."""
from __future__ import annotations
import abc
from collections.abc import AsyncIterator, Callable, Coroutine
from pathlib import Path
from typing import Any, Protocol
from propcache import cached_property
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from .models import AgentBackup
class BackupAgentError(HomeAssistantError):
"""Base class for backup agent errors."""
class BackupAgentUnreachableError(BackupAgentError):
"""Raised when the agent can't reach its API."""
_message = "The backup agent is unreachable."
class BackupAgent(abc.ABC):
"""Backup agent interface."""
domain: str
name: str
@cached_property
def agent_id(self) -> str:
"""Return the agent_id."""
return f"{self.domain}.{self.name}"
@abc.abstractmethod
async def async_download_backup(
self,
backup_id: str,
**kwargs: Any,
) -> AsyncIterator[bytes]:
"""Download a backup file.
:param backup_id: The ID of the backup that was returned in async_list_backups.
:return: An async iterator that yields bytes.
"""
@abc.abstractmethod
async def async_upload_backup(
self,
*,
open_stream: Callable[[], Coroutine[Any, Any, AsyncIterator[bytes]]],
backup: AgentBackup,
**kwargs: Any,
) -> None:
"""Upload a backup.
:param open_stream: A function returning an async iterator that yields bytes.
:param backup: Metadata about the backup that should be uploaded.
"""
@abc.abstractmethod
async def async_delete_backup(
self,
backup_id: str,
**kwargs: Any,
) -> None:
"""Delete a backup file.
:param backup_id: The ID of the backup that was returned in async_list_backups.
"""
@abc.abstractmethod
async def async_list_backups(self, **kwargs: Any) -> list[AgentBackup]:
"""List backups."""
@abc.abstractmethod
async def async_get_backup(
self,
backup_id: str,
**kwargs: Any,
) -> AgentBackup | None:
"""Return a backup."""
class LocalBackupAgent(BackupAgent):
"""Local backup agent."""
@abc.abstractmethod
def get_backup_path(self, backup_id: str) -> Path:
"""Return the local path to a backup.
The method should return the path to the backup file with the specified id.
"""
class BackupAgentPlatformProtocol(Protocol):
"""Define the format of backup platforms which implement backup agents."""
async def async_get_backup_agents(
self,
hass: HomeAssistant,
**kwargs: Any,
) -> list[BackupAgent]:
"""Return a list of backup agents."""
@callback
def async_register_backup_agents_listener(
self,
hass: HomeAssistant,
*,
listener: Callable[[], None],
**kwargs: Any,
) -> Callable[[], None]:
"""Register a listener to be called when agents are added or removed.
:return: A function to unregister the listener.
"""

View File

@@ -0,0 +1,125 @@
"""Local backup support for Core and Container installations."""
from __future__ import annotations
from collections.abc import AsyncIterator, Callable, Coroutine
import json
from pathlib import Path
from tarfile import TarError
from typing import Any
from homeassistant.core import HomeAssistant
from homeassistant.helpers.hassio import is_hassio
from .agent import BackupAgent, LocalBackupAgent
from .const import DOMAIN, LOGGER
from .models import AgentBackup
from .util import read_backup
async def async_get_backup_agents(
hass: HomeAssistant,
**kwargs: Any,
) -> list[BackupAgent]:
"""Return the local backup agent."""
if is_hassio(hass):
return []
return [CoreLocalBackupAgent(hass)]
class CoreLocalBackupAgent(LocalBackupAgent):
"""Local backup agent for Core and Container installations."""
domain = DOMAIN
name = "local"
def __init__(self, hass: HomeAssistant) -> None:
"""Initialize the backup agent."""
super().__init__()
self._hass = hass
self._backup_dir = Path(hass.config.path("backups"))
self._backups: dict[str, AgentBackup] = {}
self._loaded_backups = False
async def _load_backups(self) -> None:
"""Load data of stored backup files."""
backups = await self._hass.async_add_executor_job(self._read_backups)
LOGGER.debug("Loaded %s local backups", len(backups))
self._backups = backups
self._loaded_backups = True
def _read_backups(self) -> dict[str, AgentBackup]:
"""Read backups from disk."""
backups: dict[str, AgentBackup] = {}
for backup_path in self._backup_dir.glob("*.tar"):
try:
backup = read_backup(backup_path)
backups[backup.backup_id] = backup
except (OSError, TarError, json.JSONDecodeError, KeyError) as err:
LOGGER.warning("Unable to read backup %s: %s", backup_path, err)
return backups
async def async_download_backup(
self,
backup_id: str,
**kwargs: Any,
) -> AsyncIterator[bytes]:
"""Download a backup file."""
raise NotImplementedError
async def async_upload_backup(
self,
*,
open_stream: Callable[[], Coroutine[Any, Any, AsyncIterator[bytes]]],
backup: AgentBackup,
**kwargs: Any,
) -> None:
"""Upload a backup."""
self._backups[backup.backup_id] = backup
async def async_list_backups(self, **kwargs: Any) -> list[AgentBackup]:
"""List backups."""
if not self._loaded_backups:
await self._load_backups()
return list(self._backups.values())
async def async_get_backup(
self,
backup_id: str,
**kwargs: Any,
) -> AgentBackup | None:
"""Return a backup."""
if not self._loaded_backups:
await self._load_backups()
if not (backup := self._backups.get(backup_id)):
return None
backup_path = self.get_backup_path(backup_id)
if not await self._hass.async_add_executor_job(backup_path.exists):
LOGGER.debug(
(
"Removing tracked backup (%s) that does not exists on the expected"
" path %s"
),
backup.backup_id,
backup_path,
)
self._backups.pop(backup_id)
return None
return backup
def get_backup_path(self, backup_id: str) -> Path:
"""Return the local path to a backup."""
return self._backup_dir / f"{backup_id}.tar"
async def async_delete_backup(self, backup_id: str, **kwargs: Any) -> None:
"""Delete a backup file."""
if await self.async_get_backup(backup_id) is None:
return
backup_path = self.get_backup_path(backup_id)
await self._hass.async_add_executor_job(backup_path.unlink, True)
LOGGER.debug("Deleted backup located at %s", backup_path)
self._backups.pop(backup_id)

View File

@@ -0,0 +1,473 @@
"""Provide persistent configuration for the backup integration."""
from __future__ import annotations
import asyncio
from collections.abc import Callable
from dataclasses import dataclass, field, replace
from datetime import datetime, timedelta
from enum import StrEnum
from typing import TYPE_CHECKING, Self, TypedDict
from cronsim import CronSim
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.event import async_call_later, async_track_point_in_time
from homeassistant.helpers.typing import UNDEFINED, UndefinedType
from homeassistant.util import dt as dt_util
from .const import LOGGER
from .models import Folder
if TYPE_CHECKING:
from .manager import BackupManager, ManagerBackup
# The time of the automatic backup event should be compatible with
# the time of the recorder's nightly job which runs at 04:12.
# Run the backup at 04:45.
CRON_PATTERN_DAILY = "45 4 * * *"
CRON_PATTERN_WEEKLY = "45 4 * * {}"
class StoredBackupConfig(TypedDict):
"""Represent the stored backup config."""
create_backup: StoredCreateBackupConfig
last_attempted_strategy_backup: str | None
last_completed_strategy_backup: str | None
retention: StoredRetentionConfig
schedule: StoredBackupSchedule
@dataclass(kw_only=True)
class BackupConfigData:
"""Represent loaded backup config data."""
create_backup: CreateBackupConfig
last_attempted_strategy_backup: datetime | None = None
last_completed_strategy_backup: datetime | None = None
retention: RetentionConfig
schedule: BackupSchedule
@classmethod
def from_dict(cls, data: StoredBackupConfig) -> Self:
"""Initialize backup config data from a dict."""
include_folders_data = data["create_backup"]["include_folders"]
if include_folders_data:
include_folders = [Folder(folder) for folder in include_folders_data]
else:
include_folders = None
retention = data["retention"]
if last_attempted_str := data["last_attempted_strategy_backup"]:
last_attempted = dt_util.parse_datetime(last_attempted_str)
else:
last_attempted = None
if last_attempted_str := data["last_completed_strategy_backup"]:
last_completed = dt_util.parse_datetime(last_attempted_str)
else:
last_completed = None
return cls(
create_backup=CreateBackupConfig(
agent_ids=data["create_backup"]["agent_ids"],
include_addons=data["create_backup"]["include_addons"],
include_all_addons=data["create_backup"]["include_all_addons"],
include_database=data["create_backup"]["include_database"],
include_folders=include_folders,
name=data["create_backup"]["name"],
password=data["create_backup"]["password"],
),
last_attempted_strategy_backup=last_attempted,
last_completed_strategy_backup=last_completed,
retention=RetentionConfig(
copies=retention["copies"],
days=retention["days"],
),
schedule=BackupSchedule(state=ScheduleState(data["schedule"]["state"])),
)
def to_dict(self) -> StoredBackupConfig:
"""Convert backup config data to a dict."""
if self.last_attempted_strategy_backup:
last_attempted = self.last_attempted_strategy_backup.isoformat()
else:
last_attempted = None
if self.last_completed_strategy_backup:
last_completed = self.last_completed_strategy_backup.isoformat()
else:
last_completed = None
return StoredBackupConfig(
create_backup=self.create_backup.to_dict(),
last_attempted_strategy_backup=last_attempted,
last_completed_strategy_backup=last_completed,
retention=self.retention.to_dict(),
schedule=self.schedule.to_dict(),
)
class BackupConfig:
"""Handle backup config."""
def __init__(self, hass: HomeAssistant, manager: BackupManager) -> None:
"""Initialize backup config."""
self.data = BackupConfigData(
create_backup=CreateBackupConfig(),
retention=RetentionConfig(),
schedule=BackupSchedule(),
)
self._manager = manager
def load(self, stored_config: StoredBackupConfig) -> None:
"""Load config."""
self.data = BackupConfigData.from_dict(stored_config)
self.data.schedule.apply(self._manager)
async def update(
self,
*,
create_backup: CreateBackupParametersDict | UndefinedType = UNDEFINED,
retention: RetentionParametersDict | UndefinedType = UNDEFINED,
schedule: ScheduleState | UndefinedType = UNDEFINED,
) -> None:
"""Update config."""
if create_backup is not UNDEFINED:
self.data.create_backup = replace(self.data.create_backup, **create_backup)
if retention is not UNDEFINED:
new_retention = RetentionConfig(**retention)
if new_retention != self.data.retention:
self.data.retention = new_retention
self.data.retention.apply(self._manager)
if schedule is not UNDEFINED:
new_schedule = BackupSchedule(state=schedule)
if new_schedule.to_dict() != self.data.schedule.to_dict():
self.data.schedule = new_schedule
self.data.schedule.apply(self._manager)
self._manager.store.save()
@dataclass(kw_only=True)
class RetentionConfig:
"""Represent the backup retention configuration."""
copies: int | None = None
days: int | None = None
def apply(self, manager: BackupManager) -> None:
"""Apply backup retention configuration."""
if self.days is not None:
self._schedule_next(manager)
else:
self._unschedule_next(manager)
def to_dict(self) -> StoredRetentionConfig:
"""Convert backup retention configuration to a dict."""
return StoredRetentionConfig(
copies=self.copies,
days=self.days,
)
@callback
def _schedule_next(
self,
manager: BackupManager,
) -> None:
"""Schedule the next delete after days."""
self._unschedule_next(manager)
async def _delete_backups(now: datetime) -> None:
"""Delete backups older than days."""
self._schedule_next(manager)
def _backups_filter(
backups: dict[str, ManagerBackup],
) -> dict[str, ManagerBackup]:
"""Return backups older than days to delete."""
# we need to check here since we await before
# this filter is applied
if self.days is None:
return {}
now = dt_util.utcnow()
return {
backup_id: backup
for backup_id, backup in backups.items()
if dt_util.parse_datetime(backup.date, raise_on_error=True)
+ timedelta(days=self.days)
< now
}
await _delete_filtered_backups(manager, _backups_filter)
manager.remove_next_delete_event = async_call_later(
manager.hass, timedelta(days=1), _delete_backups
)
@callback
def _unschedule_next(self, manager: BackupManager) -> None:
"""Unschedule the next delete after days."""
if (remove_next_event := manager.remove_next_delete_event) is not None:
remove_next_event()
manager.remove_next_delete_event = None
class StoredRetentionConfig(TypedDict):
"""Represent the stored backup retention configuration."""
copies: int | None
days: int | None
class RetentionParametersDict(TypedDict, total=False):
"""Represent the parameters for retention."""
copies: int | None
days: int | None
class StoredBackupSchedule(TypedDict):
"""Represent the stored backup schedule configuration."""
state: ScheduleState
class ScheduleState(StrEnum):
"""Represent the schedule state."""
NEVER = "never"
DAILY = "daily"
MONDAY = "mon"
TUESDAY = "tue"
WEDNESDAY = "wed"
THURSDAY = "thu"
FRIDAY = "fri"
SATURDAY = "sat"
SUNDAY = "sun"
@dataclass(kw_only=True)
class BackupSchedule:
"""Represent the backup schedule."""
state: ScheduleState = ScheduleState.NEVER
cron_event: CronSim | None = field(init=False, default=None)
@callback
def apply(
self,
manager: BackupManager,
) -> None:
"""Apply a new schedule.
There are only three possible state types: never, daily, or weekly.
"""
if self.state is ScheduleState.NEVER:
self._unschedule_next(manager)
return
if self.state is ScheduleState.DAILY:
self._schedule_next(CRON_PATTERN_DAILY, manager)
else:
self._schedule_next(
CRON_PATTERN_WEEKLY.format(self.state.value),
manager,
)
@callback
def _schedule_next(
self,
cron_pattern: str,
manager: BackupManager,
) -> None:
"""Schedule the next backup."""
self._unschedule_next(manager)
now = dt_util.now()
if (cron_event := self.cron_event) is None:
seed_time = manager.config.data.last_completed_strategy_backup or now
cron_event = self.cron_event = CronSim(cron_pattern, seed_time)
next_time = next(cron_event)
if next_time < now:
# schedule a backup at next daily time once
# if we missed the last scheduled backup
cron_event = CronSim(CRON_PATTERN_DAILY, now)
next_time = next(cron_event)
# reseed the cron event attribute
# add a day to the next time to avoid scheduling at the same time again
self.cron_event = CronSim(cron_pattern, now + timedelta(days=1))
async def _create_backup(now: datetime) -> None:
"""Create backup."""
manager.remove_next_backup_event = None
config_data = manager.config.data
self._schedule_next(cron_pattern, manager)
# create the backup
try:
await manager.async_create_backup(
agent_ids=config_data.create_backup.agent_ids,
include_addons=config_data.create_backup.include_addons,
include_all_addons=config_data.create_backup.include_all_addons,
include_database=config_data.create_backup.include_database,
include_folders=config_data.create_backup.include_folders,
include_homeassistant=True, # always include HA
name=config_data.create_backup.name,
password=config_data.create_backup.password,
with_strategy_settings=True,
)
except Exception: # noqa: BLE001
# another more specific exception will be added
# and handled in the future
LOGGER.exception("Unexpected error creating automatic backup")
manager.remove_next_backup_event = async_track_point_in_time(
manager.hass, _create_backup, next_time
)
def to_dict(self) -> StoredBackupSchedule:
"""Convert backup schedule to a dict."""
return StoredBackupSchedule(state=self.state)
@callback
def _unschedule_next(self, manager: BackupManager) -> None:
"""Unschedule the next backup."""
if (remove_next_event := manager.remove_next_backup_event) is not None:
remove_next_event()
manager.remove_next_backup_event = None
@dataclass(kw_only=True)
class CreateBackupConfig:
"""Represent the config for async_create_backup."""
agent_ids: list[str] = field(default_factory=list)
include_addons: list[str] | None = None
include_all_addons: bool = False
include_database: bool = True
include_folders: list[Folder] | None = None
name: str | None = None
password: str | None = None
def to_dict(self) -> StoredCreateBackupConfig:
"""Convert create backup config to a dict."""
return {
"agent_ids": self.agent_ids,
"include_addons": self.include_addons,
"include_all_addons": self.include_all_addons,
"include_database": self.include_database,
"include_folders": self.include_folders,
"name": self.name,
"password": self.password,
}
class StoredCreateBackupConfig(TypedDict):
"""Represent the stored config for async_create_backup."""
agent_ids: list[str]
include_addons: list[str] | None
include_all_addons: bool
include_database: bool
include_folders: list[Folder] | None
name: str | None
password: str | None
class CreateBackupParametersDict(TypedDict, total=False):
"""Represent the parameters for async_create_backup."""
agent_ids: list[str]
include_addons: list[str] | None
include_all_addons: bool
include_database: bool
include_folders: list[Folder] | None
name: str | None
password: str | None
async def _delete_filtered_backups(
manager: BackupManager,
backup_filter: Callable[[dict[str, ManagerBackup]], dict[str, ManagerBackup]],
) -> None:
"""Delete backups parsed with a filter.
:param manager: The backup manager.
:param backup_filter: A filter that should return the backups to delete.
"""
backups, get_agent_errors = await manager.async_get_backups()
if get_agent_errors:
LOGGER.debug(
"Error getting backups; continuing anyway: %s",
get_agent_errors,
)
# only delete backups that are created by the backup strategy
backups = {
backup_id: backup
for backup_id, backup in backups.items()
if backup.with_strategy_settings
}
LOGGER.debug("Total strategy backups: %s", backups)
filtered_backups = backup_filter(backups)
if not filtered_backups:
return
# always delete oldest backup first
filtered_backups = dict(
sorted(
filtered_backups.items(),
key=lambda backup_item: backup_item[1].date,
)
)
if len(filtered_backups) >= len(backups):
# Never delete the last backup.
last_backup = filtered_backups.popitem()
LOGGER.debug("Keeping the last backup: %s", last_backup)
LOGGER.debug("Backups to delete: %s", filtered_backups)
if not filtered_backups:
return
backup_ids = list(filtered_backups)
delete_results = await asyncio.gather(
*(manager.async_delete_backup(backup_id) for backup_id in filtered_backups)
)
agent_errors = {
backup_id: error
for backup_id, error in zip(backup_ids, delete_results, strict=True)
if error
}
if agent_errors:
LOGGER.error(
"Error deleting old copies: %s",
agent_errors,
)
async def delete_backups_exceeding_configured_count(manager: BackupManager) -> None:
"""Delete backups exceeding the configured retention count."""
def _backups_filter(
backups: dict[str, ManagerBackup],
) -> dict[str, ManagerBackup]:
"""Return oldest backups more numerous than copies to delete."""
# we need to check here since we await before
# this filter is applied
if manager.config.data.retention.copies is None:
return {}
return dict(
sorted(
backups.items(),
key=lambda backup_item: backup_item[1].date,
)[: len(backups) - manager.config.data.retention.copies]
)
await _delete_filtered_backups(manager, _backups_filter)

View File

@@ -10,6 +10,7 @@ from homeassistant.util.hass_dict import HassKey
if TYPE_CHECKING:
from .manager import BackupManager
BUF_SIZE = 2**20 * 4 # 4MB
DOMAIN = "backup"
DATA_MANAGER: HassKey[BackupManager] = HassKey(DOMAIN)
LOGGER = getLogger(__package__)
@@ -22,6 +23,12 @@ EXCLUDE_FROM_BACKUP = [
"*.log.*",
"*.log",
"backups/*.tar",
"tmp_backups/*.tar",
"OZW_Log.txt",
"tts/*",
]
EXCLUDE_DATABASE_FROM_BACKUP = [
"home-assistant_v2.db",
"home-assistant_v2.db-wal",
]

View File

@@ -8,10 +8,11 @@ from typing import cast
from aiohttp import BodyPartReader
from aiohttp.hdrs import CONTENT_DISPOSITION
from aiohttp.web import FileResponse, Request, Response
from aiohttp.web import FileResponse, Request, Response, StreamResponse
from homeassistant.components.http import KEY_HASS, HomeAssistantView, require_admin
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.util import slugify
from .const import DATA_MANAGER
@@ -27,30 +28,47 @@ def async_register_http_views(hass: HomeAssistant) -> None:
class DownloadBackupView(HomeAssistantView):
"""Generate backup view."""
url = "/api/backup/download/{slug}"
url = "/api/backup/download/{backup_id}"
name = "api:backup:download"
async def get(
self,
request: Request,
slug: str,
) -> FileResponse | Response:
backup_id: str,
) -> StreamResponse | FileResponse | Response:
"""Download a backup file."""
if not request["hass_user"].is_admin:
return Response(status=HTTPStatus.UNAUTHORIZED)
try:
agent_id = request.query.getone("agent_id")
except KeyError:
return Response(status=HTTPStatus.BAD_REQUEST)
manager = request.app[KEY_HASS].data[DATA_MANAGER]
backup = await manager.async_get_backup(slug=slug)
if agent_id not in manager.backup_agents:
return Response(status=HTTPStatus.BAD_REQUEST)
agent = manager.backup_agents[agent_id]
backup = await agent.async_get_backup(backup_id)
if backup is None or not backup.path.exists():
# We don't need to check if the path exists, aiohttp.FileResponse will handle
# that
if backup is None:
return Response(status=HTTPStatus.NOT_FOUND)
return FileResponse(
path=backup.path.as_posix(),
headers={
CONTENT_DISPOSITION: f"attachment; filename={slugify(backup.name)}.tar"
},
)
headers = {
CONTENT_DISPOSITION: f"attachment; filename={slugify(backup.name)}.tar"
}
if agent_id in manager.local_backup_agents:
local_agent = manager.local_backup_agents[agent_id]
path = local_agent.get_backup_path(backup_id)
return FileResponse(path=path.as_posix(), headers=headers)
stream = await agent.async_download_backup(backup_id)
response = StreamResponse(status=HTTPStatus.OK, headers=headers)
await response.prepare(request)
async for chunk in stream:
await response.write(chunk)
return response
class UploadBackupView(HomeAssistantView):
@@ -62,15 +80,24 @@ class UploadBackupView(HomeAssistantView):
@require_admin
async def post(self, request: Request) -> Response:
"""Upload a backup file."""
try:
agent_ids = request.query.getall("agent_id")
except KeyError:
return Response(status=HTTPStatus.BAD_REQUEST)
manager = request.app[KEY_HASS].data[DATA_MANAGER]
reader = await request.multipart()
contents = cast(BodyPartReader, await reader.next())
try:
await manager.async_receive_backup(contents=contents)
await manager.async_receive_backup(contents=contents, agent_ids=agent_ids)
except OSError as err:
return Response(
body=f"Can't write backup file {err}",
body=f"Can't write backup file: {err}",
status=HTTPStatus.INTERNAL_SERVER_ERROR,
)
except HomeAssistantError as err:
return Response(
body=f"Can't upload backup file: {err}",
status=HTTPStatus.INTERNAL_SERVER_ERROR,
)
except asyncio.CancelledError:

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,12 @@
{
"domain": "backup",
"name": "Backup",
"after_dependencies": ["hassio"],
"codeowners": ["@home-assistant/core"],
"dependencies": ["http", "websocket_api"],
"documentation": "https://www.home-assistant.io/integrations/backup",
"integration_type": "system",
"iot_class": "calculated",
"quality_scale": "internal",
"requirements": ["securetar==2024.11.0"]
"requirements": ["cronsim==2.6", "securetar==2024.11.0"]
}

View File

@@ -0,0 +1,61 @@
"""Models for the backup integration."""
from __future__ import annotations
from dataclasses import asdict, dataclass
from enum import StrEnum
from typing import Any, Self
@dataclass(frozen=True, kw_only=True)
class AddonInfo:
"""Addon information."""
name: str
slug: str
version: str
class Folder(StrEnum):
"""Folder type."""
SHARE = "share"
ADDONS = "addons/local"
SSL = "ssl"
MEDIA = "media"
@dataclass(frozen=True, kw_only=True)
class AgentBackup:
"""Base backup class."""
addons: list[AddonInfo]
backup_id: str
date: str
database_included: bool
folders: list[Folder]
homeassistant_included: bool
homeassistant_version: str | None # None if homeassistant_included is False
name: str
protected: bool
size: int
def as_dict(self) -> dict:
"""Return a dict representation of this backup."""
return asdict(self)
@classmethod
def from_dict(cls, data: dict[str, Any]) -> Self:
"""Create an instance from a JSON serialization."""
return cls(
addons=[AddonInfo(**addon) for addon in data["addons"]],
backup_id=data["backup_id"],
date=data["date"],
database_included=data["database_included"],
folders=[Folder(folder) for folder in data["folders"]],
homeassistant_included=data["homeassistant_included"],
homeassistant_version=data["homeassistant_version"],
name=data["name"],
protected=data["protected"],
size=data["size"],
)

View File

@@ -0,0 +1,52 @@
"""Store backup configuration."""
from __future__ import annotations
from typing import TYPE_CHECKING, TypedDict
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.storage import Store
from .const import DOMAIN
if TYPE_CHECKING:
from .config import StoredBackupConfig
from .manager import BackupManager, StoredKnownBackup
STORE_DELAY_SAVE = 30
STORAGE_KEY = DOMAIN
STORAGE_VERSION = 1
class StoredBackupData(TypedDict):
"""Represent the stored backup config."""
backups: list[StoredKnownBackup]
config: StoredBackupConfig
class BackupStore:
"""Store backup config."""
def __init__(self, hass: HomeAssistant, manager: BackupManager) -> None:
"""Initialize the backup manager."""
self._hass = hass
self._manager = manager
self._store: Store[StoredBackupData] = Store(hass, STORAGE_VERSION, STORAGE_KEY)
async def load(self) -> StoredBackupData | None:
"""Load the store."""
return await self._store.async_load()
@callback
def save(self) -> None:
"""Save config."""
self._store.async_delay_save(self._data_to_save, STORE_DELAY_SAVE)
@callback
def _data_to_save(self) -> StoredBackupData:
"""Return data to save."""
return {
"backups": self._manager.known_backups.to_list(),
"config": self._manager.config.data.to_dict(),
}

View File

@@ -0,0 +1,111 @@
"""Local backup support for Core and Container installations."""
from __future__ import annotations
import asyncio
from pathlib import Path
from queue import SimpleQueue
import tarfile
from typing import cast
import aiohttp
from homeassistant.core import HomeAssistant
from homeassistant.util.json import JsonObjectType, json_loads_object
from .const import BUF_SIZE
from .models import AddonInfo, AgentBackup, Folder
def make_backup_dir(path: Path) -> None:
"""Create a backup directory if it does not exist."""
path.mkdir(exist_ok=True)
def read_backup(backup_path: Path) -> AgentBackup:
"""Read a backup from disk."""
with tarfile.open(backup_path, "r:", bufsize=BUF_SIZE) as backup_file:
if not (data_file := backup_file.extractfile("./backup.json")):
raise KeyError("backup.json not found in tar file")
data = json_loads_object(data_file.read())
addons = [
AddonInfo(
name=cast(str, addon["name"]),
slug=cast(str, addon["slug"]),
version=cast(str, addon["version"]),
)
for addon in cast(list[JsonObjectType], data.get("addons", []))
]
folders = [
Folder(folder)
for folder in cast(list[str], data.get("folders", []))
if folder != "homeassistant"
]
homeassistant_included = False
homeassistant_version: str | None = None
database_included = False
if (
homeassistant := cast(JsonObjectType, data.get("homeassistant"))
) and "version" in homeassistant:
homeassistant_version = cast(str, homeassistant["version"])
database_included = not cast(
bool, homeassistant.get("exclude_database", False)
)
return AgentBackup(
addons=addons,
backup_id=cast(str, data["slug"]),
database_included=database_included,
date=cast(str, data["date"]),
folders=folders,
homeassistant_included=homeassistant_included,
homeassistant_version=homeassistant_version,
name=cast(str, data["name"]),
protected=cast(bool, data.get("protected", False)),
size=backup_path.stat().st_size,
)
async def receive_file(
hass: HomeAssistant, contents: aiohttp.BodyPartReader, path: Path
) -> None:
"""Receive a file from a stream and write it to a file."""
queue: SimpleQueue[tuple[bytes, asyncio.Future[None] | None] | None] = SimpleQueue()
def _sync_queue_consumer() -> None:
with path.open("wb") as file_handle:
while True:
if (_chunk_future := queue.get()) is None:
break
_chunk, _future = _chunk_future
if _future is not None:
hass.loop.call_soon_threadsafe(_future.set_result, None)
file_handle.write(_chunk)
fut: asyncio.Future[None] | None = None
try:
fut = hass.async_add_executor_job(_sync_queue_consumer)
megabytes_sending = 0
while chunk := await contents.read_chunk(BUF_SIZE):
megabytes_sending += 1
if megabytes_sending % 5 != 0:
queue.put_nowait((chunk, None))
continue
chunk_future = hass.loop.create_future()
queue.put_nowait((chunk, chunk_future))
await asyncio.wait(
(fut, chunk_future),
return_when=asyncio.FIRST_COMPLETED,
)
if fut.done():
# The executor job failed
break
queue.put_nowait(None) # terminate queue consumer
finally:
if fut is not None:
await fut

View File

@@ -7,22 +7,31 @@ import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.core import HomeAssistant, callback
from .config import ScheduleState
from .const import DATA_MANAGER, LOGGER
from .manager import ManagerStateEvent
from .models import Folder
@callback
def async_register_websocket_handlers(hass: HomeAssistant, with_hassio: bool) -> None:
"""Register websocket commands."""
websocket_api.async_register_command(hass, backup_agents_info)
if with_hassio:
websocket_api.async_register_command(hass, handle_backup_end)
websocket_api.async_register_command(hass, handle_backup_start)
return
websocket_api.async_register_command(hass, handle_details)
websocket_api.async_register_command(hass, handle_info)
websocket_api.async_register_command(hass, handle_create)
websocket_api.async_register_command(hass, handle_remove)
websocket_api.async_register_command(hass, handle_create_with_strategy_settings)
websocket_api.async_register_command(hass, handle_delete)
websocket_api.async_register_command(hass, handle_restore)
websocket_api.async_register_command(hass, handle_subscribe_events)
websocket_api.async_register_command(hass, handle_config_info)
websocket_api.async_register_command(hass, handle_config_update)
@websocket_api.require_admin
@@ -35,12 +44,16 @@ async def handle_info(
) -> None:
"""List all stored backups."""
manager = hass.data[DATA_MANAGER]
backups = await manager.async_get_backups()
backups, agent_errors = await manager.async_get_backups()
connection.send_result(
msg["id"],
{
"agent_errors": {
agent_id: str(err) for agent_id, err in agent_errors.items()
},
"backups": list(backups.values()),
"backing_up": manager.backing_up,
"last_attempted_strategy_backup": manager.config.data.last_attempted_strategy_backup,
"last_completed_strategy_backup": manager.config.data.last_completed_strategy_backup,
},
)
@@ -49,7 +62,7 @@ async def handle_info(
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/details",
vol.Required("slug"): str,
vol.Required("backup_id"): str,
}
)
@websocket_api.async_response
@@ -58,11 +71,16 @@ async def handle_details(
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Get backup details for a specific slug."""
backup = await hass.data[DATA_MANAGER].async_get_backup(slug=msg["slug"])
"""Get backup details for a specific backup."""
backup, agent_errors = await hass.data[DATA_MANAGER].async_get_backup(
msg["backup_id"]
)
connection.send_result(
msg["id"],
{
"agent_errors": {
agent_id: str(err) for agent_id, err in agent_errors.items()
},
"backup": backup,
},
)
@@ -71,26 +89,39 @@ async def handle_details(
@websocket_api.require_admin
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/remove",
vol.Required("slug"): str,
vol.Required("type"): "backup/delete",
vol.Required("backup_id"): str,
}
)
@websocket_api.async_response
async def handle_remove(
async def handle_delete(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Remove a backup."""
await hass.data[DATA_MANAGER].async_remove_backup(slug=msg["slug"])
connection.send_result(msg["id"])
"""Delete a backup."""
agent_errors = await hass.data[DATA_MANAGER].async_delete_backup(msg["backup_id"])
connection.send_result(
msg["id"],
{
"agent_errors": {
agent_id: str(err) for agent_id, err in agent_errors.items()
}
},
)
@websocket_api.require_admin
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/restore",
vol.Required("slug"): str,
vol.Required("backup_id"): str,
vol.Required("agent_id"): str,
vol.Optional("password"): str,
vol.Optional("restore_addons"): [str],
vol.Optional("restore_database", default=True): bool,
vol.Optional("restore_folders"): [vol.Coerce(Folder)],
vol.Optional("restore_homeassistant", default=True): bool,
}
)
@websocket_api.async_response
@@ -100,12 +131,32 @@ async def handle_restore(
msg: dict[str, Any],
) -> None:
"""Restore a backup."""
await hass.data[DATA_MANAGER].async_restore_backup(msg["slug"])
await hass.data[DATA_MANAGER].async_restore_backup(
msg["backup_id"],
agent_id=msg["agent_id"],
password=msg.get("password"),
restore_addons=msg.get("restore_addons"),
restore_database=msg["restore_database"],
restore_folders=msg.get("restore_folders"),
restore_homeassistant=msg["restore_homeassistant"],
)
connection.send_result(msg["id"])
@websocket_api.require_admin
@websocket_api.websocket_command({vol.Required("type"): "backup/generate"})
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/generate",
vol.Required("agent_ids"): [str],
vol.Optional("include_addons"): [str],
vol.Optional("include_all_addons", default=False): bool,
vol.Optional("include_database", default=True): bool,
vol.Optional("include_folders"): [vol.Coerce(Folder)],
vol.Optional("include_homeassistant", default=True): bool,
vol.Optional("name"): str,
vol.Optional("password"): str,
}
)
@websocket_api.async_response
async def handle_create(
hass: HomeAssistant,
@@ -113,7 +164,46 @@ async def handle_create(
msg: dict[str, Any],
) -> None:
"""Generate a backup."""
backup = await hass.data[DATA_MANAGER].async_create_backup()
backup = await hass.data[DATA_MANAGER].async_initiate_backup(
agent_ids=msg["agent_ids"],
include_addons=msg.get("include_addons"),
include_all_addons=msg["include_all_addons"],
include_database=msg["include_database"],
include_folders=msg.get("include_folders"),
include_homeassistant=msg["include_homeassistant"],
name=msg.get("name"),
password=msg.get("password"),
)
connection.send_result(msg["id"], backup)
@websocket_api.require_admin
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/generate_with_strategy_settings",
}
)
@websocket_api.async_response
async def handle_create_with_strategy_settings(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Generate a backup with stored settings."""
config_data = hass.data[DATA_MANAGER].config.data
backup = await hass.data[DATA_MANAGER].async_initiate_backup(
agent_ids=config_data.create_backup.agent_ids,
include_addons=config_data.create_backup.include_addons,
include_all_addons=config_data.create_backup.include_all_addons,
include_database=config_data.create_backup.include_database,
include_folders=config_data.create_backup.include_folders,
include_homeassistant=True, # always include HA
name=config_data.create_backup.name,
password=config_data.create_backup.password,
with_strategy_settings=True,
)
connection.send_result(msg["id"], backup)
@@ -127,7 +217,6 @@ async def handle_backup_start(
) -> None:
"""Backup start notification."""
manager = hass.data[DATA_MANAGER]
manager.backing_up = True
LOGGER.debug("Backup start notification")
try:
@@ -149,7 +238,6 @@ async def handle_backup_end(
) -> None:
"""Backup end notification."""
manager = hass.data[DATA_MANAGER]
manager.backing_up = False
LOGGER.debug("Backup end notification")
try:
@@ -159,3 +247,97 @@ async def handle_backup_end(
return
connection.send_result(msg["id"])
@websocket_api.require_admin
@websocket_api.websocket_command({vol.Required("type"): "backup/agents/info"})
@websocket_api.async_response
async def backup_agents_info(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Return backup agents info."""
manager = hass.data[DATA_MANAGER]
connection.send_result(
msg["id"],
{
"agents": [{"agent_id": agent_id} for agent_id in manager.backup_agents],
},
)
@websocket_api.require_admin
@websocket_api.websocket_command({vol.Required("type"): "backup/config/info"})
@websocket_api.async_response
async def handle_config_info(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Send the stored backup config."""
manager = hass.data[DATA_MANAGER]
connection.send_result(
msg["id"],
{
"config": manager.config.data.to_dict(),
},
)
@websocket_api.require_admin
@websocket_api.websocket_command(
{
vol.Required("type"): "backup/config/update",
vol.Optional("create_backup"): vol.Schema(
{
vol.Optional("agent_ids"): vol.All(list[str]),
vol.Optional("include_addons"): vol.Any(list[str], None),
vol.Optional("include_all_addons"): bool,
vol.Optional("include_database"): bool,
vol.Optional("include_folders"): vol.Any([vol.Coerce(Folder)], None),
vol.Optional("name"): vol.Any(str, None),
vol.Optional("password"): vol.Any(str, None),
},
),
vol.Optional("retention"): vol.Schema(
{
vol.Optional("copies"): vol.Any(int, None),
vol.Optional("days"): vol.Any(int, None),
},
),
vol.Optional("schedule"): vol.All(str, vol.Coerce(ScheduleState)),
}
)
@websocket_api.async_response
async def handle_config_update(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Update the stored backup config."""
manager = hass.data[DATA_MANAGER]
changes = dict(msg)
changes.pop("id")
changes.pop("type")
await manager.config.update(**changes)
connection.send_result(msg["id"])
@websocket_api.require_admin
@websocket_api.websocket_command({vol.Required("type"): "backup/subscribe_events"})
@websocket_api.async_response
async def handle_subscribe_events(
hass: HomeAssistant,
connection: websocket_api.ActiveConnection,
msg: dict[str, Any],
) -> None:
"""Subscribe to backup events."""
def on_event(event: ManagerStateEvent) -> None:
connection.send_message(websocket_api.event_message(msg["id"], event))
manager = hass.data[DATA_MANAGER]
on_event(manager.last_event)
connection.subscriptions[msg["id"]] = manager.async_subscribe_events(on_event)
connection.send_result(msg["id"])

View File

@@ -40,7 +40,6 @@ class BAFAutoComfort(BAFEntity, ClimateEntity):
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_hvac_modes = [HVACMode.OFF, HVACMode.FAN_ONLY]
_attr_translation_key = "auto_comfort"
_enable_turn_on_off_backwards_compatibility = False
@callback
def _async_update_attrs(self) -> None:

View File

@@ -46,7 +46,7 @@ class BAFFan(BAFEntity, FanEntity):
| FanEntityFeature.TURN_OFF
| FanEntityFeature.TURN_ON
)
_enable_turn_on_off_backwards_compatibility = False
_attr_preset_modes = [PRESET_MODE_AUTO]
_attr_speed_count = SPEED_COUNT
_attr_name = None

View File

@@ -8,16 +8,12 @@ from aiobafi6 import Device, OffOnAuto
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_COLOR_TEMP_KELVIN,
ColorMode,
LightEntity,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.color import (
color_temperature_kelvin_to_mired,
color_temperature_mired_to_kelvin,
)
from . import BAFConfigEntry
from .entity import BAFEntity
@@ -77,25 +73,17 @@ class BAFStandaloneLight(BAFLight):
def __init__(self, device: Device) -> None:
"""Init a standalone light."""
super().__init__(device)
self._attr_min_mireds = color_temperature_kelvin_to_mired(
device.light_warmest_color_temperature
)
self._attr_max_mireds = color_temperature_kelvin_to_mired(
device.light_coolest_color_temperature
)
self._attr_max_color_temp_kelvin = device.light_warmest_color_temperature
self._attr_min_color_temp_kelvin = device.light_coolest_color_temperature
@callback
def _async_update_attrs(self) -> None:
"""Update attrs from device."""
super()._async_update_attrs()
self._attr_color_temp = color_temperature_kelvin_to_mired(
self._device.light_color_temperature
)
self._attr_color_temp_kelvin = self._device.light_color_temperature
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn on the light."""
if (color_temp := kwargs.get(ATTR_COLOR_TEMP)) is not None:
self._device.light_color_temperature = color_temperature_mired_to_kelvin(
color_temp
)
if (color_temp := kwargs.get(ATTR_COLOR_TEMP_KELVIN)) is not None:
self._device.light_color_temperature = color_temp
await super().async_turn_on(**kwargs)

View File

@@ -65,7 +65,6 @@ class BalboaClimateEntity(BalboaEntity, ClimateEntity):
)
_attr_translation_key = DOMAIN
_attr_name = None
_enable_turn_on_off_backwards_compatibility = False
def __init__(self, client: SpaClient) -> None:
"""Initialize the climate entity."""

View File

@@ -38,7 +38,7 @@ class BalboaPumpFanEntity(BalboaEntity, FanEntity):
| FanEntityFeature.TURN_OFF
| FanEntityFeature.TURN_ON
)
_enable_turn_on_off_backwards_compatibility = False
_attr_translation_key = "pump"
def __init__(self, control: SpaControl) -> None:

View File

@@ -8,6 +8,7 @@ from aiohttp.client_exceptions import (
ClientConnectorError,
ClientOSError,
ServerTimeoutError,
WSMessageTypeError,
)
from mozart_api.exceptions import ApiException
from mozart_api.mozart_client import MozartClient
@@ -62,6 +63,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: BangOlufsenConfigEntry)
ServerTimeoutError,
ApiException,
TimeoutError,
WSMessageTypeError,
) as error:
await client.close_api_client()
raise ConfigEntryNotReady(f"Unable to connect to {entry.title}") from error

View File

@@ -210,3 +210,20 @@ BANG_OLUFSEN_WEBSOCKET_EVENT: Final[str] = f"{DOMAIN}_websocket_event"
CONNECTION_STATUS: Final[str] = "CONNECTION_STATUS"
# Beolink Converter NL/ML sources need to be transformed to upper case
BEOLINK_JOIN_SOURCES_TO_UPPER = (
"aux_a",
"cd",
"ph",
"radio",
"tp1",
"tp2",
)
BEOLINK_JOIN_SOURCES = (
*BEOLINK_JOIN_SOURCES_TO_UPPER,
"beoradio",
"deezer",
"spotify",
"tidal",
)

View File

@@ -6,6 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/bang_olufsen",
"integration_type": "device",
"iot_class": "local_push",
"requirements": ["mozart-api==4.1.1.116.3"],
"requirements": ["mozart-api==4.1.1.116.4"],
"zeroconf": ["_bangolufsen._tcp.local."]
}

View File

@@ -74,6 +74,8 @@ from .const import (
BANG_OLUFSEN_REPEAT_FROM_HA,
BANG_OLUFSEN_REPEAT_TO_HA,
BANG_OLUFSEN_STATES,
BEOLINK_JOIN_SOURCES,
BEOLINK_JOIN_SOURCES_TO_UPPER,
CONF_BEOLINK_JID,
CONNECTION_STATUS,
DOMAIN,
@@ -135,7 +137,10 @@ async def async_setup_entry(
platform.async_register_entity_service(
name="beolink_join",
schema={vol.Optional("beolink_jid"): jid_regex},
schema={
vol.Optional("beolink_jid"): jid_regex,
vol.Optional("source_id"): vol.In(BEOLINK_JOIN_SOURCES),
},
func="async_beolink_join",
)
@@ -985,12 +990,23 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
await self.async_beolink_leave()
# Custom actions:
async def async_beolink_join(self, beolink_jid: str | None = None) -> None:
async def async_beolink_join(
self, beolink_jid: str | None = None, source_id: str | None = None
) -> None:
"""Join a Beolink multi-room experience."""
# Touch to join
if beolink_jid is None:
await self._client.join_latest_beolink_experience()
else:
# Join a peer
elif beolink_jid and source_id is None:
await self._client.join_beolink_peer(jid=beolink_jid)
# Join a peer and select specific source
elif beolink_jid and source_id:
# Beolink Converter NL/ML sources need to be in upper case
if source_id in BEOLINK_JOIN_SOURCES_TO_UPPER:
source_id = source_id.upper()
await self._client.join_beolink_peer(jid=beolink_jid, source=source_id)
async def async_beolink_expand(
self, beolink_jids: list[str] | None = None, all_discovered: bool = False

View File

@@ -48,6 +48,23 @@ beolink_join:
example: 1111.2222222.33333333@products.bang-olufsen.com
selector:
text:
source_id:
required: false
example: tidal
selector:
select:
translation_key: "source_ids"
options:
- beoradio
- deezer
- spotify
- tidal
- radio
- tp1
- tp2
- cd
- aux_a
- ph
beolink_leave:
target:

View File

@@ -29,6 +29,22 @@
}
}
},
"selector": {
"source_ids": {
"options": {
"beoradio": "ASE Beoradio",
"deezer": "ASE / Mozart Deezer",
"spotify": "ASE / Mozart Spotify",
"tidal": "Mozart Tidal",
"aux_a": "Beolink Converter NL/ML AUX_A",
"cd": "Beolink Converter NL/ML CD",
"ph": "Beolink Converter NL/ML PH",
"radio": "Beolink Converter NL/ML RADIO",
"tp1": "Beolink Converter NL/ML TP1",
"tp2": "Beolink Converter NL/ML TP2"
}
}
},
"services": {
"beolink_allstandby": {
"name": "Beolink all standby",
@@ -61,6 +77,10 @@
"beolink_jid": {
"name": "Beolink JID",
"description": "Manually specify Beolink JID to join."
},
"source_id": {
"name": "Source",
"description": "Specify which source to join, behavior varies between hardware platforms. Source names prefaced by a platform name can only be used when connecting to that platform. For example \"ASE Beoradio\" can only be used when joining an ASE device, while ”ASE / Mozart Deezer” can be used with ASE or Mozart devices. A defined Beolink JID is required."
}
},
"sections": {

View File

@@ -4,7 +4,6 @@ from __future__ import annotations
from datetime import timedelta
from enum import StrEnum
from functools import partial
import logging
from typing import Literal, final
@@ -16,12 +15,6 @@ from homeassistant.const import STATE_OFF, STATE_ON, EntityCategory
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.deprecation import (
DeprecatedConstantEnum,
all_with_deprecated_constants,
check_if_deprecated_constant,
dir_with_deprecated_constants,
)
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.entity_component import EntityComponent
from homeassistant.helpers.typing import ConfigType
@@ -126,94 +119,7 @@ class BinarySensorDeviceClass(StrEnum):
DEVICE_CLASSES_SCHEMA = vol.All(vol.Lower, vol.Coerce(BinarySensorDeviceClass))
# DEVICE_CLASS* below are deprecated as of 2021.12
# use the BinarySensorDeviceClass enum instead.
DEVICE_CLASSES = [cls.value for cls in BinarySensorDeviceClass]
_DEPRECATED_DEVICE_CLASS_BATTERY = DeprecatedConstantEnum(
BinarySensorDeviceClass.BATTERY, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_BATTERY_CHARGING = DeprecatedConstantEnum(
BinarySensorDeviceClass.BATTERY_CHARGING, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_CO = DeprecatedConstantEnum(
BinarySensorDeviceClass.CO, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_COLD = DeprecatedConstantEnum(
BinarySensorDeviceClass.COLD, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_CONNECTIVITY = DeprecatedConstantEnum(
BinarySensorDeviceClass.CONNECTIVITY, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_DOOR = DeprecatedConstantEnum(
BinarySensorDeviceClass.DOOR, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_GARAGE_DOOR = DeprecatedConstantEnum(
BinarySensorDeviceClass.GARAGE_DOOR, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_GAS = DeprecatedConstantEnum(
BinarySensorDeviceClass.GAS, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_HEAT = DeprecatedConstantEnum(
BinarySensorDeviceClass.HEAT, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_LIGHT = DeprecatedConstantEnum(
BinarySensorDeviceClass.LIGHT, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_LOCK = DeprecatedConstantEnum(
BinarySensorDeviceClass.LOCK, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_MOISTURE = DeprecatedConstantEnum(
BinarySensorDeviceClass.MOISTURE, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_MOTION = DeprecatedConstantEnum(
BinarySensorDeviceClass.MOTION, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_MOVING = DeprecatedConstantEnum(
BinarySensorDeviceClass.MOVING, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_OCCUPANCY = DeprecatedConstantEnum(
BinarySensorDeviceClass.OCCUPANCY, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_OPENING = DeprecatedConstantEnum(
BinarySensorDeviceClass.OPENING, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_PLUG = DeprecatedConstantEnum(
BinarySensorDeviceClass.PLUG, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_POWER = DeprecatedConstantEnum(
BinarySensorDeviceClass.POWER, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_PRESENCE = DeprecatedConstantEnum(
BinarySensorDeviceClass.PRESENCE, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_PROBLEM = DeprecatedConstantEnum(
BinarySensorDeviceClass.PROBLEM, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_RUNNING = DeprecatedConstantEnum(
BinarySensorDeviceClass.RUNNING, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_SAFETY = DeprecatedConstantEnum(
BinarySensorDeviceClass.SAFETY, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_SMOKE = DeprecatedConstantEnum(
BinarySensorDeviceClass.SMOKE, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_SOUND = DeprecatedConstantEnum(
BinarySensorDeviceClass.SOUND, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_TAMPER = DeprecatedConstantEnum(
BinarySensorDeviceClass.TAMPER, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_UPDATE = DeprecatedConstantEnum(
BinarySensorDeviceClass.UPDATE, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_VIBRATION = DeprecatedConstantEnum(
BinarySensorDeviceClass.VIBRATION, "2025.1"
)
_DEPRECATED_DEVICE_CLASS_WINDOW = DeprecatedConstantEnum(
BinarySensorDeviceClass.WINDOW, "2025.1"
)
# mypy: disallow-any-generics
@@ -294,11 +200,3 @@ class BinarySensorEntity(Entity, cached_properties=CACHED_PROPERTIES_WITH_ATTR_)
if (is_on := self.is_on) is None:
return None
return STATE_ON if is_on else STATE_OFF
# These can be removed if no deprecated constant are in this module anymore
__getattr__ = partial(check_if_deprecated_constant, module_globals=globals())
__dir__ = partial(
dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
)
__all__ = all_with_deprecated_constants(globals())

View File

@@ -57,7 +57,6 @@ class BleBoxClimateEntity(BleBoxEntity[blebox_uniapi.climate.Climate], ClimateEn
| ClimateEntityFeature.TURN_ON
)
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_enable_turn_on_off_backwards_compatibility = False
@property
def hvac_modes(self):

View File

@@ -11,7 +11,7 @@ from blebox_uniapi.light import BleboxColorMode
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_COLOR_TEMP_KELVIN,
ATTR_EFFECT,
ATTR_RGB_COLOR,
ATTR_RGBW_COLOR,
@@ -22,6 +22,7 @@ from homeassistant.components.light import (
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import color as color_util
from . import BleBoxConfigEntry
from .entity import BleBoxEntity
@@ -58,8 +59,8 @@ COLOR_MODE_MAP = {
class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
"""Representation of BleBox lights."""
_attr_max_mireds = 370 # 1,000,000 divided by 2700 Kelvin = 370 Mireds
_attr_min_mireds = 154 # 1,000,000 divided by 6500 Kelvin = 154 Mireds
_attr_min_color_temp_kelvin = 2700 # 370 Mireds
_attr_max_color_temp_kelvin = 6500 # 154 Mireds
def __init__(self, feature: blebox_uniapi.light.Light) -> None:
"""Initialize a BleBox light."""
@@ -78,9 +79,9 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
return self._feature.brightness
@property
def color_temp(self):
"""Return color temperature."""
return self._feature.color_temp
def color_temp_kelvin(self) -> int:
"""Return the color temperature value in Kelvin."""
return color_util.color_temperature_mired_to_kelvin(self._feature.color_temp)
@property
def color_mode(self):
@@ -136,7 +137,7 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
rgbw = kwargs.get(ATTR_RGBW_COLOR)
brightness = kwargs.get(ATTR_BRIGHTNESS)
effect = kwargs.get(ATTR_EFFECT)
color_temp = kwargs.get(ATTR_COLOR_TEMP)
color_temp_kelvin = kwargs.get(ATTR_COLOR_TEMP_KELVIN)
rgbww = kwargs.get(ATTR_RGBWW_COLOR)
feature = self._feature
value = feature.sensible_on_value
@@ -144,9 +145,10 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
if rgbw is not None:
value = list(rgbw)
if color_temp is not None:
if color_temp_kelvin is not None:
value = feature.return_color_temp_with_brightness(
int(color_temp), self.brightness
int(color_util.color_temperature_kelvin_to_mired(color_temp_kelvin)),
self.brightness,
)
if rgbww is not None:
@@ -158,9 +160,12 @@ class BleBoxLightEntity(BleBoxEntity[blebox_uniapi.light.Light], LightEntity):
value = list(rgb)
if brightness is not None:
if self.color_mode == ATTR_COLOR_TEMP:
if self.color_mode == ColorMode.COLOR_TEMP:
value = feature.return_color_temp_with_brightness(
self.color_temp, brightness
color_util.color_temperature_kelvin_to_mired(
self.color_temp_kelvin
),
brightness,
)
else:
value = feature.apply_brightness(value, brightness)

View File

@@ -5,7 +5,7 @@ from __future__ import annotations
import voluptuous as vol
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import ATTR_DEVICE_ID, CONF_PIN
from homeassistant.const import CONF_PIN
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import config_validation as cv
@@ -13,11 +13,6 @@ from homeassistant.helpers import config_validation as cv
from .const import ATTR_CONFIG_ENTRY_ID, DOMAIN, SERVICE_SEND_PIN
from .coordinator import BlinkConfigEntry
SERVICE_UPDATE_SCHEMA = vol.Schema(
{
vol.Required(ATTR_DEVICE_ID): vol.All(cv.ensure_list, [cv.string]),
}
)
SERVICE_SEND_PIN_SCHEMA = vol.Schema(
{
vol.Required(ATTR_CONFIG_ENTRY_ID): vol.All(cv.ensure_list, [cv.string]),

View File

@@ -14,7 +14,6 @@ from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN
from .services import setup_services
CONFIG_SCHEMA = cv.config_entry_only_config_schema(DOMAIN)
@@ -36,7 +35,6 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Bluesound."""
if DOMAIN not in hass.data:
hass.data[DOMAIN] = []
setup_services(hass)
return True

View File

@@ -6,7 +6,7 @@
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/bluesound",
"iot_class": "local_polling",
"requirements": ["pyblu==1.0.4"],
"requirements": ["pyblu==2.0.0"],
"zeroconf": [
{
"type": "_musc._tcp.local."

View File

@@ -28,18 +28,26 @@ from homeassistant.const import CONF_HOST, CONF_HOSTS, CONF_NAME, CONF_PORT
from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant
from homeassistant.data_entry_flow import FlowResultType
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers import config_validation as cv, issue_registry as ir
from homeassistant.helpers import (
config_validation as cv,
entity_platform,
issue_registry as ir,
)
from homeassistant.helpers.device_registry import (
CONNECTION_NETWORK_MAC,
DeviceInfo,
format_mac,
)
from homeassistant.helpers.dispatcher import (
async_dispatcher_connect,
async_dispatcher_send,
)
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
import homeassistant.util.dt as dt_util
from .const import ATTR_BLUESOUND_GROUP, ATTR_MASTER, DOMAIN, INTEGRATION_TITLE
from .utils import format_unique_id
from .utils import dispatcher_join_signal, dispatcher_unjoin_signal, format_unique_id
if TYPE_CHECKING:
from . import BluesoundConfigEntry
@@ -51,6 +59,11 @@ SCAN_INTERVAL = timedelta(minutes=15)
DATA_BLUESOUND = DOMAIN
DEFAULT_PORT = 11000
SERVICE_CLEAR_TIMER = "clear_sleep_timer"
SERVICE_JOIN = "join"
SERVICE_SET_TIMER = "set_sleep_timer"
SERVICE_UNJOIN = "unjoin"
NODE_OFFLINE_CHECK_TIMEOUT = 180
NODE_RETRY_INITIATION = timedelta(minutes=3)
@@ -130,6 +143,18 @@ async def async_setup_entry(
config_entry.runtime_data.sync_status,
)
platform = entity_platform.async_get_current_platform()
platform.async_register_entity_service(
SERVICE_SET_TIMER, None, "async_increase_timer"
)
platform.async_register_entity_service(
SERVICE_CLEAR_TIMER, None, "async_clear_timer"
)
platform.async_register_entity_service(
SERVICE_JOIN, {vol.Required(ATTR_MASTER): cv.entity_id}, "async_join"
)
platform.async_register_entity_service(SERVICE_UNJOIN, None, "async_unjoin")
hass.data[DATA_BLUESOUND].append(bluesound_player)
async_add_entities([bluesound_player], update_before_add=True)
@@ -175,13 +200,12 @@ class BluesoundPlayer(MediaPlayerEntity):
self._status: Status | None = None
self._inputs: list[Input] = []
self._presets: list[Preset] = []
self._muted = False
self._master: BluesoundPlayer | None = None
self._is_master = False
self._group_name: str | None = None
self._group_list: list[str] = []
self._bluesound_device_name = sync_status.name
self._player = player
self._is_leader = False
self._leader: BluesoundPlayer | None = None
self._attr_unique_id = format_unique_id(sync_status.mac, port)
# there should always be one player with the default port per mac
@@ -250,6 +274,22 @@ class BluesoundPlayer(MediaPlayerEntity):
name=f"bluesound.poll_sync_status_loop_{self.host}:{self.port}",
)
assert self._sync_status.id is not None
self.async_on_remove(
async_dispatcher_connect(
self.hass,
dispatcher_join_signal(self.entity_id),
self.async_add_follower,
)
)
self.async_on_remove(
async_dispatcher_connect(
self.hass,
dispatcher_unjoin_signal(self._sync_status.id),
self.async_remove_follower,
)
)
async def async_will_remove_from_hass(self) -> None:
"""Stop the polling task."""
await super().async_will_remove_from_hass()
@@ -317,25 +357,25 @@ class BluesoundPlayer(MediaPlayerEntity):
self._group_list = self.rebuild_bluesound_group()
if sync_status.master is not None:
self._is_master = False
master_id = f"{sync_status.master.ip}:{sync_status.master.port}"
master_device = [
if sync_status.leader is not None:
self._is_leader = False
leader_id = f"{sync_status.leader.ip}:{sync_status.leader.port}"
leader_device = [
device
for device in self.hass.data[DATA_BLUESOUND]
if device.id == master_id
if device.id == leader_id
]
if master_device and master_id != self.id:
self._master = master_device[0]
if leader_device and leader_id != self.id:
self._leader = leader_device[0]
else:
self._master = None
_LOGGER.error("Master not found %s", master_id)
self._leader = None
_LOGGER.error("Leader not found %s", leader_id)
else:
if self._master is not None:
self._master = None
slaves = self._sync_status.slaves
self._is_master = slaves is not None
if self._leader is not None:
self._leader = None
followers = self._sync_status.followers
self._is_leader = followers is not None
self.async_write_ha_state()
@@ -355,7 +395,7 @@ class BluesoundPlayer(MediaPlayerEntity):
if self._status is None:
return MediaPlayerState.OFF
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return MediaPlayerState.IDLE
match self._status.state:
@@ -369,7 +409,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def media_title(self) -> str | None:
"""Title of current playing media."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
return self._status.name
@@ -380,7 +420,7 @@ class BluesoundPlayer(MediaPlayerEntity):
if self._status is None:
return None
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return self._group_name
return self._status.artist
@@ -388,7 +428,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def media_album_name(self) -> str | None:
"""Artist of current playing media (Music track only)."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
return self._status.album
@@ -396,7 +436,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def media_image_url(self) -> str | None:
"""Image url of current playing media."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
url = self._status.image
@@ -411,7 +451,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def media_position(self) -> int | None:
"""Position of current playing media in seconds."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
mediastate = self.state
@@ -430,7 +470,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def media_duration(self) -> int | None:
"""Duration of current playing media in seconds."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
duration = self._status.total_seconds
@@ -489,7 +529,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def source_list(self) -> list[str] | None:
"""List of available input sources."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
sources = [x.text for x in self._inputs]
@@ -500,7 +540,7 @@ class BluesoundPlayer(MediaPlayerEntity):
@property
def source(self) -> str | None:
"""Name of the current input source."""
if self._status is None or (self.is_grouped and not self.is_master):
if self._status is None or (self.is_grouped and not self.is_leader):
return None
if self._status.input_id is not None:
@@ -520,7 +560,7 @@ class BluesoundPlayer(MediaPlayerEntity):
if self._status is None:
return MediaPlayerEntityFeature(0)
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return (
MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.VOLUME_SET
@@ -560,14 +600,17 @@ class BluesoundPlayer(MediaPlayerEntity):
return supported
@property
def is_master(self) -> bool:
"""Return true if player is a coordinator."""
return self._is_master
def is_leader(self) -> bool:
"""Return true if player is leader of a group."""
return self._sync_status.followers is not None
@property
def is_grouped(self) -> bool:
"""Return true if player is a coordinator."""
return self._master is not None or self._is_master
"""Return true if player is member or leader of a group."""
return (
self._sync_status.followers is not None
or self._sync_status.leader is not None
)
@property
def shuffle(self) -> bool:
@@ -580,25 +623,25 @@ class BluesoundPlayer(MediaPlayerEntity):
async def async_join(self, master: str) -> None:
"""Join the player to a group."""
master_device = [
device
for device in self.hass.data[DATA_BLUESOUND]
if device.entity_id == master
]
if master == self.entity_id:
raise ServiceValidationError("Cannot join player to itself")
if len(master_device) > 0:
if self.id == master_device[0].id:
raise ServiceValidationError("Cannot join player to itself")
_LOGGER.debug("Trying to join player: %s", self.id)
async_dispatcher_send(
self.hass, dispatcher_join_signal(master), self.host, self.port
)
_LOGGER.debug(
"Trying to join player: %s to master: %s",
self.id,
master_device[0].id,
)
async def async_unjoin(self) -> None:
"""Unjoin the player from a group."""
if self._sync_status.leader is None:
return
await master_device[0].async_add_slave(self)
else:
_LOGGER.error("Master not found %s", master_device)
leader_id = f"{self._sync_status.leader.ip}:{self._sync_status.leader.port}"
_LOGGER.debug("Trying to unjoin player: %s", self.id)
async_dispatcher_send(
self.hass, dispatcher_unjoin_signal(leader_id), self.host, self.port
)
@property
def extra_state_attributes(self) -> dict[str, Any] | None:
@@ -607,31 +650,31 @@ class BluesoundPlayer(MediaPlayerEntity):
if self._group_list:
attributes = {ATTR_BLUESOUND_GROUP: self._group_list}
attributes[ATTR_MASTER] = self._is_master
attributes[ATTR_MASTER] = self.is_leader
return attributes
def rebuild_bluesound_group(self) -> list[str]:
"""Rebuild the list of entities in speaker group."""
if self.sync_status.master is None and self.sync_status.slaves is None:
if self.sync_status.leader is None and self.sync_status.followers is None:
return []
player_entities: list[BluesoundPlayer] = self.hass.data[DATA_BLUESOUND]
leader_sync_status: SyncStatus | None = None
if self.sync_status.master is None:
if self.sync_status.leader is None:
leader_sync_status = self.sync_status
else:
required_id = f"{self.sync_status.master.ip}:{self.sync_status.master.port}"
required_id = f"{self.sync_status.leader.ip}:{self.sync_status.leader.port}"
for x in player_entities:
if x.sync_status.id == required_id:
leader_sync_status = x.sync_status
break
if leader_sync_status is None or leader_sync_status.slaves is None:
if leader_sync_status is None or leader_sync_status.followers is None:
return []
follower_ids = [f"{x.ip}:{x.port}" for x in leader_sync_status.slaves]
follower_ids = [f"{x.ip}:{x.port}" for x in leader_sync_status.followers]
follower_names = [
x.sync_status.name
for x in player_entities
@@ -640,21 +683,13 @@ class BluesoundPlayer(MediaPlayerEntity):
follower_names.insert(0, leader_sync_status.name)
return follower_names
async def async_unjoin(self) -> None:
"""Unjoin the player from a group."""
if self._master is None:
return
async def async_add_follower(self, host: str, port: int) -> None:
"""Add follower to leader."""
await self._player.add_follower(host, port)
_LOGGER.debug("Trying to unjoin player: %s", self.id)
await self._master.async_remove_slave(self)
async def async_add_slave(self, slave_device: BluesoundPlayer) -> None:
"""Add slave to master."""
await self._player.add_slave(slave_device.host, slave_device.port)
async def async_remove_slave(self, slave_device: BluesoundPlayer) -> None:
"""Remove slave to master."""
await self._player.remove_slave(slave_device.host, slave_device.port)
async def async_remove_follower(self, host: str, port: int) -> None:
"""Remove follower to leader."""
await self._player.remove_follower(host, port)
async def async_increase_timer(self) -> int:
"""Increase sleep time on player."""
@@ -672,7 +707,7 @@ class BluesoundPlayer(MediaPlayerEntity):
async def async_select_source(self, source: str) -> None:
"""Select input source."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
# presets and inputs might have the same name; presets have priority
@@ -691,49 +726,49 @@ class BluesoundPlayer(MediaPlayerEntity):
async def async_clear_playlist(self) -> None:
"""Clear players playlist."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.clear()
async def async_media_next_track(self) -> None:
"""Send media_next command to media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.skip()
async def async_media_previous_track(self) -> None:
"""Send media_previous command to media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.back()
async def async_media_play(self) -> None:
"""Send media_play command to media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.play()
async def async_media_pause(self) -> None:
"""Send media_pause command to media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.pause()
async def async_media_stop(self) -> None:
"""Send stop command."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.stop()
async def async_media_seek(self, position: float) -> None:
"""Send media_seek command to media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
await self._player.play(seek=int(position))
@@ -742,7 +777,7 @@ class BluesoundPlayer(MediaPlayerEntity):
self, media_type: MediaType | str, media_id: str, **kwargs: Any
) -> None:
"""Send the play_media command to the media player."""
if self.is_grouped and not self.is_master:
if self.is_grouped and not self.is_leader:
return
if media_source.is_media_source_id(media_id):

View File

@@ -1,68 +0,0 @@
"""Support for Bluesound devices."""
from __future__ import annotations
from typing import NamedTuple
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation as cv
from .const import ATTR_MASTER, DOMAIN
SERVICE_CLEAR_TIMER = "clear_sleep_timer"
SERVICE_JOIN = "join"
SERVICE_SET_TIMER = "set_sleep_timer"
SERVICE_UNJOIN = "unjoin"
BS_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.entity_ids})
BS_JOIN_SCHEMA = BS_SCHEMA.extend({vol.Required(ATTR_MASTER): cv.entity_id})
class ServiceMethodDetails(NamedTuple):
"""Details for SERVICE_TO_METHOD mapping."""
method: str
schema: vol.Schema
SERVICE_TO_METHOD = {
SERVICE_JOIN: ServiceMethodDetails(method="async_join", schema=BS_JOIN_SCHEMA),
SERVICE_UNJOIN: ServiceMethodDetails(method="async_unjoin", schema=BS_SCHEMA),
SERVICE_SET_TIMER: ServiceMethodDetails(
method="async_increase_timer", schema=BS_SCHEMA
),
SERVICE_CLEAR_TIMER: ServiceMethodDetails(
method="async_clear_timer", schema=BS_SCHEMA
),
}
def setup_services(hass: HomeAssistant) -> None:
"""Set up services for Bluesound component."""
async def async_service_handler(service: ServiceCall) -> None:
"""Map services to method of Bluesound devices."""
if not (method := SERVICE_TO_METHOD.get(service.service)):
return
params = {
key: value for key, value in service.data.items() if key != ATTR_ENTITY_ID
}
if entity_ids := service.data.get(ATTR_ENTITY_ID):
target_players = [
player for player in hass.data[DOMAIN] if player.entity_id in entity_ids
]
else:
target_players = hass.data[DOMAIN]
for player in target_players:
await getattr(player, method.method)(**params)
for service, method in SERVICE_TO_METHOD.items():
hass.services.async_register(
DOMAIN, service, async_service_handler, schema=method.schema
)

View File

@@ -6,3 +6,16 @@ from homeassistant.helpers.device_registry import format_mac
def format_unique_id(mac: str, port: int) -> str:
"""Generate a unique ID based on the MAC address and port number."""
return f"{format_mac(mac)}-{port}"
def dispatcher_join_signal(entity_id: str) -> str:
"""Join an entity ID with a signal."""
return f"bluesound_join_{entity_id}"
def dispatcher_unjoin_signal(leader_id: str) -> str:
"""Unjoin an entity ID with a signal.
Id is ip_address:port. This can be obtained from sync_status.id.
"""
return f"bluesound_unjoin_{leader_id}"

View File

@@ -2,12 +2,10 @@
from __future__ import annotations
from dataclasses import dataclass
import logging
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_DEVICE_ID, CONF_ENTITY_ID, CONF_NAME, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import (
@@ -18,7 +16,7 @@ from homeassistant.helpers import (
import homeassistant.helpers.config_validation as cv
from .const import ATTR_VIN, CONF_READ_ONLY, DOMAIN
from .coordinator import BMWDataUpdateCoordinator
from .coordinator import BMWConfigEntry, BMWDataUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
@@ -49,19 +47,9 @@ PLATFORMS = [
SERVICE_UPDATE_STATE = "update_state"
type BMWConfigEntry = ConfigEntry[BMWData]
@dataclass
class BMWData:
"""Class to store BMW runtime data."""
coordinator: BMWDataUpdateCoordinator
@callback
def _async_migrate_options_from_data_if_missing(
hass: HomeAssistant, entry: ConfigEntry
hass: HomeAssistant, entry: BMWConfigEntry
) -> None:
data = dict(entry.data)
options = dict(entry.options)
@@ -85,23 +73,29 @@ async def _async_migrate_entries(
@callback
def update_unique_id(entry: er.RegistryEntry) -> dict[str, str] | None:
replacements = {
"charging_level_hv": "fuel_and_battery.remaining_battery_percent",
"fuel_percent": "fuel_and_battery.remaining_fuel_percent",
"ac_current_limit": "charging_profile.ac_current_limit",
"charging_start_time": "fuel_and_battery.charging_start_time",
"charging_end_time": "fuel_and_battery.charging_end_time",
"charging_status": "fuel_and_battery.charging_status",
"charging_target": "fuel_and_battery.charging_target",
"remaining_battery_percent": "fuel_and_battery.remaining_battery_percent",
"remaining_range_total": "fuel_and_battery.remaining_range_total",
"remaining_range_electric": "fuel_and_battery.remaining_range_electric",
"remaining_range_fuel": "fuel_and_battery.remaining_range_fuel",
"remaining_fuel": "fuel_and_battery.remaining_fuel",
"remaining_fuel_percent": "fuel_and_battery.remaining_fuel_percent",
"activity": "climate.activity",
Platform.SENSOR.value: {
"charging_level_hv": "fuel_and_battery.remaining_battery_percent",
"fuel_percent": "fuel_and_battery.remaining_fuel_percent",
"ac_current_limit": "charging_profile.ac_current_limit",
"charging_start_time": "fuel_and_battery.charging_start_time",
"charging_end_time": "fuel_and_battery.charging_end_time",
"charging_status": "fuel_and_battery.charging_status",
"charging_target": "fuel_and_battery.charging_target",
"remaining_battery_percent": "fuel_and_battery.remaining_battery_percent",
"remaining_range_total": "fuel_and_battery.remaining_range_total",
"remaining_range_electric": "fuel_and_battery.remaining_range_electric",
"remaining_range_fuel": "fuel_and_battery.remaining_range_fuel",
"remaining_fuel": "fuel_and_battery.remaining_fuel",
"remaining_fuel_percent": "fuel_and_battery.remaining_fuel_percent",
"activity": "climate.activity",
}
}
if (key := entry.unique_id.split("-")[-1]) in replacements:
new_unique_id = entry.unique_id.replace(key, replacements[key])
if (key := entry.unique_id.split("-")[-1]) in replacements.get(
entry.domain, []
):
new_unique_id = entry.unique_id.replace(
key, replacements[entry.domain][key]
)
_LOGGER.debug(
"Migrating entity '%s' unique_id from '%s' to '%s'",
entry.entity_id,
@@ -127,7 +121,7 @@ async def _async_migrate_entries(
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: BMWConfigEntry) -> bool:
"""Set up BMW Connected Drive from a config entry."""
_async_migrate_options_from_data_if_missing(hass, entry)
@@ -137,11 +131,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# Set up one data coordinator per account/config entry
coordinator = BMWDataUpdateCoordinator(
hass,
entry=entry,
config_entry=entry,
)
await coordinator.async_config_entry_first_refresh()
entry.runtime_data = BMWData(coordinator)
entry.runtime_data = coordinator
# Set up all platforms except notify
await hass.config_entries.async_forward_entry_setups(
@@ -175,7 +169,7 @@ 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: BMWConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(

View File

@@ -26,6 +26,8 @@ from .const import UNIT_MAP
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
@@ -201,7 +203,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the BMW binary sensors from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities = [
BMWBinarySensor(coordinator, vehicle, description, hass.config.units)

View File

@@ -16,12 +16,14 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
from .entity import BMWBaseEntity
if TYPE_CHECKING:
from .coordinator import BMWDataUpdateCoordinator
PARALLEL_UPDATES = 1
_LOGGER = logging.getLogger(__name__)
@@ -53,7 +55,6 @@ BUTTON_TYPES: tuple[BMWButtonEntityDescription, ...] = (
BMWButtonEntityDescription(
key="deactivate_air_conditioning",
translation_key="deactivate_air_conditioning",
name="Deactivate air conditioning",
remote_function=lambda vehicle: vehicle.remote_services.trigger_remote_air_conditioning_stop(),
is_available=lambda vehicle: vehicle.is_remote_climate_stop_enabled,
),
@@ -71,7 +72,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the BMW buttons from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities: list[BMWButton] = []
@@ -109,6 +110,10 @@ class BMWButton(BMWBaseEntity, ButtonEntity):
try:
await self.entity_description.remote_function(self.vehicle)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
self.coordinator.async_update_listeners()

View File

@@ -18,7 +18,6 @@ import voluptuous as vol
from homeassistant.config_entries import (
SOURCE_REAUTH,
SOURCE_RECONFIGURE,
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
OptionsFlow,
@@ -39,6 +38,7 @@ from .const import (
CONF_READ_ONLY,
CONF_REFRESH_TOKEN,
)
from .coordinator import BMWConfigEntry
DATA_SCHEMA = vol.Schema(
{
@@ -53,6 +53,12 @@ DATA_SCHEMA = vol.Schema(
},
extra=vol.REMOVE_EXTRA,
)
RECONFIGURE_SCHEMA = vol.Schema(
{
vol.Required(CONF_PASSWORD): str,
},
extra=vol.REMOVE_EXTRA,
)
CAPTCHA_SCHEMA = vol.Schema(
{
vol.Required(CONF_CAPTCHA_TOKEN): str,
@@ -111,9 +117,8 @@ class BMWConfigFlow(ConfigFlow, domain=DOMAIN):
unique_id = f"{user_input[CONF_REGION]}-{user_input[CONF_USERNAME]}"
await self.async_set_unique_id(unique_id)
if self.source in {SOURCE_REAUTH, SOURCE_RECONFIGURE}:
self._abort_if_unique_id_mismatch(reason="account_mismatch")
else:
# Unique ID cannot change for reauth/reconfigure
if self.source not in {SOURCE_REAUTH, SOURCE_RECONFIGURE}:
self._abort_if_unique_id_configured()
# Store user input for later use
@@ -166,19 +171,39 @@ class BMWConfigFlow(ConfigFlow, domain=DOMAIN):
return self.async_show_form(step_id="user", data_schema=schema, errors=errors)
async def async_step_change_password(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Show the change password step."""
existing_data = (
dict(self._existing_entry_data) if self._existing_entry_data else {}
)
if user_input is not None:
return await self.async_step_user(existing_data | user_input)
return self.async_show_form(
step_id="change_password",
data_schema=RECONFIGURE_SCHEMA,
description_placeholders={
CONF_USERNAME: existing_data[CONF_USERNAME],
CONF_REGION: existing_data[CONF_REGION],
},
)
async def async_step_reauth(
self, entry_data: Mapping[str, Any]
) -> ConfigFlowResult:
"""Handle configuration by re-auth."""
self._existing_entry_data = entry_data
return await self.async_step_user()
return await self.async_step_change_password()
async def async_step_reconfigure(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle a reconfiguration flow initialized by the user."""
self._existing_entry_data = self._get_reconfigure_entry().data
return await self.async_step_user()
return await self.async_step_change_password()
async def async_step_captcha(
self, user_input: dict[str, Any] | None = None
@@ -199,7 +224,7 @@ class BMWConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod
@callback
def async_get_options_flow(
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
) -> BMWOptionsFlow:
"""Return a MyBMW option flow."""
return BMWOptionsFlow()

View File

@@ -22,39 +22,51 @@ from homeassistant.exceptions import ConfigEntryAuthFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.util.ssl import get_default_context
from .const import CONF_GCID, CONF_READ_ONLY, CONF_REFRESH_TOKEN, DOMAIN, SCAN_INTERVALS
from .const import (
CONF_GCID,
CONF_READ_ONLY,
CONF_REFRESH_TOKEN,
DOMAIN as BMW_DOMAIN,
SCAN_INTERVALS,
)
_LOGGER = logging.getLogger(__name__)
type BMWConfigEntry = ConfigEntry[BMWDataUpdateCoordinator]
class BMWDataUpdateCoordinator(DataUpdateCoordinator[None]):
"""Class to manage fetching BMW data."""
account: MyBMWAccount
config_entry: BMWConfigEntry
def __init__(self, hass: HomeAssistant, *, entry: ConfigEntry) -> None:
def __init__(self, hass: HomeAssistant, *, config_entry: BMWConfigEntry) -> None:
"""Initialize account-wide BMW data updater."""
self.account = MyBMWAccount(
entry.data[CONF_USERNAME],
entry.data[CONF_PASSWORD],
get_region_from_name(entry.data[CONF_REGION]),
config_entry.data[CONF_USERNAME],
config_entry.data[CONF_PASSWORD],
get_region_from_name(config_entry.data[CONF_REGION]),
observer_position=GPSPosition(hass.config.latitude, hass.config.longitude),
verify=get_default_context(),
)
self.read_only = entry.options[CONF_READ_ONLY]
self._entry = entry
self.read_only: bool = config_entry.options[CONF_READ_ONLY]
if CONF_REFRESH_TOKEN in entry.data:
if CONF_REFRESH_TOKEN in config_entry.data:
self.account.set_refresh_token(
refresh_token=entry.data[CONF_REFRESH_TOKEN],
gcid=entry.data.get(CONF_GCID),
refresh_token=config_entry.data[CONF_REFRESH_TOKEN],
gcid=config_entry.data.get(CONF_GCID),
)
super().__init__(
hass,
_LOGGER,
name=f"{DOMAIN}-{entry.data['username']}",
update_interval=timedelta(seconds=SCAN_INTERVALS[entry.data[CONF_REGION]]),
config_entry=config_entry,
name=f"{BMW_DOMAIN}-{config_entry.data[CONF_USERNAME]}",
update_interval=timedelta(
seconds=SCAN_INTERVALS[config_entry.data[CONF_REGION]]
),
)
# Default to false on init so _async_update_data logic works
@@ -69,18 +81,29 @@ class BMWDataUpdateCoordinator(DataUpdateCoordinator[None]):
except MyBMWCaptchaMissingError as err:
# If a captcha is required (user/password login flow), always trigger the reauth flow
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,
translation_domain=BMW_DOMAIN,
translation_key="missing_captcha",
) from err
except MyBMWAuthError as err:
# Allow one retry interval before raising AuthFailed to avoid flaky API issues
if self.last_update_success:
raise UpdateFailed(err) from err
raise UpdateFailed(
translation_domain=BMW_DOMAIN,
translation_key="update_failed",
translation_placeholders={"exception": str(err)},
) from err
# Clear refresh token and trigger reauth if previous update failed as well
self._update_config_entry_refresh_token(None)
raise ConfigEntryAuthFailed(err) from err
raise ConfigEntryAuthFailed(
translation_domain=BMW_DOMAIN,
translation_key="invalid_auth",
) from err
except (MyBMWAPIError, RequestError) as err:
raise UpdateFailed(err) from err
raise UpdateFailed(
translation_domain=BMW_DOMAIN,
translation_key="update_failed",
translation_placeholders={"exception": str(err)},
) from err
if self.account.refresh_token != old_refresh_token:
self._update_config_entry_refresh_token(self.account.refresh_token)
@@ -88,9 +111,9 @@ class BMWDataUpdateCoordinator(DataUpdateCoordinator[None]):
def _update_config_entry_refresh_token(self, refresh_token: str | None) -> None:
"""Update or delete the refresh_token in the Config Entry."""
data = {
**self._entry.data,
**self.config_entry.data,
CONF_REFRESH_TOKEN: refresh_token,
}
if not refresh_token:
data.pop(CONF_REFRESH_TOKEN)
self.hass.config_entries.async_update_entry(self._entry, data=data)
self.hass.config_entries.async_update_entry(self.config_entry, data=data)

View File

@@ -16,6 +16,8 @@ from .const import ATTR_DIRECTION
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
@@ -25,7 +27,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW tracker from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities: list[BMWDeviceTracker] = []
for vehicle in coordinator.account.vehicles:
@@ -47,7 +49,7 @@ class BMWDeviceTracker(BMWBaseEntity, TrackerEntity):
_attr_force_update = False
_attr_translation_key = "car"
_attr_icon = "mdi:car"
_attr_name = None
def __init__(
self,
@@ -56,9 +58,7 @@ class BMWDeviceTracker(BMWBaseEntity, TrackerEntity):
) -> None:
"""Initialize the Tracker."""
super().__init__(coordinator, vehicle)
self._attr_unique_id = vehicle.vin
self._attr_name = None
@property
def extra_state_attributes(self) -> dict[str, Any]:

View File

@@ -16,6 +16,8 @@ from homeassistant.helpers.device_registry import DeviceEntry
from . import BMWConfigEntry
from .const import CONF_REFRESH_TOKEN
PARALLEL_UPDATES = 1
if TYPE_CHECKING:
from bimmer_connected.vehicle import MyBMWVehicle
@@ -49,7 +51,7 @@ async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: BMWConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
coordinator.account.config.log_responses = True
await coordinator.account.get_vehicles(force_init=True)
@@ -75,7 +77,7 @@ async def async_get_device_diagnostics(
hass: HomeAssistant, config_entry: BMWConfigEntry, device: DeviceEntry
) -> dict[str, Any]:
"""Return diagnostics for a device."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
coordinator.account.config.log_responses = True
await coordinator.account.get_vehicles(force_init=True)

View File

@@ -14,11 +14,14 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 1
DOOR_LOCK_STATE = "door_lock_state"
_LOGGER = logging.getLogger(__name__)
@@ -28,7 +31,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW lock from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
if not coordinator.read_only:
async_add_entities(
@@ -67,7 +70,11 @@ class BMWLock(BMWBaseEntity, LockEntity):
# Set the state to unknown if the command fails
self._attr_is_locked = None
self.async_write_ha_state()
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
finally:
# Always update the listeners to get the latest state
self.coordinator.async_update_listeners()
@@ -87,7 +94,11 @@ class BMWLock(BMWBaseEntity, LockEntity):
# Set the state to unknown if the command fails
self._attr_is_locked = None
self.async_write_ha_state()
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
finally:
# Always update the listeners to get the latest state
self.coordinator.async_update_listeners()

View File

@@ -20,7 +20,9 @@ from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from . import DOMAIN, BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
PARALLEL_UPDATES = 1
ATTR_LOCATION_ATTRIBUTES = ["street", "city", "postal_code", "country"]
@@ -51,7 +53,7 @@ def get_service(
targets = {}
if (
config_entry
and (coordinator := config_entry.runtime_data.coordinator)
and (coordinator := config_entry.runtime_data)
and not coordinator.read_only
):
targets.update({v.name: v for v in coordinator.account.vehicles})
@@ -90,7 +92,7 @@ class BMWNotificationService(BaseNotificationService):
except (vol.Invalid, TypeError, ValueError) as ex:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_domain=BMW_DOMAIN,
translation_key="invalid_poi",
translation_placeholders={
"poi_exception": str(ex),
@@ -104,4 +106,8 @@ class BMWNotificationService(BaseNotificationService):
try:
await vehicle.remote_services.trigger_send_poi(poi)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex

View File

@@ -18,10 +18,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 1
_LOGGER = logging.getLogger(__name__)
@@ -59,7 +61,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW number from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities: list[BMWNumber] = []
@@ -107,6 +109,10 @@ class BMWNumber(BMWBaseEntity, NumberEntity):
try:
await self.entity_description.remote_service(self.vehicle, value)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
self.coordinator.async_update_listeners()

View File

@@ -15,10 +15,12 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 1
_LOGGER = logging.getLogger(__name__)
@@ -66,7 +68,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW lock from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities: list[BMWSelect] = []
@@ -121,6 +123,10 @@ class BMWSelect(BMWBaseEntity, SelectEntity):
try:
await self.entity_description.remote_service(self.vehicle, option)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
self.coordinator.async_update_listeners()

View File

@@ -34,6 +34,8 @@ from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
@@ -191,7 +193,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW sensors from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities = [
BMWSensor(coordinator, vehicle, description)

View File

@@ -2,10 +2,16 @@
"config": {
"step": {
"user": {
"description": "Connect to your MyBMW/MINI Connected account to retrieve vehicle data.",
"data": {
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]",
"region": "ConnectedDrive Region"
},
"data_description": {
"username": "The email address of your MyBMW/MINI Connected account.",
"password": "The password of your MyBMW/MINI Connected account.",
"region": "The region of your MyBMW/MINI Connected account."
}
},
"captcha": {
@@ -17,6 +23,15 @@
"data_description": {
"captcha_token": "One-time token retrieved from the captcha challenge."
}
},
"change_password": {
"description": "Update your MyBMW/MINI Connected password for account `{username}` in region `{region}`.",
"data": {
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"password": "[%key:component::bmw_connected_drive::config::step::user::data_description::password%]"
}
}
},
"error": {
@@ -27,15 +42,17 @@
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_account%]",
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]",
"reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]",
"account_mismatch": "Username and region are not allowed to change"
"reconfigure_successful": "[%key:common::config_flow::abort::reconfigure_successful%]"
}
},
"options": {
"step": {
"account_options": {
"data": {
"read_only": "Read-only (only sensors and notify, no execution of services, no lock)"
"read_only": "Read-only mode"
},
"data_description": {
"read_only": "Only retrieve values and send POI data, but don't offer any services that can change the vehicle state."
}
}
}
@@ -77,6 +94,9 @@
"activate_air_conditioning": {
"name": "Activate air conditioning"
},
"deactivate_air_conditioning": {
"name": "Deactivate air conditioning"
},
"find_vehicle": {
"name": "Find vehicle"
}
@@ -214,6 +234,15 @@
},
"missing_captcha": {
"message": "Login requires captcha validation"
},
"invalid_auth": {
"message": "[%key:common::config_flow::error::invalid_auth%]"
},
"remote_service_error": {
"message": "Error executing remote service on vehicle. {exception}"
},
"update_failed": {
"message": "Error updating vehicle data. {exception}"
}
}
}

View File

@@ -14,10 +14,12 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWConfigEntry
from . import DOMAIN as BMW_DOMAIN, BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
PARALLEL_UPDATES = 1
_LOGGER = logging.getLogger(__name__)
@@ -67,7 +69,7 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW switch from config entry."""
coordinator = config_entry.runtime_data.coordinator
coordinator = config_entry.runtime_data
entities: list[BMWSwitch] = []
@@ -109,8 +111,11 @@ class BMWSwitch(BMWBaseEntity, SwitchEntity):
try:
await self.entity_description.remote_service_on(self.vehicle)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
self.coordinator.async_update_listeners()
async def async_turn_off(self, **kwargs: Any) -> None:
@@ -118,6 +123,9 @@ class BMWSwitch(BMWBaseEntity, SwitchEntity):
try:
await self.entity_description.remote_service_off(self.vehicle)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
raise HomeAssistantError(
translation_domain=BMW_DOMAIN,
translation_key="remote_service_error",
translation_placeholders={"exception": str(ex)},
) from ex
self.coordinator.async_update_listeners()

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