Compare commits

...

778 Commits

Author SHA1 Message Date
jbouwh
ed66686e08 Migrate paho-mqtt client to version 2.1.0 2024-07-18 07:20:55 +00:00
J. Nick Koston
e2276458ed Fix homekit_controller tests to avoid global aid generation (#119852) 2024-07-17 19:10:02 -05:00
Paulus Schoutsen
454ca0ce95 Add timer support to mobile app (#121469)
* Add timer support to mobile app

* Fix tests

* Make it time-sensitive
2024-07-17 18:40:05 -05:00
J. Nick Koston
4ae6e38800 Bump govee-ble to 0.38.0 (#122099) 2024-07-17 22:05:27 +02:00
Steven B.
55cee89392 Update tplink device config during reauth flow (#122089) 2024-07-17 14:07:53 -05:00
Michael Hansen
fa0a5451b9 Split up tests to avoid CI timeouts (#122096) 2024-07-17 20:32:26 +02:00
Aidan Timson
52b90621c7 System Bridge coordinator and connector refactor (#114896)
* Update systembridgeconnector to 5.0.0.dev2

* Refactor

* Move out of single use method

* Update systembridgeconnector to 4.1.0.dev0 and systembridgemodels to 4.1.0

* Refactor WebSocket connection handling in SystemBridgeDataUpdateCoordinator

* Remove unnessasary fluff

* Update system_bridge requirements to version 4.1.0.dev1

* Set systembridgeconnector to 4.1.0

* Fix config flow tests

We'll make this better later

* Add missing tests for media source

* Update config flow tests

* Add missing check

* Refactor WebSocket connection handling in SystemBridgeDataUpdateCoordinator

* Move inside try

* Move log

* Cleanup log

* Fix disconnection update

* Set unregistered on disconnect

* Remove bool, use listener task

* Fix eager start

* == -> is

* Reduce errors

* Update test
2024-07-17 18:39:24 +02:00
Jan Bouwhuis
843fae825f Revert "Remove stale template_topic code for mqtt publish service" (#121758)
Revert "Remove stale `template_topic` code for mqtt publish service (#121604)"

This reverts commit 5b25c24539.
2024-07-17 17:56:34 +02:00
Franck Nijhof
e6dec7c856 Migrate HomeWizard to config entry runtime data (#122088) 2024-07-17 10:20:31 -05:00
Franck Nijhof
7a4e40ade0 Remove Markdown from service action descriptions (#122077) 2024-07-17 10:20:19 -05:00
Robert Resch
10c084c6e0 Add created_at/modified_at to label registry (#122078) 2024-07-17 16:36:14 +02:00
Franck Nijhof
8ae4c4445d Clean up old migration in HomeWizard (#122086) 2024-07-17 16:18:21 +02:00
Erik Montnemery
07ceafed62 Enable strict typing on script integration (#122079) 2024-07-17 15:11:06 +02:00
Arie Catsman
1e8da192b6 Add switch platform test to enphase_envoy (#122068)
* Add switch platform test to enphase_envoy

* review feedback Use HA SWITCH_DOMAIN

* Only use SWITCH_DOMAIN for service call
2024-07-17 14:51:02 +02:00
Brett Adams
57e233d30f Bump tesla-fleet-api (#122073) 2024-07-17 13:59:52 +02:00
Erik Montnemery
efb7bede40 Enable strict typing on script helper (#122075) 2024-07-17 13:51:59 +02:00
Robert Resch
a0f91d27a3 Add created_at/modified_at to floor registry (#122071) 2024-07-17 13:18:26 +02:00
Erik Montnemery
385f5be7e8 Remove dead code from script helper (#122074) 2024-07-17 13:16:57 +02:00
Guido Schmitz
7bf4e4779c Use model_id in devolo_home_control (#122066) 2024-07-17 13:09:56 +02:00
Erik Montnemery
6921e053e4 Move recorder data migration implementation to migrators (#122045) 2024-07-17 10:59:58 +02:00
ashionky
7f76de2c7a Bump refoss to v1.2.4 (#122063)
* 1.2.2

* 1.2.3

* 1.2.4

* 1.2.4
2024-07-17 10:29:41 +02:00
Robert Resch
35f84f32d6 Add created_at/modified_at for area registry (#122014) 2024-07-17 09:54:06 +02:00
Erik Montnemery
054242ff0f Require specifying extended address in otbr WS API calls (#108282)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2024-07-17 09:04:54 +02:00
Maciej Bieniek
14ec7e5f76 Set DeviceInfo.model_id in Shelly integration (#122040) 2024-07-17 09:04:40 +02:00
Stefan Agner
0aea9b0edb Read color temperature range from Matter device if supported (#122054) 2024-07-17 01:25:28 +02:00
Franck Nijhof
1b6f880a27 Add model_id to Tuya devices, mark services correctly (#122043) 2024-07-17 00:09:18 +02:00
Stefan Agner
d0c1632976 Drop spurious log messages in Matter bridge device removal (#122036)
Don't log a message when a device is removed from the Matter bridge.
2024-07-16 23:55:33 +02:00
Franck Nijhof
dc9b25af1c Change model to model_id in LaMetric (#122044) 2024-07-16 23:48:34 +02:00
Guido Schmitz
0ad2398bda Use model_id in devolo_home_network (#122048) 2024-07-16 22:39:00 +02:00
Michael
89198b0512 Fix flakey tibber tests (#121993) 2024-07-16 22:36:31 +02:00
Joakim Plate
8d290dd9d6 Convert arcam_fmj to runtime data (#122047) 2024-07-16 22:35:04 +02:00
Erik Montnemery
9970b7eece Refactor recorder data migration (#121009)
* Refactor recorder data migration

* Fix stale docstrings

* Don't store a session object in BaseRunTimeMigration instances

* Simplify logic in EntityIDMigration.migration_done

* Fix tests
2024-07-16 21:50:19 +02:00
Arie Catsman
baa97ca981 Add fixture files to Enphase_Envoy tests (#121864)
* Add fixture files to Enphase_Envoy tests

* optimize fixtures in enphase_envoy conftest

* combine setup_enphase_envoy and mock_envoy in enphase_envoy tests

* Revert "combine setup_enphase_envoy and mock_envoy in enphase_envoy tests"

This reverts commit ec072c4726.

* Rework enphase tests

* Rework enphase tests

* reset diagnostics test snapshot

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-07-16 21:14:46 +02:00
Erik Montnemery
a22e12dac9 Refactor function recorder.migration._apply_update (#122023)
* Refactor function recorder.migration._apply_update

* Remove _SchemaVersionMigrators dict
2024-07-16 20:28:03 +02:00
Erik Montnemery
d8440e809a Avoid mutating database schema definitions during schema migration (#122012)
* Avoid mutating database schema definitions during schema migration

* Adjust test when using mysql

* Address review comment
2024-07-16 20:27:49 +02:00
J. Nick Koston
c860b6cd4b Bump govee-ble to 0.37.0 (#122037) 2024-07-16 13:17:15 -05:00
Robert Svensson
aeabe3ab95 Mark UniFi power cycle button as unavailable if PoE is not enabled on port (#122035) 2024-07-16 20:16:36 +02:00
J. Nick Koston
4bcdb551d4 Bump govee-ble to 0.36.1 (#122030)
changelog: https://github.com/Bluetooth-Devices/govee-ble/compare/v0.34.0...v0.36.1

more prep to add the event platform
2024-07-16 17:29:43 +02:00
Joost Lekkerkerker
b122c2932a Add JakeBosh as Knocki codeowner (#122026) 2024-07-16 15:54:40 +02:00
J. Nick Koston
8082808ec2 Bump govee-ble to 0.34.0 (#122028) 2024-07-16 15:47:58 +02:00
HarvsG
3a0b3a4589 Log tools sent to OpenAI (#122024) 2024-07-16 15:16:50 +02:00
Joost Lekkerkerker
f8ba4d41ba Add support for adding model_id in device info (#121989) 2024-07-16 15:12:25 +02:00
Erik Montnemery
336740dbfa Add recorder migration test starting with schema version 9 (#122011) 2024-07-16 15:12:23 +02:00
Erik Montnemery
ea29c2c4d4 Improve tests/patch_time.py (#122017) 2024-07-16 14:22:22 +02:00
Erik Montnemery
dbe68ca057 Minor adjustment of recorder migration (#122020) 2024-07-16 14:20:23 +02:00
G Johansson
62cc868150 Bump python-holidays to 0.53 (#122021) 2024-07-16 13:47:11 +02:00
Jan Bouwhuis
3304e18316 Bump incomfortclient to v0.6.3-1 (#122013) 2024-07-16 13:23:39 +02:00
Glenn Waters
6645932fb7 Fix for Environment Canada date being wrong after midnight (#121850)
* Use async_connect in newly bumped 0.5.8 UPB library.

* Fix tests.

* Fix date being wrong after midnight for Environment Canada

* Fix typing.

* Add test.

* Formatting.

* Remove tests until can be added properly.

* Add weather tests back.

* Fix tests

* Change of tactic for determining previous day's data.

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-07-16 11:57:37 +02:00
jan iversen
bc7d2d2195 Remove modbus codeowner, and downgrade to quality "No score" (#122010)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-16 11:26:44 +02:00
Joakim Plate
22d977acb0 Rename dsmr integration to be more generic (#121968) 2024-07-16 11:15:17 +02:00
Stefan Agner
234870538d Prevent removal of complete bridge when removing a device from Matter (#121987)
* Prevent removal of complete bridge when removing a device from Matter

Currently, when a device is removed from Matter, the complete bridge is
being removed. This might not be the user intention. Bridged devices
themselves can't be deleted really, as they are still part of the
bridge.

Ideally, this should be fixed in the UI (remove the Delete button in
this case). But as a workaround, we can prevent the removal of the
complete bridge by disallowing to remove the bridged device itself.

This also improves deleting when the bridge is already removed from
the Server through some other means: In this case, we delete all devices
at once.

* Update homeassistant/components/matter/__init__.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2024-07-16 10:19:55 +02:00
Franck Nijhof
2f0870a063 Adjust issue description in automations fix flow (#122007) 2024-07-16 09:27:54 +02:00
J. Nick Koston
2160f981c2 Convert mopeka to use entry.runtime_data (#121973) 2024-07-16 09:02:32 +02:00
J. Nick Koston
e01c605d04 Bump uiprotect to 5.3.0 (#122005) 2024-07-16 09:01:45 +02:00
Joost Lekkerkerker
d81f6fa8f2 Make filter a helper (#121994) 2024-07-16 08:47:46 +02:00
J. Nick Koston
d0233d01da Bump govee-ble to 0.33.0 (#122004) 2024-07-16 08:37:33 +02:00
Björn Ebbinghaus
2723ab3b27 Add mac address as connection for matter device (#121257) 2024-07-16 00:54:16 +02:00
Maciej Bieniek
260e98c3f7 Add support for Shelly number virtual component (#121894)
* Support number component in field mode

* Support number in label mode

* Add tests

* Add mode_fn

* Add support for number component in slider mode

* Add comment

* Suggested change

* Revert max_fn

* Change unit 'min' to 'Hz' in test

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-15 22:26:12 +02:00
Franck Nijhof
a9bf12f102 Rename Services to Actions in translation strings (#121777) 2024-07-15 21:19:25 +02:00
Michael
190f12cead Bump python-homeassistant-analytics to 0.7.0 (#121992)
bump python-homeassistant-analytics to 0.7.0
2024-07-15 21:08:00 +02:00
Joost Lekkerkerker
026538b6dc Disable concord232 integration (#121974)
* Disable concord232 integration

* Fix
2024-07-15 20:54:07 +02:00
Álvaro Fernández Rojas
e9d4c03300 Update aioairzone to v0.8.0 (#121991)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-07-15 20:49:21 +02:00
Joost Lekkerkerker
74f04a1ede Move licenses to right list (#121986) 2024-07-15 20:06:52 +02:00
J. Nick Koston
33cb674a4b Bump yalexs to 6.4.3 (#121984) 2024-07-15 19:35:52 +02:00
Joost Lekkerkerker
d7e33429e3 Disable MVG integration (#121975)
Disable MVGLive integration
2024-07-15 17:51:41 +02:00
Joost Lekkerkerker
77f10a23b0 Make Bayesian a helper (#121976) 2024-07-15 16:53:21 +02:00
Joost Lekkerkerker
c6a0c20c64 Disable Dovado integration (#121871) 2024-07-15 10:22:01 +02:00
Richard Kroegel
99f01ac61e Fix BMW remaining fuel device class (#119172)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-07-15 09:23:05 +02:00
mvn23
894f3fe439 Fix opentherm_gw availability (#121892) 2024-07-15 09:20:32 +02:00
Scott K Logan
df00e1a65b Fix rainforest_raven closing device due to timeout (#121905) 2024-07-15 09:10:50 +02:00
Tomasz Gorochowik
ef7a84d3f4 Fix enigma2 mute (#121928) 2024-07-15 09:09:19 +02:00
Sid
3b95e88ff7 Bump ruff to 0.5.2 (#121946) 2024-07-15 09:00:48 +02:00
dependabot[bot]
6109b9206c Bump github/codeql-action from 3.25.11 to 3.25.12 (#121963)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 08:57:39 +02:00
Maciej Bieniek
50751574b4 Fix configuration_url for Shelly device using IPv6 (#121939)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-15 08:31:44 +02:00
Álvaro Fernández Rojas
9f53d0ccd9 Rename Airzone system_zone_id to system_id (#121931) 2024-07-15 01:39:59 +02:00
Kevin Stillhammer
ab945ee76e Add Broadlink select platform (#121797)
* Add broadlink select platform

* Apply strings.json feedback

* Remove obsolete Service Exception

* Use day names instead of IDs

* Use list()
2024-07-14 23:59:24 +02:00
J. Nick Koston
6d8f99903d Migrate lutron_caseta to use entry.runtime_data (#121903)
* Migrate lutron_caseta to use entry.runtime_data

* Migrate lutron_caseta to use entry.runtime_data
2024-07-14 23:26:12 +02:00
J. Nick Koston
73b836df55 Use dispatcher for doorbird event entities (#121825)
* Use dispatcher for doorbird event entities

https://github.com/home-assistant/core/pull/121114#discussion_r1668171539

* Update homeassistant/components/doorbird/view.py
2024-07-14 23:25:04 +02:00
J. Nick Koston
73f6e3c07b Narrow sqlite database corruption check to ensure disk image is malformed (#121947)
* Narrow sqlite database corruption check to ensure disk image is malformed

The database corruption check would also replace the database when it
locked externally instead of only when its malformed.

This was discovered in https://github.com/home-assistant/core/issues/121909#issuecomment-2227409124
when a user did a manual index creation while HA was online

* tweak

* tweak

* fix

* fix
2024-07-14 23:23:07 +02:00
J. Nick Koston
19d2d023ab Ensure states table rebuild still happens if the event_id index was removed (#121938)
* Ensure states table rebuild still happens if the event_id index was removed

If ix_states_event_id was removed by the foreign key still
exists, the states table would not get rebuilt. This should
not happen under normal circumstances and seems to only be
possible if the index was removed manually or Home
Assistant was restarted forcefully in the middle
of a previous migration from years ago.

* cover

* fix tests

* mysql wont allow at that point but thats ok as long as its gone at the end
2024-07-14 23:20:52 +02:00
David F. Mulcahey
1d62f0e380 Bump ZHA lib to 0.0.23 (#121900) 2024-07-14 03:59:29 +02:00
David F. Mulcahey
342e6a503a Fix group operations in ZHA websocket API (#121881) 2024-07-14 03:25:15 +02:00
Álvaro Fernández Rojas
c044417837 Dynamically add Airzone entities (#121891)
* airzone: reload entry on new devices

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* Revert "airzone: reload entry on new devices"

This reverts commit 3ecc0844e4.

* airzone: sensor: dynamically add new entities

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* tests: restore reverted airzone tests

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: sensor: code fixes

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: water_heater: dynamically add entities

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: binary_sensor: dynamically add entities

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: select: dynamically add entities

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: climate: dynamically add entities

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* tests: airzone: use freezer

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: call async_add_entities once

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: wrap async_add_listener on async_on_unload

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

* airzone: reduce number of entity listeners

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-07-13 21:45:08 +02:00
Jan Bouwhuis
3111951757 Fix alexa does to check current_position correctly when handling cover range changes (#121798) 2024-07-13 16:10:09 +02:00
Maciej Bieniek
a34858a567 Use parametrize in tests for Shelly boolean virtual component (#121895)
Use parametrize in tests

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-13 15:27:17 +03:00
J. Nick Koston
62613af033 Migrate hunterdouglas_powerview to use entry.runtime_data (#121887) 2024-07-13 12:38:47 +02:00
Shai Ungar
2dec7136c8 Address post merge review on israel rail (#121872)
* Address late israel rail review

* transfers => trains
2024-07-13 10:54:27 +02:00
Jordi
662760360a Bump aioaquacell to 0.2.0 (#121876) 2024-07-13 10:04:51 +02:00
J. Nick Koston
9e259cbf2d Remove unused code in doorbird (#121884) 2024-07-12 22:39:58 -07:00
Avi Miller
5f33e85b30 Initial support for LIFX Ceiling SKY effect (#121820) 2024-07-12 21:16:16 -05:00
dougiteixeira
162b734be7 Add config flow for select platform in Template (#121809) 2024-07-12 17:50:02 +02:00
Allen Porter
a2fab98358 Remove an unneeded test dependency on pydantic in matrix (#121860) 2024-07-12 17:45:04 +02:00
Klaas Schoute
0d27cdc845 Add inverters to Autarco integration (#121779) 2024-07-12 16:54:22 +02:00
J. Nick Koston
a8321fac95 Add reauth support to doorbird (#121815) 2024-07-12 16:53:39 +02:00
Franck Nijhof
726fcb485d Extend search with support for integrations (#121765) 2024-07-12 16:31:49 +02:00
J. Nick Koston
2e71c8d43b Fix homekit linked doorbell and motion firing on reload (#121818) 2024-07-12 16:29:55 +02:00
J. Nick Koston
a67b6c5ba6 Avoid recording additional light attributes (#121776) 2024-07-12 16:27:50 +02:00
J. Nick Koston
8a52ffb967 Use a listcomp for more history results (#121830) 2024-07-12 16:10:21 +02:00
Marcel Vriend
156e92a4cd Fix too verbose HTTP logging for Azure Data Explorer (#121802) 2024-07-12 16:09:44 +02:00
Joost Lekkerkerker
5f02f3caa9 Disable blinkstick integration (#121846) 2024-07-12 16:09:07 +02:00
Dave T
62b9b34561 Fix typo in Template switch (#121856) 2024-07-12 16:03:24 +02:00
G Johansson
df85067cae Add device link to History stats helper (#121848) 2024-07-12 16:01:50 +02:00
Joakim Plate
a0d0e0f4a9 Correct deprecated telegram usage in dsmr (#121847) 2024-07-12 16:00:27 +02:00
J. Nick Koston
244af091b8 Bump DoorBirdPy to 3.0.2 (#121823) 2024-07-12 15:59:10 +02:00
Simone Chemelli
f260b048d6 Bump boto3, botocore and aiobotocore (#121773) 2024-07-12 15:55:08 +02:00
J. Nick Koston
ebd50d327b Log add/remove index complete at the same level as when it starts (#121852) 2024-07-12 15:54:38 +02:00
Jan-Philipp Benecke
6a86cdf3f5 Add missing translations to Roborock (#121796) 2024-07-12 15:51:18 +02:00
G Johansson
1acbcf921a Fix schema and strings in template switch (#121843) 2024-07-12 15:50:21 +02:00
Joost Lekkerkerker
12384104f4 Fix Mealie mealplan service date parsing (#121844) 2024-07-12 15:21:48 +02:00
Maciej Bieniek
3ef1e5816e Add support for Shelly text virtual component (#121735)
* Add support for text component

* Add tests

* Improve const names

* Remove unnecessary code

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-12 12:58:21 +02:00
Jan Rieger
48978fb7f6 Add configuration_url to AVM FRITZ!Box Call Monitor (#121836) 2024-07-12 09:51:17 +02:00
starkillerOG
97aaae1372 Reolink media second lens (#121800)
DUO lens camera distinguish between lenses for media playback
2024-07-12 09:13:55 +02:00
J. Nick Koston
cdf7ecebc0 Make BaseCoordinatorEntity.should_poll a cached_property since it never changes (#121826) 2024-07-12 00:39:22 -05:00
Shay Levy
cdb26ef8a3 Cleanup Shelly unused strings for removed valve switch (#121813) 2024-07-12 05:44:25 +01:00
J. Nick Koston
76d6a1fe13 Use identity check for ESPHome sensor device_class (#121828) 2024-07-11 22:47:32 -05:00
J. Nick Koston
df8c949884 Migrate esphome to use shorthand available attr (#121827) 2024-07-11 22:47:10 -05:00
Avi Miller
adb88f0165 Bump aiolifx to 1.0.5 (#121824) 2024-07-11 22:21:45 -05:00
Glenn Waters
c84fe04d6b Use async_connect in newly bumped 0.5.8 UPB library (#121789) 2024-07-11 16:14:22 -05:00
ollo69
86db976ed7 Bump PySwitchbot to 0.48.1 (#121804) 2024-07-11 16:12:33 -05:00
Steven B
e269ff617c Bump python-kasa to 0.7.0.4 (#121791) 2024-07-11 19:19:31 +02:00
Álvaro Fernández Rojas
414aee395e Update aioairzone-cloud to v0.5.4 (#121787) 2024-07-11 18:45:09 +02:00
Joost Lekkerkerker
3be95ebc87 Add verify SSL option to Mealie (#121767) 2024-07-11 17:23:26 +02:00
Allen Porter
ede130aa53 Pin mashumaro version >= 3.13.1 for python 3.12.4 compatibility. (#121782)
Pin mashumaro version for python 3.12.4 compatibility.
2024-07-11 08:23:10 -07:00
Josef Zweck
21d35ff311 Bump pytedee_async to 0.2.20 (#121783) 2024-07-11 17:22:10 +02:00
J. Nick Koston
8fb700c30e Add some missing tplink ouis (#121785) 2024-07-11 17:18:45 +02:00
Steven B
2148cfc899 Fix tplink bug changing color temp on bulbs with light effects (#121696) 2024-07-11 10:10:47 -05:00
mkmer
c40a9ac4b5 Remove unused code in blink (#121780)
Remove unused code
2024-07-11 16:12:05 +02:00
J. Nick Koston
ab7c4244d2 Pre-configure default doorbird events (#121692) 2024-07-11 11:31:29 +02:00
Tsvi Mostovicz
f40897b54c Add Jewish Calendar reconfiguration test (#118833)
* Revert "Remove flaky tests"

This reverts commit c4de9fdcbe.

* Change reconfigure test to be based on data

* Don't assert using internals

* Fix assertions to be on config entry
2024-07-11 11:17:12 +02:00
Joost Lekkerkerker
73475aa675 Dynamically create and delete todo lists in mealie (#121710) 2024-07-11 10:19:45 +02:00
tronikos
c223709c7c Bump opower to 0.5.2 to fix 403 forbidden errors for users with multiple accounts (#121762) 2024-07-11 10:14:11 +02:00
dougiteixeira
52454f5218 Add config flow for platform switch in Template (#121639) 2024-07-11 10:11:31 +02:00
Franck Nijhof
f94b28f72d Add button group support (#121715)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-07-11 09:37:32 +02:00
Jan Bouwhuis
acb4a92628 Revert "Add mqtt automation publish test with template rendering" (#121757) 2024-07-11 09:36:14 +02:00
Brett Adams
f8015a7abc Add test coverage for Tessie seat coolers (#121742) 2024-07-11 09:13:50 +02:00
Joost Lekkerkerker
4c972694cd Add reconfigure flow to Mealie (#121750) 2024-07-11 09:11:59 +02:00
Mr. Bubbles
c6f1ec34e2 Fix bugs Habitica to-do lists (#121755) 2024-07-11 09:11:04 +02:00
J. Nick Koston
43596f22a4 Fix recorder max backlog calculation being too small (#121739) 2024-07-11 09:09:35 +02:00
Abílio Costa
67fee5be31 Update Idasen Desk library to 2.6.2 (#121729) 2024-07-11 09:07:18 +02:00
Luca Angemi
c89de2e6a6 Append multiple rows in Google Sheets (#120829)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-07-11 09:05:22 +02:00
Brett Adams
307ae53066 Add sunroof to Tessie (#121743) 2024-07-11 09:03:46 +02:00
J. Nick Koston
322553b8a9 Bump pyserial-asyncio-fast to 0.13 (#121745) 2024-07-11 08:58:09 +02:00
dependabot[bot]
fc770434f1 Bump actions/setup-python from 5.1.0 to 5.1.1 (#121749)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-11 08:52:35 +02:00
Shai Ungar
56b6747bc0 Add Israel rail integration (#121418)
* Add Israel Rail integration

* israel_rail tests

* israel_rail tests

* 1. use entry.runtime
2. DataConnection - data class
3. remove unique id from coordinator
4. use EntityDescription

* add a list of stations in user form

* 1. extend ConfigEntry
2. remove unused pop
3. use IsraelRailSensorEntityDescription to have only one kind of Sensor
4. add test for already configured
5. use snapshot in test

* change user step description

* 1. ConfigEntry[IsraelRailDataUpdateCoordinator]
2. remove redundant attributes
3. use snapshot_platform helper

* remove attr

* remove attr

* move test to test_init.py

* Fix

* Fix

* Fix

* Fix

* fix timezone

* fix

* fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-11 08:45:32 +02:00
Kevin Stillhammer
ea5eb0f8f2 Add Broadlink time platform (#121470)
* Add time platform

* Apply PR feedback

* Remove obsolete Exception raise
2024-07-11 08:18:10 +02:00
Klaas Schoute
bb81cfa57a Add diagnostics to Autarco integration (#121732) 2024-07-11 06:49:38 +02:00
J. Nick Koston
22c89356c0 Bump DoorBirdPy to 3.0.1 (#121733) 2024-07-10 18:22:56 -05:00
Joost Lekkerkerker
385576bfb2 Add reauth flow to Mealie (#121697) 2024-07-11 00:24:48 +02:00
atinsley
90af40b5c4 Add ability to control ventilated seats with Tessie integration (#121624) 2024-07-11 00:22:01 +02:00
Michael Hansen
417abda649 Add HassGetCurrentDate and HassGetCurrentTime intents (#121707) 2024-07-11 00:17:04 +02:00
Joost Lekkerkerker
0462582da3 Use new constants in todo tests (#121727) 2024-07-11 00:01:17 +02:00
Jan Stienstra
2fce71ea52 Retain Jellyfin config flow input on connection issue (#121618) 2024-07-10 23:54:02 +02:00
Robert Svensson
61111f5d71 Fix bad access to UniFi runtime_data when not assigned (#121725)
* Fix bad access to runtime_data when not assigned

* Fix review comment

* Clean up if statements
2024-07-10 23:53:11 +02:00
Maciej Bieniek
70f05e5f13 Add support for Shelly virtual boolean component (#119932)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-10 23:51:51 +02:00
Dave T
311b1e236a Don't patch libraries that aren't installed in pytest (#121628) 2024-07-10 23:50:47 +02:00
dougiteixeira
e0c7073da1 Add config flow for image platform in Template (#121648) 2024-07-10 23:49:24 +02:00
Tomek Porozynski
088717926d Update Supla async_set_cover_position to use "REVEAL_PARTIALLY" (#121663) 2024-07-10 23:48:08 +02:00
Klaas Schoute
664c4e6189 Fix small issue on Autarco integration (#121723) 2024-07-10 23:37:32 +02:00
J. Nick Koston
d87bbaa67a Migrate resetting doorbird favorites to a button (#121720) 2024-07-10 16:34:02 -05:00
Joost Lekkerkerker
af6c28983d Bump knocki to 0.3.1 (#121717) 2024-07-10 23:22:03 +02:00
puddly
9fcfc6d9f3 Bump ZHA dependencies (#121716) 2024-07-10 23:17:41 +02:00
Joost Lekkerkerker
e56f8d795f Add constants for todo services (#121616) 2024-07-10 23:15:03 +02:00
Joakim Plate
7ed5feee92 Extend generic hygrostat/thermostat actuators using config flow (#121690) 2024-07-10 23:11:02 +02:00
Mr. Bubbles
f3fe61f929 Bump pyloadapi to v1.3.2 (#121709) 2024-07-10 23:08:25 +02:00
J. Nick Koston
4fd5ced1f5 Fix update happening too early in unifiprotect (#121714) 2024-07-10 23:06:58 +02:00
Klaas Schoute
fce68018b7 Add Autarco integration (#121600)
* Init Autarco integration

* Add integration code with tests

* Update every 5 minutes

* Process all feedback from Joost

* Bump lib to v2.0.0

* Add more then one site if present

* Fix issue with entity translation

* Update the test for sensor entities

* Fix round two based on feedback from Joost

* Add autarco to strict typing

* Update tests/components/autarco/test_config_flow.py

* Update tests/components/autarco/test_config_flow.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-10 23:05:31 +02:00
Noah Husby
abeac3f3aa Add config flow to Russound RIO integration (#121262)
* Add config flow to Russound RIO

* Ensure Russound RIO connection is handled at entry setup

* Add tests for Russound RIO config flow

* Add yaml configuration import to Russound RIO

* Use runtime_data to store Russound RIO client

* Seperate common import and user config logic for Russound RIO

* Update config flow to use aiorussound

* Add MAC address as unique ID for Russound RIO

* Fix pre-commit for Russound RIO

* Refactor config flow error handling for Russound RIO

* Add config flow import abort message for no primary controller

* Add common strings to Russound RIO

* Use reference strings for Russound RIO issue strings

* Remove commented out test fixture from Russound RIO

* Clean up test fixtures for Russound RIO

* Remove model from entry data in Russound RIO

* Clean up Russound client mock

* Clean up Russound test fixtures

* Remove init tests and clean up Russound config flow cases
2024-07-10 23:02:33 +02:00
Joost Lekkerkerker
924e767736 Bump knocki to 0.3.0 (#121704) 2024-07-10 21:53:11 +02:00
Sid
3142f52a79 Add Ruff refurb rules (#121701) 2024-07-10 21:47:40 +02:00
Andrew Jackson
a9c9963f0f Mealie min version check (#121677) 2024-07-10 21:25:49 +02:00
Jan Bouwhuis
71e5ffb2bd Add mqtt automation publish test with template rendering (#121695) 2024-07-10 21:17:27 +02:00
Sid
319fdf42c3 Enable Ruff RUF017 (#121693) 2024-07-10 21:09:47 +02:00
Joost Lekkerkerker
1e0c03257c Add diagnostics to Mealie (#121700) 2024-07-10 21:09:03 +02:00
Lucas Mindêllo de Andrade
5dbf907323 Bump sunweg 3.0.2 (#121684) 2024-07-10 20:16:36 +02:00
Sid
cd4358ed9e Allow enigma2 devices to use different source bouquets (#121686) 2024-07-10 17:46:39 +02:00
Richard Kroegel
865190f0b0 Get suggested_unit_of_measurement via unit converter's UNIT_CLASS (#119196)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-07-10 17:45:07 +02:00
J. Nick Koston
0e0a339517 Convert doorbird to use asyncio (#121569) 2024-07-10 17:34:12 +02:00
puddly
020961d2d8 Fix ZHA select platform state restoration (#121646)
* Ensure `select` entities do not restore state if they were unavailable

* Add a unit test
2024-07-10 10:55:27 -04:00
J. Nick Koston
c81d5a1ac2 Handle empty entity_id in the recorder filter (#121681)
fixes #111745
2024-07-10 09:53:38 -05:00
Ravaka Razafimanantsoa
8b729e3c7d Bump switchbot-api to 2.2.1 (#121676) 2024-07-10 15:16:57 +02:00
J. Nick Koston
02b12837d4 Small cleanups to bond entities (#121641) 2024-07-10 15:12:46 +02:00
epenet
e812b0e02f Cleanup unnecessary returns (#121652) 2024-07-10 15:11:56 +02:00
epenet
b0837dd98f Use service_calls fixture in zha tests (#120996) 2024-07-10 15:06:49 +02:00
Joost Lekkerkerker
43806553fc Add service to import recipe to mealie (#121598) 2024-07-10 14:33:17 +02:00
Noah Husby
f762359abf Bump aiorussound to 1.1.2 (#121674) 2024-07-10 14:05:24 +02:00
Jeef
0213f1c5c0 Add SimpleFIN integration (#108336)
* reset to latest dev branch

* Update homeassistant/components/simplefin/sensor.py

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

* formatting tweak

* Removed info errors

* fix bad billing error message

* addressing PR

* addressing PR

* reauth abort and already_confiugred added to strings.json

* adding the reauth message

* ruff

* update reqs

* reset to latest dev branch

* Update homeassistant/components/simplefin/sensor.py

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

* formatting tweak

* Removed info errors

* fix bad billing error message

* addressing PR

* addressing PR

* reauth abort and already_confiugred added to strings.json

* adding the reauth message

* ruff

* update reqs

* Update homeassistant/components/simplefin/__init__.py

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

* Addressing a few PR comments - removing nix - and adding runtime data

* updated comments

* rename config flow

* pulling reauth :( - inline stuff

* inline more

* fixed a tab issue

* reverting changes

* various PR updates and code removal

* generator async add

* Update homeassistant/components/simplefin/__init__.py

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

* Update homeassistant/components/simplefin/config_flow.py

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

* Update homeassistant/components/simplefin/config_flow.py

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

* Update homeassistant/components/simplefin/sensor.py

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

* Update homeassistant/components/simplefin/sensor.py

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

* always callable

* Update homeassistant/components/simplefin/coordinator.py

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

* no-verify

* type

* fixing missing domain

* it looks like this file is gone now

* typing

* sorta pass

* fix license

* Update homeassistant/components/simplefin/config_flow.py

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

* Update homeassistant/components/simplefin/entity.py

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

* addressing PR

* Update homeassistant/components/simplefin/strings.json

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

* move property to entity.py

* moved stuff out to else block

* Initial Snappshot Testing ... still have unadressed changes to make

* Addressing PR Comments

* pushing back to joost

* removing non-needed file

* added more asserts

* reducing mocks - need to fix patch paths still

* Changed patch to be more localized to config_flow

* Removed unneeded fixture

* Moved coordinator around

* Cleaning up the code

* Removed a NOQA"

* Upping the number of asserts

* cleanup

* fixed abort call

* incremental update - for Josot... changed a function signature and removed an annotatoin

* no-verify

* Added an abort test

* ruff

* increased coverage but it might not pass muster for JOOST

* increased coverage but it might not pass muster for JOOST

* Much nicer test now

* tried to simplify

* Fix nits

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-10 12:44:04 +02:00
Franck Nijhof
42dcd693d5 Block variable <=3.4.4 custom integration from breaking the recorder (#121670) 2024-07-10 11:30:16 +02:00
tronikos
1925614a14 Handle errors in Fully Kiosk camera (#121659) 2024-07-10 11:21:38 +02:00
Marcel van der Veldt
42003ae5ac Matter lock state follow-up (#121669) 2024-07-10 11:20:26 +02:00
Maikel Punie
33df857283 Small fix in velbus cover for the assumed states (#121656) 2024-07-10 11:11:54 +02:00
Marcel van der Veldt
6702d232e2 Fix state for Matter Locks (including optional door sensor) (#121665) 2024-07-10 10:32:42 +02:00
Franck Nijhof
e9b7cc1eba Block places <=2.7.0 custom integration from breaking the recorder (#121662) 2024-07-10 10:24:44 +02:00
Franck Nijhof
65e03f952a Block icloud3 custom integration from breaking the recorder (#121658) 2024-07-10 09:47:15 +02:00
epenet
30b5297fde Small refactor to cleanup unnecessary returns (#121653) 2024-07-10 09:34:48 +02:00
epenet
86f7718c1f Adjust type hints for unnecessary returns in tests (#121657) 2024-07-10 09:30:50 +02:00
Paul Bottein
d10aa6656b Update frontend to 20240710.0 (#121651) 2024-07-10 09:29:22 +02:00
epenet
ff59adc661 Adjust type hints for unnecessary returns (#121650) 2024-07-10 09:26:29 +02:00
epenet
5d809f88ba Improve type hints in calendar tests (#121654) 2024-07-10 09:12:56 +02:00
Mike Lewis
8b0f28e7f4 Add Bromley to list of london air authorities (#121498) 2024-07-10 09:10:26 +02:00
epenet
7a337ecd1d Cleanup unnecessary definition in lamarzocco tests (#121655) 2024-07-10 09:08:39 +02:00
J. Nick Koston
fb758bd8b6 Migrate screenlogic to use entry.runtime_data (#121644) 2024-07-10 08:36:02 +02:00
J. Nick Koston
6f15352eda Convert nexia to use entry.runtime_data (#121640) 2024-07-10 08:35:13 +02:00
J. Nick Koston
bf09cee66f Migrate emonitor to entry.runtime_data (#121645) 2024-07-10 08:34:20 +02:00
David F. Mulcahey
0aa6a17da8 Prevent entity creation errors from causing all entities for a platform from loading in ZHA (#121631) 2024-07-10 08:31:24 +02:00
J. Nick Koston
4245357403 Convert solaredge to use entry.runtime_data (#121642) 2024-07-10 08:22:44 +02:00
David F. Mulcahey
72c3c0eb53 Bump ZHA lib to 0.0.19 (#121637) 2024-07-10 08:22:08 +02:00
J. Nick Koston
8d0d8fd006 Convert powerwall to use entry.runtime_data (#121643) 2024-07-10 08:20:29 +02:00
CrazyMan2000
9120115577 Split media player select input test (#121633) 2024-07-09 23:28:41 +02:00
Jan Bouwhuis
805d4fcc40 Do not use curr as abbreviation in alexa tests and remove conditions (#121627) 2024-07-09 22:58:22 +02:00
Diogo Gomes
92e6dacf14 Update CODEOWNERS of enphase_envoy (#121623) 2024-07-09 22:53:49 +02:00
dougiteixeira
d783813ba0 Add config flow for platform button in Template (#120886) 2024-07-09 21:20:18 +02:00
jan iversen
5e56c27703 Modbus, Remove duplicate address check (#121579) 2024-07-09 21:16:47 +02:00
G Johansson
9d2cf70ba5 Add constant for climate feature flag check (#121619) 2024-07-09 21:14:19 +02:00
Jan Stienstra
c5ced14473 Jellyfin - Improve unloading/reloading config entry (#121613) 2024-07-09 21:14:03 +02:00
epenet
bff663b3c1 Improve type hints in recorder result_processor (#121593) 2024-07-09 21:12:03 +02:00
Joakim Plate
f14777d0ae Allow ambilight when we have connection (philips_js) (#121620) 2024-07-09 21:10:15 +02:00
epenet
a4980cf0fd Improve type hints in zwave_js tests (#121594) 2024-07-09 20:13:47 +02:00
ilan
31dc80c616 Add binary sensor to madVR integration (#121465)
* feat: add binary sensor and tests

* fix: update test

* fix: use entity description

* feat: use translation key

* feat: implement base entity

* fix: change device classes

* fix: remove some types

* fix: coordinator.data none on init

* fix: names, tests

* feat: parameterize tests
2024-07-09 19:11:08 +02:00
Andrew Jackson
898803abe9 Add shopping lists to Mealie integration (#121534)
* Add mealie shopping lists & tests

* Add shopping_lists init failure

* Fix coordinator name

* Fixes

* Add available, fix merge

* Fixes

* Fixes

* Add todo failure tests

* Fix tests
2024-07-09 18:39:22 +02:00
Jan Bouwhuis
5b25c24539 Remove stale template_topic code for mqtt publish service (#121604) 2024-07-09 18:22:08 +02:00
CrazyMan2000
e44f00cf7c Add alexa remote support (#120878)
* Updated the AlexaModeController to support the remote domain. Also added an alexa entitiy adapter for the remote domain.

* Fixed copy paste mistake.

* Fixed power state for remove domain.

* Updated the CapabilityResource to support labels with the corresponding locale. This local is read from the users config.

* Add the alexa display category 'REMOTE' and use it for the remote capability.

* Revert "Updated the CapabilityResource to support labels with the corresponding locale. This local is read from the users config."

This reverts commit fbdf37904a.

* Fix error when the remote does not have an activtiy list.

* Add tests for the state report of a remote entity.

* Add a test for alexas set mode directive for a remote entitiy.

* Add a test for alexas TurnOn and TurnOff directives for a remote entity.

* Apply suggestions from code review

Fix copy paste mistakes.

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Improve attribute name as suggested.

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Add test case with zero and one activity.

* Add a comment why we use the mode controller instead of the input controller.

* Add test to check of the discovery returns all required interfaces for a remote entitiy.

* Tweak comment

* Add line breaks to fix max allowed chars per line.

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-07-09 18:03:47 +02:00
Paulus Schoutsen
154da1b18b Allow targeting conversation agent as pipeline (#119556)
* Allow targetting conversation agent as pipeline

* Test that we can use a conversation entity as an assist pipeline

* Add test for WS get

---------

Co-authored-by: Michael Hansen <mike@rhasspy.org>
2024-07-09 10:56:53 -05:00
Michael Hansen
69ed730101 Bump hassil to 1.7.3 for number word caching (#121608)
* Bump hassil to 1.7.3

* Add wildcard slot list name
2024-07-09 17:25:40 +02:00
Paulus Schoutsen
01861cd240 Ensure we prepare conversation pipeline when speech-to-text starts (#114665)
* Ensure we prepare conversation pipeline when speech-to-text starts

* Add lock around recognize

* Update homeassistant/components/conversation/default_agent.py

* Add lock around load intents
2024-07-09 09:58:52 -05:00
Michael Hansen
4498bf9ec4 Remove language lock from default agent and move around tests (#121531)
* Remove language lock

* Remove unsub for change events

* Remove redundant check

* Simplify intent loading

* Cache intent loading error

* Revert "Remove unsub for change events"

This reverts commit 575266abcd.

* guard instead of assert

* Some more cleanup

* No need to warn during prepare

* Some more cleanup

* Add more timing logs

* Split up tests and rely less on http

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-07-09 16:05:43 +02:00
Leonard Sperry
4a22b95620 Remove "unavailable" and "unknown" filters from Kafka integration (#121602) 2024-07-09 07:16:14 -06:00
Arie Catsman
592cfc9c17 Bump pyenphase to 1.20.6 (#121583)
bump pyenphase to 1.20.6
2024-07-09 12:52:04 +02:00
epenet
d4cc44d352 Improve type hints for webhook implementation in push (#121589)
Improve type hints in push webhook implementation
2024-07-09 12:16:23 +02:00
epenet
ba0cd595ff Improve type hints in device tracker implementations (#121585) 2024-07-09 12:06:49 +02:00
epenet
9ca398ef82 Improve type hints in webhook implementations (#121588) 2024-07-09 12:05:23 +02:00
epenet
7aada39b77 Improve type hints for webhook implementation in dialogflow (#121592) 2024-07-09 12:04:28 +02:00
Joost Lekkerkerker
a1fae0e0ce Fix missing validation and service definition in Mealie (#121578) 2024-07-09 11:55:12 +02:00
Leonard Sperry
cfabb778dd Add entity_id as key for kafka message (#121519)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
2024-07-09 08:44:49 +02:00
Brett Adams
48d9df74ed Add sunroof to Teslemetry (#121476) 2024-07-09 08:36:34 +02:00
Glenn Waters
b07fcb6a4a Fix upb config flow connect (#121571) 2024-07-09 08:32:34 +02:00
Robert Contreras
3ea694a069 Home Connect unit tests for light platform (#121576) 2024-07-09 08:31:41 +02:00
Franck Nijhof
9321bba61e Update vehicle to 2.2.2 (#121556) 2024-07-09 08:30:10 +02:00
Franck Nijhof
c13d5a663a Update tailscale to 0.6.1 (#121557) 2024-07-09 08:29:57 +02:00
Michael Hansen
6e85f09722 Revert webrtc to 1.2.3 (#121561) 2024-07-08 22:50:55 +02:00
Markus Jacobsen
45843a3112 Add Bang & Olufsen media_player testing (#120580) 2024-07-08 22:19:02 +02:00
Michael Hansen
2a31774f91 Bump webrtc-noise-gain to 1.2.5 (#121539) 2024-07-08 21:57:10 +02:00
Markus Jacobsen
f801649e9c Fix Bang & Olufsen wrong source being compared (#121512) 2024-07-08 21:48:07 +02:00
Cris-ET
60e1df2a87 Add new entities for the Growatt Storage inverter (#121507) 2024-07-08 21:47:40 +02:00
Christoph
5dbaaa9068 Remove homematic state_class from GAS_POWER sensor (#121533) 2024-07-08 21:38:09 +02:00
Franck Nijhof
10f3813ffd Update Home Assistant Wheels action to 2024.07.1 (#121555) 2024-07-08 21:35:12 +02:00
Franck Nijhof
71300b197a Update Home Assistant Wheels action to 2024.07.0 (#121552) 2024-07-08 21:18:01 +02:00
puddly
b754f03c11 ZHA as an external library (#120190)
Co-authored-by: David Mulcahey <david.mulcahey@icloud.com>
Co-authored-by: David Mulcahey <david.mulcahey@me.com>
2024-07-08 20:18:30 +02:00
Andrew Jackson
e11d24f06f Add myself as co-codeowner for Mealie integration (#121536)
* Add myself as co-codeowner for Mealie integration

* Update manifest.json

* Update homeassistant/components/mealie/manifest.json

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-08 18:58:10 +02:00
Joost Lekkerkerker
5f088e0501 Add Mealie service to get recipe (#121462) 2024-07-08 17:11:35 +02:00
J. Nick Koston
93cf8c1311 Fix person tracking in unifiprotect (#121528) 2024-07-08 07:58:18 -07:00
Cris-ET
3e8335f61b Define state_class for Growatt inverter entities (#121516) 2024-07-08 15:08:08 +02:00
tronikos
5f909d0c52 Fix unreleased breaking change in Google Cloud (#121523) 2024-07-08 14:34:18 +02:00
epenet
98651cbd2e Improve type hints in lovelace tests (#121520) 2024-07-08 14:04:11 +02:00
epenet
19e272a901 Improve type hints in iotawatt tests (#121505) 2024-07-08 13:31:05 +02:00
epenet
10ee554f1f Improve type hints in logi_circle tests (#121518) 2024-07-08 13:30:29 +02:00
epenet
f7825eb5b1 Improve type hints in lyric tests (#121517) 2024-07-08 13:30:01 +02:00
Kevin Stillhammer
8ab6a505a4 Write data to state after Broadlink entity added (#121493)
* Write data to ha after entity added

* Properly mock api return values

Some values like _attr_is_on were mapped to MagicMocks which led to them evaluating to True. Actually calling the update state method when adding the entities made that improper mocking come to the surface.

* Call _update_state instead of _recv_data
2024-07-08 13:15:17 +02:00
Cris-ET
bd4ef4b2ff Define state_class for Growatt storage entities (#121514) 2024-07-08 13:03:06 +02:00
epenet
242b28377d Improve type hints in kodi tests (#121508) 2024-07-08 12:57:52 +02:00
epenet
b048ad8afe Improve type hints in iqvia tests (#121506) 2024-07-08 12:57:19 +02:00
epenet
148803460b Improve type hints in kitchen_sink tests (#121509) 2024-07-08 12:54:43 +02:00
epenet
c4c623ea99 Improve type hints in kulersky tests (#121510) 2024-07-08 12:54:18 +02:00
epenet
4d68ae1199 Improve type hints in ipma tests (#121501) 2024-07-08 11:38:27 +02:00
epenet
3059bf0536 Improve type hints in insteon tests (#121504) 2024-07-08 11:34:50 +02:00
Paulus Schoutsen
1aa9588dcb Include hass device ID in mobile app get_config webhook (#121496) 2024-07-08 11:00:21 +02:00
Mr. Bubbles
00aafc0cf7 Add entity base class in Habitica integration (#121320)
* Sensor refactoring

* Change todo entities to use common base entity

* Requested changes

* Update button platform to use base class

* Update swtich platform to use base entity class
2024-07-08 10:18:09 +02:00
Mr. Bubbles
6350c5479b Add rest in the inn switch to Habitica integration (#121472)
* Add rest in the inn swich  to Habitica

* Move api call execution to coordinator
2024-07-08 09:58:33 +02:00
dependabot[bot]
ad47a7b8c6 Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#121491)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 09:22:07 +02:00
dependabot[bot]
617db25efb Bump actions/download-artifact from 4.1.7 to 4.1.8 (#121490)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 09:21:52 +02:00
Mr. Bubbles
ea65ff5876 Add button platform to Habitica integration (#121461) 2024-07-08 09:10:28 +02:00
dougiteixeira
cf4bd7fd1c Refactor schema generation in Template integration (#120889)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-07-08 09:06:15 +02:00
Markus Jacobsen
e30f315565 Fix BangOlufsenSource enum member names (#116052) 2024-07-07 23:53:49 +02:00
Ovidiu D. Nițan
cd478c356e Bump xiaomi-ble to 0.30.2 (#121471) 2024-07-07 23:13:43 +02:00
J. Nick Koston
27a2114ba9 Bump yalexs to 6.4.2 (#121467) 2024-07-07 13:41:31 -07:00
J. Nick Koston
4cf733b9a2 Small cleanups to doorbird (#121454) 2024-07-07 13:25:13 -07:00
Jan Bouwhuis
8a28cbe9e2 Wait for conversation test init (#121464)
* Wait for conversation test init

* typo
2024-07-07 22:24:20 +02:00
J. Nick Koston
6129a37bb0 Fix flakey homekit reload test (#121463) 2024-07-07 21:52:44 +02:00
Michael
0558e480ce Add event entity to Feedreader (#118147) 2024-07-07 21:44:41 +02:00
Joost Lekkerkerker
f126360c67 Add Mealie service to get mealplan (#120824)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-07-07 21:19:20 +02:00
G Johansson
833ac4db49 Add config flow to history_stats helper (#121381) 2024-07-07 21:06:37 +02:00
David Knowles
72458d143d Add valve support to Hydrawise (#116302) 2024-07-07 20:42:45 +02:00
ilan
12228d8a00 Add madvr envy integration (#120382)
* feat: Add madvr envy

* fix: await and pass entry directly

* fix: add attributes and unique id for sensors

* fix: reflect power state well, improve state detection

* fix: don't connect on init, add options, add reload on change, keep on during test

* fix: cancel tasks on unload

* fix: test connection via library

* fix: wait for boot time

* docs: add readme and license

* fix: broken pipe in lib

* fix: detect out of band power off

* fix: improve extra attributes

* fix: fix unloading, add config flow test, limit to one platform

* fix: use conf, refresh coordinator, other comments

* fix: remove event data

* fix: fix tests passing, remove wake on lan

* fix: dont allow to proceed unless connection works

* chore: update dep

* fix: update config flow, add constants

* fix: write state, use runtime data instead

* fix: remove await

* fix: move unloading and stuff to coordinator/init

* fix: pass in config entry with correct type

* fix: move queue and tasks to library

* fix: config flow error flow, tests, name, and update lib

* fix: update lib, leave connection open on setup

* fix: update lib

* fix: address comments, remove wol from lib

* fix: remove unneeded options

* fix: remove fields

* fix: simplify code, address comments

* fix: move error to lib

* fix: fix test

* fix: stronger types

* fix: update lib

* fix: missing text from options flow

* chore: remove options flow

* chore: remove import

* chore: update comments

* fix: get mac from device, persist

* fix: add mac stuff to test

* fix: startup import errors

* chore: stale comment

* fix: get mac from persisted config

* chore: update lib

* fix: persist mac in a better way

* feat: use mac as unique ID for entry

* fix: use unique ID from mac, add proper device

* fix: will not be set in init potentially

* fix: access mac

* fix: optimize, move error to lib

* feat: add coordinator test, use conf

* fix: use one mock, add init test

* fix: not async

* feat: add remote test

* fix: types

* fix: patch client, expand remote tests

* fix: use snapshot test

* fix: update branding

* fix: add description, fix type check

* fix: update tests

* fix: test

* fix: update test

* fix: camelcase

* Fix

* feat: strict typing

* fix: strict typing in lib

* fix: type will never be None

* fix: reference to mac, all tests passing

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-07-07 20:41:53 +02:00
Christophe Gagnier
8110b60fc9 Use ConfigEntry runtime_data in TechnoVE (#121410) 2024-07-07 20:21:28 +02:00
Elliott Balsley
cd72bdd851 Add Prometheus fan_mode and climate_mode metrics (#120267)
Co-authored-by: Anton Tolchanov <1687799+knyar@users.noreply.github.com>
2024-07-07 19:39:54 +02:00
G Johansson
26bc37195e Add defrosting as HVACAction in ClimateEntity (#121448) 2024-07-07 18:54:40 +02:00
Robert Contreras
2def33b168 Home Connect unit tests for switch platform (#115456) 2024-07-07 18:30:59 +02:00
Jason R. Coombs
a5c9aa44bd Bump jaraco.abode to 5.2.1 (#121446)
Bump dependency on jaraco.abode to 5.2.1.

Closes #121300
2024-07-07 18:02:47 +02:00
Mr. Bubbles
751935539a Migrate Habitica Dailies and To-Do's to the todo platform (#116655)
* Add todo platform

* update for DataUpdateCoordinator

* set lastCron as dailies due date

* parse alternative duedate format

* fix tests

* send notification on item drop

* fix drop message

* update exception messages

* Simplified the update of user_fields by using set union

* move userFields to const

* Issue deprecation only if entity is acutally used

* Resolve issues

* user entity registry to get entity_id

* raise ServiceValidationError

* requested changes

* Move next_due_date helper function to util.py module

* some changes

* Move function to util.py
2024-07-07 17:50:27 +02:00
jan iversen
866cdcc993 Bump pymodbus to 3.6.9 (#121445)
Bump pymodbus 3.6.9.
2024-07-07 17:38:17 +02:00
Paulus Schoutsen
eb0f6f7088 Ensure intents_changed variable is always initialized (#121444) 2024-07-07 17:32:35 +02:00
Erwin Douna
fb8eeac563 Refactor Tado to use runtime_data (#121373) 2024-07-07 17:15:38 +02:00
Joost Lekkerkerker
1fefd396b9 Add mealie version to device info (#121443) 2024-07-07 17:13:15 +02:00
Thomas55555
67facdf3a5 Generate translation in vscode taks: Code Coverage (#120434)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-07-07 17:05:44 +02:00
Clifford Roche
27975c7517 Fix incorrect temperature in Gree if temp units changed on device (#121041) 2024-07-07 17:05:14 +02:00
J. Nick Koston
792c6a9cd9 Migrate doorbird to use entry.runtime_data (#121413) 2024-07-07 16:57:10 +02:00
Shai Ungar
b6609fa77c Deprecate the dynamic package sensors in seventeentrack (#116102)
* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

* Add deprecation comments for the dynamic package sensors

add more information when retrieving packages from service call

* Add deprecation comments for the dynamic package sensors

update deprecation comment

* 1. 17Track repair flow
2. update deprecation comment

* 1. remove description_placeholders
2. 2024.8 deprecated

* Update homeassistant/components/seventeentrack/repairs.py

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

* 1. extract deprecated to constant
2. fix types
3. check for issue_id
4. add listener only when not deprecated
5. update which service to call

* Update homeassistant/components/seventeentrack/strings.json

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

* Update homeassistant/components/seventeentrack/repairs.py

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

* 1. move deprecate_sensor_issue to where needed
2. add entry_id to issue_id
3. use constant where needed

* update breaks in ha version

* Update homeassistant/components/seventeentrack/strings.json

* Remove obsolete tests

* Fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-07-07 16:55:38 +02:00
Joost Lekkerkerker
a66631f1ee Bump aiomealie to 0.6.0 (#121439) 2024-07-07 16:55:25 +02:00
Tsvi Mostovicz
de8415d5c7 Set Jewish Calendar quality scale (#120604) 2024-07-07 16:42:43 +02:00
dougiteixeira
0d48d5a5ec Remove device ID from config schema via YAML in helper template (#120708) 2024-07-07 16:40:02 +02:00
srwareham
76bdc4f5c4 Add configurable keep_alive to Ollama integration, change default to 5m (#119341)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-07 16:38:01 +02:00
Zack Cerza
6937aed9fe Handle more pushover exceptions during setup (#115802)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-07-07 16:36:16 +02:00
Jetsada Machom
959298d121 Add Tuya Smart Gardening system (#118335) 2024-07-07 16:34:30 +02:00
kingy444
9b4e64ab62 Bump pydaikin to 2.13.1 (#118679)
Co-authored-by: Fredrik Erlandsson <fredrik.e@gmail.com>
2024-07-07 16:34:05 +02:00
Elliott Balsley
275a7499b1 Add prometheus fan handler (#119805)
Co-authored-by: Anton Tolchanov <1687799+knyar@users.noreply.github.com>
2024-07-07 16:32:15 +02:00
Sid
e2141dc208 Add _attr class attributes to TextToSpeechEntity (#115684) 2024-07-07 16:21:04 +02:00
Jan Rieger
790d22dc46 Migrate QNAP extra state attributes to separate states (#109221) 2024-07-07 16:18:37 +02:00
Marc Mueller
37ffe09add Update mypy-dev to 1.12.0a1 (#121428) 2024-07-07 16:10:17 +02:00
J. Nick Koston
dc5ae9e0b2 Add event platform to august (#121392) 2024-07-07 15:39:58 +02:00
Angel Nunez Mencias
4c1cb6cce8 Add support for SenseCAP (#121405) 2024-07-07 15:29:46 +02:00
Christophe Gagnier
643dcb1429 Change TechnoVE quality scale to platinum (#121275) 2024-07-07 15:28:25 +02:00
Joost Lekkerkerker
e9b62dd203 Fix missing placeholder in intergration issue (#121425) 2024-07-07 15:22:02 +02:00
rappenze
fc6906a12f Enable remove device entry in fibaro integration (#121427) 2024-07-07 15:21:38 +02:00
Michael
846528131e Allow current empty feeds to be configured in Feedreader (#121421) 2024-07-07 15:11:28 +02:00
Joost Lekkerkerker
1c2e6ab3db Fix Mealie URL field (#121434) 2024-07-07 15:03:32 +02:00
xLarry
8e45eb6168 Minor changes to laundrify binary_sensor platform (#121435) 2024-07-07 15:02:57 +02:00
Joost Lekkerkerker
d95b28bdee Sort mealie mealplans (#121433) 2024-07-07 15:01:58 +02:00
Joost Lekkerkerker
17172d841c Fix MPD config flow (#121431) 2024-07-07 14:54:29 +02:00
Florent Thoumie
5ea1601c2c Use shared httpx client in iaqualink integration (#121407) 2024-07-06 21:51:16 -07:00
G Johansson
44f989ae38 Fix feature flag in climate (#121398) 2024-07-06 23:36:53 +02:00
Michael
f1693f2fde Add @mib1185 as codeowner for Feedreader (#121399)
add @mib1185 as codeowner
2024-07-06 22:28:47 +02:00
Richard Kroegel
52de706a85 Set BMW quality scale to platinum (#121388) 2024-07-06 21:19:50 +02:00
G Johansson
6e8cfb3376 Fix timezone issue in smhi weather (#121389) 2024-07-06 21:18:02 +02:00
G Johansson
ac8ea8356c Fix unnecessary logging of turn on/off feature flags in Climate (#121387) 2024-07-06 19:32:27 +02:00
Yaroslav Barov
f115efe51d Add support for Xiaomi airpurifier and humidifier (#117791) 2024-07-06 19:25:05 +02:00
Rasmus Lundsgaard
99476d9337 Fix empty list in kodi media_player (#121250)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-07-06 19:20:14 +02:00
G Johansson
98370fd9a0 Bump psutil to 6.0.0 (#121385) 2024-07-06 19:09:00 +02:00
Barry vd. Heuvel
d113ea8e47 Convert Hue scenes brightness to 0..255 (#105871)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-06 19:04:52 +02:00
atlflyer
ec536bda3d Add json_attributes_path configuration for command_line sensor (#116656)
Add json attributes path config to command line sensor
2024-07-06 18:52:27 +02:00
Alberto Geniola
490dd53edf Improve Elmax alarm control panel (#117689) 2024-07-06 18:21:15 +02:00
Richard Kroegel
131d9ec51b Add BMW tire pressure sensors (#120949) 2024-07-06 18:20:01 +02:00
Richard Kroegel
48145c1a7d Refactor BMW sensors and migrate unique_ids (#121380) 2024-07-06 17:34:20 +02:00
Joost Lekkerkerker
cf34b46b5a Fix Audit license script comments (#121374) 2024-07-06 15:24:45 +02:00
Joost Lekkerkerker
3c14aa12ab Add repair issue when trying to set up unknown integration (#121089)
* Add repair issue when trying to set up unknown integration

* Add repair issue when trying to set up unknown integration

* Add repair issue when trying to set up unknown integration

* Fix

* Update homeassistant/components/homeassistant/strings.json

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Update homeassistant/components/homeassistant/strings.json

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>

* Update homeassistant/setup.py

* Fix

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-07-06 15:02:58 +02:00
Christophe Gagnier
df9ced9768 Implement TechnoVE diagnostic (#121278) 2024-07-06 13:46:19 +02:00
djtimca
b5a0e89c03 Remove old codeowners who no longer maintain the Omnilogic integration (#117987)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-06 13:11:32 +02:00
Brett Adams
f46c127423 Add energy switch entities to Tessie (#121360) 2024-07-06 12:45:27 +02:00
Brett Adams
e04d612874 Add energy number entities for Tessie (#121354) 2024-07-06 12:29:18 +02:00
Xidorn Quan
2bc7904b51 Add demand window sensor for amberelectric (#121356) 2024-07-06 12:28:52 +02:00
Marius
be0cf545b2 Add valve-open/closed state icons (#121312) 2024-07-06 12:26:35 +02:00
Brett Adams
8f7c3da456 Add energy select entities to Tessie (#120641) 2024-07-06 11:49:53 +02:00
tronikos
17daccd38a Refactor the validation in Google Cloud TTS (#120853) 2024-07-06 11:44:46 +02:00
Alan
8ff4991f07 LLM to handle int attributes (#121037) 2024-07-06 11:41:18 +02:00
Luke Lashley
43481ffeac Add support for Roborock Zeo (#121334) 2024-07-06 11:24:32 +02:00
Robert C. Maehl
ac8bbe9db4 Direct Users to App-Specific Passwords for iCloud integration to prevent MFA spam (#120945)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-07-06 11:12:38 +02:00
Brett Adams
696ae91c35 Add energy binary sensors to Tessie (#121349) 2024-07-06 11:05:52 +02:00
Richard Kroegel
f29094f41d Refactor BMW send_message and add tests (#119170)
Co-authored-by: Richard <rikroe@users.noreply.github.com>
2024-07-06 11:00:00 +02:00
Brett Adams
294c31f6f5 Fix initial Wall Connector values in Tessie (#121353) 2024-07-06 10:54:09 +02:00
Robert Svensson
cce77affc7 Provide default values for common keys in deCONZ websocket fixture (#121359) 2024-07-06 10:52:50 +02:00
Michael Hansen
1ec95f900d Bump webrtc-noise-gain to 1.2.4 (#121346) 2024-07-06 10:51:40 +02:00
Dave T
a358609609 Improve user message if stream is not set up in generic camera (#121308) 2024-07-06 10:50:16 +02:00
Brett Adams
18370bdbb4 Add diagnostics to Tessie (#121348)
* Add diag

* Add snapshot

* Redact serial number
2024-07-06 09:00:03 +02:00
Luke Lashley
e86f2220d0 Bump anova-wifi to 0.17.0 (#121337)
* Bump anova-wifi to 0.16.0

* Bump to .17
2024-07-06 08:39:24 +02:00
Sid
9f839dbb77 Bump ruff to 0.5.1 (#121324)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-07-05 16:44:14 -05:00
Robert Svensson
1b8944dab6 Improve deCONZ websocket fixture (#121332) 2024-07-05 22:35:06 +02:00
Devin
9d204613e8 Expose Twitch "Started At" attribute (#121265) 2024-07-05 22:33:04 +02:00
Joost Lekkerkerker
f2c9188e46 Add audit license script (#120683)
* Add license script

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Remove packages

* Remove packages

* Remove packages

* Remove packages

* Fix

* Remove packages

* Remove packages

* Fix

* Fix

* Fix

* Fix exceptions
2024-07-05 22:04:21 +02:00
Joost Lekkerkerker
1561324274 Fix Netatmo snapshot (#121333) 2024-07-05 22:02:43 +02:00
Erwin Douna
34b5df50cc Match comments with refactoring (#121330)
Change comments
2024-07-05 21:50:50 +02:00
Cris-ET
130dbcb3f1 Add PPV2 entity for Growatt storage inverter (#121052) 2024-07-05 20:20:56 +01:00
J. Nick Koston
89ffee9ad5 Update ulid-transform to 0.10.1 (#121321) 2024-07-05 14:07:39 -05:00
Robert Svensson
94db251aea Finally remove all legacy test stubs from deCONZ tests (#121323) 2024-07-05 20:47:43 +02:00
tronikos
ad2d794fd6 Get languages and voices from the API in Google Cloud TTS (#120852) 2024-07-05 20:03:06 +02:00
Robert Svensson
178655647d Use fixtures in deCONZ init tests (#121217) 2024-07-05 19:17:47 +02:00
Jan Temešinko
6e5c3904b6 Fix ombi configuration validation (#121314) 2024-07-05 19:12:09 +02:00
Robert Svensson
a773d0c8f6 Use fixtures on deCONZ event tests (#121303) 2024-07-05 19:11:21 +02:00
Erik Montnemery
6eeb70151d Use BIGINT SQL type for ID columns (#121025) 2024-07-05 10:42:39 -05:00
Joost Lekkerkerker
fd815beb2d Add valve to base platform (#121313) 2024-07-05 17:41:13 +02:00
Robert Svensson
8c459959ee Use fixtures in deCONZ gateway tests (#121305) 2024-07-05 16:59:10 +02:00
epenet
4b4b17e774 Improve hass type hints for autouse fixtures in tests (#121311) 2024-07-05 15:49:22 +01:00
epenet
9383920b1a Improve type hints in hdmi_cec tests (#121302) 2024-07-05 16:42:55 +02:00
Luke Lashley
ffc39585ed Add ability to select current map for Roborock (#120882)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-05 09:38:26 -05:00
epenet
45ab9cae1a Improve type hints for silent_ssdp_scanner in tests (#121309) 2024-07-05 16:32:10 +02:00
Mariusz Kubisz
bf8cef3337 Add support for min mode in Netatmo public sensor (#118613) 2024-07-05 16:25:05 +02:00
Richard Kroegel
324755b8f5 Separate BMW base entity into separate file (#120830)
* Refactor BMW base entity

* Update snapshots

* Changes from review
2024-07-05 16:08:27 +02:00
Dave T
94d010a4c0 Fix vscode debug launch deprecation warning by swapping python to debugpy (#120866) 2024-07-05 14:49:41 +02:00
dougiteixeira
4289efb506 Device change test improvements in Template (#120884) 2024-07-05 14:47:31 +02:00
epenet
b9cfd4e8ce Improve type hints in hue tests (#121298) 2024-07-05 14:40:23 +02:00
epenet
7332bc5faf Improve type hints in http tests (#121294) 2024-07-05 14:37:00 +02:00
Bram Kragten
641d6382fd Update frontend to 20240705.0 (#121295) 2024-07-05 14:35:21 +02:00
epenet
288c297c9c Improve type hints in homeassistant_alerts tests (#121293) 2024-07-05 13:25:31 +02:00
epenet
e4731c07cb Add monkeypatch to enforce-type-hints plugin (#121051) 2024-07-05 11:35:56 +02:00
Steven B
d42dced852 Fix tplink light effect behaviour when activating a scene (#121288) 2024-07-05 11:19:04 +02:00
epenet
d0c10c961d Improve type hints in broadlink (#121285) 2024-07-05 11:12:01 +02:00
Joost Lekkerkerker
0088765268 Bump pynx584 to 0.8.2 (#120910) 2024-07-05 11:10:48 +02:00
Franck Nijhof
afb184db73 Remove coveragerc (#121286) 2024-07-05 11:03:31 +02:00
Robert Svensson
eb5a98e7ea Use fixtures in deCONZ light tests PT2 (#121208) 2024-07-05 10:57:17 +02:00
epenet
2ab02c06c6 Add monkeypatch type hints to rflink tests (#121053) 2024-07-05 10:54:16 +02:00
G Johansson
0cf5b4f965 Bump python-holidays to 0.52 (#121283) 2024-07-05 10:02:52 +02:00
Thomas55555
ad02afe7be Extend wrapper for sending commands to all platforms in Husqvarna Automower (#120255) 2024-07-05 10:02:38 +02:00
Paulus Schoutsen
daaf35d4c1 Simplify conversation tests (#121060)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-05 09:46:36 +02:00
J. Nick Koston
229e54d0b1 Remove unneeded blocking sleep in srp_energy tests (#121141) 2024-07-05 09:46:12 +02:00
hahn-th
97de9c9f69 Revert Homematic IP Cloud unique ID changes (#121231) 2024-07-05 09:45:20 +02:00
Allen Porter
700675042b Improve redaction for stream error messages (#120867) 2024-07-05 09:42:29 +02:00
Marcel van der Veldt
1c1e1a7bfa Listen for attribute changes of OnOff cluster in appliances (#121198) 2024-07-05 09:41:57 +02:00
Marcel van der Veldt
98dfb47448 Fix Matter light discovery schema for DimmerSwitch (#121185) 2024-07-05 09:41:41 +02:00
Thomas55555
1b42b32ac1 Fix work area sensor in Husqvarna Automower (#121228) 2024-07-05 09:41:21 +02:00
Maciej Bieniek
dbe98de82a Fix pulse counter frequency sensors for Shelly Plus Uni (#121178)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-05 09:40:43 +02:00
Christophe Gagnier
b28f528a7a Add max current number entity for TechnoVE (#121148)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-07-05 09:39:58 +02:00
J. Nick Koston
d3f424227f Cleanup unifiprotect entity classes (#121184) 2024-07-05 09:31:31 +02:00
Paulus Schoutsen
22718ca32a Assist Pipeline minor cleanup (#121187) 2024-07-05 09:26:32 +02:00
J. Nick Koston
2b9bddc3fc Make device_tracker fallback defaults cached_property (#121260) 2024-07-05 09:25:57 +02:00
Filipe Pina
213bbae63c Respect icloud Enable polling updates (#117984)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-05 09:24:02 +02:00
Matthew FitzGerald-Chamberlain
def27a082c Add Aprilaire humidifier (#120270) 2024-07-05 09:19:24 +02:00
Maikel Punie
c3830a58cc Bump velbusaio to 2024.7.5 (#121156)
* Bump velbusaio to 2024.7.4

* bump to 2024.7.5 to remove print functions
2024-07-05 09:12:47 +02:00
epenet
b054c037fe Improve type hints in hassio tests (#121221) 2024-07-05 09:05:21 +02:00
Robert Svensson
dcef25c0fa Use fixtures in deCONZ climate tests (#121242) 2024-07-05 09:01:45 +02:00
J. Nick Koston
5a24ee0bc0 Fix blocking I/O while validating config schema (#121263) 2024-07-05 08:58:30 +02:00
J. Nick Koston
e71f6c5948 Small speedup to processing entity customize (#121271) 2024-07-05 08:57:08 +02:00
J. Nick Koston
cdb2ec4231 Small speed up to entity state calculation (#121273) 2024-07-05 08:56:20 +02:00
J. Nick Koston
adee8094e7 Cache is_official_image/is_docker_env in bootstrap to fix blocking I/O (#121261)
* Cache is_official_image and is_docker_env in bootstrap to fix blocking I/O

These do blocking I/O later in the startup process

discovered in https://github.com/home-assistant/core/pull/120273

* comment
2024-07-05 08:30:07 +02:00
Avi Miller
6c42596bdd Bump aiolifx to 1.0.4 (#121267) 2024-07-04 22:26:44 -05:00
Sarabveer Singh
b3a62a97b4 Update HomeKit PM2.5 mappings based on new 2024 US EPA AQI (#109900) 2024-07-04 22:10:35 -05:00
Robert Svensson
62d9020261 Remove legacy method from deCONZ fan and sensor tests (#121244) 2024-07-04 18:17:15 -05:00
Erik Montnemery
e47cbf3cf7 Use async_setup_recorder_instance fixture in recorder v32_migration tests (#121081)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 17:49:51 -05:00
Shay Levy
d799a4575b Bump aiowebostv to 0.4.2 (#121258) 2024-07-04 17:27:56 -05:00
Jordi
b406438fa7 Bump aioaquacell to 0.1.8 (#121253) 2024-07-05 01:05:35 +03:00
Shay Levy
b14f22926a Fix WebOS TV media player status when OFF after IDLE (#121251) 2024-07-05 00:19:24 +03:00
xLarry
276f6c7ee7 Update laundrify_aio to v1.2.2 (#121068)
* refactor: upgrade laundrify_aio to v1.2.1

* refactor: update laundrify_aio to v1.2.2
2024-07-04 22:08:50 +02:00
epenet
83fac6192d Use service_calls fixture in webostv tests (#120999) 2024-07-04 23:07:38 +03:00
epenet
84a8259103 Improve type hints in ezviz tests (#120679) 2024-07-04 21:59:02 +02:00
Pavel Skuratovich
3ca66be268 Starline: Fix "Error updating SLNet token" message in Log (#121122)
Fixes https://github.com/home-assistant/core/issues/116715
2024-07-04 21:54:39 +02:00
Maciej Bieniek
001bb3a04e Bump nettigo_air_monitor to version 3.3.0 (#120901)
* Bump nam library

* Update snaphots (increasing accuracy)

* Update lib and snapshot

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-07-04 21:40:25 +02:00
dougiteixeira
50cc31e9cc Add device class translations in Random (#120890) 2024-07-04 21:36:31 +02:00
Richard Kroegel
0afebf744f Add MINI Connected virtual integration (#120874) 2024-07-04 21:30:02 +02:00
Matthew FitzGerald-Chamberlain
df7be501d3 Fix AprilAire case (#120895)
* Fix AprilAire case

* Fix test
2024-07-04 21:27:56 +02:00
G Johansson
ebe7a4747d Bump pytrafikverket to 1.0.0 (#121210)
* Update all related files and tests to new version

* Fix missed modal

* Bump requirements
2024-07-04 21:09:19 +02:00
Robert Resch
10d3c3d341 Bump deebot-client to 8.1.1 (#121241) 2024-07-04 21:03:33 +02:00
Gerben Jongerius
6ab6ce30ef Bump youless library version 2.1.2 (#121181) 2024-07-04 20:51:57 +02:00
epenet
fe0bafd067 Add warnings for deprecated json helpers (#121161) 2024-07-04 20:48:08 +02:00
epenet
04a6285e62 Add .coveragerc to core files (#121182) 2024-07-04 20:46:36 +02:00
epenet
e07bf61f03 Import AsyncGenerator from collections.abc in tests (#121019)
* Force import of Async/Generator from collections.abc

* Adjust

* Don't force
2024-07-04 20:24:27 +02:00
Marcel van der Veldt
df1b02d44e Use Generator from abc instead of typing_extensions in Matter discovery (#121236)
Use Generator from abc instead of typing_extensions
2024-07-04 20:06:23 +02:00
J. Nick Koston
79f4cc9c12 Update uiprotect to 5.2.2 (#121227) 2024-07-04 19:57:30 +02:00
Patrick Koenig
7d5341cab2 Update short_name in web app manifest (#121223) 2024-07-04 18:55:30 +02:00
jvmahon
d5135d4956 Add support for the Select platform in Matter (#119769)
* Add support for ModeSelect Cluster

* Update discovery.py

* Add files via upload

* refactor part 1

* Update discovery.py

* add remaining mode discovery schemas

* add test

* type alias

---------

Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
2024-07-04 18:29:10 +02:00
Luke Lashley
950c72a04c Bump anova-wifi to 0.15.0 (#121222) 2024-07-04 11:05:22 -05:00
Erik Montnemery
6df15ad8fc Drop use of async_setup_recorder_instance fixture in recorder purge tests (#121193) 2024-07-04 10:39:24 -05:00
Erik Montnemery
a1e6f8c2ec Drop use of async_setup_recorder_instance fixture in recorder migration tests (#121196) 2024-07-04 10:39:13 -05:00
cnico
092e362f01 Add new integration for Dio Chacon cover devices (#116267)
* Dio Chacon integration addition with config flow and cover entity

* Addition of model information for device

* Addition of light and service to force reloading states

* Logger improvements

* Convert light to switch and usage of v1.0.0 of the api

* 100% for tests coverage

* Invalid credential implementation and rebase on latest ha dev code

* Simplify PR with only one platform

* Ruff correction

* restore original .gitignore content

* Correction of cover state bug when using cover when using actions on cover group.

* Begin of corrections following review.

* unit tests correction

* Refactor with a coordinator as asked by review

* Implemented a post constructor callback init method via dio-chacon-api-1.0.2. Improved typing.

* Corrections for 2nd review

* Reimplemented without coordinator as reviewed with Joostlek

* Review improvement

* generalize callback in entity

* Other review improvements

* Refactored tests for readability

* Test 100% operationals

* Tests review corrections

* Tests review corrections

* Review tests improvements

* simplified tests with snapshots and callback method

* Final fixes

* Final fixes

* Final fixes

* Rename to chacon_dio

---------

Co-authored-by: Joostlek <joostlek@outlook.com>
2024-07-04 16:45:20 +02:00
epenet
28f06cb5a0 Add type hints to homekit events fixture (#121211) 2024-07-04 16:32:01 +02:00
epenet
411630429d Improve type hints in habitica tests (#121212) 2024-07-04 16:27:57 +02:00
epenet
9a1f7f020c Add type hints to matrix events fixtures (#121213) 2024-07-04 16:17:18 +02:00
Robert Svensson
d12f2384c5 Use fixtures in deCONZ config flow tests PT2 (#121203)
* Use fixtures in deCONZ config flow tests PT2

* Update tests/components/deconz/test_config_flow.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-07-04 15:53:25 +02:00
Robert Svensson
24c82c2475 Use fixtures in deCONZ sensor tests PT2 (#121204) 2024-07-04 15:48:49 +02:00
epenet
b949240d4a Improve type hints in google tests (#121169) 2024-07-04 05:56:01 -07:00
Robert Svensson
f78933235d Use fixtures in deCONZ service tests (#121108)
* Use fixtures in deCONZ service tests

* Update tests/components/deconz/test_services.py

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

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 14:23:40 +02:00
Robert Svensson
ece8b74967 Use fixtures in deCONZ device trigger tests (#121103) 2024-07-04 14:23:15 +02:00
Robert Svensson
1d8382a498 Use fixtures in deCONZ light tests PT1 (#121112)
Use fixtures in deCONZ light tests part 1
2024-07-04 14:22:10 +02:00
Robert Svensson
873d96bab3 Use fixtures in deCONZ binary sensor tests (#120966) 2024-07-04 14:21:26 +02:00
Robert Svensson
31ed32da6c Use fixtures in deCONZ alarm control panel tests (#120967) 2024-07-04 14:20:57 +02:00
Erik Montnemery
f1d6ad9073 Add test fixture to control recorder migration (#121180)
* Add test fixture to control recorder migration

* Update tests/components/recorder/conftest.py

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

* Update tests/components/recorder/conftest.py

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-04 13:10:08 +02:00
Erik Montnemery
d1264655a0 Fix some typos in core.py (#121189) 2024-07-04 13:04:52 +02:00
Giuliano Riccio
ad1ba1a5e5 Fix Google assistant SDK broadcasting command for italian (#116198)
Fixed broadcasting command for italian

Co-authored-by: tronikos <tronikos@users.noreply.github.com>
2024-07-04 03:47:32 -07:00
Erik Montnemery
255778d0c7 Use recorder test fixtures in recorder init tests (#121176) 2024-07-04 04:54:40 -05:00
epenet
3c69301365 Improve type hints in guardian tests (#121175) 2024-07-04 04:53:49 -05:00
J. Nick Koston
67a4c2c884 Add support for event entity motion sensors to HomeKit (#121123) 2024-07-04 04:50:50 -05:00
Robert Svensson
d429bcef16 Use fixtures in deCONZ sensor tests PT1 (#121116) 2024-07-04 11:50:23 +02:00
Robert Svensson
02e7707f91 Use fixtures in deCONZ config flow tests PT1 (#121121) 2024-07-04 04:49:46 -05:00
Franck Nijhof
ee2df9c4b3 Merge branch 'master' into dev 2024-07-04 11:48:03 +02:00
J. Nick Koston
0be1f773a2 Add event platform to doorbird (#121114) 2024-07-04 04:41:56 -05:00
epenet
a6f6221f16 Add monkeypatch type hints to numato tests (#121056)
* Add monkeypatch type hints to numato tests

* Adjust

* Improve
2024-07-04 02:33:47 -07:00
Steven B
4958e8e5c1 Bump python-kasa to 0.7.0.3 (#121183) 2024-07-04 04:31:58 -05:00
epenet
8aedb1201d Improve type hints in google_pubsub tests (#121172)
* Improve type hints in google_pubsub tests

* Remove from .coveragerc
2024-07-04 02:31:35 -07:00
J. Nick Koston
aa74ad0061 Enable ruff asyncio event loop blocking detection rules (#120799) 2024-07-04 04:17:57 -05:00
epenet
43e4223a8e Improve type hints in google_generative_ai tests (#121170) 2024-07-04 02:09:34 -07:00
Paulus Schoutsen
869f24df49 Convert async_get_conversation_languages from async to callback (#121162)
* Convert get_languages to callback

* One more callback
2024-07-04 10:41:31 +02:00
epenet
cf96084ea3 Improve type hints in generic tests (#121166) 2024-07-04 10:32:00 +02:00
epenet
1eec49696a Improve type hints in generic_hygrostat/thermostat tests (#121167) 2024-07-04 10:30:17 +02:00
epenet
1f22f0d89b Improve type hints in google_travel_time tests (#121171) 2024-07-04 10:27:55 +02:00
epenet
dd8ba0828a Improve type hints in geofency tests (#121168) 2024-07-04 10:27:37 +02:00
epenet
c9acd1711c Improve type hints in gpslogger tests (#121173) 2024-07-04 10:23:14 +02:00
epenet
4589be2d11 Improve type hints in group tests (#121174) 2024-07-04 10:22:39 +02:00
Erik Montnemery
d55d02623a Add recorder test fixture to enable persistent SQLite database (#121137)
* Add recorder test fixture to enable persistent SQLite database

* Fix tests directly using async_test_home_assistant context manager
2024-07-04 09:59:37 +02:00
Marcel van der Veldt
24f6e6e885 Fix locking/unlocking transition state in Matter lock platform (#121099) 2024-07-04 09:20:55 +02:00
Steven Looman
ac9c08f52c Add port mapping entry count sensor to upnp (#120263)
Add port mapping entry count sensor
2024-07-04 09:07:41 +02:00
J. Nick Koston
8a5b201d75 Fix blocking I/O in event loop in core test (#121128) 2024-07-04 07:43:46 +02:00
J. Nick Koston
0e9acf2685 Bump thermobeacon-ble to 0.7.0 (#121136)
changelog: https://github.com/Bluetooth-Devices/thermobeacon-ble/compare/v0.6.2...v0.7.0
2024-07-04 07:42:49 +02:00
Christophe Gagnier
3b023367d7 Update pytechnove to 1.3.1 (#121146) 2024-07-04 05:55:36 +01:00
J. Nick Koston
3dbab1a580 Bump inkbird-ble to 0.5.8 (#121134) 2024-07-04 05:51:05 +01:00
J. Nick Koston
1144e23d8d Fix blocking I/O in config tests (#121144) 2024-07-04 05:21:30 +01:00
J. Nick Koston
e8ef2c2822 Fix blocking I/O in tts tests (#121143) 2024-07-04 05:21:01 +01:00
J. Nick Koston
a4d4fc6827 Fix blocking I/O in stream tests (#121142) 2024-07-04 05:15:26 +01:00
J. Nick Koston
7002042119 Fix blocking I/O in mqtt tests (#121140) 2024-07-04 05:13:13 +01:00
J. Nick Koston
c59fc4e3c7 Fix blocking I/O in media_extractor tests (#121139) 2024-07-04 05:08:53 +01:00
Erik Montnemery
cc2782edc7 Use async_test_recorder fixture in recorder auto_repairs tests (#121125) 2024-07-04 01:38:01 +02:00
Martin Weinelt
b6a23fad35 Fix broken pathlib import in august integration (#121135) 2024-07-03 18:18:28 -05:00
MeIchthys
cfef09d653 Bump nextcloudmonitor to 1.5.1 (#120356) 2024-07-04 01:08:38 +02:00
J. Nick Koston
84d8bc711d Fix blocking I/O in event loop in google_assistant test (#121126)
found by ruff in #120799
2024-07-03 23:35:23 +01:00
J. Nick Koston
595e688c56 Fix blocking I/O in event loop in kira test (#121127) 2024-07-03 23:35:02 +01:00
Erik Montnemery
408e524551 Add recorder test fixture for skipping tests by DB engine (#121118)
* Add recorder test fixture for skipping tests by DB engine

* Fix mistake
2024-07-04 00:02:46 +02:00
epenet
73716ea529 Add monkeypatch type hints to webostv tests (#121054)
* Add monkeypatch type hints to webostv

* Improve
2024-07-03 23:49:31 +03:00
epenet
c9240b8e34 Add monkeypatch type hints to switcher_kis tests (#121055)
* Add monkeypatch type hints to switch_kis

* Improve
2024-07-03 23:49:01 +03:00
J. Nick Koston
7958c0825e Fix blocking process call in process tests (#121104)
Discovered by ruff in https://github.com/home-assistant/core/pull/120799
2024-07-03 22:26:03 +02:00
J. Nick Koston
291f309c0e Remove unnecessary lambdas in timeout tests (#121101) 2024-07-03 22:24:41 +02:00
Christoph
f85c356522 Fix HmIP-ESI GAS sensor DeviceClass (#121106)
should be SensorDeviceClass:GAS instead of SensorDeviceClass:VOLUME to be supported in the Energy Dashboard
2024-07-03 22:19:59 +02:00
J. Nick Koston
8017bc6776 Fix blocking I/O in demo mailbox (#121097) 2024-07-03 14:37:29 -05:00
Jan Bouwhuis
2040c285b1 Remove schema option for mqtt vacuum configs (#121093) 2024-07-03 21:35:20 +02:00
J. Nick Koston
53767b6159 Fix event loop blocking I/O in generic tests (#121100) 2024-07-03 20:24:25 +01:00
J. Nick Koston
4881205831 Fix event loop blocking I/O in command_line tests (#121098) 2024-07-03 14:22:38 -05:00
Erik Montnemery
5029da6919 Make the async_setup_recorder_instance fixture a context manager (#121086) 2024-07-03 14:05:34 -05:00
Erik Montnemery
61f1c8d963 Fix leak of SQLAlchemy engine objects in recorder (#121085) 2024-07-03 12:17:52 -05:00
J. Nick Koston
48172b0426 Small speed up to writing entity state (#121043) 2024-07-03 12:16:41 -05:00
J. Nick Koston
44c89e6c3b Cleanup v32 recorder migration test (#121083) 2024-07-03 10:45:19 -05:00
J. Nick Koston
e4a0a21b67 Bump uiprotect to 5.2.0 (#121079) 2024-07-03 10:18:46 -05:00
Joost Lekkerkerker
bc363c385f Fix async knocki function (#121048) 2024-07-03 17:17:37 +02:00
Marcel van der Veldt
7a9792c111 Matter fix Energy sensor discovery schemas (#121080) 2024-07-03 17:16:51 +02:00
Robert Resch
1a715d7b89 Bump deebot-client to 8.1.0 (#121078) 2024-07-03 17:11:09 +02:00
Erik Montnemery
46a488d871 Use async_setup_recorder_instance fixture in recorder auto_repairs tests (#121077) 2024-07-03 17:04:39 +02:00
Michael Hansen
0b76d5c9ca Bump intents to 2024.7.3 (#121076) 2024-07-03 16:55:21 +02:00
Marcel van der Veldt
355c7399d7 Bump python-matter-server to 6.2.2 (#121072) 2024-07-03 16:27:45 +02:00
Erik Montnemery
e26b4554e6 Improve logic when retrying establishing database connection (#121047) 2024-07-03 16:22:21 +02:00
Paulus Schoutsen
976cb434c9 Add CONTROL supported feature to OpenAI conversation entities (#121064)
Add CONTROL supported feature to OpenAI
2024-07-03 09:19:46 -05:00
Robert Svensson
f284aa41eb Bump axis to v62 (#121070) 2024-07-03 16:16:13 +02:00
epenet
1332e39f9e Cleanup deprecated json utils (#121069)
* Cleanup deprectated json utils

* Adjust pylint
2024-07-03 15:57:32 +02:00
epenet
8709c668cc Remove unused diagnostics fixtures (#121066) 2024-07-03 15:57:02 +02:00
Erik Montnemery
87f7703f3c Use async_setup_recorder_instance fixture in recorder migration tests (#121050) 2024-07-03 08:56:05 -05:00
Bram Kragten
e7ffd7b9ad Update frontend to 20240703.0 (#121063) 2024-07-03 15:41:43 +02:00
Anton Tolchanov
9b2233e65e Generate Prometheus metrics in an executor job (#121058) 2024-07-03 15:41:01 +02:00
Kevin Stillhammer
fbb98a668c Bump here-transit to 1.2.1 (#120900) 2024-07-03 15:35:08 +02:00
Paulus Schoutsen
a885bdfe76 Add conversation supported feature CONTROL (#121036) 2024-07-03 14:30:51 +02:00
epenet
ac57eb7614 Add monkeypatch type hints to shelly tests (#121057)
* Add monkeypatch type hints to shelly tests

* Improve
2024-07-03 12:08:40 +02:00
J. Nick Koston
c33cbf8312 Bump inkbird-ble to 0.5.7 (#121039)
changelog: https://github.com/Bluetooth-Devices/inkbird-ble/compare/v0.5.6...v0.5.7
2024-07-02 21:12:17 -05:00
J. Nick Koston
23e061ccbd Bump uiprotect to 5.0.0 (#121034)
changelog: https://github.com/uilibs/uiprotect/compare/v4.2.0...v5.0.0

Breaking change in the lib is not auto converting enum values to
their underlying values. They are mostly StrEnums so this should
not have any impact unless I missed one.
2024-07-02 21:11:31 -05:00
Christophe Gagnier
399548a973 Bump pytechnove to 1.3.0 (#120975) 2024-07-03 02:32:34 +02:00
Erik Montnemery
a4d889e958 Remove BaseTableManager active attribute (#121020) 2024-07-02 18:29:12 -05:00
Markus Jacobsen
510315732a Add Beoconnect Core as selectable Bang & Olufsen device (#121015)
Add Beoconnect Core as available device
2024-07-02 21:22:22 +01:00
epenet
476efb1d36 Improve type hints in home_connect tests (#121014) 2024-07-02 22:19:33 +02:00
J. Nick Koston
bdc6805771 Bump orjson to 3.10.6 (#121028) 2024-07-02 13:17:25 -07:00
Jan-Philipp Benecke
7d31d553d0 Temporarily set apprise log level to debug in tests (#121029)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-07-02 22:13:19 +02:00
Bram Kragten
9749cf113a Update frontend to 20240702.0 (#121032) 2024-07-02 22:13:07 +02:00
Marc Mueller
0e52d149e4 Update voluptuous to 0.15.2 (#120631)
* Update voluptuous to 0.15.1

* Fix typing issues

* Add type ignores for json result type

* Update voluptuous to 0.15.2

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-07-02 12:57:09 -07:00
Marcel van der Veldt
0d0ca22103 Fix setting target temperature for single setpoint Matter thermostat (#121011) 2024-07-02 21:03:01 +02:00
Marcel van der Veldt
52627b9aed Handle mains power for Matter appliances (#121023) 2024-07-02 21:02:29 +02:00
Myles Eftos
ba7e45e157 Bump amberelectric to 1.1.1 (#121010) 2024-07-02 19:40:30 +02:00
epenet
592ef59c5a Use common fixtures in tasmota tests (#121000) 2024-07-02 17:38:20 +02:00
epenet
195f07a18a Use service_calls fixture in nest tests (#120987) 2024-07-02 08:02:17 -07:00
Erik Montnemery
5b39989869 Fix typo in post_schema_migration (#121017) 2024-07-02 15:52:54 +02:00
Erik Montnemery
b8b7c23258 Create log files in an executor thread (#120912) 2024-07-02 15:48:35 +02:00
epenet
faf43ed4c7 Adjust Generator type hints in tests (#121013) 2024-07-02 14:12:02 +02:00
epenet
bd234db48f Improve type hints in analytics tests (#121012) 2024-07-02 13:58:11 +02:00
Joost Lekkerkerker
2edb7eb42c Remove Aladdin Connect integration (#120980) 2024-07-02 13:51:44 +02:00
Jesse Hills
72d706ab52 [ESPHome] Disable dashboard based update entities by default (#120907)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-07-02 13:51:14 +02:00
starkillerOG
e322cada48 Reolink replace automatic removal of devices by manual removal (#120981)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-07-02 13:31:23 +02:00
Robert Svensson
baf2ebf1f2 Use fixtures in deCONZ diagnostics tests (#120968) 2024-07-02 12:43:34 +02:00
epenet
326d24d78b Use service_calls fixture in xiaomi_ble tests (#120998) 2024-07-02 12:37:50 +02:00
epenet
3adea1ada9 Use service_calls fixture in zwave_js tests (#120994) 2024-07-02 12:37:21 +02:00
epenet
02dffcde1a Use common registry fixtures in solarlog (#121005) 2024-07-02 12:36:30 +02:00
Joost Lekkerkerker
cdc3897319 Bump yt-dlp to 2024.07.01 (#120978) 2024-07-02 12:35:10 +02:00
epenet
22f5f59478 Use service_calls fixture in core platform tests [m-z] (#121001) 2024-07-02 12:34:11 +02:00
epenet
76a62028ad Use common registry fixtures in lifx (#121004) 2024-07-02 12:32:17 +02:00
epenet
6fd1f0a34f Use common fixtures in philips_js tests (#120988) 2024-07-02 12:31:10 +02:00
epenet
e544550380 Use service_calls fixture in yolink tests (#120997) 2024-07-02 12:30:52 +02:00
epenet
8819a9aa52 Use service_calls fixture in sun tests (#120990) 2024-07-02 12:29:51 +02:00
epenet
1f6744847d Use service_calls fixture in zone tests (#120995) 2024-07-02 12:29:21 +02:00
starkillerOG
4a8436d6bc Do not hold core startup with reolink firmware check task (#120985) 2024-07-02 12:28:32 +02:00
epenet
b13e78f3a3 Use service_calls fixture in microsoft tests (#120983) 2024-07-02 12:27:54 +02:00
epenet
71b7ee40e5 Use common registry fixtures in tplink (#121002) 2024-07-02 12:27:15 +02:00
epenet
9ca9377cad Use common registry fixtures in hue (#121003) 2024-07-02 12:26:25 +02:00
epenet
e3516be3e3 Use service_calls fixture in mqtt tests (#120984) 2024-07-02 11:23:46 +02:00
epenet
fac511aa46 Use service_calls fixture in samsungtv tests (#120992) 2024-07-02 10:37:14 +02:00
epenet
3df3e6d081 Use service_calls fixture in shelly tests (#120991) 2024-07-02 10:36:50 +02:00
epenet
07d80d5ad9 Use service_calls fixture in netatmo tests (#120986) 2024-07-02 10:17:41 +02:00
starkillerOG
2d054fb5df Bump reolink-aio to 0.9.4 (#120964) 2024-07-02 09:25:33 +02:00
Joost Lekkerkerker
2635573bbc Bump airgradient to 0.6.1 (#120962) 2024-07-02 08:23:31 +02:00
Teemu R
90d622cd02 Minor polishing for tplink (#120868) 2024-07-02 08:23:07 +02:00
Robert Svensson
0ffebd4853 Use fixtures in deCONZ button tests (#120958) 2024-07-01 20:48:33 +02:00
Joost Lekkerkerker
383de96549 Fix missing airgradient string (#120957) 2024-07-01 20:36:35 +02:00
Robert Svensson
690164a518 Use fixtures in deCONZ cover tests (#120954) 2024-07-01 20:31:42 +02:00
Robert Svensson
167a8c6613 Use fixtures in deCONZ fan tests (#120953) 2024-07-01 19:49:12 +02:00
epenet
07f095aa42 Use service_calls fixture in core platform tests [a-l] (#120904) 2024-07-01 19:27:50 +02:00
Markus Jacobsen
c2dc9e9b67 Simplify Bang & Olufsen media_image_url property (#120951)
Simplify media_image_url property
2024-07-01 20:23:27 +03:00
Shay Levy
b5367e5994 Fix Shelly device shutdown (#120881) 2024-07-01 19:06:56 +02:00
Robert Svensson
1209abc944 Use fixtures in deCONZ switch tests (#120944) 2024-07-01 19:03:32 +02:00
Markus Jacobsen
a29dc4ef1e Fix Bang & Olufsen jumping volume bar (#120946) 2024-07-01 19:02:43 +02:00
Robert Svensson
7a3039aecb Use fixtures in deCONZ lock tests (#120948) 2024-07-01 19:01:32 +02:00
Robert Svensson
d506c30b38 Use fixtures in deCONZ logbook tests (#120947) 2024-07-01 18:58:43 +02:00
Robert Resch
a0b604f98c Improve add user error messages (#120909) 2024-07-01 18:27:40 +02:00
J. Nick Koston
001ee0cc0b Downgrade logging previously reported asyncio block to debug (#120942) 2024-07-01 18:26:20 +02:00
epenet
e5c7ff6a5b Use service_calls fixture in conversation tests (#120906) 2024-07-01 17:57:40 +02:00
epenet
918ac5d67c Use service_calls fixture in geo_location tests (#120911) 2024-07-01 17:56:58 +02:00
epenet
afb0a6e0ab Use service_calls fixture in homekit_controller tests (#120927) 2024-07-01 17:55:39 +02:00
epenet
b3a50893cf Use service_calls fixture in kodi tests (#120929) 2024-07-01 17:55:01 +02:00
Paulus Schoutsen
c6cfe073ea Bump openai to 1.35.1 (#120926)
Bump openai to 1.35.7
2024-07-01 17:52:30 +02:00
Allen Porter
d53cfbbb4e Bump gcal_sync to 6.1.4 (#120941) 2024-07-01 17:52:19 +02:00
tronikos
8354aa434e Remove a useless line in Google Generative AI test (#120903) 2024-07-01 17:48:39 +02:00
tronikos
5ce54c2174 Replace GoogleAPICallError with GoogleAPIError (#120902) 2024-07-01 17:48:12 +02:00
epenet
813fee663e Use service_calls fixture in litejet tests (#120933) 2024-07-01 17:47:21 +02:00
Robert Svensson
dcf4e91234 Use fixtures in deCONZ number tests (#120938) 2024-07-01 17:46:46 +02:00
Robert Svensson
361e81821c Use fixtures in deCONZ scene tests (#120936) 2024-07-01 17:42:32 +02:00
Aidan Timson
52b743e88a Add exception translations (#120937) 2024-07-01 17:39:01 +02:00
epenet
788d1999ff Use service_calls fixture in lg_netcast tests (#120932) 2024-07-01 17:37:29 +02:00
epenet
c4903dd982 Use service_calls fixture in media_extractor tests (#120935) 2024-07-01 17:32:17 +02:00
Marcel van der Veldt
8a23e37837 Mark dry/fan-only climate modes as supported for Panasonic room air conditioner (#120939) 2024-07-01 17:30:23 +02:00
Robert Svensson
77fc1c991c Use fixtures in deCONZ select tests (#120943) 2024-07-01 17:29:57 +02:00
epenet
ce54ca9c8e Use service_calls fixture in lcn tests (#120931) 2024-07-01 17:27:32 +02:00
epenet
c8bb64882e Use service_calls fixture in homeassistant tests (#120922) 2024-07-01 17:26:41 +02:00
epenet
2815c43f3e Use service_calls fixture in lutron_caseta tests (#120934) 2024-07-01 17:24:36 +02:00
Steven B
38aa6bcf19 Bump python-kasa to 0.7.0.2 (#120940) 2024-07-01 16:50:35 +02:00
Allen Porter
2506acc095 Improve flume test coverage (#120851)
* Add Flume init tests

* Increase test coverage

* Improve readability

* Fix pydoc for tests

* Use pytest.mark.usefixtures
2024-07-01 07:41:47 -07:00
epenet
c9911fa8ce Use service_calls fixture in hue tests (#120928) 2024-07-01 16:16:19 +02:00
epenet
bc3562a9e8 Use service_calls fixture in knx tests (#120930) 2024-07-01 14:33:01 +02:00
dougiteixeira
5513682de4 Add missing translations for device class in Scrape (#120891) 2024-07-01 14:21:41 +02:00
epenet
61b2e4ca32 Add Context to service_calls fixture (#120923) 2024-07-01 14:05:30 +02:00
Robert Resch
546d6b22f1 Remove OverloadUT as codeowner from Ecovacs (#120517) 2024-07-01 14:03:21 +02:00
Marc Mueller
414525503c Use TypeVar defaults for Generator (#120921)
* Use TypeVar defaults for Generator

* Code review
2024-07-01 14:02:54 +02:00
epenet
4cc414fbf8 Use service_calls fixture in google_translate tests (#120920) 2024-07-01 13:10:39 +02:00
Jan Bouwhuis
09ff44e59e Bump incomfort-client dependency to 0.6.3 (#120913) 2024-07-01 13:06:14 +02:00
Robert Svensson
44640ef9e8 First step towards fixtures in deCONZ tests (#120863)
* config entry fixture

* Mock web request

* Make siren tests use new fixtures

* Replace old constants

* Add mock put request

* Change comment
2024-07-01 12:33:51 +02:00
Joost Lekkerkerker
f08638eead Add typing to Panasonic Viera (#120772)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-07-01 12:30:20 +02:00
Marc Mueller
921430d497 Import Generator from collections.abc (3) (#120916) 2024-07-01 12:09:11 +02:00
Marc Mueller
2f0dd6f704 Import Generator from collections.abc (2) (#120915) 2024-07-01 11:58:49 +02:00
Marc Mueller
f11b316dac Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
Marc Mueller
ca55986057 Import Generator from collections.abc (1) (#120914) 2024-07-01 11:51:51 +02:00
Allen Porter
aa5ebaf613 Bump ical to 8.1.1 (#120888) 2024-07-01 10:46:10 +02:00
epenet
88583149ea Use service_calls fixture in deconz tests (#120905) 2024-07-01 10:33:31 +02:00
dependabot[bot]
d5d77db4f9 Bump github/codeql-action from 3.25.10 to 3.25.11 (#120899)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 08:47:52 +02:00
dougiteixeira
295cfd26aa Add missing translations for device class in Template (#120893) 2024-07-01 07:55:13 +02:00
dougiteixeira
74c2f000d8 Add missing translations for device class in SQL (#120892) 2024-07-01 07:44:59 +02:00
Yuxin Wang
269b8b07c4 Add handling for different STATFLAG formats in APCUPSD (#120870)
* Add handling for different STATFLAG formats

* Just use removesuffix
2024-07-01 07:30:08 +02:00
Thomas55555
6af9527310 Bump aioautomower to 2024.6.4 (#120875) 2024-07-01 01:12:33 +02:00
Kevin Stillhammer
eceecbb07b Bump here-routing to 1.0.1 (#120877) 2024-07-01 00:23:42 +02:00
Etienne Soufflet
1a63bb89cb Fix Tado fan mode (#120809) 2024-06-30 20:38:35 +02:00
Sander Peterse
2f5ec41fa6 Add valve domain to HomeKit (#115901)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-30 12:04:20 -05:00
Richard Kroegel
f672eec515 Fix unifi device tracker test imports (#120864) 2024-06-30 16:27:03 +02:00
mkmer
419d89f863 Allow EM heat on from any mode in Honeywell (#120750) 2024-06-30 15:30:52 +02:00
Robert Resch
05ffd637f5 Migrate Ecowitt to runtime_data (#120675) 2024-06-30 15:29:00 +02:00
Joost Lekkerkerker
b375f5227b Bump pizzapi to 0.0.6 (#120691) 2024-06-30 15:28:01 +02:00
Robert Svensson
8b3319b772 Improve UniFi device tracker tests (#120795) 2024-06-30 15:26:45 +02:00
Robert Svensson
289a630578 Improve UniFi device tracker tests Pt2 (#120796) 2024-06-30 15:25:38 +02:00
dontinelli
bb62a8a7dc Change schema to TextSelector to enable autocomplete (#120771) 2024-06-30 15:22:36 +02:00
Robert Svensson
e961ddd5fe Simplify UniFi uptime sensor test (#120794) 2024-06-30 15:22:15 +02:00
Simon Lamon
be68255ca4 Fix routes with transfer in nmbs integration (#120808) 2024-06-30 15:16:41 +02:00
Richard Kroegel
57aced50aa Use SelectSelector in BMW config flow (#120831) 2024-06-30 15:04:55 +02:00
tronikos
5deb69d492 Correctly return file extension in Google Cloud TTS (#120849) 2024-06-30 15:02:06 +02:00
dontinelli
255cc9ed74 Store runtime data inside the config entry in fyta (#120761) 2024-06-30 14:57:48 +02:00
Michael
7aca7cf858 Bump pyfritzhome to 0.6.12 (#120861) 2024-06-30 14:56:12 +02:00
Robert Svensson
ca7fb906cc Axis improve fixture naming (#120844) 2024-06-30 14:52:20 +02:00
Richard Kroegel
d15d001cfc Use runtime_data for BMW (#120837) 2024-06-30 14:51:39 +02:00
tronikos
d55be79e6a Handle error when validating options in Google Cloud TTS (#120850) 2024-06-30 02:03:58 -07:00
tronikos
bf608691d5 Do not set gender if voice name is specified in Google Cloud TTS (#120848)
* Use TextToSpeechAsyncClient in Google Cloud TTS

* Do not set gender if voice name is specified in Google Cloud TTS
2024-06-30 02:03:24 -07:00
tronikos
75e3afd369 Use TextToSpeechAsyncClient in Google Cloud TTS (#120847) 2024-06-29 23:28:18 -07:00
tronikos
72fdebeb88 Bump google-cloud-texttospeech to 2.16.3 (#120845) 2024-06-29 22:38:56 -07:00
Allen Porter
f65304957a Rollback PyFlume to 0.6.5 (#120846) 2024-06-29 21:35:48 -07:00
J. Nick Koston
5280291f98 Add linked doorbell event support to HomeKit (#120834) 2024-06-29 18:43:20 -05:00
Tsvi Mostovicz
7172d798f8 Fix Jewish calendar unique id move to entity (#120842) 2024-06-30 00:08:24 +02:00
Shay Levy
e0b0959b3f Bump aiowebostv to 0.4.1 (#120838) 2024-06-29 22:07:37 +03:00
dontinelli
bcee5f4d9f Store runtime data inside the config entry in solarlog (#120773) 2024-06-29 19:32:22 +02:00
Steven Looman
559caf4179 Use eventing for some of the upnp sensors, instead of polling (#120262) 2024-06-29 12:11:22 -05:00
jjlawren
b5f1076bb2 Bump plexapi to 4.15.14 (#120832) 2024-06-29 11:10:35 -05:00
J. Nick Koston
8f98fb2ec4 Fix publish cancellation handling in MQTT (#120826) 2024-06-29 11:06:56 -05:00
Joost Lekkerkerker
25932dff28 Add unique id to Mealie config entry (#120816) 2024-06-29 17:48:28 +02:00
Joost Lekkerkerker
0ab7647fea Use meal note as fallback in Mealie (#120828) 2024-06-29 17:47:21 +02:00
Joost Lekkerkerker
ce34a5e495 Add icons to Airgradient (#120820) 2024-06-29 17:46:44 +02:00
Allen Porter
7d8cbbaacb Bump gcal_sync to 6.1.3 (#120278) 2024-06-29 17:45:51 +02:00
Joost Lekkerkerker
f07f9062c1 Bump python-opensky to 1.0.1 (#120818) 2024-06-29 07:53:42 -05:00
Mick Vleeshouwer
5a6deddd30 Bump pyOverkiz to 1.13.12 (#120819) 2024-06-29 07:53:01 -05:00
J. Nick Koston
c5804d362c Remove legacy foreign key constraint from sqlite states table (#120779) 2024-06-29 07:50:53 -05:00
J. Nick Koston
852bb19223 Cleanup db_schema from_event constructors (#120803) 2024-06-29 07:49:16 -05:00
Joost Lekkerkerker
6ed0960648 Bump aiomealie to 0.5.0 (#120815) 2024-06-29 13:48:43 +02:00
Clifford Roche
8f6addcc61 Bump greeclimate to 1.4.6 (#120758) 2024-06-29 08:25:22 +02:00
J. Nick Koston
2cfd6d53bd Add event platform to unifiprotect (#120681)
* Add event platform to unifiprotect

* Add event platform to unifiprotect

* Add event platform to unifiprotect

* Add event platform to unifiprotect

* adjust

* tweaks

* translations

* coverage

* coverage

* Update tests/components/unifiprotect/test_event.py
2024-06-29 07:49:14 +02:00
J. Nick Koston
0dfb5bd7d9 Fix unneeded dict values for MATCH_ALL recorder attrs exclude (#120804)
* Small cleanup to handling MATCH_ALL recorder attrs exclude

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed

* Fix unneeded dict values for MATCH_ALL recorder attrs exclude

The exclude is a set so the dict values were not needed
2024-06-29 07:42:08 +02:00
J. Nick Koston
d4ecbc91c3 Fix blocking I/O in xmpp notify to read uploaded files (#120801)
detected by ruff in https://github.com/home-assistant/core/pull/120799
2024-06-29 07:40:35 +02:00
J. Nick Koston
04ab74589a Fix missing f-string in loop util (#120800) 2024-06-29 07:01:18 +02:00
Paul Bottein
5995459de5 Update frontend to 20240628.0 (#120785)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-28 23:14:00 -05:00
Klaas Schoute
ba38f2e43b Bump gridnet lib to v5.0.1 (#120793) 2024-06-28 17:24:43 -05:00
dougiteixeira
cef7def024 Link Generic Hygrostat helper entity to actuator entity device (#120759) 2024-06-28 23:38:45 +02:00
dougiteixeira
8ed11d4b90 Link Generic Thermostat helper entity to actuator entity device (#120767) 2024-06-28 23:37:51 +02:00
J. Nick Koston
b03c10647e Fix stale docstring in recorder queries (#120763) 2024-06-28 16:29:12 -05:00
Klaas Schoute
a6454cf3c7 Bump odp-amsterdam lib to v6.0.2 (#120788) 2024-06-28 16:20:16 -05:00
wittypluck
3549aaf69c Reject small uptime updates for Unifi clients (#120398)
Extend logic to reject small uptime updates to Unifi clients + add unit tests
2024-06-28 22:47:20 +02:00
Klaas Schoute
a3394675f3 Bump energyzero lib to v2.1.1 (#120783) 2024-06-28 15:23:44 -05:00
Matthew FitzGerald-Chamberlain
97ef56d264 Bump pyaprilaire to 0.7.4 (#120782) 2024-06-28 22:15:34 +02:00
Mr. Bubbles
4fb0621027 Catch exceptions in service calls by buttons/switches in pyLoad integration (#120701)
* Catch exceptions in service calls by buttons/switches

* changes

* more changes

* update tests
2024-06-28 20:11:03 +02:00
Maciej Bieniek
c029c534d6 Do not call async_delete_issue() if there is no issue to delete in Shelly integration (#120762)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-28 19:34:24 +03:00
Toni Korhonen
f4224a0327 Bump Wallbox to 0.7.0 (#120768) 2024-06-28 17:54:20 +02:00
Joost Lekkerkerker
3e8773c0d5 Bump aiowithings to 3.0.2 (#120765) 2024-06-28 10:51:34 -05:00
J. Nick Koston
0ea1677f51 Increase mqtt availablity timeout to 50s (#120760) 2024-06-28 10:50:55 -05:00
Jan Bouwhuis
e907c45981 Cleanup mqtt platform tests part 5 (#120719) 2024-06-28 09:22:56 -05:00
Jan Bouwhuis
a8f4684929 Cleanup mqtt platform tests part 6 (last) (#120736) 2024-06-28 09:22:25 -05:00
Joost Lekkerkerker
d03a6f84a3 Bump govee-local-api to 1.5.1 (#120747) 2024-06-28 09:21:32 -05:00
Klaas Schoute
9505fcdd7d Bump p1monitor lib to v3.0.1 (#120756) 2024-06-28 09:20:44 -05:00
Klaas Schoute
3e3ab7a134 Bump easyenergy lib to v2.1.2 (#120753) 2024-06-28 09:14:31 -05:00
Joost Lekkerkerker
b56c4a757c Bump ruff to 0.5.0 (#120749) 2024-06-28 15:23:21 +02:00
Joost Lekkerkerker
984bbf8851 Bump sense-energy to 0.12.4 (#120744)
* Bump sense-energy to 0.12.4

* Fix
2024-06-28 14:53:29 +02:00
Joost Lekkerkerker
1fdd056c0e Fix ruff manual-dict-comprehension PERF403 (#120723)
* Fix PERF403

* Fix

* Fix
2024-06-28 14:17:47 +02:00
epenet
c7906f90a3 Improve type hints in frontend tests (#120739) 2024-06-28 13:36:26 +02:00
epenet
d427dff68d Improve type hints in forked_daapd tests (#120735) 2024-06-28 13:35:55 +02:00
Joost Lekkerkerker
f69b850b1a Bump xiaomi-ble to 0.30.1 (#120743) 2024-06-28 13:35:34 +02:00
epenet
d0ce0d562e Improve type hints in flo tests (#120730) 2024-06-28 13:34:26 +02:00
epenet
2e031d0194 Separate renault strings (#120737) 2024-06-28 13:26:31 +02:00
tronikos
d2a457c24f Fix Google Generative AI: 400 Request contains an invalid argument (#120741) 2024-06-28 13:25:55 +02:00
Ivan Belokobylskiy
c385deb6a3 Bump aiomaps with fixed license classifier (#120654) 2024-06-28 13:25:23 +02:00
Joost Lekkerkerker
6ef8e87f88 Fix ruff redefined-argument-from-local PLR1704 (#120729)
* Fix PLR1704

* Fix
2024-06-28 12:31:07 +02:00
dougiteixeira
4437c4a204 Link the Statistics helper entity to the source entity device (#120705) 2024-06-28 12:22:24 +02:00
Illia
23e5e25149 Bump asyncarve to 0.1.1 (#120740) 2024-06-28 12:14:44 +02:00
Joost Lekkerkerker
c13786c952 Fix ruff manual-dict-comprehension PERF403 in tests (#120738)
Fix PERF403 in tests
2024-06-28 12:14:24 +02:00
epenet
6f8c9c28e7 Improve type hints in fjaraskupan tests (#120732) 2024-06-28 12:03:26 +02:00
Joost Lekkerkerker
0fdf037ba0 Fix ruff type comparison E721 (#120731)
Fix E721
2024-06-28 11:56:49 +02:00
Brett Adams
3d580259e1 Check Tessie scopes to fix startup bug (#120710)
* Add scope check

* Add tests

* Bump Teslemetry
2024-06-28 11:21:59 +02:00
epenet
6d93695e2c Improve type hints in flux tests (#120733) 2024-06-28 11:20:17 +02:00
Mr. Bubbles
540da3cac6 Add unit and state_class to heating sensor in ista EcoTrend (#120728)
* Add unit and state_class to heating sensor

* remove constant
2024-06-28 10:16:13 +01:00
Joost Lekkerkerker
6286177041 Bump panasonic_viera to 0.4.2 (#120692)
* Bump panasonic_viera to 0.4.2

* Bump panasonic_viera to 0.4.2

* Bump panasonic_viera to 0.4.2

* Fix Keys
2024-06-28 11:15:44 +02:00
epenet
9b980602c9 Improve type hints in flux_led tests (#120734) 2024-06-28 11:09:54 +02:00
epenet
1e72c2f94d Bump renault-api to 0.2.4 (#120727) 2024-06-28 11:03:01 +02:00
epenet
5e39faa9f8 Improve type hints in auth tests (#120655) 2024-06-28 10:01:53 +01:00
Alexey ALERT Rubashёff
84de2da19f Add warm water remaining volume sensor to Overkiz (#120718)
* warm water remaining volume sensor

* Update homeassistant/components/overkiz/sensor.py

Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>

---------

Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-06-28 09:53:07 +01:00
Joost Lekkerkerker
03c6e0c55f Fix SIM300 (#120725) 2024-06-28 10:46:02 +02:00
Alexey ALERT Rubashёff
c98e70a6dc Add electrical consumption sensor to Overkiz (#120717)
electrical consumption sensor
2024-06-28 09:45:27 +01:00
Dave Leaver
827bfa89b3 Bump airtouch5py to 1.2.0 (#120715)
* Bump airtouch5py to fix console 1.2.0

* Bump airtouch5py again
2024-06-28 09:44:54 +02:00
Steven B
e0e744aed7 Bump ring-doorbell to 0.8.12 (#120671) 2024-06-28 08:52:01 +02:00
Erik Montnemery
ec069f9084 Set stateclass on unknown numeric Tasmota sensors (#120650) 2024-06-28 08:42:47 +02:00
Joost Lekkerkerker
4e34d02d2d Bump apsystems-ez1 to 1.3.3 (#120702) 2024-06-28 08:36:10 +02:00
Maciej Bieniek
e764afecac Bump nextdns to version 3.1.0 (#120703)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-06-27 23:12:20 +02:00
Erik Montnemery
f3761a8e53 Bump hatasmota to 0.9.2 (#120670) 2024-06-27 22:56:22 +02:00
epenet
bccd5c8c35 Improve type hints in evil_genius_labs tests (#120677) 2024-06-27 22:11:24 +02:00
J. Nick Koston
440928bcbe Bump unifi-discovery to 1.2.0 (#120684) 2024-06-27 22:10:48 +02:00
Glenn Waters
338687522a Bump Environment Canada to 0.7.1 (#120699) 2024-06-27 22:10:11 +02:00
Joost Lekkerkerker
6421612429 Bump ttls to 1.8.3 (#120700) 2024-06-27 22:09:33 +02:00
Bram Kragten
c4ab0dcd74 Update frontend to 20240627.0 (#120693) 2024-06-27 22:06:30 +02:00
Alexey ALERT Rubashёff
195643d916 Improve AtlanticDomesticHotWaterProductionMBLComponent support in Overkiz (#114178)
* add overkiz AtlanticDHW support

Adds support of Overkiz water heater entity selection based on device controllable_name
Adds support of Atlantic water heater based on Atlantic Steatite Cube WI-FI VM 150 S4CS 2400W
Adds more Overkiz water heater binary_sensors, numbers, and sensors

* Changed class annotation

* min_temp and max_temp as properties

* reverted binary_sensors, number, sensor to make separate PRs

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* review fixes, typos, and pylint

* review fix

* review fix

* ruff

* temperature properties changed to constructor attributes

* logger removed

* constants usage consistency

* redundant mapping removed

* Update homeassistant/components/overkiz/water_heater_entities/atlantic_dhw.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* boost mode method annotation typo

* removed away mode for atlantic dwh

* absence and boost mode attributes now support 'prog' state

* heating status bugfix

* electrical consumption sensor

* warm water remaining volume sensor

* away mode reintroduced

* mypy check

* boost plus state support

* Update homeassistant/components/overkiz/sensor.py

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>

* sensors reverted to separate them into their own PR

* check away and boost modes on before switching them off

* atlantic_dhw renamed to atlantic_domestic_hot_water_production

* annotation changed

* AtlanticDomesticHotWaterProductionMBLComponent file renamed, annotation change reverted

---------

Co-authored-by: Mick Vleeshouwer <mick@imick.nl>
2024-06-27 22:05:58 +02:00
Thomas55555
aaef31958b Bump aioautomower to 2024.6.3 (#120697) 2024-06-27 21:29:17 +02:00
epenet
629dab238f Improve type hints in enphase_envoy tests (#120676) 2024-06-27 13:24:22 -05:00
J. Nick Koston
c419d226d5 Bump uiprotect to 4.2.0 (#120669) 2024-06-27 12:58:42 -05:00
epenet
f4b76406f2 Add capsys to enforce-type-hints plugin (#120653) 2024-06-27 19:54:44 +02:00
MatthewFlamm
eb2d2ce1b3 Use more observations in NWS (#120687)
Use more observations
2024-06-27 13:47:25 -04:00
Glenn Waters
89dfca962f Bump upb-lib to 0.5.7 (#120689) 2024-06-27 19:41:36 +02:00
Joost Lekkerkerker
d423dae8ac Fix unknown attribute in MPD (#120657) 2024-06-27 19:41:21 +02:00
Jan Bouwhuis
f3c76cd698 Split mqtt client tests (#120636) 2024-06-27 19:37:43 +02:00
J. Nick Koston
0c910bc000 Add newer models to unifi integrations discovery (#120688) 2024-06-27 19:20:37 +02:00
Glenn Waters
b9e01b9253 Bump Environment Canada to 0.7.0 (#120686) 2024-06-27 12:08:18 -05:00
epenet
e446875c7e Improve type hints in esphome tests (#120674) 2024-06-27 09:33:14 -05:00
Erik Montnemery
3895252965 Fix docstring for EventStateEventData (#120662) 2024-06-27 08:00:14 -05:00
Steven B
9758b08036 Update tplink unlink identifiers to deal with ids from other domains (#120596) 2024-06-27 07:54:34 -05:00
Steven B
970dd99226 Store tplink credentials_hash outside of device_config (#120597) 2024-06-27 07:34:12 -05:00
epenet
0d53ce4fb8 Improve type hints in emulated_hue tests (#120664) 2024-06-27 14:27:35 +02:00
Erik Montnemery
8de771de96 Rename async_track_state_reported_event to async_track_state_report_event (#120637)
* Rename async_track_state_reported_event to async_track_state_report_event

* Update tests
2024-06-27 13:45:15 +02:00
Jesse Hills
1f54180807 Mark esphome integration as platinum (#112565)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-06-27 06:26:38 -05:00
Josef Zweck
9f6783dcf5 Add release url to lamarzocco update (#120645) 2024-06-27 13:21:36 +02:00
Brett Adams
cb92510571 Fix values at startup for Tessie (#120652) 2024-06-27 13:17:15 +02:00
Jesse Hills
a93855ded3 [esphome] Add more tests to bring integration to 100% coverage (#120661) 2024-06-27 06:08:40 -05:00
Erik Montnemery
a165064e9d Improve typing of state event helpers (#120639) 2024-06-27 06:08:19 -05:00
Erik Montnemery
54a5a3e3fb Bump hatasmota to 0.9.1 (#120649) 2024-06-27 12:55:49 +02:00
Joost Lekkerkerker
9aa2cc11e9 Fix Airgradient ABC days name (#120659) 2024-06-27 12:47:58 +02:00
Joost Lekkerkerker
4f7c6bdce8 Disable polling for Knocki (#120656) 2024-06-27 12:29:32 +02:00
Dave T
022f545342 Remove unnecessary .coveragerc entries (#120620) 2024-06-27 11:21:34 +02:00
Erik Montnemery
06f495dd45 Add snapshots to tasmota sensor test (#120647) 2024-06-27 10:43:28 +02:00
Josef Zweck
85629dc31e Move Auto On/off switches to Config EntityCategory (#120648) 2024-06-27 10:34:01 +02:00
Joakim Sørensen
5634741ce2 Bump awesomeversion from 24.2.0 to 24.6.0 (#120642) 2024-06-27 10:27:20 +02:00
Erik Montnemery
3e9b57cc07 Don't allow updating a device to have no connections or identifiers (#120603)
* Don't allow updating a device to have no connections or identifiers

* Move check to the top of the function
2024-06-27 09:26:31 +02:00
Josef Zweck
c9c573dbce Fix the version that raises the issue (#120638) 2024-06-27 09:21:41 +02:00
J. Nick Koston
5503379a3b Fix performance regression in integration from state_reported (#120621)
* Fix performance regression in integration from state_reported

Because the callbacks were no longer indexed by entity id, users
saw upwards of 1M calls/min

https://github.com/home-assistant/core/pull/113869/files#r1655580523

* Update homeassistant/helpers/event.py

* coverage

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-06-27 08:50:41 +02:00
dougiteixeira
617ab48fa9 Address device helper review comments (#120615)
* Address review comments from #119761

* Address review comments from #119761

* Address review comments from #119761

* Remove reference from config entry
2024-06-27 08:50:20 +02:00
epenet
28e72753ad Prevent importing PLATFORM_SCHEMA/_BASE from config validation (#120571) 2024-06-27 06:31:22 +02:00
J. Nick Koston
a5a631148e Add async_track_state_reported_event to fix integration performance regression (#120622)
split from https://github.com/home-assistant/core/pull/120621
2024-06-26 23:04:27 -04:00
J. Nick Koston
f189d87fe9 Bump uiprotect to 4.0.0 (#120617) 2024-06-26 20:37:28 -05:00
J. Nick Koston
5e1c8b0c54 Remove unused fields from unifiprotect event sensors (#120568) 2024-06-26 20:37:08 -05:00
Luke Lashley
2449e2029e Bump anova_wifi to 0.14.0 (#120616) 2024-06-27 01:14:18 +02:00
Jan Bouwhuis
32e64f7911 Cleanup mqtt platform tests part 4 (init) (#120574) 2024-06-26 16:57:41 -05:00
Paul Bottein
b7a65d9a82 Update frontend to 20240626.2 (#120614) 2024-06-26 23:54:07 +02:00
Marc Mueller
9d7078e1fa Install libturbojpeg in hassfest job [ci] (#120611) 2024-06-26 23:52:31 +02:00
Luca Angemi
1973c604b6 Fix telegram bot thread_id key error (#120613) 2024-06-26 23:45:47 +02:00
Marc Mueller
6bceb8ec48 Add some more VolDictType annotations (#120610) 2024-06-26 22:44:43 +02:00
Marc Mueller
fcfb580f0c Update pylint to 3.2.4 (#120606) 2024-06-26 22:29:55 +02:00
Franck Nijhof
516b9126b7 Update adguardhome to 0.7.0 (#120605) 2024-06-26 22:05:30 +02:00
Markus Jacobsen
2146a4729b Improve Bang & Olufsen error messages (#120587)
* Convert logger messages to raised errors where applicable

* Modify exception types

* Improve deezer / tidal error message

* Update homeassistant/components/bang_olufsen/strings.json

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

* Update homeassistant/components/bang_olufsen/media_player.py

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-26 21:46:59 +02:00
Florian
9b2915efed Don't allow switch toggle when device in locked in AVM FRITZ!SmartHome (#120132)
* fix: set state of the FritzBox-Switch to disabled if the option for manuel switching in the userinterface is disabled

* feat: raise an error instead of disabling switch

* feat: rename method signature

* fix: tests

* fix: wrong import

* feat: Update homeassistant/components/fritzbox/strings.json

Update error message

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

* Update tests/components/fritzbox/test_switch.py

feat: update test

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

* make ruff happy

* fix expected error message check

---------

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2024-06-26 21:45:17 +02:00
Marc Mueller
dd6cc82f70 Fix mqtt test fixture usage (#120602) 2024-06-26 21:30:30 +02:00
Jan Bouwhuis
8839a71adc Prevent changes to mutable bmw_connected_drive fixture data (#120600) 2024-06-26 20:57:27 +02:00
Erik Montnemery
f1a57d69cc Remove deprecated run_immediately flag from integration sensor (#120593) 2024-06-26 20:55:41 +02:00
Max
702d53ca30 Correct deprecation warning async_register_static_paths (#120592) 2024-06-26 20:55:25 +02:00
Shay Levy
4c6cbadc11 Align Shelly sleeping devices timeout with non-sleeping (#118969) 2024-06-26 20:53:02 +02:00
Shay Levy
d8ab2debfd Add last_error reporting to Shelly diagnostics (#120595) 2024-06-26 21:35:23 +03:00
Robert Resch
31e9de3b95 Adapt Roborock to runtime_data (#120578)
* Adopt Roborock to runtime_data

* Fix name
2024-06-26 19:42:15 +02:00
Shay Levy
ed1eb8ac9c Change Shelly connect task log message level to error (#120582) 2024-06-26 18:19:28 +02:00
TheJulianJES
d09a274548 Bump ZHA dependencies (#120581) 2024-06-26 18:15:53 +02:00
Michael Hansen
02b142fbde Bump intents to 2024.6.26 (#120584)
Bump intents
2024-06-26 11:13:01 -05:00
Franck Nijhof
33b4f40b2a Bump version to 2024.8.0dev0 (#120577) 2024-06-26 16:55:08 +02:00
2066 changed files with 72312 additions and 71535 deletions

View File

@@ -49,6 +49,7 @@ base_platforms: &base_platforms
- homeassistant/components/tts/**
- homeassistant/components/update/**
- homeassistant/components/vacuum/**
- homeassistant/components/valve/**
- homeassistant/components/water_heater/**
- homeassistant/components/weather/**

File diff suppressed because it is too large Load Diff

View File

@@ -74,7 +74,6 @@ If the code communicates with devices, web services, or third-party tools:
- [ ] New or updated dependencies have been added to `requirements_all.txt`.
Updated by running `python3 -m script.gen_requirements_all`.
- [ ] For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
- [ ] Untested files have been added to `.coveragerc`.
<!--
This project is very active and we have a high turnover of pull requests.

View File

@@ -32,7 +32,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -69,7 +69,7 @@ jobs:
run: find ./homeassistant/components/*/translations -name "*.json" | tar zcvf translations.tar.gz -T -
- name: Upload translations
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: translations
path: translations.tar.gz
@@ -116,7 +116,7 @@ jobs:
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.channel == 'dev'
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -175,7 +175,7 @@ jobs:
sed -i "s|pykrakenapi|# pykrakenapi|g" requirements_all.txt
- name: Download translations
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: translations
@@ -453,12 +453,12 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Download translations
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: translations

View File

@@ -36,7 +36,7 @@ env:
CACHE_VERSION: 9
UV_CACHE_VERSION: 1
MYPY_CACHE_VERSION: 8
HA_SHORT_VERSION: "2024.7"
HA_SHORT_VERSION: "2024.8"
DEFAULT_PYTHON: "3.12"
ALL_PYTHON_VERSIONS: "['3.12']"
# 10.3 is the oldest supported version
@@ -229,7 +229,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -274,7 +274,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -314,7 +314,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -353,7 +353,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -448,7 +448,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -522,11 +522,17 @@ jobs:
- info
- base
steps:
- name: Install additional OS dependencies
run: |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-get update
sudo apt-get -y install \
libturbojpeg
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -558,7 +564,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -576,6 +582,46 @@ jobs:
. venv/bin/activate
python -m script.gen_requirements_all validate
audit-licenses:
name: Audit licenses
runs-on: ubuntu-22.04
needs:
- info
- base
if: |
needs.info.outputs.requirements == 'true'
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v4.0.2
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Run pip-licenses
run: |
. venv/bin/activate
pip-licenses --format=json --output-file=licenses.json
- name: Upload licenses
uses: actions/upload-artifact@v4.3.4
with:
name: licenses
path: licenses.json
- name: Process licenses
run: |
. venv/bin/activate
python -m script.licenses
pylint:
name: Check pylint
runs-on: ubuntu-22.04
@@ -591,7 +637,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -636,7 +682,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -680,7 +726,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -754,7 +800,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -772,7 +818,7 @@ jobs:
. venv/bin/activate
python -m script.split_tests ${{ needs.info.outputs.test_group_count }} tests
- name: Upload pytest_buckets
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: pytest_buckets
path: pytest_buckets.txt
@@ -817,7 +863,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -836,7 +882,7 @@ jobs:
run: |
echo "::add-matcher::.github/workflows/matchers/pytest-slow.json"
- name: Download pytest_buckets
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: pytest_buckets
- name: Compile English translations
@@ -871,14 +917,14 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-full.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }}
path: pytest-*.txt
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
path: coverage.xml
@@ -935,7 +981,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -996,7 +1042,7 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${mariadb}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.mariadb }}
@@ -1004,7 +1050,7 @@ jobs:
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.mariadb }}
@@ -1060,7 +1106,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1122,7 +1168,7 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${postgresql}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.postgresql }}
@@ -1130,7 +1176,7 @@ jobs:
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.postgresql }}
@@ -1154,7 +1200,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Download all coverage artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
pattern: coverage-*
- name: Upload coverage to Codecov
@@ -1205,7 +1251,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1263,14 +1309,14 @@ jobs:
2>&1 | tee pytest-${{ matrix.python-version }}-${{ matrix.group }}.txt
- name: Upload pytest output
if: success() || failure() && steps.pytest-partial.conclusion == 'failure'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: pytest-${{ github.run_number }}-${{ matrix.python-version }}-${{ matrix.group }}
path: pytest-*.txt
overwrite: true
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
path: coverage.xml
@@ -1291,7 +1337,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.7
- name: Download all coverage artifacts
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
pattern: coverage-*
- name: Upload coverage to Codecov

View File

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

View File

@@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}

View File

@@ -36,7 +36,7 @@ jobs:
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -82,14 +82,14 @@ jobs:
) > .env_file
- name: Upload env_file
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: env_file
path: ./.env_file
overwrite: true
- name: Upload requirements_diff
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: requirements_diff
path: ./requirements_diff.txt
@@ -101,7 +101,7 @@ jobs:
python -m script.gen_requirements_all ci
- name: Upload requirements_all_wheels
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.3.4
with:
name: requirements_all_wheels
path: ./requirements_all_wheels_*.txt
@@ -121,17 +121,17 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Download env_file
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: requirements_diff
- name: Build wheels
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
@@ -159,17 +159,17 @@ jobs:
uses: actions/checkout@v4.1.7
- name: Download env_file
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: requirements_diff
- name: Download requirements_all_wheels
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
name: requirements_all_wheels
@@ -203,7 +203,7 @@ jobs:
sed -i "/numpy/d" homeassistant/package_constraints.txt
- name: Build wheels (old cython)
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
@@ -218,7 +218,7 @@ jobs:
pip: "'cython<3'"
- name: Build wheels (part 1)
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
@@ -232,7 +232,7 @@ jobs:
requirements: "requirements_all.txtaa"
- name: Build wheels (part 2)
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2
@@ -246,7 +246,7 @@ jobs:
requirements: "requirements_all.txtab"
- name: Build wheels (part 3)
uses: home-assistant/wheels@2024.01.0
uses: home-assistant/wheels@2024.07.1
with:
abi: ${{ matrix.abi }}
tag: musllinux_1_2

View File

@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.9
rev: v0.5.2
hooks:
- id: ruff
args:
@@ -83,7 +83,7 @@ repos:
pass_filenames: false
language: script
types: [text]
files: ^(homeassistant/.+/(icons|manifest|strings)\.json|homeassistant/brands/.*\.json|\.coveragerc|homeassistant/.+/services\.yaml|script/hassfest/(?!metadata|mypy_config).+\.py|requirements_test.txt)$
files: ^(homeassistant/.+/(icons|manifest|strings)\.json|homeassistant/brands/.*\.json|homeassistant/.+/services\.yaml|script/hassfest/(?!metadata|mypy_config).+\.py|requirements_test.txt)$
- id: hassfest-metadata
name: hassfest-metadata
entry: script/run-in-env.sh python3 -m script.hassfest -p metadata

View File

@@ -21,6 +21,7 @@ homeassistant.helpers.entity_platform
homeassistant.helpers.entity_values
homeassistant.helpers.event
homeassistant.helpers.reload
homeassistant.helpers.script
homeassistant.helpers.script_variables
homeassistant.helpers.singleton
homeassistant.helpers.sun
@@ -97,6 +98,7 @@ homeassistant.components.assist_pipeline.*
homeassistant.components.asterisk_cdr.*
homeassistant.components.asterisk_mbox.*
homeassistant.components.asuswrt.*
homeassistant.components.autarco.*
homeassistant.components.auth.*
homeassistant.components.automation.*
homeassistant.components.awair.*
@@ -287,6 +289,7 @@ homeassistant.components.logger.*
homeassistant.components.london_underground.*
homeassistant.components.lookin.*
homeassistant.components.luftdaten.*
homeassistant.components.madvr.*
homeassistant.components.mailbox.*
homeassistant.components.map.*
homeassistant.components.mastodon.*
@@ -382,6 +385,7 @@ homeassistant.components.samsungtv.*
homeassistant.components.scene.*
homeassistant.components.schedule.*
homeassistant.components.scrape.*
homeassistant.components.script.*
homeassistant.components.search.*
homeassistant.components.select.*
homeassistant.components.sensibo.*

42
.vscode/launch.json vendored
View File

@@ -6,38 +6,52 @@
"configurations": [
{
"name": "Home Assistant",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "homeassistant",
"justMyCode": false,
"args": ["--debug", "-c", "config"],
"args": [
"--debug",
"-c",
"config"
],
"preLaunchTask": "Compile English translations"
},
{
"name": "Home Assistant (skip pip)",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "homeassistant",
"justMyCode": false,
"args": ["--debug", "-c", "config", "--skip-pip"],
"args": [
"--debug",
"-c",
"config",
"--skip-pip"
],
"preLaunchTask": "Compile English translations"
},
{
"name": "Home Assistant: Changed tests",
"type": "python",
"type": "debugpy",
"request": "launch",
"module": "pytest",
"justMyCode": false,
"args": ["--timeout=10", "--picked"],
"args": [
"--timeout=10",
"--picked"
],
},
{
// Debug by attaching to local Home Assistant server using Remote Python Debugger.
// See https://www.home-assistant.io/integrations/debugpy/
"name": "Home Assistant: Attach Local",
"type": "python",
"type": "debugpy",
"request": "attach",
"port": 5678,
"host": "localhost",
"connect": {
"port": 5678,
"host": "localhost"
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
@@ -49,10 +63,12 @@
// Debug by attaching to remote Home Assistant server using Remote Python Debugger.
// See https://www.home-assistant.io/integrations/debugpy/
"name": "Home Assistant: Attach Remote",
"type": "python",
"type": "debugpy",
"request": "attach",
"port": 5678,
"host": "homeassistant.local",
"connect": {
"port": 5678,
"host": "homeassistant.local"
},
"pathMappings": [
{
"localRoot": "${workspaceFolder}",
@@ -61,4 +77,4 @@
]
}
]
}
}

1
.vscode/tasks.json vendored
View File

@@ -76,6 +76,7 @@
"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",
"dependsOn": ["Compile English translations"],
"group": {
"kind": "test",
"isDefault": true

View File

@@ -155,6 +155,8 @@ build.json @home-assistant/supervisor
/tests/components/aurora_abb_powerone/ @davet2001
/homeassistant/components/aussie_broadband/ @nickw444 @Bre77
/tests/components/aussie_broadband/ @nickw444 @Bre77
/homeassistant/components/autarco/ @klaasnicolaas
/tests/components/autarco/ @klaasnicolaas
/homeassistant/components/auth/ @home-assistant/core
/tests/components/auth/ @home-assistant/core
/homeassistant/components/automation/ @home-assistant/core
@@ -237,6 +239,8 @@ build.json @home-assistant/supervisor
/tests/components/ccm15/ @ocalvo
/homeassistant/components/cert_expiry/ @jjlawren
/tests/components/cert_expiry/ @jjlawren
/homeassistant/components/chacon_dio/ @cnico
/tests/components/chacon_dio/ @cnico
/homeassistant/components/cisco_ios/ @fbradyirl
/homeassistant/components/cisco_mobility_express/ @fbradyirl
/homeassistant/components/cisco_webex_teams/ @fbradyirl
@@ -358,8 +362,8 @@ build.json @home-assistant/supervisor
/tests/components/ecoforest/ @pjanuario
/homeassistant/components/econet/ @w1ll1am23
/tests/components/econet/ @w1ll1am23
/homeassistant/components/ecovacs/ @OverloadUT @mib1185 @edenhaus @Augar
/tests/components/ecovacs/ @OverloadUT @mib1185 @edenhaus @Augar
/homeassistant/components/ecovacs/ @mib1185 @edenhaus @Augar
/tests/components/ecovacs/ @mib1185 @edenhaus @Augar
/homeassistant/components/ecowitt/ @pvizeli
/tests/components/ecowitt/ @pvizeli
/homeassistant/components/efergy/ @tkdrob
@@ -396,8 +400,8 @@ build.json @home-assistant/supervisor
/tests/components/enigma2/ @autinerd
/homeassistant/components/enocean/ @bdurrer
/tests/components/enocean/ @bdurrer
/homeassistant/components/enphase_envoy/ @bdraco @cgarwood @dgomes @joostlek @catsmanac
/tests/components/enphase_envoy/ @bdraco @cgarwood @dgomes @joostlek @catsmanac
/homeassistant/components/enphase_envoy/ @bdraco @cgarwood @joostlek @catsmanac
/tests/components/enphase_envoy/ @bdraco @cgarwood @joostlek @catsmanac
/homeassistant/components/entur_public_transport/ @hfurubotten
/homeassistant/components/environment_canada/ @gwww @michaeldavie
/tests/components/environment_canada/ @gwww @michaeldavie
@@ -429,6 +433,8 @@ build.json @home-assistant/supervisor
/tests/components/fan/ @home-assistant/core
/homeassistant/components/fastdotcom/ @rohankapoorcom @erwindouna
/tests/components/fastdotcom/ @rohankapoorcom @erwindouna
/homeassistant/components/feedreader/ @mib1185
/tests/components/feedreader/ @mib1185
/homeassistant/components/fibaro/ @rappenze
/tests/components/fibaro/ @rappenze
/homeassistant/components/file/ @fabaff
@@ -701,6 +707,8 @@ build.json @home-assistant/supervisor
/tests/components/isal/ @bdraco
/homeassistant/components/islamic_prayer_times/ @engrbm87 @cpfair
/tests/components/islamic_prayer_times/ @engrbm87 @cpfair
/homeassistant/components/israel_rail/ @shaiu
/tests/components/israel_rail/ @shaiu
/homeassistant/components/iss/ @DurgNomis-drol
/tests/components/iss/ @DurgNomis-drol
/homeassistant/components/ista_ecotrend/ @tr4nt0r
@@ -735,8 +743,8 @@ build.json @home-assistant/supervisor
/tests/components/kitchen_sink/ @home-assistant/core
/homeassistant/components/kmtronic/ @dgomes
/tests/components/kmtronic/ @dgomes
/homeassistant/components/knocki/ @joostlek @jgatto1
/tests/components/knocki/ @joostlek @jgatto1
/homeassistant/components/knocki/ @joostlek @jgatto1 @JakeBosh
/tests/components/knocki/ @joostlek @jgatto1 @JakeBosh
/homeassistant/components/knx/ @Julius2342 @farmio @marvin-w
/tests/components/knx/ @Julius2342 @farmio @marvin-w
/homeassistant/components/kodi/ @OnFreund
@@ -777,6 +785,8 @@ build.json @home-assistant/supervisor
/tests/components/lg_netcast/ @Drafteed @splinter98
/homeassistant/components/lidarr/ @tkdrob
/tests/components/lidarr/ @tkdrob
/homeassistant/components/lifx/ @Djelibeybi
/tests/components/lifx/ @Djelibeybi
/homeassistant/components/light/ @home-assistant/core
/tests/components/light/ @home-assistant/core
/homeassistant/components/linear_garage_door/ @IceBotYT
@@ -821,13 +831,15 @@ build.json @home-assistant/supervisor
/tests/components/lutron_caseta/ @swails @bdraco @danaues @eclair4151
/homeassistant/components/lyric/ @timmo001
/tests/components/lyric/ @timmo001
/homeassistant/components/madvr/ @iloveicedgreentea
/tests/components/madvr/ @iloveicedgreentea
/homeassistant/components/mastodon/ @fabaff
/homeassistant/components/matrix/ @PaarthShah
/tests/components/matrix/ @PaarthShah
/homeassistant/components/matter/ @home-assistant/matter
/tests/components/matter/ @home-assistant/matter
/homeassistant/components/mealie/ @joostlek
/tests/components/mealie/ @joostlek
/homeassistant/components/mealie/ @joostlek @andrew-codechimp
/tests/components/mealie/ @joostlek @andrew-codechimp
/homeassistant/components/meater/ @Sotolotl @emontnemery
/tests/components/meater/ @Sotolotl @emontnemery
/homeassistant/components/medcom_ble/ @elafargue
@@ -872,8 +884,6 @@ build.json @home-assistant/supervisor
/tests/components/moat/ @bdraco
/homeassistant/components/mobile_app/ @home-assistant/core
/tests/components/mobile_app/ @home-assistant/core
/homeassistant/components/modbus/ @janiversen
/tests/components/modbus/ @janiversen
/homeassistant/components/modem_callerid/ @tkdrob
/tests/components/modem_callerid/ @tkdrob
/homeassistant/components/modern_forms/ @wonderslug
@@ -985,8 +995,6 @@ build.json @home-assistant/supervisor
/homeassistant/components/ollama/ @synesthesiam
/tests/components/ollama/ @synesthesiam
/homeassistant/components/ombi/ @larssont
/homeassistant/components/omnilogic/ @oliver84 @djtimca @gentoosu
/tests/components/omnilogic/ @oliver84 @djtimca @gentoosu
/homeassistant/components/onboarding/ @home-assistant/core
/tests/components/onboarding/ @home-assistant/core
/homeassistant/components/oncue/ @bdraco @peterager
@@ -1202,6 +1210,8 @@ build.json @home-assistant/supervisor
/tests/components/rtsp_to_webrtc/ @allenporter
/homeassistant/components/ruckus_unleashed/ @lanrat @ms264556 @gabe565
/tests/components/ruckus_unleashed/ @lanrat @ms264556 @gabe565
/homeassistant/components/russound_rio/ @noahhusby
/tests/components/russound_rio/ @noahhusby
/homeassistant/components/ruuvi_gateway/ @akx
/tests/components/ruuvi_gateway/ @akx
/homeassistant/components/ruuvitag_ble/ @akx
@@ -1269,6 +1279,8 @@ build.json @home-assistant/supervisor
/tests/components/sighthound/ @robmarkcole
/homeassistant/components/signal_messenger/ @bbernhard
/tests/components/signal_messenger/ @bbernhard
/homeassistant/components/simplefin/ @scottg489 @jeeftor
/tests/components/simplefin/ @scottg489 @jeeftor
/homeassistant/components/simplepush/ @engrbm87
/tests/components/simplepush/ @engrbm87
/homeassistant/components/simplisafe/ @bachya

View File

@@ -4,7 +4,7 @@ coverage:
status:
project:
default:
target: 90
target: auto
threshold: 0.09
required:
target: auto

View File

@@ -363,15 +363,15 @@ class AuthManager:
local_only: bool | None = None,
) -> None:
"""Update a user."""
kwargs: dict[str, Any] = {}
for attr_name, value in (
("name", name),
("group_ids", group_ids),
("local_only", local_only),
):
if value is not None:
kwargs[attr_name] = value
kwargs: dict[str, Any] = {
attr_name: value
for attr_name, value in (
("name", name),
("group_ids", group_ids),
("local_only", local_only),
)
if value is not None
}
await self._store.async_update_user(user, **kwargs)
if is_active is not None:

View File

@@ -105,14 +105,18 @@ class AuthStore:
"perm_lookup": self._perm_lookup,
}
for attr_name, value in (
("is_owner", is_owner),
("is_active", is_active),
("local_only", local_only),
("system_generated", system_generated),
):
if value is not None:
kwargs[attr_name] = value
kwargs.update(
{
attr_name: value
for attr_name, value in (
("is_owner", is_owner),
("is_active", is_active),
("local_only", local_only),
("system_generated", system_generated),
)
if value is not None
}
)
new_user = models.User(**kwargs)

View File

@@ -88,7 +88,7 @@ from .helpers import (
)
from .helpers.dispatcher import async_dispatcher_send_internal
from .helpers.storage import get_internal_store_manager
from .helpers.system_info import async_get_system_info
from .helpers.system_info import async_get_system_info, is_official_image
from .helpers.typing import ConfigType
from .setup import (
# _setup_started is marked as protected to make it clear
@@ -104,7 +104,7 @@ from .setup import (
from .util.async_ import create_eager_task
from .util.hass_dict import HassKey
from .util.logging import async_activate_log_queue_handler
from .util.package import async_get_user_site, is_virtual_env
from .util.package import async_get_user_site, is_docker_env, is_virtual_env
with contextlib.suppress(ImportError):
# Ensure anyio backend is imported to avoid it being imported in the event loop
@@ -407,6 +407,10 @@ def _init_blocking_io_modules_in_executor() -> None:
# Initialize the mimetypes module to avoid blocking calls
# to the filesystem to load the mime.types file.
mimetypes.init()
# Initialize is_official_image and is_docker_env to avoid blocking calls
# to the filesystem.
is_official_image()
is_docker_env()
async def async_load_base_functionality(hass: core.HomeAssistant) -> None:

View File

@@ -9,5 +9,5 @@
},
"iot_class": "cloud_push",
"loggers": ["jaraco.abode", "lomond"],
"requirements": ["jaraco.abode==5.1.2"]
"requirements": ["jaraco.abode==5.2.1"]
}

View File

@@ -82,33 +82,54 @@ async def async_setup_entry(
"""Add Airzone binary sensors from a config_entry."""
coordinator = entry.runtime_data
binary_sensors: list[AirzoneBinarySensor] = [
AirzoneSystemBinarySensor(
coordinator,
description,
entry,
system_id,
system_data,
)
for system_id, system_data in coordinator.data[AZD_SYSTEMS].items()
for description in SYSTEM_BINARY_SENSOR_TYPES
if description.key in system_data
]
added_systems: set[str] = set()
added_zones: set[str] = set()
binary_sensors.extend(
AirzoneZoneBinarySensor(
coordinator,
description,
entry,
system_zone_id,
zone_data,
)
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items()
for description in ZONE_BINARY_SENSOR_TYPES
if description.key in zone_data
)
def _async_entity_listener() -> None:
"""Handle additions of binary sensors."""
async_add_entities(binary_sensors)
entities: list[AirzoneBinarySensor] = []
systems_data = coordinator.data.get(AZD_SYSTEMS, {})
received_systems = set(systems_data)
new_systems = received_systems - added_systems
if new_systems:
entities.extend(
AirzoneSystemBinarySensor(
coordinator,
description,
entry,
system_id,
systems_data.get(system_id),
)
for system_id in new_systems
for description in SYSTEM_BINARY_SENSOR_TYPES
if description.key in systems_data.get(system_id)
)
added_systems.update(new_systems)
zones_data = coordinator.data.get(AZD_ZONES, {})
received_zones = set(zones_data)
new_zones = received_zones - added_zones
if new_zones:
entities.extend(
AirzoneZoneBinarySensor(
coordinator,
description,
entry,
system_zone_id,
zones_data.get(system_zone_id),
)
for system_zone_id in new_zones
for description in ZONE_BINARY_SENSOR_TYPES
if description.key in zones_data.get(system_zone_id)
)
added_zones.update(new_zones)
async_add_entities(entities)
entry.async_on_unload(coordinator.async_add_listener(_async_entity_listener))
_async_entity_listener()
class AirzoneBinarySensor(AirzoneEntity, BinarySensorEntity):

View File

@@ -102,17 +102,31 @@ async def async_setup_entry(
entry: AirzoneConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add Airzone sensors from a config_entry."""
"""Add Airzone climate from a config_entry."""
coordinator = entry.runtime_data
async_add_entities(
AirzoneClimate(
coordinator,
entry,
system_zone_id,
zone_data,
)
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items()
)
added_zones: set[str] = set()
def _async_entity_listener() -> None:
"""Handle additions of climate."""
zones_data = coordinator.data.get(AZD_ZONES, {})
received_zones = set(zones_data)
new_zones = received_zones - added_zones
if new_zones:
async_add_entities(
AirzoneClimate(
coordinator,
entry,
system_zone_id,
zones_data.get(system_zone_id),
)
for system_zone_id in new_zones
)
added_zones.update(new_zones)
entry.async_on_unload(coordinator.async_add_listener(_async_entity_listener))
_async_entity_listener()
class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):

View File

@@ -11,5 +11,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone",
"iot_class": "local_polling",
"loggers": ["aioairzone"],
"requirements": ["aioairzone==0.7.7"]
"requirements": ["aioairzone==0.8.0"]
}

View File

@@ -83,21 +83,34 @@ async def async_setup_entry(
entry: AirzoneConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add Airzone sensors from a config_entry."""
"""Add Airzone select from a config_entry."""
coordinator = entry.runtime_data
async_add_entities(
AirzoneZoneSelect(
coordinator,
description,
entry,
system_zone_id,
zone_data,
)
for description in ZONE_SELECT_TYPES
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items()
if description.key in zone_data
)
added_zones: set[str] = set()
def _async_entity_listener() -> None:
"""Handle additions of select."""
zones_data = coordinator.data.get(AZD_ZONES, {})
received_zones = set(zones_data)
new_zones = received_zones - added_zones
if new_zones:
async_add_entities(
AirzoneZoneSelect(
coordinator,
description,
entry,
system_zone_id,
zones_data.get(system_zone_id),
)
for system_zone_id in new_zones
for description in ZONE_SELECT_TYPES
if description.key in zones_data.get(system_zone_id)
)
added_zones.update(new_zones)
entry.async_on_unload(coordinator.async_add_listener(_async_entity_listener))
_async_entity_listener()
class AirzoneBaseSelect(AirzoneEntity, SelectEntity):

View File

@@ -85,21 +85,37 @@ async def async_setup_entry(
"""Add Airzone sensors from a config_entry."""
coordinator = entry.runtime_data
sensors: list[AirzoneSensor] = [
AirzoneZoneSensor(
coordinator,
description,
entry,
system_zone_id,
zone_data,
)
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items()
for description in ZONE_SENSOR_TYPES
if description.key in zone_data
]
added_zones: set[str] = set()
def _async_entity_listener() -> None:
"""Handle additions of sensors."""
entities: list[AirzoneSensor] = []
zones_data = coordinator.data.get(AZD_ZONES, {})
received_zones = set(zones_data)
new_zones = received_zones - added_zones
if new_zones:
entities.extend(
AirzoneZoneSensor(
coordinator,
description,
entry,
system_zone_id,
zones_data.get(system_zone_id),
)
for system_zone_id in new_zones
for description in ZONE_SENSOR_TYPES
if description.key in zones_data.get(system_zone_id)
)
added_zones.update(new_zones)
async_add_entities(entities)
entities: list[AirzoneSensor] = []
if AZD_HOT_WATER in coordinator.data:
sensors.extend(
entities.extend(
AirzoneHotWaterSensor(
coordinator,
description,
@@ -110,7 +126,7 @@ async def async_setup_entry(
)
if AZD_WEBSERVER in coordinator.data:
sensors.extend(
entities.extend(
AirzoneWebServerSensor(
coordinator,
description,
@@ -120,7 +136,10 @@ async def async_setup_entry(
if description.key in coordinator.data[AZD_WEBSERVER]
)
async_add_entities(sensors)
async_add_entities(entities)
entry.async_on_unload(coordinator.async_add_listener(_async_entity_listener))
_async_entity_listener()
class AirzoneSensor(AirzoneEntity, SensorEntity):

View File

@@ -61,7 +61,7 @@ async def async_setup_entry(
entry: AirzoneConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add Airzone sensors from a config_entry."""
"""Add Airzone Water Heater from a config_entry."""
coordinator = entry.runtime_data
if AZD_HOT_WATER in coordinator.data:
async_add_entities([AirzoneWaterHeater(coordinator, entry)])

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone_cloud",
"iot_class": "cloud_push",
"loggers": ["aioairzone_cloud"],
"requirements": ["aioairzone-cloud==0.5.3"]
"requirements": ["aioairzone-cloud==0.5.4"]
}

View File

@@ -2,11 +2,10 @@
from __future__ import annotations
from collections.abc import Generator
import logging
from typing import Any
from typing_extensions import Generator
from homeassistant.components import (
button,
climate,
@@ -19,6 +18,7 @@ from homeassistant.components import (
light,
media_player,
number,
remote,
timer,
vacuum,
valve,
@@ -439,6 +439,8 @@ class AlexaPowerController(AlexaCapability):
is_on = self.entity.state == fan.STATE_ON
elif self.entity.domain == humidifier.DOMAIN:
is_on = self.entity.state == humidifier.STATE_ON
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
elif self.entity.domain == timer.DOMAIN:
@@ -1436,6 +1438,12 @@ class AlexaModeController(AlexaCapability):
if mode in modes:
return f"{humidifier.ATTR_MODE}.{mode}"
# Remote Activity
if self.instance == f"{remote.DOMAIN}.{remote.ATTR_ACTIVITY}":
activity = self.entity.attributes.get(remote.ATTR_CURRENT_ACTIVITY, None)
if activity in self.entity.attributes.get(remote.ATTR_ACTIVITY_LIST, []):
return f"{remote.ATTR_ACTIVITY}.{activity}"
# Water heater operation mode
if self.instance == f"{water_heater.DOMAIN}.{water_heater.ATTR_OPERATION_MODE}":
operation_mode = self.entity.attributes.get(
@@ -1550,6 +1558,24 @@ class AlexaModeController(AlexaCapability):
)
return self._resource.serialize_capability_resources()
# Remote Resource
if self.instance == f"{remote.DOMAIN}.{remote.ATTR_ACTIVITY}":
# Use the mode controller for a remote because the input controller
# only allows a preset of names as an input.
self._resource = AlexaModeResource([AlexaGlobalCatalog.SETTING_MODE], False)
activities = self.entity.attributes.get(remote.ATTR_ACTIVITY_LIST) or []
for activity in activities:
self._resource.add_mode(
f"{remote.ATTR_ACTIVITY}.{activity}", [activity]
)
# Remotes with a single activity completely break Alexa discovery, add a
# fake activity to the mode controller (see issue #53832).
if len(activities) == 1:
self._resource.add_mode(
f"{remote.ATTR_ACTIVITY}.{PRESET_MODE_NA}", [PRESET_MODE_NA]
)
return self._resource.serialize_capability_resources()
# Cover Position Resources
if self.instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
self._resource = AlexaModeResource(

View File

@@ -88,7 +88,7 @@ API_THERMOSTAT_MODES_CUSTOM = {
API_THERMOSTAT_PRESETS = {climate.PRESET_ECO: "ECO"}
# AlexaModeController does not like a single mode for the fan preset or humidifier mode,
# we add PRESET_MODE_NA if a fan / humidifier has only one preset_mode
# we add PRESET_MODE_NA if a fan / humidifier / remote has only one preset_mode
PRESET_MODE_NA = "-"
STORAGE_ACCESS_TOKEN = "access_token"

View File

@@ -2,12 +2,10 @@
from __future__ import annotations
from collections.abc import Iterable
from collections.abc import Generator, Iterable
import logging
from typing import TYPE_CHECKING, Any
from typing_extensions import Generator
from homeassistant.components import (
alarm_control_panel,
alert,
@@ -29,6 +27,7 @@ from homeassistant.components import (
lock,
media_player,
number,
remote,
scene,
script,
sensor,
@@ -198,6 +197,10 @@ class DisplayCategory:
# Indicates a device that prints.
PRINTER = "PRINTER"
# Indicates a decive that support stateless events,
# such as remote switches and smart buttons.
REMOTE = "REMOTE"
# Indicates a network router.
ROUTER = "ROUTER"
@@ -647,6 +650,24 @@ class FanCapabilities(AlexaEntity):
yield Alexa(self.entity)
@ENTITY_ADAPTERS.register(remote.DOMAIN)
class RemoteCapabilities(AlexaEntity):
"""Class to represent Remote capabilities."""
def default_display_categories(self) -> list[str]:
"""Return the display categories for this entity."""
return [DisplayCategory.REMOTE]
def interfaces(self) -> Generator[AlexaCapability]:
"""Yield the supported interfaces."""
yield AlexaPowerController(self.entity)
yield AlexaModeController(
self.entity, instance=f"{remote.DOMAIN}.{remote.ATTR_ACTIVITY}"
)
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.entity)
@ENTITY_ADAPTERS.register(humidifier.DOMAIN)
class HumidifierCapabilities(AlexaEntity):
"""Class to represent Humidifier capabilities."""

View File

@@ -21,6 +21,7 @@ from homeassistant.components import (
light,
media_player,
number,
remote,
timer,
vacuum,
valve,
@@ -185,6 +186,8 @@ async def async_api_turn_on(
service = fan.SERVICE_TURN_ON
elif domain == humidifier.DOMAIN:
service = humidifier.SERVICE_TURN_ON
elif domain == remote.DOMAIN:
service = remote.SERVICE_TURN_ON
elif domain == vacuum.DOMAIN:
supported = entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
if (
@@ -234,6 +237,8 @@ async def async_api_turn_off(
service = climate.SERVICE_TURN_OFF
elif domain == fan.DOMAIN:
service = fan.SERVICE_TURN_OFF
elif domain == remote.DOMAIN:
service = remote.SERVICE_TURN_OFF
elif domain == humidifier.DOMAIN:
service = humidifier.SERVICE_TURN_OFF
elif domain == vacuum.DOMAIN:
@@ -1200,6 +1205,17 @@ async def async_api_set_mode(
msg = f"Entity '{entity.entity_id}' does not support Mode '{mode}'"
raise AlexaInvalidValueError(msg)
# Remote Activity
if instance == f"{remote.DOMAIN}.{remote.ATTR_ACTIVITY}":
activity = mode.split(".")[1]
activities: list[str] | None = entity.attributes.get(remote.ATTR_ACTIVITY_LIST)
if activity != PRESET_MODE_NA and activities and activity in activities:
service = remote.SERVICE_TURN_ON
data[remote.ATTR_ACTIVITY] = activity
else:
msg = f"Entity '{entity.entity_id}' does not support Mode '{mode}'"
raise AlexaInvalidValueError(msg)
# Water heater operation mode
elif instance == f"{water_heater.DOMAIN}.{water_heater.ATTR_OPERATION_MODE}":
operation_mode = mode.split(".")[1]
@@ -1497,7 +1513,7 @@ async def async_api_adjust_range(
if instance == f"{cover.DOMAIN}.{cover.ATTR_POSITION}":
range_delta = int(range_delta * 20) if range_delta_default else int(range_delta)
service = SERVICE_SET_COVER_POSITION
if not (current := entity.attributes.get(cover.ATTR_POSITION)):
if not (current := entity.attributes.get(cover.ATTR_CURRENT_POSITION)):
msg = f"Unable to determine {entity.entity_id} current position"
raise AlexaInvalidValueError(msg)
position = response_value = min(100, max(0, range_delta + current))

View File

@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/amazon_polly",
"iot_class": "cloud_push",
"loggers": ["boto3", "botocore", "s3transfer"],
"requirements": ["boto3==1.34.51"]
"requirements": ["boto3==1.34.131"]
}

View File

@@ -71,6 +71,18 @@ class AmberPriceSpikeBinarySensor(AmberPriceGridSensor):
}
class AmberDemandWindowBinarySensor(AmberPriceGridSensor):
"""Sensor to show whether demand window is active."""
@property
def is_on(self) -> bool | None:
"""Return true if the binary sensor is on."""
grid = self.coordinator.data["grid"]
if "demand_window" in grid:
return grid["demand_window"] # type: ignore[no-any-return]
return None
async def async_setup_entry(
hass: HomeAssistant,
entry: ConfigEntry,
@@ -83,6 +95,14 @@ async def async_setup_entry(
key="price_spike",
name=f"{entry.title} - Price Spike",
)
async_add_entities(
[AmberPriceSpikeBinarySensor(coordinator, price_spike_description)]
demand_window_description = BinarySensorEntityDescription(
key="demand_window",
name=f"{entry.title} - Demand Window",
translation_key="demand_window",
)
async_add_entities(
[
AmberPriceSpikeBinarySensor(coordinator, price_spike_description),
AmberDemandWindowBinarySensor(coordinator, demand_window_description),
]
)

View File

@@ -111,6 +111,9 @@ class AmberUpdateCoordinator(DataUpdateCoordinator):
]
result["grid"]["renewables"] = round(general[0].renewables)
result["grid"]["price_spike"] = general[0].spike_status.value
tariff_information = general[0].tariff_information
if tariff_information:
result["grid"]["demand_window"] = tariff_information.demand_window
controlled_load = [
interval for interval in current if is_controlled_load(interval)

View File

@@ -13,6 +13,14 @@
"renewables": {
"default": "mdi:solar-power"
}
},
"binary_sensor": {
"demand_window": {
"default": "mdi:meter-electric",
"state": {
"off": "mdi:meter-electric-outline"
}
}
}
}
}

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/amberelectric",
"iot_class": "cloud_polling",
"loggers": ["amberelectric"],
"requirements": ["amberelectric==1.1.0"]
"requirements": ["amberelectric==1.1.1"]
}

View File

@@ -7,6 +7,6 @@
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["python_homeassistant_analytics"],
"requirements": ["python-homeassistant-analytics==0.6.0"],
"requirements": ["python-homeassistant-analytics==0.7.0"],
"single_config_entry": true
}

View File

@@ -101,7 +101,7 @@
},
"learn_sendevent": {
"name": "Learn sendevent",
"description": "Translates a key press on a remote into ADB 'sendevent' commands. You must press one button on the remote within 8 seconds of calling this service."
"description": "Translates a key press on a remote into ADB 'sendevent' commands. You must press one button on the remote within 8 seconds of performing this action."
}
},
"exceptions": {

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/anova",
"iot_class": "cloud_push",
"loggers": ["anova_wifi"],
"requirements": ["anova-wifi==0.14.0"]
"requirements": ["anova-wifi==0.17.0"]
}

View File

@@ -16,8 +16,6 @@ from homeassistant.const import (
CONF_USERNAME,
EVENT_HOMEASSISTANT_STOP,
EVENT_STATE_CHANGED,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
)
from homeassistant.core import Event, EventStateChangedData, HomeAssistant
import homeassistant.helpers.config_validation as cv
@@ -121,7 +119,7 @@ class KafkaManager:
state = event.data["new_state"]
if (
state is None
or state.state in (STATE_UNKNOWN, "", STATE_UNAVAILABLE)
or state.state == ""
or not self._entities_filter(state.entity_id)
):
return None
@@ -141,7 +139,8 @@ class KafkaManager:
async def write(self, event: Event[EventStateChangedData]) -> None:
"""Write a binary payload to Kafka."""
key = event.data["entity_id"].encode("utf-8")
payload = self._encode_event(event)
if payload:
await self._producer.send_and_wait(self._topic, payload)
await self._producer.send_and_wait(self._topic, payload, key)

View File

@@ -17,6 +17,7 @@ from .coordinator import AprilaireCoordinator
PLATFORMS: list[Platform] = [
Platform.CLIMATE,
Platform.HUMIDIFIER,
Platform.SELECT,
Platform.SENSOR,
]

View File

@@ -62,7 +62,7 @@ class AprilaireConfigFlow(ConfigFlow, domain=DOMAIN):
self._abort_if_unique_id_configured()
return self.async_create_entry(title="Aprilaire", data=user_input)
return self.async_create_entry(title="AprilAire", data=user_input)
return self.async_show_form(
step_id="user",

View File

@@ -0,0 +1,194 @@
"""The Aprilaire humidifier component."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any, cast
from pyaprilaire.const import Attribute
from homeassistant.components.humidifier import (
HumidifierAction,
HumidifierDeviceClass,
HumidifierEntity,
HumidifierEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from .const import DOMAIN
from .coordinator import AprilaireCoordinator
from .entity import BaseAprilaireEntity
HUMIDIFIER_ACTION_MAP: dict[StateType, HumidifierAction] = {
0: HumidifierAction.IDLE,
1: HumidifierAction.IDLE,
2: HumidifierAction.HUMIDIFYING,
3: HumidifierAction.OFF,
}
DEHUMIDIFIER_ACTION_MAP: dict[StateType, HumidifierAction] = {
0: HumidifierAction.IDLE,
1: HumidifierAction.IDLE,
2: HumidifierAction.DRYING,
3: HumidifierAction.DRYING,
4: HumidifierAction.OFF,
}
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Aprilaire humidifier devices."""
coordinator: AprilaireCoordinator = hass.data[DOMAIN][config_entry.unique_id]
assert config_entry.unique_id is not None
descriptions: list[AprilaireHumidifierDescription] = []
if coordinator.data.get(Attribute.HUMIDIFICATION_AVAILABLE) in (0, 1, 2):
descriptions.append(
AprilaireHumidifierDescription(
key="humidifier",
translation_key="humidifier",
device_class=HumidifierDeviceClass.HUMIDIFIER,
action_key=Attribute.HUMIDIFICATION_STATUS,
action_map=HUMIDIFIER_ACTION_MAP,
current_humidity_key=Attribute.INDOOR_HUMIDITY_CONTROLLING_SENSOR_VALUE,
target_humidity_key=Attribute.HUMIDIFICATION_SETPOINT,
min_humidity=10,
max_humidity=50,
default_humidity=30,
set_humidity_fn=coordinator.client.set_humidification_setpoint,
)
)
if coordinator.data.get(Attribute.DEHUMIDIFICATION_AVAILABLE) in (0, 1):
descriptions.append(
AprilaireHumidifierDescription(
key="dehumidifier",
translation_key="dehumidifier",
device_class=HumidifierDeviceClass.DEHUMIDIFIER,
action_key=Attribute.DEHUMIDIFICATION_STATUS,
action_map=DEHUMIDIFIER_ACTION_MAP,
current_humidity_key=Attribute.INDOOR_HUMIDITY_CONTROLLING_SENSOR_VALUE,
target_humidity_key=Attribute.DEHUMIDIFICATION_SETPOINT,
min_humidity=40,
max_humidity=90,
default_humidity=60,
set_humidity_fn=coordinator.client.set_dehumidification_setpoint,
)
)
async_add_entities(
AprilaireHumidifierEntity(coordinator, description, config_entry.unique_id)
for description in descriptions
)
@dataclass(frozen=True, kw_only=True)
class AprilaireHumidifierDescription(HumidifierEntityDescription):
"""Class describing Aprilaire humidifier entities."""
action_key: str
action_map: dict[StateType, HumidifierAction]
current_humidity_key: str
target_humidity_key: str
min_humidity: int
max_humidity: int
default_humidity: int
set_humidity_fn: Callable[[int], Awaitable]
class AprilaireHumidifierEntity(BaseAprilaireEntity, HumidifierEntity):
"""Base humidity entity for Aprilaire."""
entity_description: AprilaireHumidifierDescription
last_target_humidity: int | None = None
def __init__(
self,
coordinator: AprilaireCoordinator,
description: AprilaireHumidifierDescription,
unique_id: str,
) -> None:
"""Initialize a select for an Aprilaire device."""
self.entity_description = description
super().__init__(coordinator, unique_id)
@property
def action(self) -> HumidifierAction | None:
"""Get the current action."""
action = self.coordinator.data.get(self.entity_description.action_key)
return self.entity_description.action_map.get(action, HumidifierAction.OFF)
@property
def is_on(self) -> bool:
"""Get whether the humidifier is on."""
return self.target_humidity is not None and self.target_humidity > 0
@property
def current_humidity(self) -> float | None:
"""Get the current humidity."""
return cast(
float,
self.coordinator.data.get(self.entity_description.current_humidity_key),
)
@property
def target_humidity(self) -> float | None:
"""Get the target humidity."""
target_humidity = cast(
float,
self.coordinator.data.get(self.entity_description.target_humidity_key),
)
if target_humidity is not None and target_humidity > 0:
self.last_target_humidity = int(target_humidity)
return target_humidity
@property
def min_humidity(self) -> float:
"""Return the minimum humidity."""
return self.entity_description.min_humidity
@property
def max_humidity(self) -> float:
"""Return the maximum humidity."""
return self.entity_description.max_humidity
async def async_set_humidity(self, humidity: int) -> None:
"""Set the humidity."""
await self.entity_description.set_humidity_fn(humidity)
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
if self.last_target_humidity is None or self.last_target_humidity == 0:
target_humidity = self.entity_description.default_humidity
else:
target_humidity = self.last_target_humidity
await self.entity_description.set_humidity_fn(target_humidity)
async def async_turn_off(self, **kwargs: Any) -> None:
"""Turn the device off."""
await self.entity_description.set_humidity_fn(0)

View File

@@ -1,6 +1,6 @@
{
"domain": "aprilaire",
"name": "Aprilaire",
"name": "AprilAire",
"codeowners": ["@chamberlain2007"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/aprilaire",

View File

@@ -24,6 +24,14 @@
"name": "Thermostat"
}
},
"humidifier": {
"humidifier": {
"name": "[%key:component::humidifier::title%]"
},
"dehumidifier": {
"name": "[%key:component::humidifier::entity_component::dehumidifier::name%]"
}
},
"select": {
"air_cleaning_event": {
"name": "Air cleaning event",

View File

@@ -8,5 +8,5 @@
"integration_type": "device",
"iot_class": "cloud_polling",
"loggers": ["aioaquacell"],
"requirements": ["aioaquacell==0.1.7"]
"requirements": ["aioaquacell==0.2.0"]
}

View File

@@ -13,17 +13,17 @@ from homeassistant.const import CONF_HOST, CONF_PORT, Platform
from homeassistant.core import HomeAssistant
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.typing import ConfigType
from .const import (
DEFAULT_SCAN_INTERVAL,
DOMAIN,
DOMAIN_DATA_ENTRIES,
SIGNAL_CLIENT_DATA,
SIGNAL_CLIENT_STARTED,
SIGNAL_CLIENT_STOPPED,
)
type ArcamFmjConfigEntry = ConfigEntry[Client]
_LOGGER = logging.getLogger(__name__)
CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
@@ -31,34 +31,21 @@ CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
PLATFORMS = [Platform.MEDIA_PLAYER]
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the component."""
hass.data[DOMAIN_DATA_ENTRIES] = {}
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ArcamFmjConfigEntry) -> bool:
"""Set up config entry."""
entries = hass.data[DOMAIN_DATA_ENTRIES]
client = Client(entry.data[CONF_HOST], entry.data[CONF_PORT])
entries[entry.entry_id] = client
entry.runtime_data = Client(entry.data[CONF_HOST], entry.data[CONF_PORT])
entry.async_create_background_task(
hass, _run_client(hass, client, DEFAULT_SCAN_INTERVAL), "arcam_fmj"
hass, _run_client(hass, entry.runtime_data, DEFAULT_SCAN_INTERVAL), "arcam_fmj"
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Cleanup before removing config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
hass.data[DOMAIN_DATA_ENTRIES].pop(entry.entry_id)
return unload_ok
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def _run_client(hass: HomeAssistant, client: Client, interval: float) -> None:

View File

@@ -10,18 +10,11 @@ from arcam.fmj.utils import get_uniqueid_from_host, get_uniqueid_from_udn
import voluptuous as vol
from homeassistant.components import ssdp
from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DEFAULT_NAME, DEFAULT_PORT, DOMAIN, DOMAIN_DATA_ENTRIES
def get_entry_client(hass: HomeAssistant, entry: ConfigEntry) -> Client:
"""Retrieve client associated with a config entry."""
client: Client = hass.data[DOMAIN_DATA_ENTRIES][entry.entry_id]
return client
from .const import DEFAULT_NAME, DEFAULT_PORT, DOMAIN
class ArcamFmjFlowHandler(ConfigFlow, domain=DOMAIN):

View File

@@ -11,5 +11,3 @@ EVENT_TURN_ON = "arcam_fmj.turn_on"
DEFAULT_PORT = 50000
DEFAULT_NAME = "Arcam FMJ"
DEFAULT_SCAN_INTERVAL = 5
DOMAIN_DATA_ENTRIES = f"{DOMAIN}.entries"

View File

@@ -19,7 +19,6 @@ from homeassistant.components.media_player import (
MediaType,
)
from homeassistant.components.media_player.errors import BrowseError
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
@@ -27,7 +26,7 @@ from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .config_flow import get_entry_client
from . import ArcamFmjConfigEntry
from .const import (
DOMAIN,
EVENT_TURN_ON,
@@ -41,12 +40,12 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: ArcamFmjConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the configuration entry."""
client = get_entry_client(hass, config_entry)
client = config_entry.runtime_data
async_add_entities(
[

View File

@@ -5,7 +5,7 @@ from __future__ import annotations
import array
import asyncio
from collections import defaultdict, deque
from collections.abc import AsyncIterable, Callable, Iterable
from collections.abc import AsyncGenerator, AsyncIterable, Callable
from dataclasses import asdict, dataclass, field
from enum import StrEnum
import logging
@@ -16,7 +16,6 @@ import time
from typing import TYPE_CHECKING, Any, Final, Literal, cast
import wave
from typing_extensions import AsyncGenerator
import voluptuous as vol
if TYPE_CHECKING:
@@ -116,10 +115,13 @@ AUDIO_PROCESSOR_SAMPLES: Final = 160 # 10 ms @ 16 Khz
AUDIO_PROCESSOR_BYTES: Final = AUDIO_PROCESSOR_SAMPLES * 2 # 16-bit samples
async def _async_resolve_default_pipeline_settings(
@callback
def _async_resolve_default_pipeline_settings(
hass: HomeAssistant,
stt_engine_id: str | None,
tts_engine_id: str | None,
*,
conversation_engine_id: str | None = None,
stt_engine_id: str | None = None,
tts_engine_id: str | None = None,
pipeline_name: str,
) -> dict[str, str | None]:
"""Resolve settings for a default pipeline.
@@ -137,12 +139,13 @@ async def _async_resolve_default_pipeline_settings(
wake_word_entity = None
wake_word_id = None
if conversation_engine_id is None:
conversation_engine_id = conversation.HOME_ASSISTANT_AGENT
# Find a matching language supported by the Home Assistant conversation agent
conversation_languages = language_util.matches(
hass.config.language,
await conversation.async_get_conversation_languages(
hass, conversation.HOME_ASSISTANT_AGENT
),
conversation.async_get_conversation_languages(hass, conversation_engine_id),
country=hass.config.country,
)
if conversation_languages:
@@ -201,7 +204,7 @@ async def _async_resolve_default_pipeline_settings(
tts_engine_id = None
return {
"conversation_engine": conversation.HOME_ASSISTANT_AGENT,
"conversation_engine": conversation_engine_id,
"conversation_language": conversation_language,
"language": hass.config.language,
"name": pipeline_name,
@@ -223,8 +226,8 @@ async def _async_create_default_pipeline(
The default pipeline will use the homeassistant conversation agent and the
default stt / tts engines.
"""
pipeline_settings = await _async_resolve_default_pipeline_settings(
hass, stt_engine_id=None, tts_engine_id=None, pipeline_name="Home Assistant"
pipeline_settings = _async_resolve_default_pipeline_settings(
hass, pipeline_name="Home Assistant"
)
return await pipeline_store.async_create_item(pipeline_settings)
@@ -242,8 +245,11 @@ async def async_create_default_pipeline(
"""
pipeline_data: PipelineData = hass.data[DOMAIN]
pipeline_store = pipeline_data.pipeline_store
pipeline_settings = await _async_resolve_default_pipeline_settings(
hass, stt_engine_id, tts_engine_id, pipeline_name=pipeline_name
pipeline_settings = _async_resolve_default_pipeline_settings(
hass,
stt_engine_id=stt_engine_id,
tts_engine_id=tts_engine_id,
pipeline_name=pipeline_name,
)
if (
pipeline_settings["stt_engine"] != stt_engine_id
@@ -253,6 +259,22 @@ async def async_create_default_pipeline(
return await pipeline_store.async_create_item(pipeline_settings)
@callback
def _async_get_pipeline_from_conversation_entity(
hass: HomeAssistant, entity_id: str
) -> Pipeline:
"""Get a pipeline by conversation entity ID."""
entity = hass.states.get(entity_id)
settings = _async_resolve_default_pipeline_settings(
hass,
pipeline_name=entity.name if entity else entity_id,
conversation_engine_id=entity_id,
)
settings["id"] = entity_id
return Pipeline.from_json(settings)
@callback
def async_get_pipeline(hass: HomeAssistant, pipeline_id: str | None = None) -> Pipeline:
"""Get a pipeline by id or the preferred pipeline."""
@@ -262,6 +284,9 @@ def async_get_pipeline(hass: HomeAssistant, pipeline_id: str | None = None) -> P
# A pipeline was not specified, use the preferred one
pipeline_id = pipeline_data.pipeline_store.async_get_preferred_item()
if pipeline_id.startswith("conversation."):
return _async_get_pipeline_from_conversation_entity(hass, pipeline_id)
pipeline = pipeline_data.pipeline_store.data.get(pipeline_id)
# If invalid pipeline ID was specified
@@ -274,11 +299,11 @@ def async_get_pipeline(hass: HomeAssistant, pipeline_id: str | None = None) -> P
@callback
def async_get_pipelines(hass: HomeAssistant) -> Iterable[Pipeline]:
def async_get_pipelines(hass: HomeAssistant) -> list[Pipeline]:
"""Get all pipelines."""
pipeline_data: PipelineData = hass.data[DOMAIN]
return pipeline_data.pipeline_store.data.values()
return list(pipeline_data.pipeline_store.data.values())
async def async_update_pipeline(
@@ -304,21 +329,25 @@ async def async_update_pipeline(
updates.pop("id")
# Refactor this once we bump to Python 3.12
# and have https://peps.python.org/pep-0692/
for key, val in (
("conversation_engine", conversation_engine),
("conversation_language", conversation_language),
("language", language),
("name", name),
("stt_engine", stt_engine),
("stt_language", stt_language),
("tts_engine", tts_engine),
("tts_language", tts_language),
("tts_voice", tts_voice),
("wake_word_entity", wake_word_entity),
("wake_word_id", wake_word_id),
):
if val is not UNDEFINED:
updates[key] = val
updates.update(
{
key: val
for key, val in (
("conversation_engine", conversation_engine),
("conversation_language", conversation_language),
("language", language),
("name", name),
("stt_engine", stt_engine),
("stt_language", stt_language),
("tts_engine", tts_engine),
("tts_language", tts_language),
("tts_voice", tts_voice),
("wake_word_entity", wake_word_entity),
("wake_word_id", wake_word_id),
)
if val is not UNDEFINED
}
)
await pipeline_data.pipeline_store.async_update_item(pipeline.id, updates)
@@ -855,6 +884,15 @@ class PipelineRun:
stream: AsyncIterable[ProcessedAudioChunk],
) -> str:
"""Run speech-to-text portion of pipeline. Returns the spoken text."""
# Create a background task to prepare the conversation agent
if self.end_stage >= PipelineStage.INTENT:
self.hass.async_create_background_task(
conversation.async_prepare_agent(
self.hass, self.intent_agent, self.language
),
f"prepare conversation agent {self.intent_agent}",
)
if isinstance(self.stt_provider, stt.Provider):
engine = self.stt_provider.name
else:
@@ -957,8 +995,6 @@ class PipelineRun:
"""Prepare recognizing an intent."""
agent_info = conversation.async_get_agent_info(
self.hass,
# If no conversation engine is set, use the Home Assistant agent
# (the conversation integration default is currently the last one set)
self.pipeline.conversation_engine or conversation.HOME_ASSISTANT_AGENT,
)
@@ -1653,6 +1689,12 @@ class PipelineStorageCollectionWebsocket(
if item_id is None:
item_id = self.storage_collection.async_get_preferred_item()
if item_id.startswith("conversation.") and hass.states.get(item_id):
connection.send_result(
msg["id"], _async_get_pipeline_from_conversation_entity(hass, item_id)
)
return
if item_id not in self.storage_collection.data:
connection.send_error(
msg["id"],
@@ -1671,7 +1713,7 @@ class PipelineStorageCollectionWebsocket(
connection.send_result(
msg["id"],
{
"pipelines": self.storage_collection.async_items(),
"pipelines": async_get_pipelines(hass),
"preferred_pipeline": self.storage_collection.async_get_preferred_item(),
},
)

View File

@@ -5,13 +5,12 @@ import asyncio
# Suppressing disable=deprecated-module is needed for Python 3.11
import audioop # pylint: disable=deprecated-module
import base64
from collections.abc import Callable
from collections.abc import AsyncGenerator, Callable
import contextlib
import logging
import math
from typing import Any, Final
from typing_extensions import AsyncGenerator
import voluptuous as vol
from homeassistant.components import conversation, stt, tts, websocket_api
@@ -379,8 +378,8 @@ def websocket_get_run(
vol.Required("type"): "assist_pipeline/language/list",
}
)
@websocket_api.async_response
async def websocket_list_languages(
@callback
def websocket_list_languages(
hass: HomeAssistant,
connection: websocket_api.connection.ActiveConnection,
msg: dict[str, Any],
@@ -390,7 +389,7 @@ async def websocket_list_languages(
This will return a list of languages which are supported by at least one stt, tts
and conversation engine respectively.
"""
conv_language_tags = await conversation.async_get_conversation_languages(hass)
conv_language_tags = conversation.async_get_conversation_languages(hass)
stt_language_tags = stt.async_get_speech_to_text_languages(hass)
tts_language_tags = tts.async_get_text_to_speech_languages(hass)
pipeline_languages: set[str] | None = None

View File

@@ -2,10 +2,10 @@
from __future__ import annotations
from pathlib import Path
from typing import cast
from aiohttp import ClientResponseError
from path import Path
from yalexs.exceptions import AugustApiAIOHTTPError
from yalexs.manager.exceptions import CannotConnect, InvalidAuth, RequireValidation
from yalexs.manager.gateway import Config as YaleXSConfig

View File

@@ -8,7 +8,7 @@ from datetime import datetime, timedelta
from functools import partial
import logging
from yalexs.activity import ACTION_DOORBELL_CALL_MISSED, Activity, ActivityType
from yalexs.activity import Activity, ActivityType
from yalexs.doorbell import DoorbellDetail
from yalexs.lock import LockDetail, LockDoorStatus
from yalexs.manager.const import ACTIVITY_UPDATE_INTERVAL
@@ -26,67 +26,25 @@ from homeassistant.helpers.event import async_call_later
from . import AugustConfigEntry, AugustData
from .entity import AugustDescriptionEntity
from .util import (
retrieve_ding_activity,
retrieve_doorbell_motion_activity,
retrieve_online_state,
retrieve_time_based_activity,
)
_LOGGER = logging.getLogger(__name__)
TIME_TO_DECLARE_DETECTION = timedelta(seconds=ACTIVITY_UPDATE_INTERVAL.total_seconds())
TIME_TO_RECHECK_DETECTION = timedelta(
seconds=ACTIVITY_UPDATE_INTERVAL.total_seconds() * 3
)
def _retrieve_online_state(
data: AugustData, detail: DoorbellDetail | LockDetail
) -> bool:
"""Get the latest state of the sensor."""
# The doorbell will go into standby mode when there is no motion
# for a short while. It will wake by itself when needed so we need
# to consider is available or we will not report motion or dings
if isinstance(detail, DoorbellDetail):
return detail.is_online or detail.is_standby
return detail.bridge_is_online
def _retrieve_time_based_state(
activities: set[ActivityType], data: AugustData, detail: DoorbellDetail
) -> bool:
"""Get the latest state of the sensor."""
stream = data.activity_stream
if latest := stream.get_latest_device_activity(detail.device_id, activities):
return _activity_time_based_state(latest)
return False
_RING_ACTIVITIES = {ActivityType.DOORBELL_DING}
def _retrieve_ding_state(data: AugustData, detail: DoorbellDetail | LockDetail) -> bool:
stream = data.activity_stream
latest = stream.get_latest_device_activity(detail.device_id, _RING_ACTIVITIES)
if latest is None or (
data.push_updates_connected and latest.action == ACTION_DOORBELL_CALL_MISSED
):
return False
return _activity_time_based_state(latest)
def _activity_time_based_state(latest: Activity) -> bool:
"""Get the latest state of the sensor."""
start = latest.activity_start_time
end = latest.activity_end_time + TIME_TO_DECLARE_DETECTION
return start <= _native_datetime() <= end
def _native_datetime() -> datetime:
"""Return time in the format august uses without timezone."""
return datetime.now()
@dataclass(frozen=True, kw_only=True)
class AugustDoorbellBinarySensorEntityDescription(BinarySensorEntityDescription):
"""Describes August binary_sensor entity."""
value_fn: Callable[[AugustData, DoorbellDetail], bool]
value_fn: Callable[[AugustData, DoorbellDetail | LockDetail], Activity | None]
is_time_based: bool
@@ -99,14 +57,14 @@ SENSOR_TYPES_VIDEO_DOORBELL = (
AugustDoorbellBinarySensorEntityDescription(
key="motion",
device_class=BinarySensorDeviceClass.MOTION,
value_fn=partial(_retrieve_time_based_state, {ActivityType.DOORBELL_MOTION}),
value_fn=retrieve_doorbell_motion_activity,
is_time_based=True,
),
AugustDoorbellBinarySensorEntityDescription(
key="image capture",
translation_key="image_capture",
value_fn=partial(
_retrieve_time_based_state, {ActivityType.DOORBELL_IMAGE_CAPTURE}
retrieve_time_based_activity, {ActivityType.DOORBELL_IMAGE_CAPTURE}
),
is_time_based=True,
),
@@ -114,7 +72,7 @@ SENSOR_TYPES_VIDEO_DOORBELL = (
key="online",
device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=_retrieve_online_state,
value_fn=retrieve_online_state,
is_time_based=False,
),
)
@@ -124,7 +82,7 @@ SENSOR_TYPES_DOORBELL: tuple[AugustDoorbellBinarySensorEntityDescription, ...] =
AugustDoorbellBinarySensorEntityDescription(
key="ding",
device_class=BinarySensorDeviceClass.OCCUPANCY,
value_fn=_retrieve_ding_state,
value_fn=retrieve_ding_activity,
is_time_based=True,
),
)
@@ -189,10 +147,12 @@ class AugustDoorbellBinarySensor(AugustDescriptionEntity, BinarySensorEntity):
def _update_from_data(self) -> None:
"""Get the latest state of the sensor."""
self._cancel_any_pending_updates()
self._attr_is_on = self.entity_description.value_fn(self._data, self._detail)
self._attr_is_on = bool(
self.entity_description.value_fn(self._data, self._detail)
)
if self.entity_description.is_time_based:
self._attr_available = _retrieve_online_state(self._data, self._detail)
self._attr_available = retrieve_online_state(self._data, self._detail)
self._schedule_update_to_recheck_turn_off_sensor()
else:
self._attr_available = True

View File

@@ -42,6 +42,7 @@ PLATFORMS = [
Platform.BINARY_SENSOR,
Platform.BUTTON,
Platform.CAMERA,
Platform.EVENT,
Platform.LOCK,
Platform.SENSOR,
]

View File

@@ -0,0 +1,104 @@
"""Support for august events."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING
from yalexs.activity import Activity
from yalexs.doorbell import DoorbellDetail
from yalexs.lock import LockDetail
from homeassistant.components.event import (
EventDeviceClass,
EventEntity,
EventEntityDescription,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AugustConfigEntry, AugustData
from .entity import AugustDescriptionEntity
from .util import (
retrieve_ding_activity,
retrieve_doorbell_motion_activity,
retrieve_online_state,
)
@dataclass(kw_only=True, frozen=True)
class AugustEventEntityDescription(EventEntityDescription):
"""Describe august event entities."""
value_fn: Callable[[AugustData, DoorbellDetail | LockDetail], Activity | None]
TYPES_VIDEO_DOORBELL: tuple[AugustEventEntityDescription, ...] = (
AugustEventEntityDescription(
key="motion",
translation_key="motion",
device_class=EventDeviceClass.MOTION,
event_types=["motion"],
value_fn=retrieve_doorbell_motion_activity,
),
)
TYPES_DOORBELL: tuple[AugustEventEntityDescription, ...] = (
AugustEventEntityDescription(
key="doorbell",
translation_key="doorbell",
device_class=EventDeviceClass.DOORBELL,
event_types=["ring"],
value_fn=retrieve_ding_activity,
),
)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: AugustConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the august event platform."""
data = config_entry.runtime_data
entities: list[AugustEventEntity] = []
for lock in data.locks:
detail = data.get_device_detail(lock.device_id)
if detail.doorbell:
entities.extend(
AugustEventEntity(data, lock, description)
for description in TYPES_DOORBELL
)
for doorbell in data.doorbells:
entities.extend(
AugustEventEntity(data, doorbell, description)
for description in TYPES_DOORBELL + TYPES_VIDEO_DOORBELL
)
async_add_entities(entities)
class AugustEventEntity(AugustDescriptionEntity, EventEntity):
"""An august event entity."""
entity_description: AugustEventEntityDescription
_attr_has_entity_name = True
_last_activity: Activity | None = None
@callback
def _update_from_data(self) -> None:
"""Update from data."""
self._attr_available = retrieve_online_state(self._data, self._detail)
current_activity = self.entity_description.value_fn(self._data, self._detail)
if not current_activity or current_activity == self._last_activity:
return
self._last_activity = current_activity
event_types = self.entity_description.event_types
if TYPE_CHECKING:
assert event_types is not None
self._trigger_event(event_type=event_types[0])
self.async_write_ha_state()

View File

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

View File

@@ -58,6 +58,26 @@
"operator": {
"name": "Operator"
}
},
"event": {
"doorbell": {
"state_attributes": {
"event_type": {
"state": {
"ring": "Ring"
}
}
}
},
"motion": {
"state_attributes": {
"event_type": {
"state": {
"motion": "Motion"
}
}
}
}
}
}
}

View File

@@ -1,12 +1,24 @@
"""August util functions."""
from __future__ import annotations
from datetime import datetime, timedelta
from functools import partial
import socket
import aiohttp
from yalexs.activity import ACTION_DOORBELL_CALL_MISSED, Activity, ActivityType
from yalexs.doorbell import DoorbellDetail
from yalexs.lock import LockDetail
from yalexs.manager.const import ACTIVITY_UPDATE_INTERVAL
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import aiohttp_client
from . import AugustData
TIME_TO_DECLARE_DETECTION = timedelta(seconds=ACTIVITY_UPDATE_INTERVAL.total_seconds())
@callback
def async_create_august_clientsession(hass: HomeAssistant) -> aiohttp.ClientSession:
@@ -22,3 +34,60 @@ def async_create_august_clientsession(hass: HomeAssistant) -> aiohttp.ClientSess
# we can allow IPv6 again
#
return aiohttp_client.async_create_clientsession(hass, family=socket.AF_INET)
def retrieve_time_based_activity(
activities: set[ActivityType], data: AugustData, detail: DoorbellDetail | LockDetail
) -> Activity | None:
"""Get the latest state of the sensor."""
stream = data.activity_stream
if latest := stream.get_latest_device_activity(detail.device_id, activities):
return _activity_time_based(latest)
return False
_RING_ACTIVITIES = {ActivityType.DOORBELL_DING}
def retrieve_ding_activity(
data: AugustData, detail: DoorbellDetail | LockDetail
) -> Activity | None:
"""Get the ring/ding state."""
stream = data.activity_stream
latest = stream.get_latest_device_activity(detail.device_id, _RING_ACTIVITIES)
if latest is None or (
data.push_updates_connected and latest.action == ACTION_DOORBELL_CALL_MISSED
):
return None
return _activity_time_based(latest)
retrieve_doorbell_motion_activity = partial(
retrieve_time_based_activity, {ActivityType.DOORBELL_MOTION}
)
def _activity_time_based(latest: Activity) -> Activity | None:
"""Get the latest state of the sensor."""
start = latest.activity_start_time
end = latest.activity_end_time + TIME_TO_DECLARE_DETECTION
if start <= _native_datetime() <= end:
return latest
return None
def _native_datetime() -> datetime:
"""Return time in the format august uses without timezone."""
return datetime.now()
def retrieve_online_state(
data: AugustData, detail: DoorbellDetail | LockDetail
) -> bool:
"""Get the latest state of the sensor."""
# The doorbell will go into standby mode when there is no motion
# for a short while. It will wake by itself when needed so we need
# to consider is available or we will not report motion or dings
if isinstance(detail, DoorbellDetail):
return detail.is_online or detail.is_standby
return detail.bridge_is_online

View File

@@ -0,0 +1,49 @@
"""The Autarco integration."""
from __future__ import annotations
import asyncio
from autarco import Autarco
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .coordinator import AutarcoDataUpdateCoordinator
PLATFORMS: list[Platform] = [Platform.SENSOR]
type AutarcoConfigEntry = ConfigEntry[list[AutarcoDataUpdateCoordinator]]
async def async_setup_entry(hass: HomeAssistant, entry: AutarcoConfigEntry) -> bool:
"""Set up Autarco from a config entry."""
client = Autarco(
email=entry.data[CONF_EMAIL],
password=entry.data[CONF_PASSWORD],
session=async_get_clientsession(hass),
)
account_sites = await client.get_account()
coordinators: list[AutarcoDataUpdateCoordinator] = [
AutarcoDataUpdateCoordinator(hass, client, site) for site in account_sites
]
await asyncio.gather(
*[
coordinator.async_config_entry_first_refresh()
for coordinator in coordinators
]
)
entry.runtime_data = coordinators
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: AutarcoConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)

View File

@@ -0,0 +1,57 @@
"""Config flow for Autarco integration."""
from __future__ import annotations
from typing import Any
from autarco import Autarco, AutarcoAuthenticationError, AutarcoConnectionError
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from .const import DOMAIN
DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_EMAIL): str,
vol.Required(CONF_PASSWORD): str,
}
)
class AutarcoConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Autarco."""
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> ConfigFlowResult:
"""Handle the initial step."""
errors: dict[str, str] = {}
if user_input is not None:
self._async_abort_entries_match({CONF_EMAIL: user_input[CONF_EMAIL]})
client = Autarco(
email=user_input[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_create_entry(
title=user_input[CONF_EMAIL],
data={
CONF_EMAIL: user_input[CONF_EMAIL],
CONF_PASSWORD: user_input[CONF_PASSWORD],
},
)
return self.async_show_form(
step_id="user",
errors=errors,
data_schema=DATA_SCHEMA,
)

View File

@@ -0,0 +1,11 @@
"""Constants for the Autarco integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Final
DOMAIN: Final = "autarco"
LOGGER = logging.getLogger(__package__)
SCAN_INTERVAL = timedelta(minutes=5)

View File

@@ -0,0 +1,49 @@
"""Coordinator for Autarco integration."""
from __future__ import annotations
from typing import NamedTuple
from autarco import AccountSite, Autarco, Inverter, Solar
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from .const import DOMAIN, LOGGER, SCAN_INTERVAL
class AutarcoData(NamedTuple):
"""Class for defining data in dict."""
solar: Solar
inverters: dict[str, Inverter]
class AutarcoDataUpdateCoordinator(DataUpdateCoordinator[AutarcoData]):
"""Class to manage fetching Autarco data from the API."""
config_entry: ConfigEntry
def __init__(
self,
hass: HomeAssistant,
client: Autarco,
site: AccountSite,
) -> None:
"""Initialize global Autarco data updater."""
super().__init__(
hass,
LOGGER,
name=DOMAIN,
update_interval=SCAN_INTERVAL,
)
self.client = client
self.site = site
async def _async_update_data(self) -> AutarcoData:
"""Fetch data from Autarco API."""
return AutarcoData(
solar=await self.client.get_solar(self.site.public_key),
inverters=await self.client.get_inverters(self.site.public_key),
)

View File

@@ -0,0 +1,43 @@
"""Support for the Autarco diagnostics."""
from __future__ import annotations
from typing import Any
from homeassistant.core import HomeAssistant
from . import AutarcoConfigEntry, AutarcoDataUpdateCoordinator
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: AutarcoConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
autarco_data: list[AutarcoDataUpdateCoordinator] = config_entry.runtime_data
return {
"sites_data": [
{
"id": coordinator.site.site_id,
"name": coordinator.site.system_name,
"health": coordinator.site.health,
"solar": {
"power_production": coordinator.data.solar.power_production,
"energy_production_today": coordinator.data.solar.energy_production_today,
"energy_production_month": coordinator.data.solar.energy_production_month,
"energy_production_total": coordinator.data.solar.energy_production_total,
},
"inverters": [
{
"serial_number": inverter.serial_number,
"out_ac_power": inverter.out_ac_power,
"out_ac_energy_total": inverter.out_ac_energy_total,
"grid_turned_off": inverter.grid_turned_off,
"health": inverter.health,
}
for inverter in coordinator.data.inverters.values()
],
}
for coordinator in autarco_data
],
}

View File

@@ -0,0 +1,9 @@
{
"domain": "autarco",
"name": "Autarco",
"codeowners": ["@klaasnicolaas"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/autarco",
"iot_class": "cloud_polling",
"requirements": ["autarco==2.0.0"]
}

View File

@@ -0,0 +1,189 @@
"""Support for Autarco sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from autarco import Inverter, Solar
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import UnitOfEnergy, UnitOfPower
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import AutarcoConfigEntry
from .const import DOMAIN
from .coordinator import AutarcoDataUpdateCoordinator
@dataclass(frozen=True, kw_only=True)
class AutarcoSolarSensorEntityDescription(SensorEntityDescription):
"""Describes an Autarco sensor entity."""
value_fn: Callable[[Solar], StateType]
SENSORS_SOLAR: tuple[AutarcoSolarSensorEntityDescription, ...] = (
AutarcoSolarSensorEntityDescription(
key="power_production",
translation_key="power_production",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda solar: solar.power_production,
),
AutarcoSolarSensorEntityDescription(
key="energy_production_today",
translation_key="energy_production_today",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value_fn=lambda solar: solar.energy_production_today,
),
AutarcoSolarSensorEntityDescription(
key="energy_production_month",
translation_key="energy_production_month",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
value_fn=lambda solar: solar.energy_production_month,
),
AutarcoSolarSensorEntityDescription(
key="energy_production_total",
translation_key="energy_production_total",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda solar: solar.energy_production_total,
),
)
@dataclass(frozen=True, kw_only=True)
class AutarcoInverterSensorEntityDescription(SensorEntityDescription):
"""Describes an Autarco inverter sensor entity."""
value_fn: Callable[[Inverter], StateType]
SENSORS_INVERTER: tuple[AutarcoInverterSensorEntityDescription, ...] = (
AutarcoInverterSensorEntityDescription(
key="out_ac_power",
translation_key="out_ac_power",
native_unit_of_measurement=UnitOfPower.WATT,
device_class=SensorDeviceClass.POWER,
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda inverter: inverter.out_ac_power,
),
AutarcoInverterSensorEntityDescription(
key="out_ac_energy_total",
translation_key="out_ac_energy_total",
native_unit_of_measurement=UnitOfEnergy.KILO_WATT_HOUR,
device_class=SensorDeviceClass.ENERGY,
state_class=SensorStateClass.TOTAL_INCREASING,
value_fn=lambda inverter: inverter.out_ac_energy_total,
),
)
async def async_setup_entry(
hass: HomeAssistant,
entry: AutarcoConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up Autarco sensors based on a config entry."""
entities: list[SensorEntity] = []
for coordinator in entry.runtime_data:
entities.extend(
AutarcoSolarSensorEntity(
coordinator=coordinator,
description=description,
)
for description in SENSORS_SOLAR
)
entities.extend(
AutarcoInverterSensorEntity(
coordinator=coordinator,
description=description,
serial_number=inverter,
)
for description in SENSORS_INVERTER
for inverter in coordinator.data.inverters
)
async_add_entities(entities)
class AutarcoSolarSensorEntity(
CoordinatorEntity[AutarcoDataUpdateCoordinator], SensorEntity
):
"""Defines an Autarco solar sensor."""
entity_description: AutarcoSolarSensorEntityDescription
_attr_has_entity_name = True
def __init__(
self,
*,
coordinator: AutarcoDataUpdateCoordinator,
description: AutarcoSolarSensorEntityDescription,
) -> None:
"""Initialize Autarco sensor."""
super().__init__(coordinator)
self.entity_description = description
self._attr_unique_id = f"{coordinator.site.site_id}_solar_{description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, f"{coordinator.site.site_id}_solar")},
entry_type=DeviceEntryType.SERVICE,
manufacturer="Autarco",
name="Solar",
)
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self.entity_description.value_fn(self.coordinator.data.solar)
class AutarcoInverterSensorEntity(
CoordinatorEntity[AutarcoDataUpdateCoordinator], SensorEntity
):
"""Defines an Autarco inverter sensor."""
entity_description: AutarcoInverterSensorEntityDescription
_attr_has_entity_name = True
def __init__(
self,
*,
coordinator: AutarcoDataUpdateCoordinator,
description: AutarcoInverterSensorEntityDescription,
serial_number: str,
) -> None:
"""Initialize Autarco sensor."""
super().__init__(coordinator)
self.entity_description = description
self._serial_number = serial_number
self._attr_unique_id = f"{serial_number}_{description.key}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, serial_number)},
name=f"Inverter {serial_number}",
manufacturer="Autarco",
model="Inverter",
serial_number=serial_number,
)
@property
def native_value(self) -> StateType:
"""Return the state of the sensor."""
return self.entity_description.value_fn(
self.coordinator.data.inverters[self._serial_number]
)

View File

@@ -0,0 +1,46 @@
{
"config": {
"step": {
"user": {
"description": "Connect to your Autarco account to get information about your solar panels.",
"data": {
"email": "[%key:common::config_flow::data::email%]",
"password": "[%key:common::config_flow::data::password%]"
},
"data_description": {
"email": "The email address of your Autarco account.",
"password": "The password of your Autarco account."
}
}
},
"error": {
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"sensor": {
"power_production": {
"name": "Power production"
},
"energy_production_today": {
"name": "Energy production today"
},
"energy_production_month": {
"name": "Energy production month"
},
"energy_production_total": {
"name": "Energy production total"
},
"out_ac_power": {
"name": "Power AC output"
},
"out_ac_energy_total": {
"name": "Energy AC output total"
}
}
}
}

View File

@@ -215,7 +215,7 @@ def _prepare_result_json(
data = result.copy()
if (schema := data["data_schema"]) is None:
data["data_schema"] = []
data["data_schema"] = [] # type: ignore[typeddict-item] # json result type
else:
data["data_schema"] = voluptuous_serialize.convert(schema)

View File

@@ -156,7 +156,7 @@ def _prepare_result_json(
data = result.copy()
if (schema := data["data_schema"]) is None:
data["data_schema"] = []
data["data_schema"] = [] # type: ignore[typeddict-item] # json result type
else:
data["data_schema"] = voluptuous_serialize.convert(schema)

View File

@@ -1048,29 +1048,32 @@ async def _async_process_config(
automation_configs_with_id: dict[str, tuple[int, AutomationEntityConfig]] = {}
automation_configs_without_id: list[tuple[int, AutomationEntityConfig]] = []
for config_idx, config in enumerate(automation_configs):
if automation_id := config.config_block.get(CONF_ID):
automation_configs_with_id[automation_id] = (config_idx, config)
for config_idx, automation_config in enumerate(automation_configs):
if automation_id := automation_config.config_block.get(CONF_ID):
automation_configs_with_id[automation_id] = (
config_idx,
automation_config,
)
continue
automation_configs_without_id.append((config_idx, config))
automation_configs_without_id.append((config_idx, automation_config))
for automation_idx, automation in enumerate(automations):
if automation.unique_id:
if automation.unique_id not in automation_configs_with_id:
continue
config_idx, config = automation_configs_with_id.pop(
config_idx, automation_config = automation_configs_with_id.pop(
automation.unique_id
)
if automation_matches_config(automation, config):
if automation_matches_config(automation, automation_config):
automation_matches.add(automation_idx)
config_matches.add(config_idx)
continue
for config_idx, config in automation_configs_without_id:
for config_idx, automation_config in automation_configs_without_id:
if config_idx in config_matches:
# Only allow an automation config to match at most once
continue
if automation_matches_config(automation, config):
if automation_matches_config(automation, automation_config):
automation_matches.add(automation_idx)
config_matches.add(config_idx)
# Only allow an automation to match at most once

View File

@@ -5,7 +5,7 @@ from __future__ import annotations
from collections.abc import Mapping
from contextlib import suppress
from enum import StrEnum
from typing import Any, cast
from typing import Any
import voluptuous as vol
from voluptuous.humanize import humanize_error
@@ -90,7 +90,7 @@ async def _async_validate_config_item( # noqa: C901
def _humanize(err: Exception, config: ConfigType) -> str:
"""Humanize vol.Invalid, stringify other exceptions."""
if isinstance(err, vol.Invalid):
return cast(str, humanize_error(config, err))
return humanize_error(config, err)
return str(err)
def _log_invalid_automation(

View File

@@ -37,12 +37,12 @@
},
"issues": {
"service_not_found": {
"title": "{name} uses an unknown service",
"title": "{name} uses an unknown action",
"fix_flow": {
"step": {
"confirm": {
"title": "[%key:component::automation::issues::service_not_found::title%]",
"description": "The automation \"{name}\" (`{entity_id}`) has an action that calls an unknown service: `{service}`.\n\nThis error prevents the automation from running correctly. Maybe this service is no longer available, or perhaps a typo caused it.\n\nTo fix this error, [edit the automation]({edit}) and remove the action that calls this service.\n\nClick on SUBMIT below to confirm you have fixed this automation."
"description": "The automation \"{name}\" (`{entity_id}`) has an unknown action: `{service}`.\n\nThis error prevents the automation from running correctly. Maybe this action is no longer available, or perhaps a typo caused it.\n\nTo fix this error, [edit the automation]({edit}) and remove this action.\n\nClick on SUBMIT below to confirm you have fixed this automation."
}
}
}

View File

@@ -2,11 +2,10 @@
from __future__ import annotations
from collections.abc import Generator
from contextlib import contextmanager
from typing import Any
from typing_extensions import Generator
from homeassistant.components.trace import (
CONF_STORED_TRACES,
ActionTrace,

View File

@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/aws",
"iot_class": "cloud_push",
"loggers": ["aiobotocore", "botocore"],
"requirements": ["aiobotocore==2.13.0"]
"requirements": ["aiobotocore==2.13.1", "botocore==1.34.131"]
}

View File

@@ -65,13 +65,18 @@ class AzureDataExplorerClient:
)
if data[CONF_USE_QUEUED_CLIENT] is True:
# Queded is the only option supported on free tear of ADX
# Queued is the only option supported on free tier of ADX
self.write_client = QueuedIngestClient(kcsb_ingest)
else:
self.write_client = ManagedStreamingIngestClient.from_dm_kcsb(kcsb_ingest)
self.query_client = KustoClient(kcsb_query)
# Reduce the HTTP logging, the default INFO logging is too verbose.
logging.getLogger("azure.core.pipeline.policies.http_logging_policy").setLevel(
logging.WARNING
)
def test_connection(self) -> None:
"""Test connection, will throw Exception if it cannot connect."""
@@ -80,7 +85,7 @@ class AzureDataExplorerClient:
self.query_client.execute_query(self._database, query)
def ingest_data(self, adx_events: str) -> None:
"""Send data to Axure Data Explorer."""
"""Send data to Azure Data Explorer."""
bytes_stream = io.StringIO(adx_events)
stream_descriptor = StreamDescriptor(bytes_stream)

View File

@@ -78,8 +78,9 @@ class AzureDevOpsDataUpdateCoordinator(DataUpdateCoordinator[AzureDevOpsData]):
)
if not self.client.authorized:
raise ConfigEntryAuthFailed(
"Could not authorize with Azure DevOps. You will need to update your"
" token"
translation_domain=DOMAIN,
translation_key="authentication_failed",
translation_placeholders={"title": self.title},
)
return True

View File

@@ -62,5 +62,10 @@
"name": "{definition_name} latest build url"
}
}
},
"exceptions": {
"authentication_failed": {
"message": "Could not authorize with Azure DevOps for {title}. You will need to update your personal access token."
}
}
}

View File

@@ -10,27 +10,17 @@ from mozart_api.models import Source, SourceArray, SourceTypeEnum
from homeassistant.components.media_player import MediaPlayerState, MediaType
class BangOlufsenSource(StrEnum):
"""Enum used for associating device source ids with friendly names. May not include all sources."""
class BangOlufsenSource:
"""Class used for associating device source ids with friendly names. May not include all sources."""
URI_STREAMER = "Audio Streamer"
BLUETOOTH = "Bluetooth"
AIR_PLAY = "AirPlay"
CHROMECAST = "Chromecast built-in"
SPOTIFY = "Spotify Connect"
GENERATOR = "Tone Generator"
LINE_IN = "Line-In"
SPDIF = "Optical"
NET_RADIO = "B&O Radio"
LOCAL = "Local"
DLNA = "DLNA"
QPLAY = "QPlay"
WPL = "Wireless Powerlink"
PL = "Powerlink"
TV = "TV"
DEEZER = "Deezer"
BEOLINK = "Networklink"
TIDAL_CONNECT = "Tidal Connect"
URI_STREAMER: Final[Source] = Source(name="Audio Streamer", id="uriStreamer")
BLUETOOTH: Final[Source] = Source(name="Bluetooth", id="bluetooth")
CHROMECAST: Final[Source] = Source(name="Chromecast built-in", id="chromeCast")
LINE_IN: Final[Source] = Source(name="Line-In", id="lineIn")
SPDIF: Final[Source] = Source(name="Optical", id="spdif")
NET_RADIO: Final[Source] = Source(name="B&O Radio", id="netRadio")
DEEZER: Final[Source] = Source(name="Deezer", id="deezer")
TIDAL: Final[Source] = Source(name="Tidal", id="tidal")
BANG_OLUFSEN_STATES: dict[str, MediaPlayerState] = {
@@ -62,6 +52,7 @@ class BangOlufsenMediaType(StrEnum):
class BangOlufsenModel(StrEnum):
"""Enum for compatible model names."""
BEOCONNECT_CORE = "Beoconnect Core"
BEOLAB_8 = "BeoLab 8"
BEOLAB_28 = "BeoLab 28"
BEOSOUND_2 = "Beosound 2 3rd Gen"

View File

@@ -344,8 +344,8 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
# Check if source is line-in or optical and progress should be updated
if self._source_change.id in (
BangOlufsenSource.LINE_IN,
BangOlufsenSource.SPDIF,
BangOlufsenSource.LINE_IN.id,
BangOlufsenSource.SPDIF.id,
):
self._playback_progress = PlaybackProgress(progress=0)
@@ -381,7 +381,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
def media_content_type(self) -> str:
"""Return the current media type."""
# Hard to determine content type
if self.source == BangOlufsenSource.URI_STREAMER:
if self._source_change.id == BangOlufsenSource.URI_STREAMER.id:
return MediaType.URL
return MediaType.MUSIC
@@ -398,9 +398,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
@property
def media_image_url(self) -> str | None:
"""Return URL of the currently playing music."""
if self._media_image:
return self._media_image.url
return None
return self._media_image.url
@property
def media_image_remotely_accessible(self) -> bool:
@@ -439,33 +437,31 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
# Try to fix some of the source_change chromecast weirdness.
if hasattr(self._playback_metadata, "title"):
# source_change is chromecast but line in is selected.
if self._playback_metadata.title == BangOlufsenSource.LINE_IN:
return BangOlufsenSource.LINE_IN
if self._playback_metadata.title == BangOlufsenSource.LINE_IN.name:
return BangOlufsenSource.LINE_IN.name
# source_change is chromecast but bluetooth is selected.
if self._playback_metadata.title == BangOlufsenSource.BLUETOOTH:
return BangOlufsenSource.BLUETOOTH
if self._playback_metadata.title == BangOlufsenSource.BLUETOOTH.name:
return BangOlufsenSource.BLUETOOTH.name
# source_change is line in, bluetooth or optical but stale metadata is sent through the WebSocket,
# And the source has not changed.
if self._source_change.id in (
BangOlufsenSource.BLUETOOTH,
BangOlufsenSource.LINE_IN,
BangOlufsenSource.SPDIF,
BangOlufsenSource.BLUETOOTH.id,
BangOlufsenSource.LINE_IN.id,
BangOlufsenSource.SPDIF.id,
):
return BangOlufsenSource.CHROMECAST
return BangOlufsenSource.CHROMECAST.name
# source_change is chromecast and there is metadata but no artwork. Bluetooth does support metadata but not artwork
# So i assume that it is bluetooth and not chromecast
if (
hasattr(self._playback_metadata, "art")
and self._playback_metadata.art is not None
and len(self._playback_metadata.art) == 0
and self._source_change.id == BangOlufsenSource.CHROMECAST.id
):
if (
len(self._playback_metadata.art) == 0
and self._source_change.name == BangOlufsenSource.BLUETOOTH
):
return BangOlufsenSource.BLUETOOTH
return BangOlufsenSource.BLUETOOTH.name
return self._source_change.name
@@ -508,7 +504,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
async def async_media_seek(self, position: float) -> None:
"""Seek to position in ms."""
if self.source == BangOlufsenSource.DEEZER:
if self._source_change.id == BangOlufsenSource.DEEZER.id:
await self._client.seek_to_position(position_ms=int(position * 1000))
# Try to prevent the playback progress from bouncing in the UI.
self._attr_media_position_updated_at = utcnow()

View File

@@ -3,6 +3,7 @@
"name": "Bayesian",
"codeowners": ["@HarvsG"],
"documentation": "https://www.home-assistant.io/integrations/bayesian",
"integration_type": "helper",
"iot_class": "local_polling",
"quality_scale": "internal"
}

View File

@@ -4,14 +4,13 @@ from __future__ import annotations
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import ATTR_DEVICE_ID, CONF_PIN
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import config_validation as cv, device_registry as dr
from homeassistant.helpers import config_validation as cv
from .const import ATTR_CONFIG_ENTRY_ID, DOMAIN, SERVICE_SEND_PIN
from .coordinator import BlinkUpdateCoordinator
SERVICE_UPDATE_SCHEMA = vol.Schema(
{
@@ -29,45 +28,6 @@ SERVICE_SEND_PIN_SCHEMA = vol.Schema(
def setup_services(hass: HomeAssistant) -> None:
"""Set up the services for the Blink integration."""
def collect_coordinators(
device_ids: list[str],
) -> list[BlinkUpdateCoordinator]:
config_entries: list[ConfigEntry] = []
registry = dr.async_get(hass)
for target in device_ids:
device = registry.async_get(target)
if device:
device_entries: list[ConfigEntry] = []
for entry_id in device.config_entries:
entry = hass.config_entries.async_get_entry(entry_id)
if entry and entry.domain == DOMAIN:
device_entries.append(entry)
if not device_entries:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="invalid_device",
translation_placeholders={"target": target, "domain": DOMAIN},
)
config_entries.extend(device_entries)
else:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="device_not_found",
translation_placeholders={"target": target},
)
coordinators: list[BlinkUpdateCoordinator] = []
for config_entry in config_entries:
if config_entry.state != ConfigEntryState.LOADED:
raise HomeAssistantError(
translation_domain=DOMAIN,
translation_key="not_loaded",
translation_placeholders={"target": config_entry.title},
)
coordinators.append(hass.data[DOMAIN][config_entry.entry_id])
return coordinators
async def send_pin(call: ServiceCall):
"""Call blink to send new pin."""
for entry_id in call.data[ATTR_CONFIG_ENTRY_ID]:

View File

@@ -1,10 +1,11 @@
"""Support for Blinkstick lights."""
# mypy: ignore-errors
from __future__ import annotations
from typing import Any
from blinkstick import blinkstick
# from blinkstick import blinkstick
import voluptuous as vol
from homeassistant.components.light import (

View File

@@ -2,6 +2,7 @@
"domain": "blinksticklight",
"name": "BlinkStick",
"codeowners": [],
"disabled": "This integration is disabled because it uses non-open source code to operate.",
"documentation": "https://www.home-assistant.io/integrations/blinksticklight",
"iot_class": "local_polling",
"loggers": ["blinkstick"],

View File

@@ -0,0 +1,5 @@
extend = "../../../pyproject.toml"
lint.extend-ignore = [
"F821"
]

View File

@@ -99,8 +99,7 @@ class Blueprint:
inputs = {}
for key, value in self.data[CONF_BLUEPRINT][CONF_INPUT].items():
if value and CONF_INPUT in value:
for key, value in value[CONF_INPUT].items():
inputs[key] = value
inputs.update(dict(value[CONF_INPUT]))
else:
inputs[key] = value
return inputs

View File

@@ -15,11 +15,9 @@ from homeassistant.helpers.update_coordinator import (
from .update_coordinator import BasePassiveBluetoothCoordinator
if TYPE_CHECKING:
from collections.abc import Callable
from collections.abc import Callable, Generator
import logging
from typing_extensions import Generator
from . import BluetoothChange, BluetoothScanningMode, BluetoothServiceInfoBleak
_PassiveBluetoothDataUpdateCoordinatorT = TypeVar(

View File

@@ -2,10 +2,9 @@
from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import Any
from bimmer_connected.vehicle import MyBMWVehicle
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
@@ -17,11 +16,8 @@ from homeassistant.helpers import (
entity_registry as er,
)
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.typing import ConfigType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTR_VIN, ATTRIBUTION, CONF_READ_ONLY, DATA_HASS_CONFIG, DOMAIN
from .const import ATTR_VIN, CONF_READ_ONLY, DOMAIN
from .coordinator import BMWDataUpdateCoordinator
_LOGGER = logging.getLogger(__name__)
@@ -55,13 +51,14 @@ PLATFORMS = [
SERVICE_UPDATE_STATE = "update_state"
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the BMW Connected Drive component from configuration.yaml."""
# Store full yaml config in data for platform.NOTIFY
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][DATA_HASS_CONFIG] = config
type BMWConfigEntry = ConfigEntry[BMWData]
return True
@dataclass
class BMWData:
"""Class to store BMW runtime data."""
coordinator: BMWDataUpdateCoordinator
@callback
@@ -82,7 +79,7 @@ def _async_migrate_options_from_data_if_missing(
async def _async_migrate_entries(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: BMWConfigEntry
) -> bool:
"""Migrate old entry."""
entity_registry = er.async_get(hass)
@@ -90,8 +87,20 @@ async def _async_migrate_entries(
@callback
def update_unique_id(entry: er.RegistryEntry) -> dict[str, str] | None:
replacements = {
"charging_level_hv": "remaining_battery_percent",
"fuel_percent": "remaining_fuel_percent",
"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])
@@ -134,8 +143,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})
hass.data[DOMAIN][entry.entry_id] = coordinator
entry.runtime_data = BMWData(coordinator)
# Set up all platforms except notify
await hass.config_entries.async_forward_entry_setups(
@@ -150,7 +158,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
Platform.NOTIFY,
DOMAIN,
{CONF_NAME: DOMAIN, CONF_ENTITY_ID: entry.entry_id},
hass.data[DOMAIN][DATA_HASS_CONFIG],
{},
)
)
@@ -171,45 +179,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
return await hass.config_entries.async_unload_platforms(
entry, [platform for platform in PLATFORMS if platform != Platform.NOTIFY]
)
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
class BMWBaseEntity(CoordinatorEntity[BMWDataUpdateCoordinator]):
"""Common base for BMW entities."""
coordinator: BMWDataUpdateCoordinator
_attr_attribution = ATTRIBUTION
_attr_has_entity_name = True
def __init__(
self,
coordinator: BMWDataUpdateCoordinator,
vehicle: MyBMWVehicle,
) -> None:
"""Initialize entity."""
super().__init__(coordinator)
self.vehicle = vehicle
self._attrs: dict[str, Any] = {
"car": self.vehicle.name,
"vin": self.vehicle.vin,
}
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self.vehicle.vin)},
manufacturer=vehicle.brand.name,
model=vehicle.name,
name=vehicle.name,
)
async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
self._handle_coordinator_update()

View File

@@ -17,14 +17,14 @@ from homeassistant.components.binary_sensor import (
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util.unit_system import UnitSystem
from . import BMWBaseEntity
from .const import DOMAIN, UNIT_MAP
from . import BMWConfigEntry
from .const import UNIT_MAP
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
@@ -197,11 +197,11 @@ SENSOR_TYPES: tuple[BMWBinarySensorEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the BMW binary sensors from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities = [
BMWBinarySensor(coordinator, vehicle, description, hass.config.units)
@@ -241,9 +241,8 @@ class BMWBinarySensor(BMWBaseEntity, BinarySensorEntity):
self._attr_is_on = self.entity_description.value_fn(self.vehicle)
if self.entity_description.attr_fn:
self._attr_extra_state_attributes = dict(
self._attrs,
**self.entity_description.attr_fn(self.vehicle, self._unit_system),
self._attr_extra_state_attributes = self.entity_description.attr_fn(
self.vehicle, self._unit_system
)
super()._handle_coordinator_update()

View File

@@ -12,13 +12,12 @@ from bimmer_connected.vehicle import MyBMWVehicle
from bimmer_connected.vehicle.remote_services import RemoteServiceStatus
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .entity import BMWBaseEntity
if TYPE_CHECKING:
from .coordinator import BMWDataUpdateCoordinator
@@ -68,11 +67,11 @@ BUTTON_TYPES: tuple[BMWButtonEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the BMW buttons from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities: list[BMWButton] = []

View File

@@ -20,6 +20,7 @@ from homeassistant.config_entries import (
from homeassistant.const import CONF_PASSWORD, CONF_REGION, CONF_SOURCE, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.selector import SelectSelector, SelectSelectorConfig
from . import DOMAIN
from .const import CONF_ALLOWED_REGIONS, CONF_GCID, CONF_READ_ONLY, CONF_REFRESH_TOKEN
@@ -28,7 +29,12 @@ DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
vol.Required(CONF_REGION): vol.In(CONF_ALLOWED_REGIONS),
vol.Required(CONF_REGION): SelectSelector(
SelectSelectorConfig(
options=CONF_ALLOWED_REGIONS,
translation_key="regions",
)
),
}
)

View File

@@ -3,7 +3,6 @@
from homeassistant.const import UnitOfLength, UnitOfVolume
DOMAIN = "bmw_connected_drive"
ATTRIBUTION = "Data provided by MyBMW"
ATTR_DIRECTION = "direction"
ATTR_VIN = "vin"

View File

@@ -8,24 +8,24 @@ from typing import Any
from bimmer_connected.vehicle import MyBMWVehicle
from homeassistant.components.device_tracker import SourceType, TrackerEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import ATTR_DIRECTION, DOMAIN
from . import BMWConfigEntry
from .const import ATTR_DIRECTION
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW tracker from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities: list[BMWDeviceTracker] = []
for vehicle in coordinator.account.vehicles:
@@ -63,7 +63,7 @@ class BMWDeviceTracker(BMWBaseEntity, TrackerEntity):
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return entity specific state attributes."""
return {**self._attrs, ATTR_DIRECTION: self.vehicle.vehicle_location.heading}
return {ATTR_DIRECTION: self.vehicle.vehicle_location.heading}
@property
def latitude(self) -> float | None:

View File

@@ -9,17 +9,16 @@ from typing import TYPE_CHECKING, Any
from bimmer_connected.utils import MyBMWJSONEncoder
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntry
from .const import CONF_REFRESH_TOKEN, DOMAIN
from . import BMWConfigEntry
from .const import CONF_REFRESH_TOKEN
if TYPE_CHECKING:
from bimmer_connected.vehicle import MyBMWVehicle
from .coordinator import BMWDataUpdateCoordinator
TO_REDACT_INFO = [CONF_USERNAME, CONF_PASSWORD, CONF_REFRESH_TOKEN]
TO_REDACT_DATA = [
@@ -47,10 +46,10 @@ def vehicle_to_dict(vehicle: MyBMWVehicle | None) -> dict:
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
hass: HomeAssistant, config_entry: BMWConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
coordinator.account.config.log_responses = True
await coordinator.account.get_vehicles(force_init=True)
@@ -73,10 +72,10 @@ async def async_get_config_entry_diagnostics(
async def async_get_device_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry, device: DeviceEntry
hass: HomeAssistant, config_entry: BMWConfigEntry, device: DeviceEntry
) -> dict[str, Any]:
"""Return diagnostics for a device."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
coordinator.account.config.log_responses = True
await coordinator.account.get_vehicles(force_init=True)

View File

@@ -0,0 +1,40 @@
"""Base for all BMW entities."""
from __future__ import annotations
from bimmer_connected.vehicle import MyBMWVehicle
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator import BMWDataUpdateCoordinator
class BMWBaseEntity(CoordinatorEntity[BMWDataUpdateCoordinator]):
"""Common base for BMW entities."""
_attr_has_entity_name = True
def __init__(
self,
coordinator: BMWDataUpdateCoordinator,
vehicle: MyBMWVehicle,
) -> None:
"""Initialize entity."""
super().__init__(coordinator)
self.vehicle = vehicle
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, vehicle.vin)},
manufacturer=vehicle.brand.name,
model=vehicle.name,
name=vehicle.name,
serial_number=vehicle.vin,
)
async def async_added_to_hass(self) -> None:
"""When entity is added to hass."""
await super().async_added_to_hass()
self._handle_coordinator_update()

View File

@@ -10,14 +10,13 @@ from bimmer_connected.vehicle import MyBMWVehicle
from bimmer_connected.vehicle.doors_windows import LockState
from homeassistant.components.lock import LockEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
DOOR_LOCK_STATE = "door_lock_state"
_LOGGER = logging.getLogger(__name__)
@@ -25,11 +24,11 @@ _LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW lock from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
if not coordinator.read_only:
async_add_entities(
@@ -97,8 +96,6 @@ class BMWLock(BMWBaseEntity, LockEntity):
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
_LOGGER.debug("Updating lock data of %s", self.vehicle.name)
# Set default attributes
self._attr_extra_state_attributes = self._attrs
# Only update the HA state machine if the vehicle reliably reports its lock state
if self.door_lock_state_available:
@@ -106,8 +103,8 @@ class BMWLock(BMWBaseEntity, LockEntity):
LockState.LOCKED,
LockState.SECURED,
}
self._attr_extra_state_attributes["door_lock_state"] = (
self.vehicle.doors_and_windows.door_lock_state.value
)
self._attr_extra_state_attributes = {
DOOR_LOCK_STATE: self.vehicle.doors_and_windows.door_lock_state.value
}
super()._handle_coordinator_update()

View File

@@ -6,5 +6,6 @@
"documentation": "https://www.home-assistant.io/integrations/bmw_connected_drive",
"iot_class": "cloud_polling",
"loggers": ["bimmer_connected"],
"quality_scale": "platinum",
"requirements": ["bimmer-connected[china]==0.15.3"]
}

View File

@@ -5,33 +5,35 @@ from __future__ import annotations
import logging
from typing import Any, cast
from bimmer_connected.models import MyBMWAPIError
from bimmer_connected.models import MyBMWAPIError, PointOfInterest
from bimmer_connected.vehicle import MyBMWVehicle
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
ATTR_TARGET,
BaseNotificationService,
)
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LOCATION,
ATTR_LONGITUDE,
ATTR_NAME,
CONF_ENTITY_ID,
)
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE, CONF_ENTITY_ID
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from .const import DOMAIN
from .coordinator import BMWDataUpdateCoordinator
from . import DOMAIN, BMWConfigEntry
ATTR_LAT = "lat"
ATTR_LOCATION_ATTRIBUTES = ["street", "city", "postal_code", "country"]
ATTR_LON = "lon"
ATTR_SUBJECT = "subject"
ATTR_TEXT = "text"
POI_SCHEMA = vol.Schema(
{
vol.Required(ATTR_LATITUDE): cv.latitude,
vol.Required(ATTR_LONGITUDE): cv.longitude,
vol.Optional("street"): cv.string,
vol.Optional("city"): cv.string,
vol.Optional("postal_code"): cv.string,
vol.Optional("country"): cv.string,
}
)
_LOGGER = logging.getLogger(__name__)
@@ -42,12 +44,16 @@ def get_service(
discovery_info: DiscoveryInfoType | None = None,
) -> BMWNotificationService:
"""Get the BMW notification service."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][
config_entry: BMWConfigEntry | None = hass.config_entries.async_get_entry(
(discovery_info or {})[CONF_ENTITY_ID]
]
)
targets = {}
if not coordinator.read_only:
if (
config_entry
and (coordinator := config_entry.runtime_data.coordinator)
and not coordinator.read_only
):
targets.update({v.name: v for v in coordinator.account.vehicles})
return BMWNotificationService(targets)
@@ -68,33 +74,34 @@ class BMWNotificationService(BaseNotificationService):
async def async_send_message(self, message: str = "", **kwargs: Any) -> None:
"""Send a message or POI to the car."""
try:
# Verify data schema
poi_data = kwargs.get(ATTR_DATA) or {}
POI_SCHEMA(poi_data)
# Create the POI object
poi = PointOfInterest(
lat=poi_data.pop(ATTR_LATITUDE),
lon=poi_data.pop(ATTR_LONGITUDE),
name=(message or None),
**poi_data,
)
except (vol.Invalid, TypeError, ValueError) as ex:
raise ServiceValidationError(
translation_domain=DOMAIN,
translation_key="invalid_poi",
translation_placeholders={
"poi_exception": str(ex),
},
) from ex
for vehicle in kwargs[ATTR_TARGET]:
vehicle = cast(MyBMWVehicle, vehicle)
_LOGGER.debug("Sending message to %s", vehicle.name)
# Extract params from data dict
data = kwargs.get(ATTR_DATA)
# Check if message is a POI
if data is not None and ATTR_LOCATION in data:
location_dict = {
ATTR_LAT: data[ATTR_LOCATION][ATTR_LATITUDE],
ATTR_LON: data[ATTR_LOCATION][ATTR_LONGITUDE],
ATTR_NAME: message,
}
# Update dictionary with additional attributes if available
location_dict.update(
{
k: v
for k, v in data[ATTR_LOCATION].items()
if k in ATTR_LOCATION_ATTRIBUTES
}
)
try:
await vehicle.remote_services.trigger_send_poi(location_dict)
except TypeError as ex:
raise ValueError(str(ex)) from ex
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex
else:
raise ValueError(f"'data.{ATTR_LOCATION}' is required.")
try:
await vehicle.remote_services.trigger_send_poi(poi)
except MyBMWAPIError as ex:
raise HomeAssistantError(ex) from ex

View File

@@ -14,14 +14,13 @@ from homeassistant.components.number import (
NumberEntityDescription,
NumberMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
@@ -56,11 +55,11 @@ NUMBER_TYPES: list[BMWNumberEntityDescription] = [
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW number from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities: list[BMWNumber] = []

View File

@@ -10,15 +10,14 @@ from bimmer_connected.vehicle import MyBMWVehicle
from bimmer_connected.vehicle.charging_profile import ChargingMode
from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitOfElectricCurrent
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
@@ -63,11 +62,11 @@ SELECT_TYPES: tuple[BMWSelectEntityDescription, ...] = (
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW lock from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities: list[BMWSelect] = []

View File

@@ -18,21 +18,21 @@ from homeassistant.components.sensor import (
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
PERCENTAGE,
STATE_UNKNOWN,
UnitOfElectricCurrent,
UnitOfLength,
UnitOfPressure,
UnitOfVolume,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import dt as dt_util
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
@@ -45,11 +45,12 @@ class BMWSensorEntityDescription(SensorEntityDescription):
is_available: Callable[[MyBMWVehicle], bool] = lambda v: v.is_lsc_enabled
TIRES = ["front_left", "front_right", "rear_left", "rear_right"]
SENSOR_TYPES: list[BMWSensorEntityDescription] = [
BMWSensorEntityDescription(
key="ac_current_limit",
key="charging_profile.ac_current_limit",
translation_key="ac_current_limit",
key_class="charging_profile",
device_class=SensorDeviceClass.CURRENT,
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
entity_registry_enabled_default=False,
@@ -57,41 +58,36 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="charging_start_time",
key="fuel_and_battery.charging_start_time",
translation_key="charging_start_time",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.TIMESTAMP,
entity_registry_enabled_default=False,
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="charging_end_time",
key="fuel_and_battery.charging_end_time",
translation_key="charging_end_time",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.TIMESTAMP,
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="charging_status",
key="fuel_and_battery.charging_status",
translation_key="charging_status",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.ENUM,
options=[s.value.lower() for s in ChargingState if s != ChargingState.UNKNOWN],
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="charging_target",
key="fuel_and_battery.charging_target",
translation_key="charging_target",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
suggested_display_precision=0,
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="remaining_battery_percent",
key="fuel_and_battery.remaining_battery_percent",
translation_key="remaining_battery_percent",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
@@ -107,18 +103,16 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
suggested_display_precision=0,
),
BMWSensorEntityDescription(
key="remaining_range_total",
key="fuel_and_battery.remaining_range_total",
translation_key="remaining_range_total",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.DISTANCE,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=0,
),
BMWSensorEntityDescription(
key="remaining_range_electric",
key="fuel_and_battery.remaining_range_electric",
translation_key="remaining_range_electric",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.DISTANCE,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
@@ -126,9 +120,8 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
is_available=lambda v: v.is_lsc_enabled and v.has_electric_drivetrain,
),
BMWSensorEntityDescription(
key="remaining_range_fuel",
key="fuel_and_battery.remaining_range_fuel",
translation_key="remaining_range_fuel",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.DISTANCE,
native_unit_of_measurement=UnitOfLength.KILOMETERS,
state_class=SensorStateClass.MEASUREMENT,
@@ -136,28 +129,25 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
is_available=lambda v: v.is_lsc_enabled and v.has_combustion_drivetrain,
),
BMWSensorEntityDescription(
key="remaining_fuel",
key="fuel_and_battery.remaining_fuel",
translation_key="remaining_fuel",
key_class="fuel_and_battery",
device_class=SensorDeviceClass.VOLUME,
device_class=SensorDeviceClass.VOLUME_STORAGE,
native_unit_of_measurement=UnitOfVolume.LITERS,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=0,
is_available=lambda v: v.is_lsc_enabled and v.has_combustion_drivetrain,
),
BMWSensorEntityDescription(
key="remaining_fuel_percent",
key="fuel_and_battery.remaining_fuel_percent",
translation_key="remaining_fuel_percent",
key_class="fuel_and_battery",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=0,
is_available=lambda v: v.is_lsc_enabled and v.has_combustion_drivetrain,
),
BMWSensorEntityDescription(
key="activity",
key="climate.activity",
translation_key="climate_status",
key_class="climate",
device_class=SensorDeviceClass.ENUM,
options=[
s.value.lower()
@@ -166,16 +156,43 @@ SENSOR_TYPES: list[BMWSensorEntityDescription] = [
],
is_available=lambda v: v.is_remote_climate_stop_enabled,
),
*[
BMWSensorEntityDescription(
key=f"tires.{tire}.current_pressure",
translation_key=f"{tire}_current_pressure",
device_class=SensorDeviceClass.PRESSURE,
native_unit_of_measurement=UnitOfPressure.KPA,
suggested_unit_of_measurement=UnitOfPressure.BAR,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=2,
is_available=lambda v: v.is_lsc_enabled and v.tires is not None,
)
for tire in TIRES
],
*[
BMWSensorEntityDescription(
key=f"tires.{tire}.target_pressure",
translation_key=f"{tire}_target_pressure",
device_class=SensorDeviceClass.PRESSURE,
native_unit_of_measurement=UnitOfPressure.KPA,
suggested_unit_of_measurement=UnitOfPressure.BAR,
state_class=SensorStateClass.MEASUREMENT,
suggested_display_precision=2,
entity_registry_enabled_default=False,
is_available=lambda v: v.is_lsc_enabled and v.tires is not None,
)
for tire in TIRES
],
]
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW sensors from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities = [
BMWSensor(coordinator, vehicle, description)
@@ -209,13 +226,12 @@ class BMWSensor(BMWBaseEntity, SensorEntity):
_LOGGER.debug(
"Updating sensor '%s' of %s", self.entity_description.key, self.vehicle.name
)
if self.entity_description.key_class is None:
state = getattr(self.vehicle, self.entity_description.key)
else:
state = getattr(
getattr(self.vehicle, self.entity_description.key_class),
self.entity_description.key,
)
key_path = self.entity_description.key.split(".")
state = getattr(self.vehicle, key_path.pop(0))
for key in key_path:
state = getattr(state, key)
# For datetime without tzinfo, we assume it to be the same timezone as the HA instance
if isinstance(state, datetime.datetime) and state.tzinfo is None:

View File

@@ -149,6 +149,30 @@
"inactive": "Inactive",
"standby": "Standby"
}
},
"front_left_current_pressure": {
"name": "Front left tire pressure"
},
"front_right_current_pressure": {
"name": "Front right tire pressure"
},
"rear_left_current_pressure": {
"name": "Rear left tire pressure"
},
"rear_right_current_pressure": {
"name": "Rear right tire pressure"
},
"front_left_target_pressure": {
"name": "Front left target pressure"
},
"front_right_target_pressure": {
"name": "Front right target pressure"
},
"rear_left_target_pressure": {
"name": "Rear left target pressure"
},
"rear_right_target_pressure": {
"name": "Rear right target pressure"
}
},
"switch": {
@@ -159,5 +183,19 @@
"name": "Charging"
}
}
},
"selector": {
"regions": {
"options": {
"china": "China",
"north_america": "North America",
"rest_of_world": "Rest of world"
}
}
},
"exceptions": {
"invalid_poi": {
"message": "Invalid data for point of interest: {poi_exception}"
}
}
}

View File

@@ -10,14 +10,13 @@ from bimmer_connected.vehicle import MyBMWVehicle
from bimmer_connected.vehicle.fuel_and_battery import ChargingState
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import BMWBaseEntity
from .const import DOMAIN
from . import BMWConfigEntry
from .coordinator import BMWDataUpdateCoordinator
from .entity import BMWBaseEntity
_LOGGER = logging.getLogger(__name__)
@@ -64,11 +63,11 @@ NUMBER_TYPES: list[BMWSwitchEntityDescription] = [
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
config_entry: BMWConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the MyBMW switch from config entry."""
coordinator: BMWDataUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
coordinator = config_entry.runtime_data.coordinator
entities: list[BMWSwitch] = []

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