Compare commits

...

1311 Commits

Author SHA1 Message Date
Paulus Schoutsen
51716290bb Bump version to 2024.3.0b2 2024-02-29 10:43:47 -05:00
Paulus Schoutsen
10cc0e6b2b Import cryptography OpenSSL backend (#111840)
* Import cryptography OpenSSL backend

* No need to impor top-level. Included.

* Update homeassistant/bootstrap.py
2024-02-29 10:42:50 -05:00
J. Nick Koston
640de7dbc9 Include filename in exception when loading a json file fails (#111802)
* Include filename in exception when loading a json file fails

* fix
2024-02-29 10:42:49 -05:00
J. Nick Koston
868f19e846 Fix race in config entry setup again (#111800)
Because the setup again was scheduled as a task, it would
not unset self._async_cancel_retry_setup in time and we would
try to unsub self._async_cancel_retry_setup after it had already
fired. Change it to call a callback that runs right away so it
unsets self._async_cancel_retry_setup as soon as its called
so there is no race

fixes #111796
2024-02-29 10:42:48 -05:00
Jan-Philipp Benecke
52ea1a9deb Deprecate hass.components and log warning if used inside custom component (#111508)
* Deprecate @bind_hass and log error if used inside custom component

* Log also when accessing `hass.components`

* Log warning only when `hass.components` is used

* Change version

* Process code review
2024-02-29 10:42:47 -05:00
David F. Mulcahey
5c2fc8d7a0 Add support for ZHA entities exposed by Zigpy quirks (#111176)
* Add counter entities to the ZHA coordinator device

* rework to prepare for non coordinator device counters

* Initial scaffolding to support quirks v2 entities

* update for zigpy changes

* add assertion error message

* clean up test

* update group entity discovery kwargs

* constants and clearer names

* apply custom device configuration

* quirks switches

* quirks select entities

* quirks sensor entities

* update discovery

* move call to super

* add complex quirks v2 discovery test

* remove duplicate replaces

* add quirks v2 button entity support

* add quirks v2 binary sensor entity support

* fix exception in counter entitiy discovery

* oops

* update formatting

* support custom on and off values

* logging

* don't filter out entities quirks says should be created

* fix type alias warnings

* sync up with zigpy changes and additions

* add a binary sensor test

* button coverage

* switch coverage

* initial select coverage

* number coverage

* sensor coverage

* update discovery after rebase

* coverage

* single line

* line lengths

* fix double underscore

* review comments

* set category from quirks in base entity

* line lengths

* move comment

* imports

* simplify

* simplify
2024-02-29 10:42:46 -05:00
Paulus Schoutsen
fba331fd7e Bump version to 2024.3.0b1 2024-02-28 23:26:32 -05:00
Paulus Schoutsen
dd85a97a48 get_matter_device_info: Test the Matter config entry is set up (#111792)
Ensure the Matter config entry is set up
2024-02-28 23:26:24 -05:00
Michael Hansen
b19b5dc451 Bump intents and add sentence tests (#111791) 2024-02-28 23:26:22 -05:00
J. Nick Koston
3d4291fc59 Import discord in the executor to avoid blocking the event loop (#111790)
`2024-02-28 19:20:04.485 DEBUG (MainThread) [homeassistant.loader] Component discord import took 1.181 seconds (loaded_executor=False)`
2024-02-28 23:26:22 -05:00
J. Nick Koston
3cd07aacad Fix steamist blocking startup by waiting for discovery (#111789)
Fix steamist blocking statup by waiting for discovery
2024-02-28 23:26:21 -05:00
J. Nick Koston
19837055bf Fix tplink blocking startup by waiting for discovery (#111788)
* Fix tplink blocking statup by waiting for discovery

* remove started
2024-02-28 23:26:20 -05:00
J. Nick Koston
209e61f734 Fix flux_led blocking startup by waiting for discovery (#111787)
* Avoid blocking startup by waiting for discovery in flux_led

* remove started discovery
2024-02-28 23:26:19 -05:00
J. Nick Koston
39deab74b3 Import analytics_insights in the executor to avoid blocking the event loop (#111786)
fixes #111780
2024-02-28 23:26:19 -05:00
J. Nick Koston
77fd02da1d Fix time trigger tests with leap year (#111785) 2024-02-28 23:26:18 -05:00
J. Nick Koston
7e80eb551e Bump securetar to 2024.2.1 (#111782) 2024-02-28 23:26:17 -05:00
J. Nick Koston
536addc5ff Import backup in the executor to avoid blocking the event loop (#111781) 2024-02-28 23:26:16 -05:00
J. Nick Koston
ff0fbcb309 Import opower in the executor to avoid blocking the event loop (#111778)
fixes #111777
2024-02-28 23:26:16 -05:00
J. Nick Koston
c9ea72ba7d Import androidtv_remote in the executor to avoid blocking the event loop (#111776)
fixes #111775
2024-02-28 23:26:15 -05:00
J. Nick Koston
10a1a450a3 Import coinbase in the executor to avoid blocking the event loop (#111774)
fixes #111773
2024-02-28 23:26:14 -05:00
J. Nick Koston
7ff6627e07 Import blink in the executor to avoid blocking the event loop (#111772)
fixes #111771
2024-02-28 23:26:13 -05:00
Marcel van der Veldt
4a66727bff Bump aiohue to 4.7.1 (#111770)
bump aiohue to 4.7.1
2024-02-28 23:26:12 -05:00
J. Nick Koston
db584857c8 Import cryptography early since importing openssl is not thread-safe (#111768) 2024-02-28 23:26:11 -05:00
J. Nick Koston
cb7116126c Import isy994 in the executor to avoid blocking the event loop (#111766) 2024-02-28 23:26:11 -05:00
Marcel van der Veldt
99a70ba959 Bump Python Matter Server to 5.7.0 (#111765) 2024-02-28 23:26:10 -05:00
J. Nick Koston
a9fd113a80 Move DATA_LOGGING constant to homeassistant.const (#111763) 2024-02-28 23:26:09 -05:00
J. Nick Koston
acfd1c2755 Pre-import api, config, and lovelace in bootstrap to avoid loading them at runtime (#111752) 2024-02-28 23:26:08 -05:00
puddly
feea4071d0 Improve ZHA group color modes (#111669)
* Set the color mode based on supported color modes

* Replace `zha` with `tuya` in unit test
2024-02-28 23:26:07 -05:00
yanuino
e1be109947 Read min/max number of showers from state for DomesticHotWaterProduction in Overkiz integration (#111535)
* Read min/max number of showers from state

* Rewrite code for Read min/max number of showers from state

* Set _attr_ instead of inherited value
2024-02-28 23:26:06 -05:00
Allen Porter
812afc1bd0 Fix calendar trigger to survive config entry reloads (#111334)
* Fix calendar trigger to survive config entry reloads

* Apply suggestions from code review

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-28 23:26:05 -05:00
Jeremy TRUFIER
27b5a79fa5 Add overkiz support for Atlantic Shogun ZoneControl 2.0 (AtlanticPassAPCHeatingAndCoolingZone) (#110510)
* Add Overkiz support for AtlanticPassAPCHeatingAndCoolingZone widget

* Add support for AUTO HVAC mode for Atlantic Pass APC ZC devices that support it

* Add support for multiple IO controllers for same widget (mainly for Atlantic APC)

* Implement PR feedback

* Small PR fixes

* Fix constant inversion typo
2024-02-28 23:26:04 -05:00
Bram Kragten
fbc456c4c7 Bump version to 2024.3.0b0 2024-02-28 20:52:40 +01:00
Bram Kragten
e0566ee204 Merge dev into rc 2024-02-28 20:47:56 +01:00
Andy
cd5377367a Add Ecovacs goat switch entities (#111751) 2024-02-28 20:43:53 +01:00
puddly
4ec75d6ca7 Use new zigpy OTA providers for ZHA (#111159)
* Use `None` instead of `"unknown"` when the current version is unknown

* Only use the current file version from the OTA notification

* Use `sw_version`, if available, and update `current_file_version`

* Assume the current version is the latest version

* Fix lint errors

* Use `image` instead of `firmware`

* Include a changelog if updates expose it

* Clear latest firmware only after updating the installed version

* Bump minimum zigpy version to 0.63.0

* Create a data update coordinator to consolidate updates

* Fix overridden `async_update`

* Fix most unit tests

* Simplify `test_devices` to fix current tests

* Use a dict comprehension for creating mocked entities

* Fix unit tests (thanks @dmulcahey!)

* Update the currently installed version on cluster attribute update

* Drop `PARALLEL_UPDATES` now that we use an update coordinator

* Drop `_reset_progress`, it is already handled by the update component

* Do not update the progress if we are not supposed to be updating

* Ignore latest version (e.g. if device attrs changed) if zigpy rejects it

* Clean up handling of command id in `Ota.cluster_command`

* Start progress at 1%: 0 and False are considered equal and are filtered!

Use `ceil` instead of remapping 1-100

* The installed version will be auto-updated when the upgrade succeeds

* Avoid 1 as well, it collides with `True`

* Bump zigpy to (unreleased) 0.63.2

* Fix unit tests

* Fix existing unit tests

Send both event types

Globally enable sending both event types

* Remove unnecessary branches

* Test ignoring invalid progress callbacks

* Test updating a device with a no longer compatible firmware
2024-02-28 14:38:04 -05:00
Scott K Logan
4895f92551 Bump aioraven to 0.5.1 (#111600) 2024-02-28 20:34:07 +01:00
J. Nick Koston
941df567f8 Import powerwall in the executor to avoid blocking the event loop (#111749)
`2024-02-27 22:44:17.087 DEBUG (MainThread) [homeassistant.loader] Component powerwall import took 0.459 seconds (loaded_executor=False)`
2024-02-28 14:31:23 -05:00
J. Nick Koston
327796a750 Eagerly unload config entries in tests (#111707)
This is a small latancy reduction to reduce test wall clock time
since it runs every test
2024-02-28 14:03:21 -05:00
J. Nick Koston
104884056f Import plex in the executor to avoid blocking the event loop (#111743)
`Importing platform plex.config_flow took 0.54s (loaded_executor=False)`
2024-02-28 14:02:34 -05:00
Cyrill Raccaud
c0a7aacfa8 Cleanup swiss_public_transport error logging (#111741) 2024-02-28 19:42:25 +01:00
Bram Kragten
928458160e Update frontend to 20240228.0 (#111736) 2024-02-28 17:35:53 +01:00
J. Nick Koston
f95e5c1196 Use eager tasks in ssdp (#111696)
There are a few places where we are likely to never suspend here
2024-02-28 10:56:07 -05:00
J. Nick Koston
d164039bba Remove gather for loading generated files in zeroconf (#111699)
async_get_custom_components is the only place this can suspend
and it will always be cached by the time this is called so there
is no reason to schedule these on the event loop
2024-02-28 10:55:41 -05:00
Joost Lekkerkerker
c957ff49bf Add icon translations to Huisbaasje (#111726)
* Add icon translations to Huisbaasje

* Add icon translations to Huisbaasje
2024-02-28 16:37:14 +01:00
Joost Lekkerkerker
e28f551cb0 Add icon translations to Huawei LTE (#111724)
* Add icon translations to Huawei LTE

* Add icon translations to Huawei LTE
2024-02-28 16:35:47 +01:00
Andy
69bb827a20 Add ecovacs lawn mover (#111673) 2024-02-28 16:35:29 +01:00
Joost Lekkerkerker
515ca2b6f1 Add icon translations to Homekit (#111719) 2024-02-28 16:34:50 +01:00
Joost Lekkerkerker
7d1d72cc45 Add icon translations to Harmony (#111714) 2024-02-28 16:34:25 +01:00
Joost Lekkerkerker
0ff55a2d24 Add icon translations to Hassio (#111715) 2024-02-28 16:33:46 +01:00
Joost Lekkerkerker
5940dbd51d Add icon translations to Heos (#111716) 2024-02-28 16:33:12 +01:00
Joost Lekkerkerker
818022073d Add icon translations to Hive (#111717) 2024-02-28 16:32:52 +01:00
Joost Lekkerkerker
afe3d7fb4f Add icon translations to Home connect (#111718) 2024-02-28 16:32:26 +01:00
Joost Lekkerkerker
15cd9c011e Add icon translations to Homekit Controller (#111720)
* Add icon translations to Homekit Controller

* Add icon translations to Homekit Controller
2024-02-28 16:31:09 +01:00
Joost Lekkerkerker
b6d56d38ba Add icon translations to Homematic IP Cloud (#111723) 2024-02-28 16:30:20 +01:00
Sebastian Noack
df61d0a29d Add entities for Balboa Spa lights (#111252) 2024-02-28 16:29:40 +01:00
Erik Montnemery
b336095239 Allow translating device names (#110711)
* Allow translating device names

* Don't keep a reference to translations in config entry

* Update kitchen_sink tests

* Add tests
2024-02-28 15:59:59 +01:00
J. Nick Koston
9b9700c75f Import nexia in the executor to avoid blocking the event loop (#111694)
2024-02-27 22:54:18.638 DEBUG (MainThread) [homeassistant.loader] Importing platform nexia.config_flow took 1.84s (loaded_executor=False)
2024-02-28 15:37:10 +01:00
J. Nick Koston
f71343a3ba Import tplink in the executor to avoid blocking the event loop (#111691)
* Import tplink in the executor to avoid blocking the event loop

2024-02-27 22:44:19.908 DEBUG (MainThread) [homeassistant.loader] Component tplink import took 1.620 seconds (loaded_executor=False)

* patch out discovery because it happens too fast now
2024-02-28 15:06:33 +01:00
dependabot[bot]
ee0f177153 Bump github/codeql-action from 3.24.4 to 3.24.5 (#111448)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.4 to 3.24.5.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.4...v3.24.5)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 14:58:37 +01:00
Robert Svensson
c478b1416c Adapt Axis integration to library refactoring (#110898)
* Adapt Axis integration to library refactoring

* Bump axis to v49
2024-02-28 14:36:32 +01:00
Joost Lekkerkerker
2b3630b054 Add icon translations to HVV departures (#111728) 2024-02-28 14:19:32 +01:00
Sebastian Noack
5a57816e50 Add entities for Balboa Spa pumps (#111245)
* Add entities for Balboa Spa pumps

* Fix fan tests and move client_update to __init__

* Ruff

---------

Co-authored-by: Jan-Philipp Benecke <github@bnck.me>
2024-02-28 14:19:02 +01:00
Simone Chemelli
5c124e5fd2 Add Comelit humidifier/dehumidifier (#111203)
* Add Comelit humidifier/dehumidifier

* optimize turn_on

* fix entity naming

* raise ServiceValidationError

* apply review comment

* apply review comments

* rename HumidifierComelitAction
2024-02-28 14:15:44 +01:00
Joost Lekkerkerker
4be0e86591 Add icon translations to Guardian (#111712)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
2024-02-28 13:08:40 +01:00
Joost Lekkerkerker
a8887d59ed Add icon translations to BMW (#111348)
* Add icon translations to BMW

* Add icon translations to BMW
2024-02-28 13:05:27 +01:00
Joost Lekkerkerker
40431a9f7e Add icon translations to DROP connect (#111373)
* Add icon translations to DROP connect

* Add icon translations to DROP connect
2024-02-28 12:58:04 +01:00
Joost Lekkerkerker
7ad1d3e891 Add icon translations to DSMR (#111411)
* Add icon translations to DSMR

* Add icon translations to DSMR
2024-02-28 12:55:43 +01:00
J. Nick Koston
913ee90e1a Use eager tasks when updating entity state after service calls (#111702)
In a multi-entity update case the state update may not need
to suspend and can get executed without scheduling a task
on the event loop
2024-02-28 12:46:32 +01:00
J. Nick Koston
69a1da0a1a Make entity component platform setup tasks eager (#111698)
Many of these that setup from YAML will never suspend
because they do no I/O
2024-02-28 12:44:23 +01:00
J. Nick Koston
459f430575 Use eager tasks in a few more places in bootstrap (#111697)
I missed a few of the ones that run before we call
_async_set_up_integrations as I was too focused
on the timings of that function
2024-02-28 12:41:03 +01:00
J. Nick Koston
f7ac1e4b8e Import mobile_app in the executor to avoid blocking the event loop (#111692)
2024-02-27 22:44:23.926 DEBUG (MainThread) [homeassistant.loader] Component mobile_app import took 0.490 seconds (loaded_executor=False)
2024-02-28 12:39:51 +01:00
Michał Jaworski
12b15a9a37 Bump blebox_uniapi to 2.2.1 (#108918)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-28 12:39:37 +01:00
Joost Lekkerkerker
e8837a4026 Add icon translations to Fronius (#111608) 2024-02-28 12:04:49 +01:00
Joost Lekkerkerker
b117deff58 Add icon translations to Gree (#111662)
* Add icon translations to Gree

* Add icon translations to Gree
2024-02-28 11:38:16 +01:00
Erwin Douna
c52e2038be Tado code quality improvements (#107678)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-28 11:28:51 +01:00
Joost Lekkerkerker
38ba966d74 Add icon translations to Devolo home network (#111367) 2024-02-28 11:21:19 +01:00
Joost Lekkerkerker
b629f5c143 Add icon translations to Denon avr (#111364)
* Add icon translations to Denon avr

* Update homeassistant/components/denonavr/icons.json
2024-02-28 11:02:37 +01:00
Jan-Philipp Benecke
ebfba7258e Revert "Drop @bind_hass use from hassio component (#111522)" (#111705)
This reverts commit 4e4345f04e.
2024-02-28 10:51:37 +01:00
Jan-Philipp Benecke
3ae056b358 Revert "Remove @bind_hass from async_active_zone and make callback function" (#111704)
Revert "Remove `@bind_hass` from async_active_zone and make callback function…"

This reverts commit f85a8c5041.
2024-02-28 10:51:17 +01:00
Jan-Philipp Benecke
259171eda9 Revert "Remove @bind_hass from camera functions" (#111703)
Revert "Remove `@bind_hass` from `camera` functions (#111494)"

This reverts commit c890c1aeee.
2024-02-28 10:51:04 +01:00
Joost Lekkerkerker
dbeb93b260 Add icon translations to Filesize (#111536) 2024-02-28 09:37:38 +01:00
J. Nick Koston
01a6b85a35 Avoid creating system monitor disk sensors for non-dirs (#111695)
Avoid creating system monitor sensors for non-dirs

Currently we create sensors for /etc/hosts, /etc/asound.conf, since
they are bind mounts in the container. These all have to have
their own coordinator
2024-02-28 09:31:02 +01:00
Joost Lekkerkerker
f9d9ac48c7 Add icon translations to Google Assistant SDK (#111658) 2024-02-28 08:52:51 +01:00
Joost Lekkerkerker
882f28bb5f Add icon translations to FAA delays (#111533) 2024-02-28 08:52:36 +01:00
Joost Lekkerkerker
2f38ce2813 Add icon translations to Eufylife BLE (#111530) 2024-02-28 08:52:24 +01:00
Joost Lekkerkerker
2cee022bb7 Add icon translations to Fastdotcom (#111534) 2024-02-28 08:51:10 +01:00
Joost Lekkerkerker
1a61c6db1c Add icon translations to Fireservicerota (#111537) 2024-02-28 08:50:57 +01:00
Joost Lekkerkerker
24050b6e0f Add icon translations to Escea (#111529) 2024-02-28 08:50:44 +01:00
Joost Lekkerkerker
e2c38c6415 Add icon translations to Environment Canada (#111527)
* Add icon translations to Environment Canada

* Add icon translations to Environment Canada
2024-02-28 08:50:31 +01:00
Joost Lekkerkerker
dfd8179a2d Add icon translations to FiveM (#111539) 2024-02-28 08:50:16 +01:00
Joost Lekkerkerker
cd9219d4c6 Add icon translations to GDACS (#111611)
* Add icon translations to GDACS

* Add icon translations to GDACS

* Add icon translations to GDACS
2024-02-28 08:49:58 +01:00
Joost Lekkerkerker
3077039470 Add icon translations to Glances (#111615)
* Add icon translations to Glances

* Add icon translations to Glances
2024-02-28 08:49:47 +01:00
Joost Lekkerkerker
132b597d9e Add icon translations to Epson (#111528) 2024-02-28 08:49:24 +01:00
J. Nick Koston
c3412bb017 Make homekit_controller platform load tasks eagerly (#111701) 2024-02-27 21:46:42 -10:00
J. Nick Koston
e0d15680a6 Import xiaomi_ble in the executor to avoid blocking the event loop (#111693) 2024-02-27 20:48:40 -10:00
J. Nick Koston
b9718fe2e9 Avoid tracking tasks that finish right away (#111690) 2024-02-27 19:09:34 -10:00
Joost Lekkerkerker
470d121f5c Add icon translations to Flume (#111543) 2024-02-27 18:36:12 -10:00
J. Nick Koston
78bb6dbe75 Reduce latency in storage by making the tasks eager (#111500)
* Reduce latancy to load storage by making the task eager

This changes the semantics a bit under the hood because it
can raise sooner which means we do not store the task
as _load_task if it raises right away. That means
concurrent calls that result in failure are likely to try
again now which will be a tiny performance hit for this
case.

* fix

* will now finish in time
2024-02-27 23:27:37 -05:00
J. Nick Koston
e74e1e3008 Reduce hassio setup time (#111686)
Reduce supervisor setup time

The two calls that take the most time are calling
push_config ~0.4s and updating the api ~0.35s and
can be run concurrently
2024-02-27 21:30:48 -05:00
J. Nick Koston
e62b709dea Reduce task overhead in homekit_controller (#111670) 2024-02-27 14:49:29 -10:00
Joost Lekkerkerker
147c261389 Add icon translations to Generic camera (#111612)
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-02-27 13:42:56 -10:00
Bernhard B
1570977e9f Bump pysignalclirestapi to 0.3.23 (#111501) 2024-02-27 13:42:29 -10:00
Joost Lekkerkerker
2858d73abc Add icon translations to Foscam (#111546)
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-02-27 13:41:44 -10:00
Joost Lekkerkerker
74a319f907 Add icon translations to Google (#111656)
Co-authored-by: Dave T <17680170+davet2001@users.noreply.github.com>
2024-02-27 13:41:29 -10:00
Jan-Philipp Benecke
4e4345f04e Drop @bind_hass use from hassio component (#111522)
* Drop `@bind_hass` use from hassio component

* Add comment why we import locally

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-28 00:25:46 +01:00
Simone Chemelli
0e329d2572 Bump aioshelly to 8.1.1 (#111678) 2024-02-28 00:24:42 +01:00
J. Nick Koston
49eb664a05 Update httpx to 0.27.0 and httpcore to 1.0.4 (#111681) 2024-02-27 13:15:33 -10:00
J. Nick Koston
2b19783311 Await service calls in emulated_hue instead of making them blocking (#111674) 2024-02-27 12:44:27 -10:00
J. Nick Koston
105a1ca127 Use eager_start for homekit task creation (#111675) 2024-02-27 12:44:01 -10:00
J. Nick Koston
3c25e2a4bd Small speed up to Bluetooth setup (#111677) 2024-02-27 12:43:44 -10:00
J. Nick Koston
6abb8ae273 Migrate setup to use eager tasks (#111619) 2024-02-27 12:43:32 -10:00
Joost Lekkerkerker
9cf874d4a0 Add icon translations to Energyzero (#111513)
* Add icon translations to Energyzero

* Add icon translations to Energyzero
2024-02-27 23:41:07 +01:00
J. Nick Koston
c4d719a7cf Use eager_start for background service call tasks (#111620) 2024-02-27 12:06:32 -10:00
Jan-Philipp Benecke
c8b7f098e5 Avoid call to hass.helpers.store in FloorRegistry (#111554)
* Avoid call to `hass.helpers.store` in FloorRegistry

* Change type annotation
2024-02-27 23:03:28 +01:00
Jc2k
cf849664ba Cleanup BLE-only controls when migrating HomeKit BLE device to Thread (#110334)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-27 12:02:27 -10:00
Jan-Philipp Benecke
c890c1aeee Remove @bind_hass from camera functions (#111494)
* Remove `@bind_hass` from camera functions

* Pass hass to async_get_image in image_processing
2024-02-27 23:01:43 +01:00
J. Nick Koston
6c00d02d0b Use eager_start for shelly task creation (#111671) 2024-02-27 11:55:38 -10:00
Joost Lekkerkerker
99c1912ccd Add icon translations to Goalzero (#111630) 2024-02-27 22:49:59 +01:00
Arie Catsman
d8d44069b5 Add Grid import export to Enphase Envoy (#110884)
* Add Grid import export to enphase Envoy

* Update snapshot for labels dict element in entity registry

* use identity check for enum

* Revert use of identity check, didn't add entities

* Implement review feedback for tests

* ct phase sensors disabled by default

* import PHASENAMES from pyenphase

* Update tests/components/enphase_envoy/test_sensor.py

* Update tests/components/enphase_envoy/test_sensor.py

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-27 16:43:43 -05:00
Joost Lekkerkerker
a29d29ad85 Add icon translations to Google Assistant (#111657) 2024-02-27 22:30:27 +01:00
Joost Lekkerkerker
071835c761 Add icon translations to Google Generative AI Conversation (#111659) 2024-02-27 22:30:02 +01:00
Joost Lekkerkerker
5aa5bc406c Add icon translations to Google Mail (#111660) 2024-02-27 22:28:53 +01:00
Joost Lekkerkerker
d9486c1eb5 Add icon translations to Google Sheets (#111661) 2024-02-27 22:28:10 +01:00
Joost Lekkerkerker
81590ac887 Add icon translations to Goodwe (#111655) 2024-02-27 22:22:56 +01:00
Jan Čermák
d4a7e4a6ac Add ODROID-M1S as a supported OS hardware board (#111022) 2024-02-27 21:51:55 +01:00
Mike Degatano
68200de4d2 Bad Request from supervisor should be error (#111162) 2024-02-27 21:49:52 +01:00
Shay Levy
2a8e5ceea9 Fix Switcher test update CI failure (#111667) 2024-02-27 10:32:40 -10:00
J. Nick Koston
290ffd14a4 Bump aiohomekit to 3.1.5 (#111663) 2024-02-27 10:13:14 -10:00
Arie Catsman
850add120a Bump pyenphase to 1.19.1 (#111653) 2024-02-27 09:56:49 -10:00
J. Nick Koston
a6f4f6eae8 Use eager task creation to add entities to entity platform (#111553) 2024-02-27 09:54:51 -10:00
Robert Svensson
8da2c53742 Bump aiounifi to v72 (#111649) 2024-02-27 20:15:33 +01:00
Federico D'Amico
1109aba211 Add button platform to microBees (#111141)
* add button platform to microBees

* use list comprehension for async_add_entities

* add a transaltion_key and fix list comprehension

* add panic button

* remove BUTTON_PRODUCT_IDS
2024-02-27 19:41:42 +01:00
Erik Montnemery
fc4b18b907 Return FlowResultType.ABORT when violating single_config_entry (#111637)
* Return FlowResultType.ABORT when violating single_config_entry

* Fix translations

* Fix tests
2024-02-27 18:28:19 +01:00
Robert Svensson
4281f648d2 Break out UniFi get_unifi_api function (#111323)
Break out get api function
2024-02-27 18:20:06 +01:00
Erik Montnemery
6bd7a74fab Update list of integrations known to violate color mode rules (#111647) 2024-02-27 18:17:26 +01:00
J. Nick Koston
e25b097376 Import bluetooth in the executor to avoid blocking the event loop (#111596) 2024-02-27 07:05:39 -10:00
Joakim Sørensen
f622ddef47 Move backup/* WS commands to the backup integration (#111636)
Revert "Revert "Move backup/* WS commands to the backup integration" (#111136)"

This reverts commit 8f83426895.
2024-02-27 11:56:07 -05:00
Michael Hansen
890e651bdd Avoid race condition with UDP voice server starting in ESPHome (#111644)
* Avoid race condition with UDP server starting

* Fix test
2024-02-27 10:54:56 -06:00
Paulus Schoutsen
8b8c607b01 Bump version to 2024.2.5 2024-02-27 11:48:39 -05:00
Aidan Timson
6b5735cd08 Add title to reauthenticate integration issue (#111275)
* Add title to reauthenticate integration issue

* Fix translation placeholder in test

* Update translation placeholders in test_init.py

* Update integration reauthentication message

* Update string
2024-02-27 11:48:35 -05:00
Martin Hjelmare
00d11ff68e Fix rfxtrx flaky reconnect test (#111635) 2024-02-27 16:13:08 +01:00
Jan Rothkegel
887182c224 Wolflink connection pooling (#111483)
* Enable connection pooling

* Decrease polling frequency

* Replace client passing by instance instead of lambda
2024-02-27 15:59:52 +01:00
Erik Montnemery
6ccf7dea32 Always allow ignore and unignore flows for single config entry integrations (#111631)
* Always allow ignore and unignore flows for single config entry integrations

* Update tests/test_config_entries.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-27 15:47:56 +01:00
Jan-Philipp Benecke
070b411820 Avoid call to hass.helpers.store in LabelRegistry (#111555)
* Avoid call to `hass.helpers.store` in LabelRegistry

* Change type annotation
2024-02-27 09:37:45 -05:00
J. Nick Koston
773543b617 Ensure all data is set in seventeentrack before adding entities (#111603)
This integration would call async_add_entities before
it has set the data that the entity needed. There is
no guarantee that the entity would take long enough
to add that the data would be there
2024-02-27 08:47:31 -05:00
J. Nick Koston
08e0008d31 Use an eager task to setup entity platforms (#111574)
* Use an eager task to setup entity platforms

Ideally we would have awaited this function instead, but we want
to shield it from cancellation so we wrap it in asyncio.shield
which schedules it as a task. Since we have integrations that
never suspend in async_setup_entry, we can avoid scheduling on
the evnet loop with an eager task for this case

* its an executor future

* its an executor future

* fix

* doc string lied
2024-02-27 08:45:45 -05:00
Joost Lekkerkerker
224ca122fd Add icon translations to Fully kiosk (#111609)
* Add icon translations to Fully kiosk

* Update homeassistant/components/fully_kiosk/icons.json
2024-02-27 08:43:42 -05:00
J. Nick Koston
c78cccf7d2 Import shelly in the executor to avoid blocking the event loop (#111623)
`[homeassistant.loader] Component shelly import took 0.396 seconds (loaded_executor=False)`
2024-02-27 08:35:57 -05:00
J. Nick Koston
55e3eb6160 Import airvisual in the executor to avoid blocking the event loop (#111624)
`Component airvisual import took 0.566 seconds (loaded_executor=False)`
2024-02-27 08:35:46 -05:00
J. Nick Koston
7fbd10019a Import xbox in the executor to avoid blocking the event loop (#111625)
`Component xbox import took 0.326 seconds (loaded_executor=False)
`
2024-02-27 08:35:33 -05:00
Nils Bergmann
08497db358 Extend ZHA thermostat local temperature calibration range for Sonoff TRVZB (#109691)
* Extend thermostat local temperature calibration range

* Extend thermostat local temperature calibration range only for TRVZB

* Change _attr_native_min_value and _attr_native_max_value back to -2.5 and 2.5

* Adjust _attr_native_step for TRVZB to 0.2

* Implement requested changes

* Fix platform for MULTI_MATCH

* Implement requested changes

* Implement requested changes
2024-02-27 08:32:23 -05:00
Robert Resch
d7fb949994 Deprecate mailbox platform (#110930) 2024-02-27 13:50:02 +01:00
Erik Montnemery
8fb542917b Deprecate the Ambiclimate integration (#111627)
Deprecate Ambiclimate integration
2024-02-27 13:45:12 +01:00
Brenan Kelley
458c5ae657 Add statistics keep_last_sample option (#88655)
* introduce preserve last value option

* improve comments

* add unit test

* skip scheduling purge on a preserved value

* do not schedule sensor update if preserving last value

* fix unit test to use new mock time pattern

pattern introduced in https://github.com/home-assistant/core/pull/93499

* rename preserve_last_val to keep_last_sample

* add keep_last_sample config validation
2024-02-27 13:17:05 +01:00
J. Nick Koston
4414b468f3 Import zwave_js in the executor to avoid blocking the event loop (#111622)
`2024-02-27 10:55:54.872 DEBUG (MainThread) [homeassistant.loader] Component zwave_js import took 0.780 seconds (loaded_executor=False)`
2024-02-27 13:14:27 +01:00
David F. Mulcahey
5d1b78a29d Add device list to ZHA config entry diagnostics (#111549)
* Add device list to ZHA  config entry diagnostics

* add logical type
2024-02-27 06:44:26 -05:00
Marc Mueller
e854ce5c21 Update typing-extensions to 4.10.0 (#111538) 2024-02-27 12:33:31 +01:00
Marc Mueller
adbd9c8d40 Update python-slugify to 8.0.4 (#111284) 2024-02-27 12:29:48 +01:00
dependabot[bot]
38395c8fab Bump actions/download-artifact from 4.1.2 to 4.1.3 (#111602) 2024-02-27 12:12:23 +01:00
Erik Montnemery
413b74a2e0 Deprecate Logi Circle integration (#111491)
* Deprecate Logi Circle integration

* Update homeassistant/components/logi_circle/__init__.py

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

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-02-27 11:36:36 +01:00
Joost Lekkerkerker
c09212e5aa Add icon translations to Garages Amsterdam (#111610) 2024-02-27 10:39:31 +01:00
Joost Lekkerkerker
497b63216a Add icon translations to Geocaching (#111613) 2024-02-27 10:39:10 +01:00
J. Nick Koston
044ace0a6a Make core tests that should run in the event loop coros (#111605) 2024-02-26 23:18:22 -10:00
Robert Resch
3703698f77 Bump deebot-client to 6.0.2 (#111507) 2024-02-27 09:39:49 +01:00
J. Nick Koston
d812507aeb Refactor eafm to avoid creating entities in the coordinator update (#111601) 2024-02-26 21:08:28 -10:00
Chris Talkington
2618d4abe0 Update pyipp to 0.14.5 (#111590) 2024-02-26 19:30:00 -10:00
J. Nick Koston
4579de6eb5 Import ssdp in the executor to avoid blocking the event loop (#111593)
`2024-02-26 21:37:59.325 DEBUG (MainThread) [homeassistant.loader] Component ssdp import took 1.179 seconds (loaded_executor=False)`
2024-02-26 23:58:34 -05:00
J. Nick Koston
f08122084b Reduce bootstrap code (#111450)
* Reduce bootstrap code

Adds a SETUP_ORDER const dict which will be used
for future refactoring

* tweak

* fix bad merge
2024-02-26 23:58:16 -05:00
J. Nick Koston
587854fd59 Remove zeroconf from ssdp after deps (#111326)
* Remove zeroconf from ssdp after deps

This was added in #36277 but is no longer needed since
we setup discovery integrations ahead of time to ensure
their deps are updated before other integrations can load
them

* adjust test
2024-02-26 23:57:41 -05:00
J. Nick Koston
de48ad5931 Create bootstrap tasks eagerly (#111497)
We can avoid one event loop iteration to start the tasks here
2024-02-26 23:56:16 -05:00
J. Nick Koston
7d9fa2f407 Load config entry platforms eagerly (#111498)
We can avoid one event loop iteration to start the tasks here.
2024-02-26 23:55:41 -05:00
J. Nick Koston
ce0fb1e716 Fully fix race in removing entities (#111499)
Full fix race in removing entities

Followup to #110978 now that we can start the task
eagerly it completely closes the race window
2024-02-26 23:55:15 -05:00
J. Nick Koston
f984cca49b Import usb in the executor to avoid blocking the event loop (#111592)
`2024-02-26 21:38:00.091 DEBUG (MainThread) [homeassistant.loader] Component usb import took 0.753 seconds (loaded_executor=False)`
2024-02-26 18:49:29 -10:00
J. Nick Koston
145ce183d0 Create component setup tasks eagerly in bootstrap (#111511)
This saves waiting one iteration of the event loop
2024-02-26 23:45:55 -05:00
J. Nick Koston
d5e1934942 Use an eager task in the update coordinator scheduled refresh (#111570)
* Use an eager task in the update coordinator scheduled refresh

We have a lot of places that will not suspend because the refresh function
decides it does not need to update. Currently these have to be scheduled
on the event loop even though they are a noop.

Since _handle_refresh_interval is subclassed in some integrations, I created
a dunder wrapper function to avoid integraions subclassing it

* fix time fires outside of patch
2024-02-26 23:31:08 -05:00
J. Nick Koston
b692f30c33 Import august in the executor to avoid blocking the event loop (#111595) 2024-02-26 18:30:31 -10:00
J. Nick Koston
35a3573bd2 Import spotify in the executor to avoid blocking the event loop (#111594) 2024-02-26 18:30:21 -10:00
Jesse Hills
e1dade69e1 ESPHome: Pass through wake_word_phrase from on-device microWakeWord (#111585)
* ESPHome: Pass through wake_word_phrase from on-device microWakeWord

* Bump aioesphomeapi to 23.0.0
2024-02-26 23:29:03 -05:00
J. Nick Koston
80ad4f1232 Import thread in the executor to avoid blocking the event loop (#111586)
Import thread in the executor

DEBUG (MainThread) [homeassistant.loader] Importing platform thread.config_flow took 2.92s (loaded_executor=False)
2024-02-26 23:21:10 -05:00
J. Nick Koston
7a3f829eac Import wemo in the executor to avoid blocking the event loop (#111587)
`2024-02-26 21:12:29.792 DEBUG (MainThread) [homeassistant.loader] Importing platform wemo.config_flow took 1.11s (loaded_executor=False)`
2024-02-26 23:20:55 -05:00
J. Nick Koston
b1e2eafe26 Import samsungtv in the executor to avoid blocking the event loop (#111588)
`2024-02-26 21:12:28.305 DEBUG (MainThread) [homeassistant.loader] Importing platform samsungtv.config_flow took 1.10s (loaded_executor=False)`

This one has a long requirements list
2024-02-26 23:20:39 -05:00
J. Nick Koston
d6d2ded546 Import dhcp in the executor to avoid blocking the event loop (#111589)
Discovery integrations load a lot earlier when many modules
are not yet loaded so they have a lot less overlapping deps

dhcp uses scapy which is large to import. I hope one
day to replace it with something more lightweight
2024-02-26 23:20:24 -05:00
J. Nick Koston
40190a2f1f Import zeroconf in the executor to avoid blocking the event loop (#111591)
This one takes ~0.45s on the green
2024-02-26 23:20:03 -05:00
J. Nick Koston
f56e4d6a09 Use eager task creation for entity platform polling (#111575)
* Use eager task creation for entity platform polling

We have lots of places where `async_update` does not suspend and
is only a coro because its required to be a coro to run in the
event loop

* try again
2024-02-26 23:16:39 -05:00
J. Nick Koston
1e02260bbe Use eager start for august subscriber refreshes (#111581)
Since most of the time this call will be a noop since pubnub will be connected
we can avoid scheduling a task on the event loop every time it fires
2024-02-26 23:13:33 -05:00
J. Nick Koston
cfe478245f Migrate gather_with_limited_concurrency to use create_eager_task (#111565) 2024-02-26 16:31:52 -10:00
J. Nick Koston
4bdd8dbd40 Refactor rainmachine to increase chance of reusing the connection (#111573) 2024-02-26 16:31:18 -10:00
J. Nick Koston
26079a6eaf Use eager_start for sonos ping background task (#111578) 2024-02-26 16:31:06 -10:00
J. Nick Koston
bf866732c9 Make unifiprotect fallback update an eager task (#111580) 2024-02-26 16:30:53 -10:00
J. Nick Koston
86ced5a85f Bump yalexs to 1.11.4 (#111567) 2024-02-26 16:30:37 -10:00
J. Nick Koston
6a62a39456 Start automations with eager tasks (#111568) 2024-02-26 16:30:00 -10:00
J. Nick Koston
fb4e8a4f3b Start the debouncer task eagerly (#111569) 2024-02-26 16:29:46 -10:00
J. Nick Koston
1e3af1b48f Convert person start to be a callback function (#111571)
Nothing was being awaited here so there was no need to create
a task per person at the start event.

The async_update_config coro remains since its required
by the collection but is now a wrapper around a callback
_async_update_config
2024-02-26 21:04:33 -05:00
J. Nick Koston
ebdfff4037 Reduce latency to connect websocket writer (#111559)
Reduce latancy to connect websocket writer

Use an eager start task to start the writer
2024-02-26 20:52:53 -05:00
J. Nick Koston
321295a872 Reduce latency to set up websocket forwarding in hassio (#111558)
Reduce latancy to set up websocket forwarding in hassio

Create the tasks eagerly to avoid one iteration of the event loop
to connect the proxy
2024-02-26 20:52:37 -05:00
J. Nick Koston
ae2ce99cbd Create tasks eagerly in the discovery flow helper (#111557)
The likely outcome from most discoveries is an near immediate abort
so we run them eagerly to avoid having to schedule on the event loop
for the common case
2024-02-26 20:52:04 -05:00
J. Nick Koston
b75277cc24 Use an eager task to update multiple entities (#111556)
If there are multiple entities on the same platform its likely
that only one of them will suspend in the update so schedule
them eagerly
2024-02-26 20:49:09 -05:00
Michael Hansen
f6622ea8e0 Add speech-to-text cooldown for local wake word (#108806)
* Deconflict based on wake word

* Undo test

* Make wake up key a string, rename error

* Update snapshot

* Change to "wake word phrase" and normalize

* Move normalization into the wake provider

* Working on describe

* Use satellite info to resolve wake word phrase

* Add test for wake word phrase

* Match phrase with model name in wake word provider

* Check model id

* Use one constant wake word cooldown

* Update homeassistant/components/assist_pipeline/error.py

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

* Fix wake word tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-26 20:35:19 -05:00
J. Nick Koston
c38e0d22b8 Fix text in docstrings and debug logging for loader (#111560) 2024-02-26 15:14:15 -10:00
Joost Lekkerkerker
9e2db708b9 Add icon translations to Fritz (#111547)
* Add icon translations to Fritz

* Add icon translations to Fritz
2024-02-27 00:17:15 +01:00
Niels Perfors
951743551a Add Tado add meter readings service (#111552) 2024-02-26 23:47:01 +01:00
Jan-Philipp Benecke
4de56c1751 Avoid call to hass.helpers in permobile (#111541) 2024-02-26 23:46:19 +01:00
Shay Levy
24dee11a4d Bump aioshelly to 8.0.2 (#111414) 2024-02-27 00:37:25 +02:00
Joost Lekkerkerker
467659cb21 Add icon translations to Flo (#111542) 2024-02-26 22:52:26 +01:00
J. Nick Koston
359bd625c8 Import mqtt in the executor to avoid blocking the event loop (#111521) 2024-02-26 11:41:07 -10:00
Jeef
bc20e7900c WeatherFlow Forecast (REST API) (#106615)
* rebase off dev

* Update homeassistant/components/weatherflow_cloud/const.py

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

* Addressing 1st round of PR Comments

* Update homeassistant/components/weatherflow_cloud/config_flow.py

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

* addressing PR Comments

* fixing last comment that i can see

* Update homeassistant/components/weatherflow_cloud/coordinator.py

OOPS

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

* Update homeassistant/components/weatherflow_cloud/weather.py

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

* Update homeassistant/components/weatherflow_cloud/coordinator.py

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

* switching to station id

* Update homeassistant/components/weatherflow_cloud/strings.json

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

* addressing PR

* Updated tests to be better

* Updated tests accordingly

* REAuth flow and tests added

* Update homeassistant/components/weatherflow_cloud/strings.json

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

* Update homeassistant/components/weatherflow_cloud/coordinator.py

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

* Addressing PR comments

* Apply suggestions from code review

* ruff fix

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-02-26 22:40:21 +01:00
J. Nick Koston
b6393cc3a0 Import influxdb in the executor to avoid blocking the event loop (#111520)
was not added to the original PR to contain scope

identified at: https://github.com/home-assistant/core/pull/111336#issuecomment-1963062529
2024-02-26 16:00:16 -05:00
J. Nick Koston
e742951993 Import radio_browser in the executor to avoid blocking the event loop (#111519)
was not added to the original PR to contain scope

identified at: https://github.com/home-assistant/core/pull/111336#issuecomment-1963062529
2024-02-26 15:59:51 -05:00
Tomer Shemesh
886a450cf4 Add support to Lutron lights for color and temperature control (#109019)
* Add support to lutron lights for color and temperature control

* Fix review comments for adding color and temperature to Lutron lights

* Add eclair4151 as codeowner Lutron Caseta Integration

* Fix review comments for add color support for Lutron lights

* Code cleanup suggestions from PR review for adding color support for Lutron Lights

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

* Fix minor syntax errors from review comments for lutron light color support

* Fix review comments and code cleanup for Lutron light color support

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-26 10:58:20 -10:00
J. Nick Koston
30094acec7 Fix dict changing size during iteration in deconz (#111523) 2024-02-26 10:47:08 -10:00
On Freund
32dc8d9fcb Improve code comment for Chrome frame bug in Camera (#111504) 2024-02-26 15:30:35 -05:00
J. Nick Koston
4ea1c5cc3c Add support for importing integrations in the executor (#111336)
* Add support for pre-imports at setup time

alternative solution to #111331

* refactor

* refactor

* refactor

* mark >1.0s integrations

* no point in executor if already loaded

* no point in executor if already loaded

* cleanup

* cleanup

* two more

* one more

* analytics loads a lot more integrations

* cloud

* debug

* psutil, hardwre

* try zha

* Update homeassistant/setup.py

* await

* comments

* coverage

* coverage

* coverage

* move logic to loader

* move logic to loader

* preserve comments
2024-02-26 14:49:43 -05:00
starkillerOG
75e59167de Reolink trigger ReAuth when credentials invalid during update (#111492)
Check for CredentialsInvalidError
2024-02-26 14:41:20 -05:00
spycle
53f0272357 Bump pyMicrobot to 0.0.17 (#111496)
* Update manifest.json

Up-version pyMicrobot to 0.0.17

* Update requirements_all.txt

Up-version pyMicrobot to 0.0.17

* Update requirements_test_all.txt

Up-version pyMicrobot to 0.0.17
2024-02-26 20:36:05 +01:00
Jonas Fors Lellky
d44e389844 Add hvac_action to flexit_bacnet climate entity (#110498)
* Add hvac_action to flexit_bacnet climate entity

Also add extra state attributes

* Remove extra state attrs

* Change hvac action to heating
2024-02-26 20:22:25 +01:00
Erik Montnemery
730fe760cf Remove JuiceNet integration (#111477)
* Remove JuiceNet integration

* Adjust issue

* Add test

* Fix stale DOMAIN constant
2024-02-26 21:08:36 +02:00
Joakim Plate
a55c56a207 Update rfxtrx library to handle connection retries (#111366)
Upgrade rfxtrx library to one that leaves reconnection to home assistant and handle loss of connection by reloading the integration.

https://github.com/Danielhiversen/pyRFXtrx/releases/tag/0.31.0
2024-02-26 19:30:22 +01:00
On Freund
979fe57f7f Image entity media source (#104743)
* Image entity media source

* MJPEG streaming

* Update on change rather than fixed interval

* Only send boundary twice

* return when image has no data

* Write each frame twice

* Use friendly name when browsing

* Fix sending of double frame

* Initial image proxy test

* Improve proxy stream test

* Refactor

* Code review fixes
2024-02-26 19:04:25 +01:00
Jan-Philipp Benecke
baf84b6fba Add single_config_entry manifest option (#109505)
* Allow setting if we support multiple config entries in config flow

* Move property to config flow instead of flow handler

* Move marking an integration as single instance only to manifest

* Revert line remove

* Avoid init a config flow or adding a new entry on a single instance with an entry

* Revert changes in test

* Process code review comments

* Apply code review suggestion
2024-02-26 19:00:33 +01:00
Matthias Alphart
673a95227b Update xknx to 2.12.1 and xknxproject to 3.7.0 (#111460) 2024-02-26 18:52:51 +01:00
J. Nick Koston
4624c859e1 Use discovery flow helper for hardware integrations (#111437)
* Use discovery flow helper for hardware integrations

The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability.

* Use discovery flow helper for hardware integrations

The discovery flow helper defers loading discovered integrations until after startup
to improve startup reliability. Since hardware was not listed in as a
discovery integration, the notification for new discoveries was missing.
2024-02-26 12:04:33 -05:00
Jan-Philipp Benecke
f85a8c5041 Remove @bind_hass from async_active_zone and make callback function (#111488) 2024-02-26 11:57:17 -05:00
J. Nick Koston
67e356904b Add support for eager tasks (#111425)
* Add support for eager tasks

python 3.12 supports eager tasks

reading:
https://docs.python.org/3/library/asyncio-task.html#eager-task-factory
https://github.com/python/cpython/issues/97696

There are lots of places were we are unlikely to suspend, but we might
suspend so creating a task makes sense

* reduce

* revert entity

* revert

* coverage

* coverage

* coverage

* coverage

* fix test
2024-02-26 11:36:46 -05:00
J. Nick Koston
93cc6e0f36 Switch nmap_tracker to use aiooui (#111415)
mac-vendor-lookup can take a long time to startup because
it has to fetch the oui db from the web
2024-02-26 17:32:53 +01:00
Abílio Costa
9420ac1cff Update idasen-ha to v2.5.1 to fix regression (#111439)
Update Idasen Desk support lib to fix regression

idasen v0.11.1 introduces some regressions, so idasen-ha v2.5.1 now
depends on v.0.11.0 instead.
2024-02-26 17:15:24 +01:00
Åke Strandberg
732491d3c9 Bump myuplink lib to 0.5.0 (#111447) 2024-02-26 17:13:21 +01:00
J. Nick Koston
1d4e82bd3d Fix race in dlna_dmr test (#111428)
The entity was removed before the entity registry could update it

```
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity.py", line 1482, in _async_process_registry_update_or_remove
    assert registry_entry is not None
AssertionError

```
2024-02-26 17:11:50 +01:00
Sid
174ebe70d7 Add webmin integration (#106976)
* add webmin integration 1

* refactor, add memory sensors

* Fix docstring

* addressed reviews

* address reviews

* address reviews

* use translation strings for sensors

* add async_abort_entries_match

* apply review comments

* address reviews

* add async_set_unique_id

* add identifiers to device_info

* disable all sensors by default

* move icons to icons.json

* show Faults when given from server in config flow

* add test for Fault

* Apply review suggestions

* Create helper functions for webmin instance and sorted mac addresses

* fix tests
2024-02-26 17:10:11 +01:00
Luke Lashley
4ad7f420e7 Bump Python-roborock to 0.39.2 (#111479)
bump to 0.39.2
2024-02-26 17:25:38 +02:00
Aidan Timson
9f77e275e9 Add title to reauthenticate integration issue (#111275)
* Add title to reauthenticate integration issue

* Fix translation placeholder in test

* Update translation placeholders in test_init.py

* Update integration reauthentication message

* Update string
2024-02-26 08:19:37 -05:00
Jevgeni Kiski
0947bdbd20 Bump vallox-websocket-api to 5.1.0 (#111471)
Bump lib to 5.1.0
2024-02-26 15:03:18 +02:00
Jeremy TRUFIER
ecc9c3b5f0 Add @tronix117 as overkiz codeowner (#111464) 2024-02-26 12:13:26 +01:00
Erik Montnemery
9b91da23c4 Improve logging of google_assistant messages (#110637)
* Improve logging of google_assistant messages

* Add tests

* Add test
2024-02-26 11:43:31 +01:00
starkillerOG
7b059b3dff Add Motionblinds virtual integration Madeco (#111455) 2024-02-26 11:06:28 +01:00
starkillerOG
3f7b2634f7 Add Motionblinds virtual integration Krispol (#111456) 2024-02-26 11:05:25 +01:00
Jan Bouwhuis
1b2e669302 Improve handling mqtt command template exceptions (#110499)
* Improve handling mqtt command template exceptions

* Fix test

* Cleanup stale exception handler

* Throw on topic template exception
2024-02-26 11:04:55 +01:00
starkillerOG
1f0697e85f Add Motionblinds virtual integration Acomax (#111458) 2024-02-26 11:03:49 +01:00
Jan Bouwhuis
da09b6174d Add validation to water_heater set_operation mode at entity component (#111168)
* Add validation to water_heater set_operation mode at entity component

* Add final decorator
2024-02-26 11:02:39 +01:00
Christophe Gagnier
0d4728e1c6 Add TechnoVE auto charge switch (#109093)
* Add binary sensors to TechnoVE integration

* Add unit tests for TechnoVE binary sensors

* Implement PR feedback for TechnoVE

* Limit to appropriate sensors in TechnoVE tests

* Removed leftover code

* Implement feedback in TechnoVE PR #108938

* Add auto-charge switch to TechnoVE

* Improve TechnoVE test_switches to be consistent with other platforms

* Regenerate test_switch.ambr snapshot

* Add binary sensors to TechnoVE integration

* Add unit tests for TechnoVE binary sensors

* Implement PR feedback for TechnoVE

* Limit to appropriate sensors in TechnoVE tests

* Implement feedback in TechnoVE PR #108938

* Add auto-charge switch to TechnoVE

* Apply suggestions from code review

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

* Fix conflict merge issue

* Implement feedback from TechnoVE PR #109093

* Use TechnoVESwitchDescription

* Remove None from is_on in TechnoVE switches

* Update homeassistant/components/technove/strings.json

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

* Remove unneeded code.

* Update test_switch.ambr

* Update TechnoVE switch test similar to Flexit_bacnet

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-26 10:36:40 +01:00
Åke Strandberg
999b1bb220 Add @astrandb as myuplink codeowner (#111449)
Add codeowner
2024-02-26 10:32:37 +01:00
Christopher Fenner
1e564f777e Add sensors for energy storage system to ViCare integration (#106600)
* add sensors for vitocharge

* add further sensors

* add unig getters

* remove icons

* Update strings.json

* handle percent uom

* handle unknown uom device class mapping

* add device class to sensor

* add sensor options

* Apply suggestions from code review

* fix

* align sensor naming

* add feed-in and consumption sensors for pcc

* Update strings.json

* battery symbol

* fix format

* remove obsolete device classes

* add icons

* Apply suggestions from code review

* Apply suggestions from code review

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

* refactor

* modify lambda

* use helper

* Apply suggestions from code review

* Apply suggestions from code review

* Update strings.json

* Update sensor.py

* Apply suggestions from code review

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-26 09:59:58 +01:00
Steve HOLWEG
4a128f1225 Return group unit of measurement when device_class is None (#110973)
* Groups: Return units when device_class is None

* Fixes

* Mods

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-02-25 22:44:05 -05:00
dougiteixeira
34e9c29ef2 Esphome text sensor device class (#111057) 2024-02-25 16:56:52 -10:00
Abílio Costa
5a8779551b Fix uneeded state update in Idasen Desk sensor (#111433) 2024-02-25 15:03:52 -10:00
Marc Mueller
bfd82a0780 Update freezegun to 1.4.0 (#111268) 2024-02-25 15:01:31 -10:00
Marc Mueller
eb370d7213 Update guppy3 to 3.1.4.post1 (#111430) 2024-02-25 15:00:51 -10:00
Marc Mueller
a492ccdc15 Update caldav to 1.3.9 (#111429) 2024-02-25 15:00:37 -10:00
dougiteixeira
c8ec66fcbe Bump aioesphomeapi to 22.1.0 (#111435) 2024-02-25 14:58:37 -10:00
Brett Adams
d84bd14acc Bump tesla-fleet-api to 0.4.6 in Teslemetry (#111127) 2024-02-25 14:06:12 -10:00
Matthias Alphart
e984bdaf98 Fix KNX cover schema for voluptuous 0.14.2 (#111427) 2024-02-26 00:26:32 +01:00
Joost Lekkerkerker
c3d3fc7000 Add icon translations to Dynalite (#111412) 2024-02-25 23:01:28 +01:00
Joost Lekkerkerker
a410aa4a85 Add icon translations to Ecobee (#111416) 2024-02-25 23:01:17 +01:00
Joost Lekkerkerker
8dec6336b3 Add icon translations to edl21 (#111420) 2024-02-25 23:00:52 +01:00
Joost Lekkerkerker
33cb54b888 Add icon translations to Electric Kiwi (#111422) 2024-02-25 23:00:22 +01:00
Joost Lekkerkerker
e366763eb2 Add icon translations to Ecoforest (#111417) 2024-02-25 22:47:15 +01:00
Joost Lekkerkerker
a2af3e5ba1 Add icon translations to EasyEnergy (#111413) 2024-02-25 22:46:33 +01:00
Álvaro Fernández Rojas
b3e10198dd Enable CONF_STATION_UPDATES by default on AEMET (#111214)
* aemet: set CONF_STATION_UPDATES default to True

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

* tests: aemet: check CONF_STATION_UPDATES default form value

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

* Revert "tests: aemet: check CONF_STATION_UPDATES default form value"

This reverts commit f0f95da68f.

* tests: aemet: parametriz test_form_options

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-25 23:23:18 +02:00
Marc Mueller
8c50e24056 Update bcrypt to 4.1.2 (#111283) 2024-02-25 22:22:50 +01:00
J. Nick Koston
014e21ce80 Bump bluetooth-adapters to 0.18.0 (#111316)
changelog: https://github.com/Bluetooth-Devices/bluetooth-adapters/compare/v0.17.0...v0.18.0
2024-02-25 23:07:12 +02:00
hahn-th
80662cd989 Bump homematicip to 1.1.0 (#111385)
#108775 Bump homematicip upstream lib to 1.1.0
2024-02-25 23:03:14 +02:00
Marc Mueller
5206514538 Update ciso8601 to 2.3.1 (#111389) 2024-02-25 22:59:00 +02:00
Luis Andrade
d3c53a1cef Fix another name missing in wyoming getLogger (#111390)
bugfix wyoming getLogger
2024-02-25 21:41:07 +01:00
wittypluck
716d8f8a00 Fix Glances translation keys on CPU load, Memory use, Swap use (#111401)
Fix translation keys on CPU load, Memory use, Swap use
2024-02-25 21:25:28 +01:00
Jan-Philipp Benecke
1c5be598f5 Run pylint sorted platform check also when platform has type annotations (#111407) 2024-02-25 21:18:07 +01:00
steffenrapp
e116d2a721 Add Nuki ID as serial number (#111381)
* Nuki add Nuki ID as serial number

* add hardwareId to bridge

* __init__.py aktualisieren

Co-authored-by: Pascal Reeb <pascal@reeb.io>

* __init__.py aktualisieren

Co-authored-by: Pascal Reeb <pascal@reeb.io>

---------

Co-authored-by: Pascal Reeb <pascal@reeb.io>
2024-02-25 21:16:21 +01:00
Marc Mueller
fa103ec924 Update pytest to 8.0.2 (#111399) 2024-02-25 21:15:48 +01:00
J. Nick Koston
ab68a26000 Fix flakey utility meter test (#111400)
The test tooling would cancel setup at teardown because
it was still setting up

https://github.com/home-assistant/core/actions/runs/8039593463/job/21956908225?pr=111336
2024-02-25 20:21:09 +01:00
Marc Mueller
21ff8c8e03 Update pylint to 3.1.0 (#111392) 2024-02-25 08:01:20 -10:00
Marc Mueller
f155f1c102 Update aionotion to 2024.02.2 (#111388) 2024-02-25 10:45:51 -07:00
Joost Lekkerkerker
953fd82d2c Add icon translations to Deconz (#111363) 2024-02-25 17:12:14 +01:00
Joakim Sørensen
a6a0a0c901 Adjustment post move to WS in Traccar Server (#111337)
* Adjustment post move to WS in Traccar Server

* Use entry.async_create_background_task
2024-02-25 16:04:09 +01:00
mkmer
23cf418807 Allow EM Setpoint in Honeywell (#111332)
Add emheat setpoint
2024-02-25 14:40:08 +01:00
J. Nick Koston
dad1184e18 Make hardware setup in hassio a normal function (#111328)
nothing awaited hassio
2024-02-25 14:37:09 +01:00
Joost Lekkerkerker
77284c746a Add icons translations for ambiclimate (#111322) 2024-02-25 14:31:53 +01:00
Joost Lekkerkerker
407a949b50 Add icons translations for android_ip_webcam (#111324)
* Add icons translations for android_ip_webcam

* Add icon translations to android IP webcam

* Apply suggestions from code review
2024-02-25 14:30:57 +01:00
Daniel Gangl
2adca7a057 Bump Geosphere to v0.3.6 (#111376) 2024-02-25 14:20:51 +01:00
Joost Lekkerkerker
4982e792f3 Add icon translations to Dexcom (#111368) 2024-02-25 14:17:08 +01:00
Joost Lekkerkerker
67165349c5 Add icon translations to Doorbird (#111370) 2024-02-25 14:16:42 +01:00
Joost Lekkerkerker
724b5c8892 Add icon translations to Dremel 3D printer (#111371) 2024-02-25 14:15:57 +01:00
Joost Lekkerkerker
9ada85af36 Add icon translations to Bosch SHC (#111350)
* Add icon translations to Bosch SHC

* Update homeassistant/components/bosch_shc/sensor.py

* Update homeassistant/components/bosch_shc/sensor.py
2024-02-25 14:09:44 +01:00
Joost Lekkerkerker
0009c9a1de Add icon translations to Cloudflare (#111356) 2024-02-25 14:08:49 +01:00
Joost Lekkerkerker
02907578ab Add icon translations to Color extractor (#111357) 2024-02-25 14:08:12 +01:00
Joost Lekkerkerker
9afa154271 Use device class icon in cpu-speed (#111360)
* Use device class icon in cpu-speed

* Use device class icon in cpu-speed
2024-02-25 14:06:54 +01:00
Joost Lekkerkerker
ba961e12a4 Use device class icon in Crownstone (#111361) 2024-02-25 14:06:16 +01:00
Joost Lekkerkerker
5fa4be02f0 Add icon translations to Daikin (#111362) 2024-02-25 14:05:43 +01:00
Joost Lekkerkerker
18fcb14c1b Add icon translations to Cert expiry (#111354) 2024-02-25 14:04:48 +01:00
Joost Lekkerkerker
40a38d23eb Add icon translations to Coolmaster (#111359) 2024-02-25 14:03:07 +01:00
Joost Lekkerkerker
33bf5d7b8b Add icon translations to Cloud (#111355) 2024-02-25 14:01:41 +01:00
Joost Lekkerkerker
5849227033 Add icon translations to Bring (#111351) 2024-02-25 13:59:41 +01:00
Joost Lekkerkerker
33a4040f8e Add icon translations to Cast (#111352) 2024-02-25 13:58:50 +01:00
steffenrapp
13621532fd Nuki add binary sensor for battery charging (#111320)
* Nuki binary sensors

* disable by default
2024-02-25 13:37:13 +01:00
steffenrapp
7d37aeac59 Add icon translations to Nuki (#111377) 2024-02-25 13:25:12 +01:00
J. Nick Koston
8645184dbf Make matter import in google_assistant late to avoid blocking the event loop (#111335)
related issue https://github.com/home-assistant-libs/python-matter-server/issues/578
2024-02-25 07:20:01 -05:00
Marc Mueller
49ae81c5c4 Refactor deprecated workday argument (#111379) 2024-02-25 13:04:02 +01:00
Joost Lekkerkerker
a94f8bd14d Add icon translations to DNS IP (#111369) 2024-02-25 13:00:45 +01:00
Joost Lekkerkerker
8d3982f3dd Add icon translations to Comelit (#111358) 2024-02-25 11:35:22 +01:00
Joost Lekkerkerker
76784cbc95 Add icon translations to Blink (#111346) 2024-02-25 10:44:49 +01:00
Joost Lekkerkerker
3e67b9828b Add icon translations to Android TV (#111338) 2024-02-25 10:43:56 +01:00
Joost Lekkerkerker
a55e5130a4 Use device class icon in Anthem AV (#111339) 2024-02-25 10:43:21 +01:00
Joost Lekkerkerker
4229f988e2 Add icon translations to aosmith (#111340)
* Add icon translations to aosmith

* Add icon translations to aosmith
2024-02-25 10:42:41 +01:00
Joost Lekkerkerker
859c28fdb7 Add icon translations to apcupsd (#111342)
* Add icon translations to apcupsd

* Add icon translations to apcupsd
2024-02-25 10:42:04 +01:00
Joost Lekkerkerker
cb6cf3bedc Add icon translations to Balboa (#111343) 2024-02-25 10:40:44 +01:00
Joost Lekkerkerker
496339773b Add icon translations to Blue current (#111347) 2024-02-25 10:39:15 +01:00
Joost Lekkerkerker
70af28cc26 Add icon translations to aftership (#111317) 2024-02-25 10:38:17 +01:00
Joost Lekkerkerker
dbc4d90435 Add icon translations to amberelectric (#111321) 2024-02-25 10:37:29 +01:00
Joost Lekkerkerker
a706d5e282 Add icon translations to alarmdecoder (#111319) 2024-02-25 10:36:18 +01:00
Marc Mueller
20f455d39f Update python-homewizard-energy to 4.3.1 (#111311) 2024-02-25 10:35:12 +01:00
J. Nick Koston
d053f0b9e2 Bump ibeacon-ble to 1.2.0 (#111315)
changelog: https://github.com/Bluetooth-Devices/ibeacon-ble/compare/v1.0.1...v1.2.0
2024-02-25 10:44:23 +02:00
Joost Lekkerkerker
6e5d14737e Add icons translations for airvisual (#111318)
* Add icons translations for airvisual

* Add icon translations to airvisual
2024-02-25 08:27:29 +01:00
MarkGodwin
d004011d41 Bump tplink-omada-client to 1.3.11 (#111273)
Bump TP-Link Omada API
2024-02-24 23:33:13 +01:00
G Johansson
5073842514 Fix sql integration no recorder (#111263) 2024-02-24 22:40:49 +01:00
Åke Strandberg
cd46cc6e80 Add myuplink number platform (#111154)
* Add number platform

* Use constant for SERVICE_SET_VALUE
2024-02-24 22:39:14 +01:00
J. Nick Koston
b9b52b5e6d Reduce Bluetooth setup time (#111304) 2024-02-24 11:31:45 -10:00
J. Nick Koston
dd80157dc7 Load translations at setup time if they were not loaded at bootstrap (#110921) 2024-02-24 11:31:25 -10:00
Jan-Philipp Benecke
076ae22fdd Freeze time in aemet diagnostics test (#111308) 2024-02-24 16:26:16 -05:00
J. Nick Koston
93a76ab519 Fix profiler.lru_stats always throwing an exception (#111249)
Remove IntegrationMatcher as its now a slotted class and cannot
be examined with the current methods (we also likely do not need
to optimize it anymore)

```
  File "/usr/src/homeassistant/homeassistant/components/profiler/__init__.py", line 201, in _lru_stats
    for maybe_lru in class_with_lru_attr.__dict__.values():
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'IntegrationMatcher' object has no attribute '__dict__'. Did you mean: '__dir__'?
```
2024-02-24 16:26:01 -05:00
J. Nick Koston
bccab1bad7 Fix workday blocking the event loop (#111310)
- Avoid calling list_supported_countries to setup workday
- Only call list_supported_countries in executor in the config flow
2024-02-24 22:22:07 +01:00
Robert Svensson
efc89cd34f Unifi websocket manager (#111041)
* Move hub into .hub.hub

* Move websocket to own module

* Minor shuffle
2024-02-24 16:20:59 -05:00
Jan-Philipp Benecke
d796085923 Bump pydiscovergy to 3.0.0 (#111305) 2024-02-24 22:07:46 +01:00
Ben Hoff
adf4392c0a Bump opower to 0.3.1 (#111307)
bump opower instance
2024-02-24 21:56:20 +01:00
Rami Mosleh
a65d9c17c4 Fix async_validate_location arguments order (#111277)
fix `async_validate_location` arguments order
2024-02-24 21:43:00 +01:00
G Johansson
c45cae3665 Remove obsolete entities from System Monitor automatically (#111231)
* Remove obsolete entities from System Monitor automatically

* callback
2024-02-24 20:50:53 +01:00
Joost Lekkerkerker
47b7dd4a01 Set Lutron switch to device name (#111293) 2024-02-24 20:18:06 +01:00
Minims
597118d584 Add ECO temp to Generic Thermostat (#110471)
feat: add ECO temp to Generic Thermostat.
2024-02-24 20:17:22 +01:00
G Johansson
777428c36d Add diagnostics to System Monitor (#111291)
* Add diagnostics to System Monitor

* Fix
2024-02-24 20:11:11 +01:00
Álvaro Fernández Rojas
57d169582d Add diagnostics support for AEMET (#111218)
aemet: add diagnostics support

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-24 20:08:50 +01:00
Federico D'Amico
bf9c4197b9 Add light platform to microBees and change docstring in sensor (#111093)
* Add light platform to microBees and change docstring in sensor

* update .coveragerc

* fixes review

* fixes review

* fixes async_add_entities
2024-02-24 20:07:04 +01:00
starkillerOG
9cebbf15f3 Bump motionblinds to 0.6.23 (#111265)
* Bump motionblinds to 0.6.22

* Bump motionblinds to 0.6.23
2024-02-24 20:05:04 +01:00
dougiteixeira
3d72f40aea Add strings to the options attribute (#111302)
Add strings to the message attribute
2024-02-24 19:23:07 +01:00
steffenrapp
dbf70f9e0a Nuki add battery critical binary sensor (#111285)
* Update binary_sensor.py

* Update strings.json

* Update homeassistant/components/nuki/binary_sensor.py

Co-authored-by: Pascal Reeb <pascal@reeb.io>

* Update homeassistant/components/nuki/binary_sensor.py

Co-authored-by: Pascal Reeb <pascal@reeb.io>

* Update homeassistant/components/nuki/binary_sensor.py

Co-authored-by: Pascal Reeb <pascal@reeb.io>

---------

Co-authored-by: Pascal Reeb <pascal@reeb.io>
2024-02-24 18:17:42 +01:00
J. Nick Koston
53b12d67f7 Bump yalexs-ble to 2.4.2 (#111247)
changelog: https://github.com/bdraco/yalexs-ble/compare/v2.4.1...v2.4.2
2024-02-24 19:04:19 +02:00
Marc Mueller
70790bc614 Update pytest-timeout to 2.2.0 (#111272) 2024-02-24 19:02:15 +02:00
Klaas Schoute
04a6c0b5f2 Bump odp-amsterdam to v6.0.1 (#111296) 2024-02-24 19:00:40 +02:00
Álvaro Fernández Rojas
766596abdc Add Airzone Cloud Air Quality zone binary sensors (#106573)
* airzone_cloud: add Air Quality binary sensor

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

* airzone_cloud: binary_sensor: rename Air Quality

Add "active" to indicate status.

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-24 08:41:12 -05:00
Álvaro Fernández Rojas
d3d6870c04 Add Airzone Cloud Air Quality zone sensors (#106571)
* airzone-cloud: add Air Quality sensors

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

* tests: airzone_cloud: add missing AQI test

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-24 08:39:53 -05:00
J. Nick Koston
e5ac7970ca Bump habluetooth to 2.4.1 (#111236)
changelog: https://github.com/Bluetooth-Devices/habluetooth/compare/v2.4.0...v2.4.1
2024-02-24 08:38:50 -05:00
Marc Mueller
6d10f96980 Update coverage to 7.4.3 (#111267) 2024-02-24 14:37:07 +01:00
Marc Mueller
4e9bfd1f4a Update pytest-sugar to 1.0.0 (#111271) 2024-02-24 14:35:58 +01:00
Marc Mueller
e7ab416ab9 Update pytest-socket to 0.7.0 (#111270) 2024-02-24 14:35:27 +01:00
Marc Mueller
d70c013ea6 Update pipdeptree to 2.15.1 (#111269) 2024-02-24 08:34:48 -05:00
Cyrill Raccaud
22480a7894 Fix bring! comment pep8 conformity (#111276)
fix bring comment pep8 conformity
2024-02-24 08:18:54 -05:00
Joakim Sørensen
79572c0a5d Subscribe to Traccar Server events (#111262)
* Subscribe to Traccar Server events

* No need to unsubscribe on error

* typo

* rename _attrs

* arg type

* reorder return type

* more spesific

* Update stale docstring
2024-02-24 12:35:32 +01:00
Maciej Bieniek
ee57c924f2 Bump pysnmp-lextudio library to version 6.0.2 (#111193)
* Bump pysnmp-lextudio to version 6.0.2

* Update gen_requirements_all.py

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-24 11:30:00 +01:00
G Johansson
d08fc1f342 Add debugging to coordinator output in System Monitor (#111244) 2024-02-24 09:36:22 +01:00
J. Nick Koston
883d5a0842 Bump cryptography to 42.0.5 (#111259)
changelog: https://github.com/pyca/cryptography/compare/42.0.3...42.0.5
2024-02-24 08:49:46 +01:00
J. Nick Koston
5d6687503e Bump orjson to 3.9.15 (#111233)
changelog: https://github.com/ijl/orjson/compare/3.9.14...3.9.15
2024-02-24 08:47:29 +01:00
J. Nick Koston
5b8591ec7e Avoid reschedule churn in Storage.async_delay_save (#111091)
* Avoid circular import in Storage.async_delay_save

We call Storage.async_delay_save for every entity being added or removed
from the registry. The late import took more time than everything else
in the function.

* Avoid reschedule churn in Storage.async_delay_save

When we are adding or removing entities we will call async_delay_save
quite often which has to add and remove a TimerHandle on the event loop
which can add up when there are a lot of registry items changing.

If the timer handle still has 80% of the time remaining on it
we will avoid resceduling and let it fire at the time the
original async_delay_save call was made. This ensures we
do not force the event loop to rebuild its heapq because
too many timer handlers were cancelled at once

* div0

* add coverage for 0 since we had none

* fix bad conflict

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks

* more test fixes

* mqtt tests rely on event loop overhead
2024-02-24 08:46:00 +01:00
J. Nick Koston
ff0e0b3e77 Convert debouncer async_shutdown to be a normal function (#111257)
* Convert debouncer async_shutdown to be a normal function

nothing was being awaited here and the shutdown call was only used
in integrations marked internal and other internals. Its possible
that a custom component might have been using the method but it
seemed uncommon enough that it did not warrent marking as a breaking
change. The update coordinator is no longer awaiting anything in
async_shutdown either now but it seemed likely that this use
would get subclassed.

* fix
2024-02-24 08:37:33 +01:00
Teemu R
e0490a3ade Improve tplink authenticate description wording (#111250) 2024-02-23 15:19:28 -10:00
J. Nick Koston
b60ca4260c Fix bluetooth manager stop missing callback decorator (#111232) 2024-02-23 12:58:55 -10:00
David F. Mulcahey
5d4dc63118 Bump ZHA dependencies (#111227) 2024-02-23 17:57:39 -05:00
J. Nick Koston
40774101d3 Avoid creating task per device when adding legacy device trackers (#111220) 2024-02-23 23:47:43 +01:00
Marc Mueller
5f8ef37f2d Update pylint to 3.0.4 (#111229)
* Update pylint to 3.0.4

* Use yield from

* Remove unnecessary pylint disable comments
2024-02-23 23:46:00 +01:00
rlippmann
efd1ed86ae Code improvements for microbees component (#111208) 2024-02-23 12:35:56 -10:00
J. Nick Koston
d9addc45f9 Avoid scheduling a task to add each entity when not using update_before_add (#110951)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-23 10:49:26 -10:00
J. Nick Koston
3aecec5082 Avoid rechecking for missing platforms in the loader (#111204) 2024-02-23 10:48:47 -10:00
G Johansson
9e46c2e2b3 Isolate systemmonitor from psutil shared state (#111110)
* Isolate systemmonitor from psutil shared state

* Mods

* typing

* Fix tests

* Fix read temp issue

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-23 20:53:48 +01:00
Niklas Roth
2ff0102bce Bump python-hpilo to 4.4.3 (#110325)
* Update hpilo version in requirements_all.txt (#109581)

The issue with the deprecated and now removed ssl.wrap_socket function was fixed years ago in the library

* Update hpilo version in manifest.json (#109581)
2024-02-23 20:51:29 +01:00
J. Nick Koston
125de17a09 Avoid linear search to remove from the entity registry index (#111138)
Avoid linear search to remove from entity registry index

Because the entity registry index needs to preserve insertion order
for backwards compat, a list was used for the index. Because some
config entries/devices/areas have a large amount of entities, removing
the entities, the O(n) time complexity of removing from a list can
slow down reloads. As python has no orderedset in stdlib, use
a dict since it preserves insertion order has O(1) add/remove
time complexity for the average case
2024-02-23 13:57:59 -05:00
J. Nick Koston
b5a2df1951 Refactor keyed event trackers to reduce future refactoring risk (#111150)
* Refactor keyed event trackers to avoid refactoring risk

Follow to https://github.com/home-assistant/core/pull/110978#discussion_r1496771106

I had to do some type ignores because of the EventType vs Event
which is hopefully not going to be needed after the next mypy

* delete constants only used one in other const

* no field

* fixes

* less refactoring later

* less refactoring later

* keep const
2024-02-23 13:55:02 -05:00
J. Nick Koston
5e16602595 Refactor storage collections to reduce tasks during startup (#111182)
* Make adding entities in storage collection a normal function

Nothing is awaited when adding

* cleanup

* cleanup

* cleanup

* cleanup

* reduce

* reduce

* reduce

* reduce

* tweak
2024-02-23 13:50:25 -05:00
J. Nick Koston
b3a8a75e75 Improve performance of filtering HomeKit entities (#111201)
Get the underlying filter with get_filter to avoid the wrapper
2024-02-23 13:42:01 -05:00
J. Nick Koston
3877a56d23 Avoid creating tasks for automation and script validation (#111181)
These functions created tasks to run small validators, and the cost of
creating all the tasks was more expensive than running the validators
themselves. Since the code is unlikely to suspend its more efficient to
await them in series.
2024-02-23 13:41:36 -05:00
J. Nick Koston
5d421e249f YAML loader performance improvements (#111199)
* YAML loader performance improvements

- Cache the name of the loader since we call it multiple
  times for every line

- Add a fast path for scalar tags since they are the
  most common

* Update homeassistant/util/yaml/loader.py

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

* remove unreachable code

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-23 13:37:09 -05:00
J. Nick Koston
b9ed315cf7 Avoid yalexs_ble delaying startup when the lock is not advertising (#111167) 2024-02-23 13:35:17 -05:00
J. Nick Koston
b6b5b1f788 Fix race in ESPHome entity test (#111179)
This test relied on the event loop overhead. Change it
to listen for the state to change instead
2024-02-23 13:34:46 -05:00
David F. Mulcahey
d485e8967b Add device counter entities to ZHA (#111175)
* Add counter entities to the ZHA coordinator device

* rework to prepare for non coordinator device counters

* counter entity test

* update log lines

* disable by default
2024-02-23 13:22:47 -05:00
J. Nick Koston
59066c1770 Migrate zha to use Debouncer.async_schedule_call (#111103) 2024-02-23 07:28:23 -10:00
J. Nick Koston
3ecbd05ac0 Avoid creating tasks to register hassio panels (#111206)
panel_custom never suspends so we can avoid the overhead of
creating and scheduling tasks
e398accc3e/homeassistant/components/panel_custom/__init__.py (L74)

panel_custom.async_register_panel could be converted to a normal function but it
would be a breaking change
2024-02-23 16:50:39 +01:00
J. Nick Koston
e398accc3e Convert hassio websocket_apis that did not await to normal functions (#111173)
* Convert hassio websocket_apis that did not await to normal functions

* Convert hassio websocket_apis that did not await to normal functions
2024-02-23 15:27:17 +01:00
Marc Mueller
dd51b0c6cc Update beautifulsoup4 to 4.12.3 (#111195) 2024-02-23 13:42:32 +01:00
Marc Mueller
55e39d48eb Update coverage to 7.4.2 (#111194) 2024-02-23 13:22:19 +01:00
Joost Lekkerkerker
730d805876 Enable SIM114 ruff rule (#111125) 2024-02-23 13:21:59 +01:00
dependabot[bot]
26fac184b4 Bump github/codeql-action from 3.24.3 to 3.24.4 (#111184) 2024-02-23 12:15:42 +01:00
Álvaro Fernández Rojas
d12335a3aa Update AEMET-OpenData to v0.5.1 (#111191)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-23 11:59:09 +01:00
Joakim Sørensen
512bc7c699 Bump pytraccar from 2.1.0 to 2.1.1 (#111188) 2024-02-23 11:57:41 +01:00
J. Nick Koston
70d7f74f35 Convert hardware system status websocket api to a normal function (#111172)
* Convert hardware system status websocket api to a normal function

Nothing is awaited here

* tweak
2024-02-23 11:48:13 +01:00
Andriy Kushnir
87fed65fb3 Bump roombapy to 1.6.13 (#111187) 2024-02-23 10:42:13 +01:00
J. Nick Koston
68d1fbaadc Fix race in openalpr_cloud tests (#111185)
The test would end before setup was finished and the setup
would get cancelled
2024-02-23 09:28:20 +01:00
Jan Bouwhuis
afa4e76248 Optimize mqtt device cleanup (#111170)
Thnx
2024-02-23 07:29:50 +01:00
jjlawren
8d4569ff55 Bump plexapi to 4.15.10 (#111180) 2024-02-23 07:03:07 +01:00
Mike O'Driscoll
eb9eff404d Fix stale sensors for Recollect Waste (#111174) 2024-02-22 22:05:30 -07:00
kingy444
83859bd342 Rework how shade updates are processed in powerview (#110928)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-22 15:58:37 -10:00
J. Nick Koston
98a8714705 Improve error reporting in tplink config flow (#111166)
* Improve error reporting in tplink config flow

* coverage, fixes
2024-02-23 02:38:46 +01:00
Matthew Donoughe
6712621b95 Update pylutron-caseta to 0.20.0 (#111169) 2024-02-22 14:44:30 -10:00
Christopher Bailey
ae60f59bed Add metadata for UniFi Protect Media Source (#109389) 2024-02-22 14:44:16 -10:00
ollo69
f0f3773858 Add base class AndroidTVEntity to AndroidTV (#105945) 2024-02-22 12:38:38 -10:00
J. Nick Koston
2ef71289b9 Avoid creating tasks for dependencies already being setup (#111034)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-22 12:34:46 -10:00
J. Nick Koston
32cd3ad862 Fix lingering timer in enphase_envoy test (#111165) 2024-02-22 12:33:44 -10:00
J. Nick Koston
fb7da1ba83 Simplify ESPHome entity removal process (#111076) 2024-02-22 11:39:53 -10:00
Maciej Bieniek
bccd9bd21f Bump brother library to version 4.0.0 (#111157)
* Bump library

* Update code to the new library version

* Improve diagnostics

* Fix tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-22 23:27:24 +02:00
Åke Strandberg
3be83bf2f5 Correct myUplink dash replacement (#111143)
* Corrected dash replacement

* Fix comment
2024-02-22 22:26:08 +01:00
J. Nick Koston
36c11119cf Refactor Debouncer usage in august (#111102) 2024-02-22 11:23:14 -10:00
Álvaro Fernández Rojas
78f3f67e3a Update AEMET-OpenData to v0.5.0 (#111155)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-22 21:47:21 +02:00
Christopher Fenner
88e9870f1c Add number entities to change heat pump program temperatures in ViCare integration (#109315)
* add HeatingProgram type

* use HeatingProgram type

* add heatpump number sensors

* use HeatingProgram type

* Update strings.json

* rename HeatingProgram to Program

* remove commented code

* rename heating program type

* simplify

* Apply suggestions from code review

* Update strings.json

* Update const.py

* fix

* add heating program type

* correct imports

* Revert "fix"

This reverts commit 857dda59da.

* Apply suggestions from code review

* Update strings.json
2024-02-22 18:58:38 +01:00
rkruisselbrink
c1b4a21821 Bump rova to 0.4.0 (#111131)
* Bump rova to 0.4.0

* Apply suggestions from code review

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-22 19:55:45 +02:00
Mr. Bubbles
eeeabfb440 bump bring-api to 0.4.1 (#111149) 2024-02-22 19:54:56 +02:00
J. Nick Koston
5bf8086a2b Cache formatting of mac addresses (#111140) 2024-02-22 07:09:56 -10:00
Christopher Bailey
b740783f8d Bump pyunifiprotect to 4.23.3 (#111059) 2024-02-22 05:57:42 -10:00
Shay Levy
6bbd8c7f7b Remove filter of -1 in Shelly block based sensors (#111116) 2024-02-22 17:48:14 +02:00
Artem Draft
a7a19786cc Handle media position in Bravia TV (#107080)
Handle media position in BraviaTV
2024-02-22 16:22:07 +01:00
Jan-Philipp Benecke
ef66560744 Use async_update_reload_and_abort helper in discord (#111104) 2024-02-22 16:11:46 +01:00
Joakim Sørensen
8f83426895 Revert "Move backup/* WS commands to the backup integration" (#111136)
Revert "Move backup/* WS commands to the backup integration (#110651)"

This reverts commit ec4e6c3a74.
2024-02-22 16:08:30 +01:00
David Knowles
8bf0466151 Bump pydrawise to 2024.2.0 (#111080) 2024-02-22 13:00:25 +01:00
Malte Franken
5f9d46205c Bump georss-qld-bushfire-alert-client to 0.7 (#111075)
* bump georss-qld-bushfire-alert-client to 0.7

* fix tests
2024-02-22 12:58:54 +01:00
Åke Strandberg
58269fefea Replace dash with hard hyphen in myuplink entity names (#111074)
Replace dash with hard hyphen in entity names
2024-02-22 12:56:42 +01:00
Álvaro Fernández Rojas
b72d64a3dc Disable AEMET legacy options (#107795)
* aemet: disable legacy options

This enables proper timezone handling:
- Atlantic/Canary for the Canary Islands.
- Europe/Madrid for the Iberian Peninsula.

Also provides daily data for the current day after AEMET stops providing the
full day interval, which is normally after midday (12:00).
This is a breaking change because with the previous behaviour the daily data
for the current day wasn't available after midday and now it will be.
What the integration library does to workaround this is to fallback to the
12-24 interval data if the the 00-24 is no longer provided by the API.

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

* Fix AEMET tests with v0.4.8

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-22 12:52:57 +01:00
Thomas55555
85be94e0a9 Add switch platform for husqvarna_automower (#110139)
* Add switch platform for husqvarna_automower

* Use RestrictedReasons const

* Typing

* Add snapshot testing

* Invert switch

* Test sucessfull servie calls

* Assert client mock calls

* Use getattr

* Update snapshot

* Add available property

* Add a new base class for control entities

* Make switch unavailabe if mower in error state

* Sort platforms

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-22 12:34:24 +01:00
dependabot[bot]
6fc4eea0e7 Bump dawidd6/action-download-artifact from 3.1.1 to 3.1.2 (#111120) 2024-02-22 11:50:45 +01:00
Federico D'Amico
6af7d7de41 Bump microBeesPy to 0.3.2 (#111067)
Bump microBeesPy 0.3.2
2024-02-22 11:34:48 +01:00
Åke Strandberg
c167001861 Add myuplink switch platform (#110810)
* Add switch platform

* Add mypulink switch platform

* Update tests according to review

* Address more review comments

* Adjust types

* More typing

* Fix typo

* Use constants in tests

* Revert constants

* Catch aiohttp.ClientError when API call fails

* Add test case for failed async_set_device_points call

* Test api failures for both toggle directions

* Use parametrize for testing switching
2024-02-22 11:27:46 +01:00
Joost Lekkerkerker
92c8c4b1ae Ignore cloudhook already removed in mobile app (#111122) 2024-02-22 11:19:27 +01:00
Brett Adams
767fcd707f Add wake up timeout to Teslemetry (#109037) 2024-02-22 10:50:44 +01:00
Michael
9348f99ce8 Bump roombapy to 1.6.12 (#110762)
* bump roombapy to 1.6.11

* Apply suggestions from code review

* "fix" tests (make them pydantic fiendly?)

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-22 10:39:53 +01:00
Joakim Sørensen
ec4e6c3a74 Move backup/* WS commands to the backup integration (#110651)
* Move backup/* WS commands to the backup integration

* Call correct command

* Use debug for logging

* Remove assertion of hass.data for setup test

* parametrize token fixture
2024-02-22 10:25:38 +01:00
ollo69
52621f9609 Remove reserved UpdateFailed exception in AsusWRT (#110910)
* Remove reserved UpdateFailed exception in AsusWRT

* Restore UpdateFailed exception in decorator
2024-02-22 09:53:40 +01:00
Thomas55555
6e91776d65 Add sensor platform for husqvarna_automower (#110410)
* Add sensor platform for husqvarna_automower

* Adress review comments

* Try to fix test

* Improve sensors

* Address review

* Adapt some values

* Add test

* Add test for cutting blade usage time

* Import TEST_MOWER_ID

* Use a parenthesis around the lambda and indent it so it's easier to distinguish the entity description parameters from the lambda
2024-02-22 09:26:38 +01:00
J. Nick Koston
e88dfd4f68 Migrate Bluetooth coordinators to use Debouncer async_schedule_call (#111077)
* Switch Bluetooth to use Debouncer async_schedule_call

If the debouncer does not fire the underlying call no task has to be
scheduled

* revert change in init

* revert change in init

* revert change in init
2024-02-21 22:03:22 -05:00
J. Nick Koston
5267e4f5db Fix race in otbr config flow (#111044)
* fix otbr

* Update homeassistant/components/otbr/config_flow.py

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

* unique ids should not change

* handle missing unique id

* handle missing unique id

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-02-21 22:02:44 -05:00
Robert Resch
345228429e Bump deebot-client to 5.2.2 (#111112) 2024-02-22 01:01:32 +02:00
David Knowles
424080f79f Bump pyschlage to 2024.2.0 (#111079) 2024-02-21 22:23:06 +01:00
Matthias Alphart
3028ad8ac2 KNX: Group address validators use more detailed error messages (#110875)
* GA validators use xknx exception message

* move validation functions to own module

* use type name
2024-02-21 22:09:27 +01:00
David F. Mulcahey
6bdb3357fa Remove ZHA storage file cleanup logic (#111088) 2024-02-21 22:02:41 +01:00
Álvaro Fernández Rojas
704230e3c1 Bump aioairzone to v0.7.4 (#111105)
* Update aioairzone to v0.7.3

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

* Update aioairzone to v0.7.4

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-21 22:00:09 +01:00
TimL
c8bf589384 Auto detect ZHA SMLIGHT SLZB-07 dongle (#110982) 2024-02-21 21:39:16 +01:00
Brett Adams
ff0ba5361f Add translation to Tessie exceptions (#106525)
* Fix HomeAssistantError

* Add error translations

* Add cable error

* remove underscore from fallback

* Add more exceptions

* Try again for name

* Improve messages

* Address review feedback
2024-02-21 20:58:38 +01:00
Jason Kossis
a5ab2dfb62 Add Vital 100S & Vital 200S to VeSync sensors (#111017) 2024-02-21 20:39:06 +01:00
Paul Bottein
0eef449526 Add icon translations to Tessie (#111096) 2024-02-21 19:49:04 +01:00
starkillerOG
ef02fca6ba Fix Motionblinds TDBU (#110871) 2024-02-21 19:47:02 +01:00
Shay Levy
53be4ebab5 Bump pywebpush to 1.14.1 (#111082) 2024-02-21 19:46:08 +01:00
J. Nick Koston
1de83140ab Avoid circular import in Storage.async_delay_save (#111086) 2024-02-21 12:45:59 -06:00
J. Nick Koston
d6fac87876 Avoid compressing application (tarfile) downloads from supervisor (#110224) 2024-02-21 12:45:47 -06:00
Christopher Bailey
a0b185d06d Fixes UniFi Protect light state check (#111058) 2024-02-21 19:45:32 +01:00
J. Nick Koston
7bf0fb9e48 Avoid late import of area registry in device registry if its not used (#111081) 2024-02-21 12:45:00 -06:00
Álvaro Fernández Rojas
395a452162 Update AEMET-OpenData to v0.4.9 (#111092)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-21 19:35:19 +01:00
Franck Nijhof
a906ae3647 Merge branch 'master' into dev 2024-02-21 16:58:45 +01:00
J. Nick Koston
ae7ebc25c7 Migrate shelly to use Debouncer.async_schedule_call (#111087) 2024-02-21 09:47:36 -06:00
Cyrill Raccaud
6e20cc8700 Support Bring! recently list (#109854)
* support bring recently list

* fix keyerror

---------

Co-authored-by: tr4nt0r <manni@zapto.de>
2024-02-21 07:27:59 -08:00
Andriy Kushnir
6f1cc7b3a4 Add code owner to roomba integration (#111071)
* Add Orhideous as code owner to roomba integration

* Update CODEOWNERS for roomba integration as well
2024-02-21 13:44:03 +01:00
J. Nick Koston
4bddf32cc4 Avoid the final write of every registry at the end of each test (#111053) 2024-02-21 06:01:19 -06:00
Åke Strandberg
2614d6fece Add tests to myuplink binary_sensor (#110995) 2024-02-21 12:32:25 +01:00
Jan Rothkegel
05b23c2e7b Replace Wolflink dependency with wolf_comm to support authentication via OpenID (#110249)
* Add OpenID authentication to wolflink integration

* Update wolf-comm to 0.0.2

* Upgrade wolf_comm to 0.0.3 + fix tests

* Version 0.0.4 of wolf_comm including LICENSE.txt

* Update requirements to wolf_comm 0.0.4

---------

Co-authored-by: Jan Rothkegel <jan.rothkegel@web.de>
2024-02-21 09:37:13 +01:00
J. Nick Koston
776a9b8691 Make device registry cleanup a callback function (#111052)
* Add async_schedule_call to the Debouncer

async_schedule_call allows the Debouncer to schedule a call
from a callback without having to create tasks to run
async_call

* Update homeassistant/helpers/debounce.py

* Make device registry cleanup all callback function

* fix typing, code supported callback functions, but typing did not

* fixes

* fixes

* fix

* we had no coverage for other job types

* we had no coverage for other job types
2024-02-21 09:34:49 +01:00
Jan Bouwhuis
c048b840fc Do not directly call async_setup_entry in MQTT tests (#111010) 2024-02-21 07:47:30 +01:00
J. Nick Koston
5b73adba20 Revert "Reduce dict lookups in entity registry indices" (#111055)
Revert "Reduce dict lookups in entity registry indices (#109712)"

This reverts commit 440212ddce.
2024-02-21 07:11:58 +01:00
J. Nick Koston
490c03d248 Add async_schedule_call to the Debouncer (#111051) 2024-02-21 00:09:45 -06:00
J. Nick Koston
aaa071e810 Increase unifiprotect fallback interval to 20s (#110870) 2024-02-20 23:48:41 -06:00
J. Nick Koston
b1cbf9840a Make adding new device in unifiprotect callback functions (#111054) 2024-02-20 23:47:31 -06:00
Christopher Bailey
7eb6614818 Guide users to migrate from Ubiquiti Cloud Accounts to local for UniFi Protect (#111018)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-20 23:32:47 -06:00
Christopher Bailey
fb04df5392 Improve UniFi Protect re-auth (#110021)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-20 23:31:42 -06:00
J. Nick Koston
da9d71cb6b Fix race in automation test_extraction_functions (#111056) 2024-02-20 23:25:19 -06:00
J. Nick Koston
1a02330bd9 Avoid creating tasks to remove entities (#110967) 2024-02-20 21:32:36 -06:00
Josef Zweck
db77e73a76 Add calendar platform to La Marzocco (#108237)
* add calendar

* rename function

* remove device from test

* requested changes

* extend range

* fix async_get_events

* catch and test edge cases

* remove commented code

* rebase snapshot
2024-02-20 19:15:47 -08:00
Shay Levy
c690a9df83 Fix Shelly RPC RSSI sensor removal (#111035) 2024-02-20 21:05:59 -06:00
J. Nick Koston
2f2cdedddd Avoid creating multiple tasks for config entry init (#110899) 2024-02-20 21:57:36 -05:00
J. Nick Koston
9ce1ec414e Reduce overhead to load multiple languages in translations (#111028)
* Reduce overhead to load multiple languages in translations

Instead of loading in a task, we now group everything
to be loaded into a single executor job

* fixes

* fixes

* fixes

* fixes

* fixes

* update tests

* add missing coverage (was existing)
2024-02-20 21:52:28 -05:00
J. Nick Koston
9c145b5faa Fix race in removing entities from the registry (#110978) 2024-02-20 20:48:31 -06:00
J. Nick Koston
94e372a345 Make ConfigEntry.async_shutdown a callback (#111027)
Nothing needed to be awaited here and this generated a task per config
entry at shutdown
2024-02-20 21:38:24 -05:00
J. Nick Koston
17ba96ffdb Avoid creating tasks to install dependent requirements (#111048) 2024-02-20 20:30:07 -06:00
J. Nick Koston
dc4008c518 Avoid creating tasks to shutdown entity platforms (#111026)
* Avoid creating tasks to shutdown entity platforms

Nothing needed to be awaited here

* fix mocking

* missed one test
2024-02-20 21:10:25 -05:00
J. Nick Koston
98d5f2fc01 Reduce registry overhead in tests (#110955)
* Avoid scheduling registry loads as tasks in tests

Since we patch out async_load in Store, these will not yield
to the event loop so it makes sense to await them instead
of creating tasks

This reduced my local test run times ~2.5% on average

* mock out save as well so we do not schedule tasks to save empty data

* tweaks

* fix lingering files

* another one

* too much for one PR, reduce

* fix targets
2024-02-20 21:01:50 -05:00
some-guy-23
a542b36997 Add state class to Motion Blinds battery sensor (#111016) 2024-02-20 23:45:37 +01:00
G Johansson
32a6662d1d Bump holidays to 0.43 (#111039) 2024-02-20 23:37:17 +01:00
J. Nick Koston
145c6163a4 Fix race in gardena_bluetooth config flow tests (#111042) 2024-02-20 16:08:06 -06:00
Brett Adams
5b00703ef7 Add presets to Advantage Air (#109485)
* Add presets

* Make hvac_modes dynamic

* Add supported features

* Fix set preset mode

* Add coverage

* Remove unused constants

* Remove the extra newline

* Add snapshot assertion to new test

* Add comments

* Use ServiceValidationError

* Test for ServiceValidationError

* Fix typo

* Refactor to use _handle_coordinator_update

* Remove preset_mode prop

* Apply suggestions from code review

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

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-20 22:00:52 +01:00
J. Nick Koston
9f8e4cecdd Remove update_before_add from legacy ios integration (#111033) 2024-02-20 21:26:24 +01:00
J. Nick Koston
8e9946afc9 Remove update_before_add from nut sensors (#111032) 2024-02-20 21:12:06 +01:00
Michael
f295382c92 Reset error state when Ecovacs bot is operational again (#110962) 2024-02-20 17:15:55 +01:00
Jeremy TRUFIER
86ea5c135f Bump pyOverkiz to 1.13.7 (#111004) 2024-02-20 15:42:29 +01:00
Marco Lettieri
cd05972276 Add sensor platform to microBees (#111008)
* add microBees sensor

* add a sensor.py in .coveragerc

* fixes review

---------

Co-authored-by: FedDam <noceracity@gmail.com>
2024-02-20 15:32:19 +01:00
J. Nick Koston
ad94534d37 Migrate sensibo to use async_update_reload_and_abort (#110986) 2024-02-20 14:41:14 +01:00
Mick Vleeshouwer
6471397d09 Fix reauth in Overkiz for config entries created prior to 2022.12 (#106251)
* Fix #106204

* Use api type variable
2024-02-20 14:15:16 +01:00
Federico D'Amico
93d6f0a780 Bump microBeesPy to 0.2.9 (#111006)
change library
2024-02-20 13:39:14 +01:00
Thomas55555
e6cfa7fa09 Bump aioautomower to 2024.2.7 (#110991)
bump aioautomower to 2024.2.7

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2024-02-20 12:04:42 +01:00
Federico D'Amico
ac926f9c64 Introduce actuator base entity to microBees (#111000)
* changed library imports and added sensors to coordinator and new entity

* revert library

* revert library
2024-02-20 11:55:36 +01:00
Simon Goodall
5b470ff16f Expose Hive Motion Sensor temperature (#105985) 2024-02-20 10:57:19 +01:00
J. Nick Koston
6ed221de5d Handle empty name in powerview config flow (#110969)
fixes

```
2024-02-19 13:51:58.128 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved:   File "/Users/bdraco/home-assistant/venv/bin/hass", line 8, in <module>
    sys.exit(main())
  File "/Users/bdraco/home-assistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/Users/bdraco/home-assistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 673, in run_until_complete
    self.run_forever()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 640, in run_forever
    self._run_once()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 1965, in _run_once
    handle._run()
  File "/opt/homebrew/Cellar/python@3.12/3.12.1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/events.py", line 84, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 610, in async_add_entities
    await add_func(coros, entities, timeout)
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 561, in _async_add_entities
    await coro
  File "/Users/bdraco/home-assistant/homeassistant/helpers/entity_platform.py", line 652, in _async_add_entity
    entity.add_to_platform_start(
  File "/Users/bdraco/home-assistant/homeassistant/components/device_tracker/config_entry.py", line 356, in add_to_platform_start
    _async_connected_device_registered(
  File "/Users/bdraco/home-assistant/homeassistant/components/device_tracker/config_entry.py", line 94, in _async_connected_device_registered
    async_dispatcher_send(
  File "/Users/bdraco/home-assistant/homeassistant/helpers/dispatcher.py", line 227, in async_dispatcher_send
    hass.async_run_hass_job(job, *args)
  File "/Users/bdraco/home-assistant/homeassistant/core.py", line 701, in async_run_hass_job
    hassjob.target(*args)
  File "/Users/bdraco/home-assistant/homeassistant/util/logging.py", line 133, in _callback_wrapper
    func(*args)
  File "/Users/bdraco/home-assistant/homeassistant/components/dhcp/__init__.py", line 392, in _async_process_device_data
    self.async_process_client(ip_address, hostname, mac_address)
  File "/Users/bdraco/home-assistant/homeassistant/components/dhcp/__init__.py", line 268, in async_process_client
    discovery_flow.async_create_flow(
  File "/Users/bdraco/home-assistant/homeassistant/helpers/discovery_flow.py", line 32, in async_create_flow
    hass.async_create_task(init_coro, f"discovery flow {domain} {context}")
  File "/Users/bdraco/home-assistant/homeassistant/core.py", line 634, in async_create_task
    task = self.loop.create_task(target, name=name)
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1017, in async_init
    flow, result = await self._async_init(flow_id, handler, context, data)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/config_entries.py", line 1047, in _async_init
    result = await self._async_handle_step(flow, flow.init_step, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 501, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/components/hunterdouglas_powerview/config_flow.py", line 127, in async_step_dhcp
    return await self.async_step_discovery_confirm()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/bdraco/home-assistant/homeassistant/components/hunterdouglas_powerview/config_flow.py", line 152, in async_step_discovery_confirm
    assert self.discovered_ip and self.discovered_name
AssertionError
```
2024-02-20 10:41:38 +01:00
Robert Svensson
2f026ca963 Unifi rename controller to hub (#110976)
* Rename controller.py to hub.py

* Rename UniFiController to UnifiHub

* Rename controller instances into hub

* Rename controller to hub in tests

* Rename aiounifi Controller references to api

* Update strings

* Rename test_controller test_hub

* Narrow scope of test_remove_sensors
2024-02-20 08:51:22 +01:00
Mr. Bubbles
2b3f5319d6 Bump bring-api to 0.3.1 (#110769)
* bump bring-api

* unpinned dependencies
2024-02-20 08:46:02 +01:00
J. Nick Koston
54d005a3b8 Migrate xiaomi_miio to use async_update_reload_and_abort (#110988) 2024-02-20 07:08:21 +01:00
J. Nick Koston
8927769545 Migrate unifi to use async_update_reload_and_abort (#110987) 2024-02-20 07:07:55 +01:00
J. Nick Koston
059e1fbe37 Migrate yalexs_ble to use async_update_reload_and_abort (#110985) 2024-02-20 07:07:21 +01:00
Keilin Bickar
70542efc23 Fix last_reset set for Sense percentage sensors (#110977) 2024-02-19 21:45:09 -06:00
Michael Hansen
ec4bd9a421 Add new intents for cover, valve, vacuum, and media player (#110757)
* Add valve to HassTurnOn/Off

* Add set position for valves

* Add set position to covers

* Add HassTurnOn/Off for vacuums

* Add media player intents

* Split out vacuum intents

* Address comments

* Extra test
2024-02-19 22:28:42 -05:00
J. Nick Koston
015f9cdb35 Fix failing tessie tests (#110980) 2024-02-19 20:45:07 -06:00
Åke Strandberg
230ac417c0 Add check for myuplink startup ClientError (#110926)
* Raise ConfigEntryNotReady if appropriate

* Catchin exceptions during startup

* Change expected_state to SETUP_ERROR
2024-02-20 02:17:35 +01:00
J. Nick Koston
ae49b3a274 Add async_schedule_reload helper to the ConfigEntries manager (#110912)
* Add async_schedule_reload helper to the ConfigEntries manager

We have cases where the the setup retry kicks in right before
the reload happens causing the reload to fail with
OperationNotAllowed. The async_schedule_reload will
cancel the setup retry before the async_reload task
is created to avoid this problem.

I updated a few integrations that were most likely
to have this problem. Future PRs will do a more
extensive audit

* coverage

* revert for now since this needs more refactoring in a followup

* cover

* cleanup and fixes
2024-02-20 02:14:45 +01:00
starkillerOG
9361f3c443 Bump motionblinds to 0.6.21 (#110970) 2024-02-19 23:33:02 +01:00
Brett Adams
61766c0e59 Fix set_temperature in Tessie climate platform (#110445)
* HVAC_MODE support for set_temperature

* Fix import
2024-02-19 21:52:59 +01:00
Brett Adams
980413c57f Add new range sensors to Tessie (#110446)
* Add new sensors

* Fix tests
2024-02-19 21:50:20 +01:00
J. Nick Koston
b35490404a Make EntityRegistryDisabledHandler._handle_entry_updated a callback (#110966) 2024-02-19 14:44:57 -06:00
starkillerOG
e83c7c8770 Bump reolink-aio to 0.8.8 (#110959) 2024-02-19 21:35:41 +01:00
J. Nick Koston
1f1c66b3c2 Group adding unifi entities together to reduce number of tasks (#110965) 2024-02-19 13:58:44 -06:00
starkillerOG
aa9f0f5734 Reolink continue setup when internet blocked (#110888) 2024-02-19 20:53:18 +01:00
Oliver
3e5329d463 Do not turn on denonavr receiver when changing the source (#110964) 2024-02-19 20:33:48 +01:00
Jan Bouwhuis
f4fd3633b4 Improve timing mqtt integration discovery test (#110960)
* Improve timing mqtt integration discovery test

* Remove condition
2024-02-19 20:16:06 +01:00
J. Nick Koston
1bc0263ea4 Revert powerwall back to awaiting each api call (#110947)
We converted these to run as tasks in the hope that it would be faster,
but since the cost of establishing another connection and the task
overhead exceeded the savings, it makes sense to await them all in
series.
2024-02-19 20:13:49 +01:00
Martin Hjelmare
058eec114b Freeze light profiles for further development (#110946) 2024-02-19 16:02:27 +01:00
Marco Lettieri
3a4c6fc7f3 Add microBees integration (#99573)
* Create a new homeassistan integration for microBees

* black --fast homeassistant tests

* Switch platform

* rename folder

* rename folder

* Update owners

* aiohttp removed in favor of hass

* Update config_flow.py

* Update __init__.py

* Update const.py

* Update manifest.json

* Update string.json

* Update servicesMicrobees.py

* Update switch.py

* Update __init__.py

* Update it.json

* Create a new homeassistan integration for microBees

* black --fast homeassistant tests

* Switch platform

* rename folder

* rename folder

* Update owners

* aiohttp removed in favor of hass

* Update config_flow.py

* Update __init__.py

* Update const.py

* Update manifest.json

* Update string.json

* Update servicesMicrobees.py

* Update switch.py

* Update __init__.py

* Update it.json

* fixes review

* fixes review

* fixes review

* pyproject.toml

* Update package_constraints.txt

* fixes review

* bug fixes

* bug fixes

* delete microbees connector

* add other productID in switch

* added coordinator and enanchments

* added coordinator and enanchments

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* fixes from suggestions

* add test

* add test

* add test

* add test

* requested commit

* requested commit

* requested commit

* requested commit

* reverting .strict-typing and added microbees to .coveragerc

* remove log

* remove log

* remove log

* remove log

* add test for microbeesExeption and Exeption

* add test for microbeesExeption and Exeption

* add test for microbeesException and Exception

* add test for microbeesException and Exception

* add test for microbeesException and Exception

---------

Co-authored-by: FedDam <noceracity@gmail.com>
Co-authored-by: Federico D'Amico <48856240+FedDam@users.noreply.github.com>
2024-02-19 15:12:03 +01:00
J. Nick Koston
b349a466ba Fix concurrent reloads in yeelight tests (#110911) 2024-02-19 07:37:22 -06:00
Jevgeni Kiski
2250baab21 Update vallox_websocket_api to 5.0.2 (#110752)
Co-authored-by: Sebastian Lövdahl <slovdahl@hibox.fi>
2024-02-19 14:36:51 +01:00
starkillerOG
efac3b0a60 Add Motionblinds vitual integrations __init__.py (#110903) 2024-02-19 12:36:56 +01:00
dependabot[bot]
0c39b465b3 Bump dawidd6/action-download-artifact from 3.1.0 to 3.1.1 (#110925) 2024-02-19 12:29:09 +01:00
Franck Nijhof
e0a9dcd996 Add label registry (#110821) 2024-02-19 11:59:08 +01:00
ruohan.chen
8201ea4b3c Bump zhong-hong-hvac to 1.0.12 (#110701)
zhong_hong_hvac requirements upgrade to 1.0.12
2024-02-19 10:58:03 +01:00
Dominik Sander
8e78710f84 Bump deluge-client to 1.10.2 (#110905)
This mainly addresses the client hanging and not reconnecting whenever
the deluge server is restarted. See https://github.com/JohnDoee/deluge-client/pull/42

https://github.com/JohnDoee/deluge-client/compare/1.10.0...1.10.2
2024-02-19 10:49:57 +01:00
Kevin Stillhammer
03e8482aa9 Fix BroadlinkThermostat inheritance order (#110927)
fix BroadlinkThermostat inheritance order
2024-02-19 10:44:45 +01:00
J. Nick Koston
fd1f712d67 Bump esphome dependencies (#110892) 2024-02-19 10:38:28 +01:00
J. Nick Koston
136a31e4bc Avoid creating tasks to run homekit accessories (#110895) 2024-02-19 10:36:54 +01:00
J. Nick Koston
4bc28489c5 Improve performance of waiting for after dependencies and device config entries (#110902)
To wait for after dependencies we created a task to wait an asyncio.Event object,
instead of using an Event we can use an asyncio.Future instead and avoid the need
for a task wrapper
2024-02-19 10:28:50 +01:00
Marc Mueller
a21d65d025 Fix cloud test RuntimeWarning (#110909) 2024-02-19 10:09:59 +01:00
J. Nick Koston
764e628394 Add missing async_block_till_done to github config flow tests (#110913) 2024-02-19 09:58:57 +01:00
J. Nick Koston
6fc764330f Fix steamist not setting unique id when discovered in user flow (#110915) 2024-02-19 09:58:32 +01:00
J. Nick Koston
a2bd59ab3b Fix switcher_kis tests not holding patch while calling async_block_till_done (#110916) 2024-02-19 09:58:09 +01:00
J. Nick Koston
c74958dd36 Reduce one iteration of pending flows in the discovery flow helper (#110918) 2024-02-19 09:57:39 +01:00
J. Nick Koston
19cf80d5c5 Fix homekit_controller test race (#110917) 2024-02-19 08:42:17 +00:00
wilburCforce
88f72009c6 Fix uuid issue in Lutron (#110524) 2024-02-19 09:30:58 +01:00
Chris Caron
31ce43212a Allow loading of more then 1 defined Apprise URL (#110868) 2024-02-19 09:29:26 +01:00
J. Nick Koston
88b92ff2a8 Narrow bosch_shc patch target in config flow tests (#110922) 2024-02-19 09:24:44 +01:00
Marc Mueller
02eca17002 Update wheels artifact actions to v4 [ci] (#110894) 2024-02-19 09:23:51 +01:00
J. Nick Koston
b35d7a348b Fix mqtt discovery subscribe unsubscribe test with one less task (#110914)
This test currently relies on event loop overhead and since #110899
will remove another task in the config entry init flow, it needs
another async_block_till_done. In the future it should be refactored
to have better synchronization without having to rely on iterations
of the event loop.
2024-02-19 07:36:32 +01:00
Marc Mueller
795d90eb1b Update pre-commit to 3.6.2 (#110908) 2024-02-18 19:37:05 -06:00
J. Nick Koston
aab21105da Convert config entry subscriptions to callback (#110900) 2024-02-18 19:36:53 -06:00
Marc Mueller
af6b24d9bd Update pytest to 8.0.1 (#110907) 2024-02-19 01:52:40 +01:00
Marc Mueller
85864e77ac Partially revert setup typing update (#110901) 2024-02-19 00:36:47 +01:00
Lenn
3275b28e2a Fix Motionblinds brand name consistency (#110222) 2024-02-19 00:04:57 +01:00
Jan-Philipp Benecke
22e62f42e6 Use entity & device registry fixtures in unifi tests (#110889) 2024-02-18 23:47:10 +01:00
Marc Mueller
72ccc40c43 Add better HassJob typing for IntegrationPlatform process_job (#110896) 2024-02-18 16:46:48 -06:00
Álvaro Fernández Rojas
49e9c9dd48 Update AEMET-OpenData to v0.4.8 (#110890)
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-02-18 23:33:06 +02:00
spycle
503af70985 Bump pyMicrobot to 0.0.16 (#110876)
* Update manifest.json

Up-version pyMicrobot

* Update requirements_all.txt

Up-version pyMicrobot

* Update requirements_test_all.txt

Up-version pyMicrobot
2024-02-18 23:32:01 +02:00
J. Nick Koston
314123e0ab Avoid creating two tasks to setup components at startup (#110828) 2024-02-18 14:17:41 -06:00
Jan-Philipp Benecke
85587f995b Use entity registry fixture in octoprint tests (#110887) 2024-02-18 20:55:12 +01:00
Paul Daumlechner
b358a03379 Fix Velux setup (#110886)
fix async_setup without configuration.yaml entry
2024-02-18 20:39:02 +01:00
J. Nick Koston
fdd45189ca Fix trigger attachment race in conversation tests (#110869) 2024-02-18 20:13:41 +01:00
Marc Mueller
f785bdf571 Update coverage artifact actions to v4 [ci] (#110344) 2024-02-18 20:13:20 +01:00
J. Nick Koston
93d56cc105 Enable compression on error log api (#110865) 2024-02-18 20:12:30 +01:00
J. Nick Koston
3633700d97 Fix sending multiple empty integration timing in bootstrap (#110872) 2024-02-18 19:53:05 +01:00
On Freund
e879ab0eef Show WebRTC cameras that also support HLS in the media browser (#108796)
* Show WebRTC cameras in the media browser

* Only show webrtc cameras with source in the browser

* Address code review

* Refactor BrowseMediaSource creation

* Refactor

* Address code review
2024-02-18 10:12:08 -08:00
Jc2k
8fa347fb4c Add Identify device class to homekit_controller (#110878) 2024-02-18 12:05:19 -06:00
Galorhallen
7d3755715f Update govee-local-api library to 1.4.4 (#110854) 2024-02-18 18:04:37 +01:00
J. Nick Koston
bd4f8e0cc0 Fix races in ESPHome manager tests (#110867) 2024-02-18 17:06:57 +01:00
Jan Bouwhuis
addc02fa86 Revert "Set up smtp integration via the UI" (#110862)
Revert "Set up smtp integration via the UI (#110817)"

This reverts commit 66a31407f9.
2024-02-18 16:21:27 +01:00
Franck Nijhof
67ac60d042 Add hex color validator (#110846) 2024-02-18 16:03:21 +01:00
Franck Nijhof
70d1bbb20d Improve floor registry event typing (#110844) 2024-02-18 14:57:15 +01:00
Franck Nijhof
1c55ba0cb2 Use covariant for fire event data type (#110843) 2024-02-18 13:21:55 +01:00
Jan Bouwhuis
66a31407f9 Set up smtp integration via the UI (#110817)
* Set up smtp integration via the UI

* Update homeassistant/components/smtp/config_flow.py

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>

* Update homeassistant/components/smtp/notify.py

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

* Update homeassistant/components/smtp/notify.py

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

* Update homeassistant/components/smtp/notify.py

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

* Update homeassistant/components/smtp/notify.py

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

* ruff

---------

Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Jan-Philipp Benecke <jan-philipp@bnck.me>
2024-02-18 13:20:45 +01:00
Joost Lekkerkerker
e2ab44903c Clean up twitch setup (#110849)
* Clean up twitch setup

* Clean up twitch setup
2024-02-18 13:16:22 +01:00
Allen Porter
babb436512 Fix local todo list persistence for due dates (#110830)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-18 12:59:50 +01:00
Jan-Philipp Benecke
9ac199a8f2 Bump aiotankerkoenig to 0.4.1 (#110840) 2024-02-18 11:58:33 +01:00
J. Nick Koston
16653ff5d0 Group loading of translations for integrations to reduce executor jobs at startup (#110674) 2024-02-17 21:08:55 -06:00
J. Nick Koston
def6c5c21c Refactor integration startup time tracking to reduce overhead (#110136)
* Refactor integration startup time tracking to reduce overhead

- Use monotonic time for watching integration startup time as it avoids incorrect values if time moves backwards because of ntp during startup and reduces many time conversions since we want durations in seconds and not local time

- Use loop scheduling instead of a task

- Moves all the dispatcher logic into the new _WatchPendingSetups

* websocket as well

* tweaks

* simplify logic

* preserve logic

* preserve logic

* lint

* adjust
2024-02-17 21:47:55 -05:00
J. Nick Koston
9bc130c131 Ensure translations for other integrations can be loaded if one integration fails (#110748)
* load failure

* merge
2024-02-17 21:01:36 -05:00
J. Nick Koston
0a01161cdd Cache JSON representation of ConfigEntry objects (#110823)
* Cache JSON representation of ConfigEntry objects

* fix recursive set

* tweak

* adjust

* order
2024-02-17 20:52:39 -05:00
J. Nick Koston
0d4c82b54d Convert Integration platforms processors where nothing is awaited to callbacks (#110825)
Convert Integration platforms processors where nothing is awaited callbacks
2024-02-17 20:49:47 -05:00
J. Nick Koston
165d79b553 Add typing of EVENT_COMPONENT_LOADED to integration_platform helper (#110826) 2024-02-17 20:48:46 -05:00
Aarni Koskela
5d23a1f84f Enable augmented-assignment operations in scripts (#108081) 2024-02-17 20:32:23 -05:00
J. Nick Koston
33ff6b5b6e Avoid creating tasks for checking integrations platforms (#110795)
* Avoid creating tasks for checking integrations platforms

This is a followup to #110743 to avoid creating a task to check
if the integration platform exists. We created tasks because
we needed to await async_get_integrations but since its always
called from EVENT_COMPONENT_LOADED firing, we can use the
async_get_loaded_integration version which does not need
to be awaited. This eliminates one task for every loaded
component

* there is no more race risk

* reduce

* coro or callback

* reduce

* tweak

* race safe

* fix type

* fixes

* use built-in helper to make it smaller

* use built-in helper to make it smaller

* use built-in helper to make it smaller

* add coverage to ensure exceptions are logged

* improve readability a bit

* platforms
2024-02-18 01:07:18 +01:00
Cody C
a656e14b20 Fix Local Calendar changing user-specified capitalisation of calendar names (#108454)
When you create a Local Calendar, say, "Home Maintenance", the integration overrides this to instead be "Home maintenance".
2024-02-17 16:03:13 -08:00
J. Nick Koston
0d6f4058ca Add typing for EVENT_COMPONENT_LOADED (#110812) 2024-02-17 23:03:52 +01:00
Allen Porter
bf1b5252c0 Bump ical to 7.0.0 (#110811) 2024-02-17 22:58:59 +01:00
Allen Porter
80abe7bfff Bump pyrainbird to 4.0.2 (#110814) 2024-02-17 22:56:09 +01:00
Joost Lekkerkerker
1417428880 Remove unneeded mock from Epion (#110815) 2024-02-17 22:53:38 +01:00
Franck Nijhof
4570eed6f6 Add floor registry (#110741)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-17 21:21:15 +01:00
Claudio Ruggeri - CR-Tech
1ded412061 Add modbus option to manage different setPoint registers (#107600)
Co-authored-by: jan iversen <jancasacondor@gmail.com>
2024-02-17 19:48:42 +01:00
J. Nick Koston
53944235d2 Improve performance of async_get_integration_with_requirements (#110770)
* Improve performance of async_get_integration_with_requirements

- Migrate to the future pattern instead of using asyncio.Event
- Use sets in a few places to avoid linear searching
- Check the cache when processing deps so we do not
  create tasks to process requirements for deps that
  have already been processed

* name

* add concurrency test

* Update homeassistant/requirements.py

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

* Update homeassistant/requirements.py

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

* Update homeassistant/requirements.py

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

* Update homeassistant/requirements.py

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

* reset_mock

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-17 19:26:41 +01:00
Franck Nijhof
aa8d8402b4 Cleanups in entity registry tests (#110788)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-17 19:07:46 +01:00
Sid
926a634ebf Handle deep standby and poweroffs of enigma2 devices gracefully (#107462)
* handle deep standby and poweroff of enigma2 devices gracefully

* address review comments

* remove warning on deep standby

* use contextlib.suppress
2024-02-17 18:23:29 +01:00
J. Nick Koston
664285b9d4 Small performance improvement in tracking template results (#110622)
- Avoid inner function creation each refresh
- remove extra unneeded checks from ratelimit
2024-02-17 18:08:24 +01:00
J. Nick Koston
094fd3d918 Simplify ConfigFlow._async_current_entries (#110799)
async_entries supports the flags needed for this function so we
can now hand it off instead
2024-02-17 18:04:27 +01:00
J. Nick Koston
b8143a7944 Improve performance of _async_when_setup (#110791)
* Improve performance of _async_when_setup

Use an event filter to avoid creating a task until the
filter matches

* Improve performance of _async_when_setup

Use an event filter to avoid creating a task until the
filter matches
2024-02-17 17:46:06 +01:00
J. Nick Koston
c4653be2fa Make template trigger callbacks when nothing needs to be awaited (#110771)
async_initialize_triggers supports a coro or a callback, and in most
cases the user will not have configured a script so we can avoid
creating a task
2024-02-17 17:37:46 +01:00
Arie Catsman
a4150fe8b2 Enable Enphase Envoy authentication credentials update (#110474) 2024-02-17 09:58:25 -06:00
kingy444
6e2f64fdc2 Add number platform to powerview to control velocity on gen 3 hubs (#110724)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-17 09:52:13 -06:00
Aidan Timson
4aafe14d4c Fix translations for binary sensors in System Bridge (#110095)
* Add translation keys for binary sensor names

* Update version_available string in system_bridge component

* Remove unused code in SystemBridgeBinarySensor class

* Restrict SystemBridgeBinarySensorEntityDescription name type to str

* Refactor binary sensor entity descriptions and remove unused translation keys
2024-02-17 16:10:29 +01:00
Aaron Bach
258f8bfed0 Ensure Tile timestamps are reported as UTC (#110773) 2024-02-17 07:43:28 -07:00
Shay Levy
833c0ee723 Cleanup Shelly async_setup_block_attribute_entities (#110792) 2024-02-17 08:29:35 -06:00
Franck Nijhof
0fbadc274a Cleanups in device registry tests (#110786) 2024-02-17 14:06:53 +01:00
J. Nick Koston
42cf081582 Avoid creating tasks to load integration platforms that do not exist (#110743) 2024-02-17 07:02:51 -06:00
Franck Nijhof
df3556f0d8 Cleanups in area registry tests (#110785)
* Cleanups in area registry tests

* Adjust typing
2024-02-17 13:20:33 +01:00
Chris Talkington
3491dd68b5 Update rokuecp to 0.19.1 (#110670) 2024-02-17 13:01:47 +01:00
J. Nick Koston
9b1ba19354 Bump aioesphomeapi to 21.0.3 (#110772) 2024-02-17 11:09:10 +01:00
J. Nick Koston
0bf95df4d6 Avoid creating tasks to setup ignored and disabled config entries (#110756)
* Avoid creating tasks to setup ignored and disabled config entries

* lint
2024-02-17 10:34:03 +01:00
Åke Strandberg
f5dad1d312 Add myuplink reauth flow (#110587)
* WIP test

* WIP

* WIP Reauth flow. Test fail otherways OK.

* Minor adjustments to tests

* Merge

* Merge

* Next level...

* Cleanup according to review

* It works!

* Simplify setup

* Remove default

* Remove files from PR

* Add back test_init

* Add back test_sensor

* Adjust error message

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-17 10:18:53 +01:00
J. Nick Koston
d99a7e2825 Fix race in wyoming test (#110766)
reverts #110751 and replaces it with a change to wait for the
assist_pipeline.async_pipeline_from_audio_stream to be called
which will actually solve the problem and unblock #110743
2024-02-17 08:24:21 +01:00
Michael
aa5695a859 Bump aiopegelonline to 0.0.9 (#110760)
bump aiopegelonline to 0.0.9
2024-02-17 01:12:53 +01:00
J. Nick Koston
50770ce436 Refactor config integration to use normal functions for setup (#110750)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-16 18:12:33 -06:00
Malte Franken
d7f650ed7c Bump georss-ign-sismologia-client to 0.8 (#110501)
* bump georss-ign-sismologia-client to 0.8

* fixed tests
2024-02-17 00:52:58 +02:00
Kanchana M
bc5ec4f2a3 Fix flo sensor native unit (#110745)
* use flow rate unit enums for proper unit conversions

* update typo for device class
2024-02-16 23:18:27 +01:00
J. Nick Koston
5adb9240c5 Wait for client to be created in wyoming tests (#110751)
* Add missing async_block_till_done in wyoming tests

* better fix

* better fix

* better fix

* better fix
2024-02-16 22:48:47 +01:00
Michael
58a6f26f66 Fix scene activation with climate entities with None attribute values (#110684)
don't call service with attribute None
2024-02-16 22:27:55 +01:00
J. Nick Koston
5292c3408e Bump cryptography to 42.0.3 (#110728) 2024-02-16 20:37:40 +01:00
Franck Nijhof
788b53534f Run codeql on schedule only (#110729) 2024-02-16 19:32:36 +01:00
J. Nick Koston
2cb0249f0a Add filter to translation event listeners to avoid creating tasks (#110732) 2024-02-16 12:13:23 -06:00
jimmyd-be
6f74ea9186 Add breeze switch to Renson integration (#101641)
* Add breeze switch

* Cleanup code

* Replace switch entity with new fan entity

* Revert "Replace switch entity with new fan entity"

This reverts commit 4fc1ac22e67091a7e980aefd217652f2a88bed17.
2024-02-16 17:56:09 +01:00
J. Nick Koston
d449eadac3 Guard ConfigEntry from being mutated externally without using the built-in interfaces (#110023)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-16 10:15:05 -06:00
J. Nick Koston
4c11371898 Adjust ConfigEntry.async_setup comments to be more clear (#110726) 2024-02-16 10:13:35 -06:00
Franck Nijhof
ef9f117baa Stop building Python 3.11 wheels (#110727) 2024-02-16 17:11:05 +01:00
J. Nick Koston
53062a81cc Simplify loading of icons (#110687) 2024-02-16 16:51:14 +01:00
Erik Montnemery
a0ead2b861 Remove hourly weather entity from met.no (#97023) 2024-02-16 16:46:37 +01:00
J. Nick Koston
1260c5a909 Speed up bootstrap by preloading manifests for base platforms (#110130) 2024-02-16 09:35:46 -06:00
Jan-Philipp Benecke
80b404f351 Raise translatable exceptions in entity set methods for BSBLan (#105693)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-16 16:23:47 +01:00
Artur Pragacz
3392660537 Add toggle service to climate (#100418)
* Add toggle service to climate

* Fix mqtt test

* Add comments

* Fix rebase

* Remove not needed properties

* Fix toggle service

* Fix test

* Test

* Mod mqtt test

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2024-02-16 15:53:48 +01:00
G Johansson
cb776593cf Make context in data entry flow possible to modify for subclasses (#110561)
* Make context in data entry flow possible to modify for subclasses

* mypy

* Make get_context

* base view

* Review comments

* Remove context from options flow
2024-02-16 15:51:51 +01:00
Joakim Sørensen
23e81a45c8 Use snapshots in analytics tests (#110704) 2024-02-16 15:47:41 +01:00
Franck Nijhof
7aa14e20d1 2024.2.2 (#110720) 2024-02-16 15:47:38 +01:00
Denis Shulyaka
2d74dafd3f Generic Hygrostat: Do not log warning if the hygrostat is already not active (#102662)
* Generic Hygrostat: Do not log warning if the hygrostat is already not active

* add test
2024-02-16 15:29:14 +01:00
Imre Liessens
085f75ef1f Add media file playback to DuneHD (#105796)
* Add media player play file option

* Add media playback from HA

* Remove volume capability

* Add missing imports

* Apply suggestions from code review

* Update homeassistant/components/dunehd/media_player.py

* Apply suggestions from code review

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-16 15:20:09 +01:00
J. Nick Koston
f9dc92a9a0 Fix recorder ws_info blocking the event loop (#110657)
* Fix recorder ws_info blocking the event loop

Fixes
```
2024-02-15 06:37:55.423 WARNING (MainThread) [asyncio] Executing <Task pending name=websocket_api.async:ws_info coro=<_handle_async_response() running at /usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py:26> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()] created at /usr/local/lib/python3.12/asyncio/tasks.py:712> cb=[set.remove()] created at /usr/src/homeassistant/homeassistant/core.py:653> took 0.332 seconds
```

* no instance did not actually work
2024-02-16 15:11:09 +01:00
J. Nick Koston
95015fbb40 Small performance improvement to async_get_config_flows (#110666)
- Migrates to using a future instead of Event like we have done
  everywhere else
2024-02-16 14:32:26 +01:00
IceBotYT
35149a46fc Bump linear-garage-door to 0.2.9 (#110298) 2024-02-16 13:56:25 +01:00
dependabot[bot]
1f1042c034 Bump dawidd6/action-download-artifact from 3.0.0 to 3.1.0 (#110699)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-16 13:40:03 +01:00
Steven Barth
5d0d3a5c2b Remove matplotlib pinning due to Python 3.12 incompatibility (#110706) 2024-02-16 12:33:57 +01:00
J. Nick Koston
da55ef7901 Fix elkm1 service calls running in the executor (#110655)
fixes
```
  File "/usr/src/homeassistant/homeassistant/components/elkm1/__init__.py", line 416, in _set_time_service
    _getelk(service).panel.set_time(dt_util.now())
  File "/usr/local/lib/python3.11/site-packages/elkm1_lib/panel.py", line 55, in set_time
    self._connection.send(rw_encode(datetime))
  File "/usr/local/lib/python3.11/site-packages/elkm1_lib/connection.py", line 152, in send
    self._send(QueuedWrite(msg.message, msg.response_command), priority_send)
  File "/usr/local/lib/python3.11/site-packages/elkm1_lib/connection.py", line 148, in _send
    self._check_write_queue.set()
  File "/usr/local/lib/python3.11/asyncio/locks.py", line 192, in set
    fut.set_result(True)
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 763, in call_soon
    self._check_thread()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 800, in _check_thread
    raise RuntimeError(
RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one
```
2024-02-16 12:27:13 +01:00
J. Nick Koston
66f189ef26 Small performance improvements to collecting analytics (#110662)
- Use async_entity_ids_count instead of async_all

I also tried to make the code wrap a bit less but
I didn't want to refactor it to much in this PR

This one blocks the event loop for just a bit so there
are probably some more parts that could be optimized

`2024-02-15 07:17:30.034 WARNING (MainThread) [asyncio] Executing <Task
pending name='analytics schedule' coro=<Analytics.send_analytics()
running at
/usr/src/homeassistant/homeassistant/components/analytics/analytics.py:220>
wait_for=<Future pending cb=[_chain_future.<locals>._call_check_cancel()
at /usr/local/lib/python3.12/asyncio/futures.py:387, Task.task_wakeup()]
created at /usr/local/lib/python3.12/asyncio/base_events.py:447>
cb=[set.remove()] created at
/usr/src/homeassistant/homeassistant/core.py:598> took 0.335 seconds`
2024-02-16 12:23:11 +01:00
dupondje
0aaa517217 add missing state class to dsmr sensors (#110712)
current_average_demand and maximum_demand_current_month are missing a state class, which gives errors in the statistics tab in HA.
So adding them to the sensor.
2024-02-16 12:08:09 +01:00
dependabot[bot]
81199af488 Bump github/codeql-action from 3.24.1 to 3.24.3 (#110700)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.1 to 3.24.3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.1...v3.24.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-16 11:58:17 +01:00
dependabot[bot]
5618670fd1 Bump dorny/paths-filter from 3.0.0 to 3.0.1 (#110698)
Bumps [dorny/paths-filter](https://github.com/dorny/paths-filter) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dorny/paths-filter/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: dorny/paths-filter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-16 11:55:30 +01:00
Robert Resch
bcce32e2de Bump deebot-client to 5.2.1 (#110683)
* Bump deebot-client to 5.2.0

* Bumb again

* Fix tests
2024-02-16 11:47:36 +01:00
Robert Hillis
2ac7d11b8d Mitigate session closed error in Netgear LTE (#110412) 2024-02-16 11:22:30 +01:00
Sid
d4a2dc7116 Bump openwebifpy to 4.2.4 (#110676) 2024-02-16 10:47:19 +01:00
Jan-Philipp Benecke
613b183898 Avoid calling internals when adding mock config entry in Nightscout (#110600) 2024-02-16 10:00:52 +01:00
Jan Rieger
4ededefe24 Add translations to AVM FRITZ!Box Call Monitor state attributes (#108412) 2024-02-16 09:41:59 +01:00
Matthew FitzGerald-Chamberlain
ce8cf314f9 Add Aprilaire integration (#95093)
* Add Aprilaire integration

* Fix test errors

* Update constants

* Code review cleanup

* Reuse coordinator from config flow

* Code review fixes

* Remove unneeded tests

* Improve translation

* Code review fixes

* Remove unneeded fixture

* Code review fixes

* Code review updates

* Use base data coordinator

* Deduplicate based on MAC

* Fix tests

* Check mac address on init

* Fix mypy error

* Use config entry ID for entity unique ID

* Fix tests

* Code review updates

* Fix mypy errors

* Code review updates

* Add data_description

* Update homeassistant/components/aprilaire/coordinator.py

Co-authored-by: Jon Oberheide <506986+jonoberheide@users.noreply.github.com>

* Update .coveragerc

* Update homeassistant/components/aprilaire/coordinator.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: Jon Oberheide <506986+jonoberheide@users.noreply.github.com>
2024-02-16 08:30:51 +01:00
J. Nick Koston
f7b9b0da0e Migrate dependencies loader to use async_get_integrations (#110690) 2024-02-16 08:07:39 +01:00
J. Nick Koston
9cf45882a7 Use bytes join fast path for large states payload (#110694)
b"".join has a fast path for when there are more than two bytes-strings
to combine

f383ca1a6f/Objects/stringlib/join.h (L123)
2024-02-16 07:58:11 +01:00
J. Nick Koston
37897ee384 Move late import of config flows in loader to load time (#110688)
* Move late import of config flows in loader to load time

There does not seem to be any reason to import the
generated flows late. Import them at load time
with the rest of the generated files

* tests
2024-02-16 07:55:12 +01:00
J. Nick Koston
1608e05be6 Speed up registry config websocket api calls with list comps (#110693)
* Speed up registry config websocket api calls with list comps

list comps are faster than generator expressions, even more so in
python 3.12 since https://peps.python.org/pep-0709/

https://stackoverflow.com/questions/47789/generator-expressions-vs-list-comprehensions/62709748#62709748

* more readable
2024-02-16 07:41:55 +01:00
Robert Hillis
59d7bceaee Bump deluge-client to 1.10.0 (#110663) 2024-02-16 01:12:34 +01:00
J. Nick Koston
dd1cf2c593 Remove unneeded list copy in icon helper (#110680) 2024-02-15 16:33:24 -06:00
Erik Montnemery
5f00e15d35 Don't add fritz entities with update_before_add (#110667)
Co-authored-by: mib1185 <mail@mib85.de>
2024-02-15 21:49:26 +01:00
Erik Montnemery
ae39945a85 Correct config entry setup in fritz tests (#110669) 2024-02-15 20:52:40 +01:00
Robert Hillis
dbca65dffb Bump nextcord to 2.6.0 (#110485) 2024-02-15 20:33:07 +01:00
Erik Montnemery
06a21d4ed9 Bump pychromecast to 14.0.0 (#108374)
* Pass unregister callback to cast HomeAssisstantController

* Update tests

* Bump pychromecast to 14.0.0

* Fix lint warning, adjust tests

* Improve test coverage
2024-02-15 20:14:01 +01:00
Robert Svensson
dc09633cc2 Bump aiounifi to v71 (#110658) 2024-02-15 19:17:06 +01:00
jan iversen
286c98d70f Modbus, allow received int to be a float. (#110648) 2024-02-15 18:22:23 +01:00
Christopher Fenner
1372cf5a18 Categorize burner and compressor sensors as diagnostic entities in ViCare integration (#110653)
Categorize Burner and Compressor start and runtime counters as diagnostic entities in ViCare integration
2024-02-15 17:29:17 +01:00
Erik Montnemery
3526fd66df Add option to block remote enabling of HA Cloud remote (#109700)
* Allow blocking remote enabling of HA Cloud remote

* Fix test
2024-02-15 17:26:06 +01:00
G Johansson
619e7fbbce Coerce to float in Sensibo climate react custom service (#110508) 2024-02-15 11:11:16 -05:00
Livio Avalle
c4247205ed Add state_class to ring battery sensor for LTS (#109872)
* Add state_class to ring battery sensor for LTS

* Add test, in test_sensor.py, for state_class for battery entity; in response to comment in PR
2024-02-15 09:52:11 -06:00
J. Nick Koston
d49bccf123 Ensure lamarzocco tests add config entry before updating it (#110423) 2024-02-15 09:09:47 -06:00
kingy444
3529eb6044 Powerview Gen 3 functionality (#110158)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-15 08:27:11 -06:00
spycle
d6efdc47a5 Bump pyMicrobot to 0.0.15 (#110502) 2024-02-15 15:21:36 +01:00
Stackie Jia
636c7ce350 Enable strict type checking on apple_tv integration (#101688)
* Enable strict type checking on apple_tv integration

* move some instance variables to class variables

* fix type of attr_value

* fix tests for description_placeholders assertion

* nits

* Apply suggestions from code review

* Update remote.py

* Apply suggestions from code review

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update config_flow.py

* Improve test coverage

* Update test_config_flow.py

* Update __init__.py

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-15 15:17:00 +01:00
Javier Fernández
d555f91702 Update wallbox to 0.6.0 (#110636)
* Update wallbox plugin version

Closes #110566

* Fix unit tests failing

* Fix import order

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-15 15:04:32 +01:00
Christopher Fenner
47cbe8f00c Add support for multiple devices linked to a Viessmann account (#96044)
* care about all devices

* use first device for diagnostics

* update constants

* handle multiple devices

* handle multiple devices

* handle multiple devices

* handle multiple devices

* handle multiple devices

* code style

* code style

* code style

* code style

* code style

* remove unused import

* remove unused import

* use has_entity_name and add serial to device name

* use has_entity_name and add serial to device name

* use has_entity_name and add serial to device name

* use has_entity_name and add serial to device name

* use has_entity_name and add serial to device name

* remove unused constant

* Update const.py

* Update binary_sensor.py

* change format

* change format

* fix line duplication

* fix line duplication

* change format

* fix typo

* use serial in device name if multiple devices are found

* add common base class

* use base class

* Update __init__.py

* Update __init__.py

* Update __init__.py

* Update sensor.py

* Update binary_sensor.py

* correct import

* use base class

* fix cdestyle findings

* fix pylint findings

* fix mypy findings

* fix codestyle finidings

* move has_entity_name to base class

* Revert "fix mypy findings"

This reverts commit 2d78801a69.

* fix type issue

* move multiple device handling

* fix import

* remove special handling for device name

* extract api getter

* Update __init__.py

* Update __init__.py

* Update entity.py

* Update button.py

* Update binary_sensor.py

* Update climate.py

* Update sensor.py

* Update water_heater.py

* Apply suggestions from code review

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

* Update __init__.py

* fix mypy & black

* move get_device to utils

* rename const

* Apply suggestions from code review

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

* store device in config entry

* extract types

* fix diagnostics

* handle new platform

* handle api rate limit

* add types

* add types

* rename

* add types

* ignore gateways for now

* Update .coveragerc

* adjust types

* fix merge issues

* rename

* Update types.py

* fix type

* add test method

* simplify

* ignore unused devices

* Apply suggestions from code review

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

* fix findings

* handle unsupported devices

* Apply suggestions from code review

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

* Update types.py

* fix format

* adjust variable naming

* Update conftest.py

* Update conftest.py

* remove kw_only

* Apply suggestions from code review

* Update __init__.py

* Update binary_sensor.py

* Update button.py

* Update climate.py

* Update const.py

* Update diagnostics.py

* Update number.py

* Update sensor.py

* Update types.py

* Update water_heater.py

* fix comment

* Apply suggestions from code review

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

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-15 13:58:00 +01:00
Åke Strandberg
fd0f093299 Add some myuplink tests (#110521)
* Add some myuplink tests

* Update fixtures for api endpoints

* Adjust according to review

* Update snapshot file

* Remove unneded fixtures and improve typing

* More cleanup

* One last session scope removed

* Fix typing

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-15 13:44:45 +01:00
Joakim Sørensen
57d3f3f9f7 Split pre/post backup actions into dedicated methods (#110632)
* Split pre/post backup actions into dedicated methods

* Update homeassistant/components/backup/manager.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-15 12:38:36 +01:00
Aurélien Grenotton
b9a8b992d7 Fix freebox pairing in bridge mode (#106131) 2024-02-15 12:34:29 +01:00
On Freund
d4be6632cc Add monthly forecast sensor to RymPro (#101012)
* Add monthly forecast

* Apply suggestions from code review

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

* Remove state class and add precision

* Apply suggestions from code review

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

* Fix ruff and mypy

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-15 12:34:03 +01:00
Kristof Mariën
d7787cdfd8 Bump libpyfoscam to 1.2.2 (#110625)
Bump foscam dependency
2024-02-15 11:52:01 +01:00
J. Nick Koston
8da07f1bf2 Fix formatting of mac addresses from dhcp discovery mocking in axis (#110560)
dhcp returns addresses in lowercase without :
2024-02-14 20:37:31 -05:00
J. Nick Koston
d48a45fee7 Fix formatting of mac addresses from dhcp discovery mocking in config_entries test (#110617) 2024-02-14 16:32:02 -06:00
J. Nick Koston
499c42364e Fix formatting of mac addresses from dhcp discovery mocking in broadlink (#110558)
* Fix formatting of mac addresses from dhcp discovery mocking in broadlink

dhcp returns addresses in lowercase without :

* fix missed ones

* broadlink has same format
2024-02-14 17:26:14 -05:00
J. Nick Koston
78bc561700 Fix formatting of mac addresses from dhcp discovery mocking in nest (#110584)
dhcp returns addresses in lowercase without :
2024-02-14 17:25:52 -05:00
J. Nick Koston
7b4c5a112c Fix formatting of mac addresses from dhcp discovery mocking in radiotherm (#110593)
dhcp returns addresses in lowercase without :
2024-02-14 23:25:33 +01:00
J. Nick Koston
1f67e4fed1 Fix formatting of mac addresses from dhcp discovery mocking in ruuvi_gateway (#110597)
dhcp returns addresses in lowercase without :
2024-02-14 17:25:22 -05:00
J. Nick Koston
28afe9ff9e Correct misaligned formatting of mac addresses in samsungtv (#110599)
* Correct misaligned formatting of mac addresses in samsungtv

dhcp returns addresses in lowercase without : and there were places
were it was not passed through format_mac which resulted in the wrong
format being saved in the config entry

* safer
2024-02-14 17:25:08 -05:00
J. Nick Koston
0ea524659c Fix formatting of mac addresses from dhcp discovery mocking in roomba (#110596)
dhcp returns addresses in lowercase without :
2024-02-14 23:24:34 +01:00
J. Nick Koston
20d1cd1246 Fix formatting of mac addresses from dhcp discovery mocking in qnap_qsw (#110592)
dhcp returns addresses in lowercase without :
2024-02-14 23:23:43 +01:00
J. Nick Koston
c7e2f24303 Fix formatting of mac addresses from dhcp discovery mocking in lametric (#110580) 2024-02-14 23:23:22 +01:00
J. Nick Koston
b87e34ec67 Fix formatting of mac addresses from dhcp discovery mocking in screenlogic (#110602)
dhcp returns addresses in lowercase without :
2024-02-14 17:23:13 -05:00
J. Nick Koston
9105dd16e3 Fix formatting of mac addresses from dhcp discovery mocking in somfy_mylink (#110603)
dhcp returns addresses in lowercase without :
2024-02-14 17:23:02 -05:00
J. Nick Koston
35bcf2e9e4 Fix formatting of mac addresses from dhcp discovery mocking in squeezebox (#110604)
dhcp returns addresses in lowercase without :
2024-02-14 17:22:51 -05:00
J. Nick Koston
d4562f4674 Fix formatting of mac addresses from dhcp discovery mocking in steamist (#110605)
dhcp returns addresses in lowercase without :
2024-02-14 17:22:38 -05:00
J. Nick Koston
48cd973c62 Fix formatting of mac addresses from dhcp discovery mocking in tailwind (#110606)
dhcp returns addresses in lowercase without :
2024-02-14 17:22:24 -05:00
J. Nick Koston
334c177e67 Fix formatting of mac addresses from dhcp discovery mocking in tesla_wall_connector (#110607)
* Fix formatting of mac addresses from dhcp discovery mocking in tesla_wall_connector

dhcp returns addresses in lowercase without :

* Fix formatting of mac addresses from dhcp discovery mocking in tesla_wall_connector

dhcp returns addresses in lowercase without :
2024-02-14 17:22:09 -05:00
J. Nick Koston
cefaf0e065 Fix formatting of mac addresses from dhcp discovery mocking in tolo (#110608)
dhcp returns addresses in lowercase without :
2024-02-14 17:21:56 -05:00
J. Nick Koston
77a44c54dd Fix formatting of mac addresses from dhcp discovery mocking in twinkly (#110609)
dhcp returns addresses in lowercase without :
2024-02-14 17:21:33 -05:00
J. Nick Koston
2fe246441f Fix formatting of mac addresses from dhcp discovery mocking in unifiprotect (#110610)
dhcp returns addresses in lowercase without :
2024-02-14 17:21:19 -05:00
J. Nick Koston
2a04eabe18 Fix formatting of mac addresses from dhcp discovery mocking in verisure (#110611)
dhcp returns addresses in lowercase without :
2024-02-14 17:21:04 -05:00
J. Nick Koston
e6ac4c5f1f Fix formatting of mac addresses from dhcp discovery mocking in vicare (#110613)
dhcp returns addresses in lowercase without :
2024-02-14 17:20:47 -05:00
J. Nick Koston
fa026b7e12 Fix formatting of mac addresses from dhcp discovery mocking in wiz (#110615)
dhcp returns addresses in lowercase without :
wiz discovery returns addresses in lowercase without :
2024-02-14 17:20:32 -05:00
J. Nick Koston
79b2e465de Fix formatting of mac addresses from dhcp discovery mocking in yeelight (#110616)
dhcp returns addresses in lowercase without :
2024-02-14 17:20:15 -05:00
J. Nick Koston
c20d2d44ed Fix formatting of mac addresses from dhcp discovery mocking in fronius (#110572)
Co-authored-by: Matthias Alphart <farmio@alphart.net>
2024-02-14 16:18:19 -06:00
Thomas55555
72297a9044 Bump aioautomower to 2024.2.6 (#110598) 2024-02-14 23:14:41 +01:00
J. Nick Koston
dcfff6c138 Fix formatting of mac addresses from dhcp discovery mocking in powerwall (#110591)
dhcp returns addresses in lowercase without :
2024-02-14 23:11:25 +01:00
J. Nick Koston
cc3783f999 Fix misaligned mac formatting in goalzero (#110574)
The DHCP mac address was being set as aabbcceeddff but the user step
was setting it as aa:bb:cc:dd:ee:ff
2024-02-14 23:10:07 +01:00
J. Nick Koston
5988db1670 Fix formatting of mac addresses from dhcp discovery mocking in dlink (#110562)
* Fix formatting of mac addresses from dhcp discovery mocking in dlink

dhcp returns addresses in lowercase without :

* fix tests
2024-02-14 23:07:45 +01:00
J. Nick Koston
cd1c633ff9 Fix tplink not updating IP from DHCP discovery and discovering twice (#110557)
We only called format_mac on the mac address if we connected
to the device during entry creation. Since the format of the
mac address from DHCP discovery did not match the format saved
in the unique id, the IP would not get updated and a second
discovery would appear

Thankfully the creation path does format the mac so we did not
create any entries with an inconsistantly formatted unique id

fixes #110460
2024-02-14 23:03:30 +01:00
J. Nick Koston
c045e23000 Fix formatting of mac addresses from dhcp discovery mocking in overkiz (#110590) 2024-02-14 16:01:15 -06:00
Jan-Philipp Benecke
5da31a3f1d Avoid calling internals when adding mock config entry in Squeezebox (#110601) 2024-02-14 22:59:49 +01:00
Charles Garwood
d781dc4600 Add support for Fully Kiosk sound playing state (#105762) 2024-02-14 15:45:29 -05:00
J. Nick Koston
4627e8b1fc Fix formatting of mac addresses from dhcp discovery mocking in reolink (#110594)
dhcp returns addresses in lowercase without :
2024-02-14 21:39:30 +01:00
Marc Mueller
269f6be096 Improve hassio decorator typing (#110545)
* Improve hassio decorator typing

* Fix typing
2024-02-14 21:25:21 +01:00
J. Nick Koston
0bbe46d236 Fix formatting of mac addresses from dhcp discovery mocking in airzone (#110559)
dhcp returns addresses in lowercase without :
2024-02-14 20:59:16 +01:00
J. Nick Koston
16d2482fe6 Fix formatting of mac addresses from dhcp discovery mocking in elkm1 (#110564)
dhcp returns addresses in lowercase without :
2024-02-14 20:58:40 +01:00
J. Nick Koston
5ce39f2177 Fix formatting of mac addresses from dhcp discovery mocking in emonitor (#110565)
dhcp returns addresses in lowercase without :
2024-02-14 20:58:07 +01:00
J. Nick Koston
730e8ab5f3 Fix formatting of mac addresses from dhcp discovery mocking in esphome (#110567)
dhcp returns addresses in lowercase without :
2024-02-14 20:57:37 +01:00
J. Nick Koston
08f97d66ff Fix formatting of mac addresses from dhcp discovery mocking in flux_led (#110568)
dhcp returns addresses in lowercase without :
2024-02-14 20:56:00 +01:00
J. Nick Koston
a87960a323 Fix formatting of mac addresses from dhcp discovery mocking in onvif (#110589)
dhcp returns addresses in lowercase without :
2024-02-14 20:55:14 +01:00
J. Nick Koston
52e8f7f865 Fix formatting of mac addresses from dhcp discovery mocking in fully_kiosk (#110573)
dhcp returns addresses in lowercase without :
2024-02-14 20:54:44 +01:00
J. Nick Koston
efbfec0ece Fix formatting of mac addresses from dhcp discovery mocking in guardian (#110575)
dhcp returns addresses in lowercase without :
2024-02-14 20:54:16 +01:00
J. Nick Koston
cd0ce7d9f6 Fix formatting of mac addresses from dhcp discovery mocking in intellifire (#110579)
dhcp returns addresses in lowercase without :
2024-02-14 20:53:50 +01:00
J. Nick Koston
98263d7d76 Fix formatting of mac addresses from dhcp discovery mocking in lifx (#110581)
dhcp returns addresses in lowercase without :
2024-02-14 20:53:26 +01:00
J. Nick Koston
815232069a Fix formatting of mac addresses from dhcp discovery mocking in motion_blinds (#110583)
dhcp returns addresses in lowercase without :
2024-02-14 20:52:32 +01:00
J. Nick Koston
b0e87c0941 Fix formatting of mac addresses from dhcp discovery mocking in nuki (#110585)
dhcp returns addresses in lowercase without :
2024-02-14 20:51:44 +01:00
J. Nick Koston
4eca0371d5 Fix formatting of mac addresses from dhcp discovery mocking in obihai (#110586)
dhcp returns addresses in lowercase without :
2024-02-14 20:51:06 +01:00
J. Nick Koston
88fce6a76d Fix formatting of mac addresses from dhcp discovery mocking in insteon (#110578)
dhcp returns addresses in lowercase without :
2024-02-14 20:49:32 +01:00
J. Nick Koston
bba19a5bab Fix formatting of mac addresses from dhcp discovery mocking in hunterdouglas_powerview (#110577)
dhcp returns addresses in lowercase without :
2024-02-14 20:48:53 +01:00
J. Nick Koston
25fac03705 Bump orjson to 3.9.14 (#110552)
changelog: https://github.com/ijl/orjson/compare/3.9.13...3.9.14

fixes a crasher due to buffer overread (was only partially fixed in 3.9.13)
2024-02-14 18:57:47 +01:00
Joost Lekkerkerker
acca69f77a Migrate Vizio to has entity name (#96773) 2024-02-14 11:39:38 -05:00
Joost Lekkerkerker
f72efa9618 Add entity translations to OralB (#97402)
* Make bluetooth use the translation from the entity description

* Add entity translations to OralB

* Remove links to other platforms

* Remove links to other platforms

* Remove links to other platforms

* Add test

* Use is

* Fix tests

* Update homeassistant/components/oralb/strings.json
2024-02-14 17:21:47 +01:00
J. Nick Koston
3a053afac6 Create backups files without having to copy inner tarballs (#110267) 2024-02-14 10:08:22 -06:00
Joost Lekkerkerker
0e833c5fe3 Migrate Twinkly to has entity naming (#97206)
* Migrate Twinkly to has entity naming

* Update the device name after sync

* Fix tests

---------

Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-02-14 16:43:29 +01:00
Simone Chemelli
538ef7764e Move Shelly thermostat check to status endpoint (#110543)
* Move Shelly thermostat check to status endpoint

* fix key path
2024-02-14 16:36:42 +01:00
J. Nick Koston
eee6a119d5 Bump SQLAlchemy to 2.0.27 (#110517) 2024-02-14 10:32:05 +01:00
dependabot[bot]
29e6123220 Bump github/codeql-action from 3.24.0 to 3.24.1 (#110522)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.24.0 to 3.24.1.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3.24.0...v3.24.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-14 09:55:04 +01:00
J. Nick Koston
b3452dc3f3 Refactor dhcp to move all mac formatting into the client processor (#110509) 2024-02-13 19:12:38 -06:00
DeerMaximum
9a8c5af0a6 Add DeerMaximum to velux codeowners (#110504) 2024-02-14 00:46:51 +02:00
DeerMaximum
d16d9d72c3 Add config flow to Velux (#89155)
* Add config_flow

* Add old config import

* Change from platform setup to entry setup

* Improve yaml config import

* Allow multiple hosts

* Apply recommendations

* Add DeerMaximum as codeowner

* Apply recommendations

* Fix config schema

* Fix hass data

* Remove DeerMaximum from CODEOWNERS

* Try to fix tests in ci

* Try to fix tests in ci 2

* Try to fix tests in ci 3

* Revert: Try to fix tests in ci 3

* Add end-to-end flow to connection error test

* Fix rebase

* Add required changes

* Change deprecation date

* Import only valid config entries

* Improve issue creation

* Fix error type

* Add missing test

* Optimize issue creation

* Optimize tests

* Add check for duplicate entries

* Add already_configured message

* Create issue for duplicate entries
2024-02-13 21:31:56 +01:00
J. Nick Koston
2981d7ed0e Fix logger message in samsungtv (#110484) 2024-02-13 11:12:37 -06:00
DustyArmstrong
3bf6d525fb Bump datapoint to 0.9.9 + re-enable Met Office Integration (#110206) 2024-02-13 17:24:08 +01:00
Shay Levy
43bd05ba82 Bump aiowebostv to 0.4.0 (#110477) 2024-02-13 16:15:15 +01:00
Jonas Fors Lellky
f7c43710dc Refactor flexit_bacnet to use icon translations (#110479) 2024-02-13 16:09:18 +01:00
Åke Strandberg
e2ff5bc248 Add myuplink binary_sensor platform (#110388)
* Add binary_sensor platform

* Address review comments

* Add one file more to .coveragerc
2024-02-13 15:59:38 +01:00
Stephen Brown II
171bb80b3f Add icon translations to Teslemetry (#109928)
* [Teslemetry] Create icons.json

Adds Icons to Teslemetry integration for climate presets.

* Update homeassistant/components/teslemetry/icons.json

Co-authored-by: Brett Adams <Bre77@users.noreply.github.com>

* Update homeassistant/components/teslemetry/icons.json

Co-authored-by: Brett Adams <Bre77@users.noreply.github.com>

---------

Co-authored-by: Brett Adams <Bre77@users.noreply.github.com>
2024-02-13 15:21:27 +01:00
Paul Bottein
70af81cf64 Set icons for switch without device class (#110470) 2024-02-13 15:11:09 +01:00
Stefan Agner
07e16ab073 Fix Raspberry Pi utilities installation on Alpine 3.19 (#110463) 2024-02-13 15:07:37 +01:00
Jonas Fors Lellky
6091ae55dc Add setpoints for fans to flexit_bacnet (#110262)
* Adds setpoints for fans to flexit_bacnet

* Add snapshot test for flexit_bacnet number

* Add test for flexit_bacnet number implementation

* Refactor set_native_value_fn

* Refactor names of number entities

Also refactor keys, translation keys
Order alphabetically
Update test snapshot

* Add icons to flexit_bacnet number entities

* Refactor to use icon translations, add unit of measurement

* Remove redundant assert
2024-02-13 14:55:02 +01:00
Michael
602380e111 Detect reached API rate limit in Tankerkoenig (#110432) 2024-02-13 14:34:01 +01:00
J. Nick Koston
01c3205635 Small performance improvements to config entry setup retry (#110448)
* Small performance improvements to config entry setup retry

- cache some properties that never change
- avoid loader.async_get_integration when we already have it
- avoid multiple integration.domain checks

* tweaks
2024-02-13 13:28:52 +01:00
Cyrill Raccaud
6812596cd7 Switch to new Bring! lib (#110355)
* switch to new bring lib

* rename lib again
2024-02-13 13:25:32 +01:00
J. Nick Koston
4d39a85553 Avoid creating many tasks when adding hue v2 entities (#110386)
Each entity creation would call async_add_entities which spawned a
seperate task

fixes
```
2024-02-12 18:06:09.819 WARNING (MainThread) [asyncio] Executing <Task pending name='config entry forward setup Philips Hue 2 hue fcb64edfc5ac2edbb656607d5193b583 light' coro=<ConfigEntries.async_forward_entry_setup() running at /usr/src/homeassistant/homeassistant/config_entries.py:1597> wait_for=<Future pending cb=[shield.<locals>._outer_done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:922, Task.task_wakeup()] created at /usr/local/lib/python3.12/asyncio/base_events.py:447> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.12/asyncio/tasks.py:767] created at /usr/local/lib/python3.12/asyncio/tasks.py:420> took 1.260 seconds
```
2024-02-13 13:04:29 +01:00
Martin Hjelmare
f140c1a46d Deprecate cloud tts platform config (#110461)
* Deprecate cloud tts platform config

* Add test
2024-02-13 13:00:42 +01:00
Joost Lekkerkerker
8fb04d759b Change function name in tesla_wall_connector (#110467) 2024-02-13 12:02:48 +01:00
Joost Lekkerkerker
5ab0bd5bbe Change function name in flexit_bacnet (#110465) 2024-02-13 12:02:32 +01:00
Joost Lekkerkerker
103aab2218 Change function name in tfiac (#110466) 2024-02-13 12:02:09 +01:00
Jan Bouwhuis
09f1ec78a5 Handle template errors on MQTT payload handling (#110180)
* Handle template errors on MQTT payload handling (alt)

* Handle mqtt event en image template errors correctly
2024-02-13 10:59:55 +01:00
Josef Zweck
ee25f6b960 Add additonal number entities to La Marzocco (#108258) 2024-02-13 09:47:39 +01:00
Jan Bouwhuis
545a34a849 Remove power_state_template from mqtt climate value template list (#110452) 2024-02-13 09:16:11 +01:00
wilburCforce
a317196bda Update pylutron to 0.2.12 (#110414) 2024-02-13 08:37:58 +01:00
J. Nick Koston
77f416fa04 Ensure cast tests add config entry before updating it (#110441)
* Ensure cast tests add config entry before updating it

* time to walk away for a bit

* missed two
2024-02-13 05:01:37 +01:00
J. Nick Koston
0e1cdc1f79 Ensure github tests add config entry before updating it (#110430) 2024-02-13 05:00:44 +01:00
J. Nick Koston
704ad67917 Ensure hue tests add config entry before updating it (#110428) 2024-02-13 04:59:26 +01:00
Åke Strandberg
a51ecd0614 Add myuplink unit-based sensor descriptions (#110370)
* Add more unit-based sensor descriptions

* Adjust energy sensor state class  to TOTAL_INCREASING
2024-02-13 04:41:29 +01:00
Aaron Bach
e3c838d512 Update Notion auth to store refresh tokens instead of account passwords (#109670) 2024-02-12 20:35:06 -07:00
Raman Gupta
92c3c401b9 Remove unused instance variable in Z-wave (#110442)
* Remove unused variable and fix typing in zwave_js

* remove redundant type
2024-02-13 03:55:49 +01:00
Raman Gupta
c1d61b9748 Improve climate turn_on/turn_off services for zwave_js (#109187)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-12 19:06:23 -05:00
Maciej Bieniek
b60f931e6d Improve tests for Shelly WallDisplay (#110435)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-12 16:51:34 -06:00
J. Nick Koston
da50e459bf Ensure knx tests add config entry before updating it (#110425) 2024-02-12 23:13:10 +01:00
J. Nick Koston
92842c28d2 Ensure cast tests add config entry before updating it (#110416) 2024-02-12 23:06:13 +01:00
J. Nick Koston
067645520a Ensure dlna_dmr tests add config entry before updating it (#110418) 2024-02-12 22:59:44 +01:00
J. Nick Koston
e605b96d84 Ensure config entry oauth2 tests add config entry before updating it (#110421) 2024-02-12 22:59:17 +01:00
J. Nick Koston
d9c581e2c8 Ensure homematicip_cloud tests add config entry before updating it (#110429) 2024-02-12 23:57:48 +02:00
J. Nick Koston
4e76e6b2b0 Ensure gdacs tests add config entry before updating it (#110431) 2024-02-12 23:56:48 +02:00
J. Nick Koston
b3d9e15fb4 Ensure blink tests add config entry before updating it (#110415) 2024-02-12 22:56:22 +01:00
J. Nick Koston
a3a1f8216c Migrate luftdaten to use async_update_entry to alter config entries (#110424) 2024-02-12 22:55:34 +01:00
J. Nick Koston
ddab106391 Migrate twentemilieu to use async_update_entry to alter config entries (#110419) 2024-02-12 22:55:05 +01:00
Steven Looman
147a1f7b0b Bump async-upnp-client to 0.38.2 (#110411) 2024-02-12 15:31:09 -06:00
J. Nick Koston
bb9ffa758d Ensure sonarr tests add config entry before updating it (#110422) 2024-02-12 15:30:01 -06:00
J. Nick Koston
8282018260 Migrate onewire to use async_update_entry to alter config entries (#110413) 2024-02-12 15:29:50 -06:00
J. Nick Koston
61610a5ef9 Ensure deconz tests add config entry before updating it (#110417) 2024-02-12 15:29:33 -06:00
J. Nick Koston
bc0a78d069 Migrate tplink to use async_update_entry to alter config entries (#110406) 2024-02-12 21:39:37 +01:00
J. Nick Koston
45f23f4458 Migrate trend to use async_update_entry to alter config entries (#110408) 2024-02-12 14:38:56 -06:00
J. Nick Koston
5c60ff19e9 Migrate plex to use async_update_entry to alter config entries (#110405) 2024-02-12 21:38:38 +01:00
J. Nick Koston
15e8d66fea Migrate unifiprotect to use async_update_entry to alter config entries (#110409) 2024-02-12 21:38:25 +01:00
J. Nick Koston
04dccc7ec6 Migrate mqtt to use async_update_entry to alter config entries (#110407) 2024-02-12 21:38:13 +01:00
J. Nick Koston
4a98f3f223 Migrate ping to use async_update_entry to alter config entries (#110404) 2024-02-12 21:25:17 +01:00
J. Nick Koston
7dcf2e94b4 Migrate zha to use async_update_entry to alter config entries (#110402) 2024-02-12 21:24:56 +01:00
J. Nick Koston
c3d9192384 Migrate smartthings to use async_update_entry to alter config entries (#110403) 2024-02-12 21:24:45 +01:00
J. Nick Koston
db9c08b2e0 Migrate verisure to use async_update_entry to alter config entries (#110400) 2024-02-12 21:24:32 +01:00
J. Nick Koston
7d1b9dce9d Migrate yale_smart_alarm to use async_update_entry to alter config entries (#110401) 2024-02-12 21:23:07 +01:00
J. Nick Koston
aa0e8625ad Migrate velbus to use async_update_entry to alter config entries (#110399) 2024-02-12 21:22:52 +01:00
Michael
9a672a1f31 Bump py-sucks to 0.9.9 (#110397)
bump py-sucks to 0.9.9
2024-02-12 21:13:47 +01:00
Åke Strandberg
78531ffbc6 Cleanup myuplink imports (#110374)
Cleanup imports
2024-02-12 20:21:33 +01:00
J. Nick Koston
cc13d7eec7 Migrate hue to use async_update_entry to alter config entries (#110310) 2024-02-12 20:20:10 +01:00
J. Nick Koston
5c7d3035ca Migrate ipp to use async_update_entry to alter config entries (#110311) 2024-02-12 20:19:48 +01:00
Franck Nijhof
7b881e1c6a Update Home Assistant base image to 2024.02.1 (#110395) 2024-02-12 20:17:24 +01:00
J. Nick Koston
a1f0e9015b Migrate openweathermap to use async_update_entry to alter config entries (#110372)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-02-12 13:15:57 -06:00
J. Nick Koston
fc1c513f33 Migrate obihai to use async_update_entry to alter config entries (#110368) 2024-02-12 20:13:53 +01:00
Maciej Bieniek
2bd64dba6b Add removal_condition for Shelly analog input sensors (#110331)
* Add remove condition for analog input sensors

* xpercent key is not present in the payload if it has not been configured

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-12 20:13:11 +01:00
J. Nick Koston
32e3f6c5a7 Migrate roku to use async_update_entry to alter config entries (#110363) 2024-02-12 20:10:06 +01:00
Erik Montnemery
e27e799dd5 Add power strip with 2 outlets to kitchen_sink (#110346) 2024-02-12 20:00:13 +01:00
Erik Montnemery
3086d24231 Add back supported_color_modes property to blebox light (#110350) 2024-02-12 19:59:04 +01:00
J. Nick Koston
5e5a9d9c59 Bump SQLAlchemy to 2.0.26 (#110358) 2024-02-12 19:57:53 +01:00
J. Nick Koston
96850c6524 Migrate minecraft_server to use async_update_entry to alter config entries (#110367) 2024-02-12 19:57:27 +01:00
J. Nick Koston
f5497cb0be Migrate foscam to use async_update_entry to alter config entries (#110365) 2024-02-12 19:57:09 +01:00
J. Nick Koston
e2ec23955e Migrate ps4 to use async_update_entry to alter config entries (#110373) 2024-02-12 19:52:04 +01:00
J. Nick Koston
df8a168c97 Migrate switchbee to use async_update_entry to alter config entries (#110392) 2024-02-12 19:51:45 +01:00
J. Nick Koston
332db5093f Migrate utility_meter to use async_update_entry to alter config entries (#110394) 2024-02-12 19:51:16 +01:00
J. Nick Koston
4d1e3cdf49 Bump securetar to 2024.2.0 (#110383) 2024-02-12 19:50:59 +01:00
J. Nick Koston
29146326fa Fix zone radius calculation when radius is not 0 (#110354) 2024-02-12 19:47:34 +01:00
J. Nick Koston
4bcfa9e315 Migrate sonarr to use async_update_entry to alter config entries (#110364) 2024-02-12 19:46:48 +01:00
J. Nick Koston
300f5670e0 Migrate sensibo to use async_update_entry to alter config entries (#110390) 2024-02-12 19:46:30 +01:00
J. Nick Koston
5f03b5ad41 Migrate smhi to use async_update_entry to alter config entries (#110391) 2024-02-12 19:45:28 +01:00
J. Nick Koston
2f0d294219 Migrate trafikverket_camera to use async_update_entry to alter config entries (#110393) 2024-02-12 19:45:07 +01:00
Erik Montnemery
6e4fd69326 Fix color mode in wiz light (#110328) 2024-02-12 19:44:46 +01:00
J. Nick Koston
3b409b07e3 Migrate zwave_js to use async_update_entry to alter config entries (#110376) 2024-02-12 19:42:02 +01:00
Erik Montnemery
a51d3b4286 Remove store from google_assistant AbstractConfig (#109877)
* Remove store from google_assistant AbstractConfig

* Bump minor version of google_assistant store

* Fix test

* Improve comments

* Fix typo

* Refactor

* Update homeassistant/components/google_assistant/http.py

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

* Fix bug, add tests

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-12 19:24:21 +01:00
J. Nick Koston
d78bb3894c Migrate samsungtv to use async_update_entry to alter config entries (#110362) 2024-02-12 11:41:46 -06:00
J. Nick Koston
542e306b0c Migrate recollect_waste to use async_update_entry to alter config entries (#110378) 2024-02-12 11:41:06 -06:00
J. Nick Koston
925e9eecce Migrate ridwell to use async_update_entry to alter config entries (#110380) 2024-02-12 11:40:23 -06:00
J. Nick Koston
fb622c6cc8 Migrate rainmachine to use async_update_entry to alter config entries (#110377) 2024-02-12 11:35:17 -06:00
J. Nick Koston
66607cd034 Migrate openuv to use async_update_entry to alter config entries (#110371) 2024-02-12 11:34:26 -06:00
Erik Montnemery
1764c031df Warn when lights violate color mode rules (#110336)
* Warn when lights violate color mode rules

* Update test

* Remove redundant warning, add tests

* Improve test coverage
2024-02-12 17:43:50 +01:00
Maciej Bieniek
8de038527f Improve type annotation in Shelly tests (#110361)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-12 10:23:55 -06:00
Nikolay Vasilchuk
1a22189262 Fix Starline GPS count sensor (#110348) 2024-02-12 17:07:22 +01:00
Åke Strandberg
29ed82332c Add myuplink specific sensor descriptions (#109867)
* Add specific sensor descriptions

* Address review suggestions

* Adress more review comments

* Change variable name according to code review

* Qualify parameter_id:s to avoid collisions

* Qualify sensor descriptions with a model group prefix

* Improve lookup of sensor descriptions

* Address review comments

* Add constant for unknown value from API

* Add raw value as attribute to enum sensors

* Create extra raw_value sensors with enum sensors

* Moved attributes to class attributes

* Move capitalize() to class setup
2024-02-12 16:37:44 +01:00
Joost Lekkerkerker
89331d0ff3 Change function name in hvv_departures (#110349) 2024-02-12 15:54:48 +01:00
Peter Winkler
0157026489 Upgrade myuplink package to 0.2.1 (#110343) 2024-02-12 15:33:58 +01:00
Adam Goode
5cdc3cec32 Properly report cover positions to prometheus (#110157) 2024-02-12 15:33:03 +01:00
Jan-Philipp Benecke
fb878836a8 Handle no data error in Electricity Maps config flow (#110259)
Co-authored-by: Viktor Andersson <30777521+VIKTORVAV99@users.noreply.github.com>
2024-02-12 15:03:29 +01:00
Minims
f792690e27 Update python rflink to 0.0.66 (#110060)
* Update python rflink to 0.0.66

Used to manage new data WIND from last R51 release

* Update requirements_all.txt

* Update requirements_test_all.txt
2024-02-12 13:27:01 +02:00
Marc Mueller
defbe3c067 Update pytest warnings filter (#110332) 2024-02-12 11:30:41 +01:00
Joakim Sørensen
30e932f36d Bump pytraccar from 2.0.0 to 2.1.0 (#110320) 2024-02-12 11:23:16 +01:00
Kevin Worrel
121f37b6b6 Correct screenlogic test's mock adapter name (#110317)
Correct mock adapter name
2024-02-12 11:20:33 +01:00
J. Nick Koston
aa67eb7f46 Migrate landisgyr_heat_meter to use async_update_entry to alter config entries (#110314) 2024-02-12 11:18:54 +01:00
J. Nick Koston
b5d9f275b9 Migrate google_assistant_sdk to use async_update_entry to alter config entries (#110307) 2024-02-12 11:16:44 +01:00
Åke Strandberg
8376c07969 Add myuplink diagnostics download (#109925)
* Dump all relevant data from API

* Cleanup and adjust

* Redact serialNumber

* WIP

* Add fixtures

* WIP

* Tests for diagnostics completed

* Address review comments

* Change to fake token

* Add missed redact

* Improve mocks

* Resolve review comments
2024-02-12 10:56:06 +01:00
Richard Kroegel
1b8bda6067 Remove old BMW vehicles/devices automatically (#110255)
* Remove not assigned vehicles from DeviceRegistry on startup

* Replace async_remove_device with async_update_device

* Add test

* Use generator

---------

Co-authored-by: Richard <rikroe@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-12 10:52:08 +01:00
Erik Montnemery
12709050ea Fix color mode in comelit light (#110326) 2024-02-12 10:41:28 +01:00
Erik Montnemery
9c9fa11654 Fix color mode in hive light (#110330) 2024-02-12 10:21:43 +01:00
Maciej Bieniek
4f277b9509 Add pulse counter sensors for Shelly (#110248)
* Add pulse counter sensors to Shelly

* Add a unit for the pulse counter

* Fix removal condition

* xtotal key is not present in the payload if it has not been configured

* Update test

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-12 09:42:38 +01:00
J. Nick Koston
5528ae9707 Migrate knx to use async_update_entry to alter config entries (#110312) 2024-02-12 09:39:05 +01:00
Luke Lashley
33cdcce191 Better teardown and setup of Roborock connections (#106092)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-12 09:37:37 +01:00
J. Nick Koston
2516eafba6 Migrate axis to use async_update_entry to alter config entries (#110302) 2024-02-12 09:22:44 +01:00
J. Nick Koston
e3813d4134 Migrate blink to use async_update_entry to alter config entries (#110303) 2024-02-12 08:30:38 +01:00
J. Nick Koston
55022767ac Migrate homematicip_cloud to use async_update_entry to alter config entries (#110308) 2024-02-12 08:29:37 +01:00
J. Nick Koston
303bb99da0 Migrate huawei_lte to use async_update_entry to alter config entries (#110309) 2024-02-12 08:28:54 +01:00
J. Nick Koston
73bb7d6830 Migrate forecast_solar to use async_update_entry to alter config entries (#110306) 2024-02-12 08:27:44 +01:00
J. Nick Koston
322b8b5be0 Migrate lametric to use async_update_entry to alter config entries (#110313) 2024-02-12 08:27:05 +01:00
J. Nick Koston
d6ba7bf506 Migrate ambient_station to use async_update_entry to alter config entries (#110305) 2024-02-11 21:45:34 -06:00
Marc Mueller
eadf2380d9 Update pytest to 8.0.0 (#109876) 2024-02-12 00:03:51 +01:00
Marc Mueller
2ef2172b01 Convert test helpers to get hass instance to contextmanagers (#109990)
* Convert get_test_home_assistant helper to contextmanager

* Convert async_test_home_assistant helper to contextmanager

* Move timezone reset to async_test_home_assistant helper
2024-02-11 21:23:51 +01:00
Jan-Philipp Benecke
3342e6ddbd Avoid calling hass internals when adding mock config entry in Fully Kiosk (#110291) 2024-02-11 21:17:54 +01:00
Jan-Philipp Benecke
932d930084 Avoid calling hass internals when adding mock config entry in Blink (#110290) 2024-02-11 21:17:22 +01:00
starkillerOG
589e3952de Fix TDBU naming in Motionblinds (#110283)
fix TDBU naming
2024-02-11 21:16:06 +01:00
G Johansson
7ce1ba9304 Fix cpu percentage in System Monitor (#110268)
* Fix cpu percentage in System Monitor

* Tests
2024-02-11 21:11:31 +01:00
Maciej Bieniek
326da81656 Add icon translations to Shelly (#110183)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-11 14:07:10 -06:00
Floris272
7dc9ad63bd Implement late feedback for Bluecurrent (#106918)
* Apply changes

* Fix MockClient

* Apply feedback

* Remove connector tests

* Change MockClient to inhert MagicMock

* Add reconnect tests and refactor mock client

* Refactor mock exception throwing

* Add future_fixture

* Move mocked client methods into create_client_mock

* Remove fixture and separate event from mock_client

* Add FutureContainer to store the loop_future
2024-02-11 20:57:38 +01:00
Marc Mueller
654ab54aa0 Update tqdm to 4.66.2 (#110277) 2024-02-11 20:11:08 +01:00
J. Nick Koston
e9f8bae693 Bump PySwitchbot to 0.45.0 (#110275) 2024-02-11 13:09:11 -06:00
J. Nick Koston
ab85ebb996 Bump thermopro-ble to 0.10.0 (#110279) 2024-02-11 13:08:49 -06:00
Marc Mueller
ba93cf0336 Update pre-commit to 3.6.1 (#110278) 2024-02-11 20:07:14 +01:00
Michael
ce37b84360 Bump aiopegelonline to 0.0.8 (#110274) 2024-02-11 20:06:47 +01:00
Matthias Alphart
8f2f869f46 Update xknxproject to 3.6.0 (#110282) 2024-02-11 20:01:16 +01:00
deosrc
e38cb01d81 Add missing log message for error resolving OAuth token (#107606) 2024-02-11 13:07:54 +00:00
David Bonnes
2e0ee11de5 Bump evohome-async to 0.4.19 (#110225)
bump client to 0.4.19
2024-02-11 13:31:51 +02:00
Martin Hjelmare
6b4920ffa6 Refactor tradfri tests (#110094)
* Refactor tradfri tests

* Refactor command store

* Fix fixture type annotations

* Fix test type errors
2024-02-11 12:01:12 +01:00
Maciej Bieniek
470de0a4de Add icon translations to NextDNS (#110179)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-11 10:20:01 +01:00
Simon Lamon
6c4e372908 Fix state classes issue translation in Group (#110238)
Fix state classes translation
2024-02-11 09:54:50 +01:00
Thomas55555
816f231e27 Bump aioautomower to 2024.2.4 (#110209)
* Bump aioautomower to 2024.2.3

* Bump aioautomower to 2023.2.4
2024-02-11 10:13:52 +02:00
Oliver
0c9f9486bf Update denonavr to 0.11.6 (#110231)
* Update `denonavr` to `0.11.5`

* Handle `AvrProcessingError` exception

* Remove obsolete `_telnet_was_healthy` property from receiver

* Update `denonavr` to `0.11.6`
2024-02-11 09:29:40 +02:00
J. Nick Koston
2f7d71347e Enable compression for manifest.json (#110229)
Now that compression is ~5x faster than base zlib, it makes
sense to compress this
2024-02-10 19:45:21 -05:00
chammp
a5cc0ae890 Improve package schema validation (#108125)
* Add failing tests for package config validation error wrapping

* Wrap package schema validation errors in HomeAssistantError

* Fix yamllint errors

* Rework package merge validation

Ignore invalid package definitions instead of failing startup.
Output error messages with locations if possible when a package
definition has errors.

* Ruff format

* Fix linter errors

* Move package_definition_schema to module scope

* Move inner function to module level

* Merge exception handlers

Merge exception handlers for config schema validation and package merge
to avoid untested code branches

* Fix long lines and doc strings

* More minor changes to exception handler

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-10 20:16:20 +01:00
Simon Lamon
fa4433c569 Fix device class repairs issues placeholders in Group (#110181)
fix translation placeholders
2024-02-10 20:09:02 +01:00
J. Nick Koston
1e7cd7c0c6 Update airvisual to set ConfigEntry version with async_update_entry (#110204)
* Update airvisual to set ConfigEntry version with async_update_entry

* Update airvisual to set ConfigEntry version with async_update_entry
2024-02-10 19:57:53 +01:00
J. Nick Koston
b3e46e3d64 Update airnow to set ConfigEntry version with async_update_entry (#110202) 2024-02-10 19:55:38 +01:00
J. Nick Koston
6b913546b9 Update swiss_public_transport to set ConfigEntry version with async_update_entry (#110197) 2024-02-10 19:54:35 +01:00
J. Nick Koston
991bef7ea0 Update prusalink to set ConfigEntry version with async_update_entry (#110196) 2024-02-10 19:53:35 +01:00
J. Nick Koston
118712d38d Update islamic_prayer_times to set ConfigEntry version with async_update_entry (#110194) 2024-02-10 19:52:45 +01:00
J. Nick Koston
087e52af6e Update switch_as_x to set ConfigEntry version with async_update_entry (#110193)
* Update switch_as_x to set ConfigEntry version with async_update_entry

* lint
2024-02-10 19:51:47 +01:00
J. Nick Koston
a48c1ac57e Only schedule august activity update when a new activity is seen (#110141) 2024-02-10 09:29:49 -06:00
J. Nick Koston
3441b93c5c Update systemmonitor to set config entry version using async_update_entry (#110192) 2024-02-10 09:20:16 -06:00
Maciej Bieniek
845071f8f0 Add icon translations to Brother (#110128)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-10 12:17:53 +01:00
Piotr Machowski
a2f4e99994 Add state_translated function to jinja templates (#96906)
* Add state_translated jinja function

* Add tests for load_state_translations_to_cache and get_cached_translations

* Cleanup state_translated template

* Add tests for state_translated jinja function

* Apply black formatting

* Improve code quality

* Apply suggestions from code review

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

* Apply suggestions from code review

* Prevent invalid components from loading translations

* Refactor loading translations to cache

* Adjust code issues

* Update homeassistant/helpers/translation.py

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

* Refactor listeners that trigger translation loading

* Apply suggestions from code review

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

* Apply suggestions from code review

* Adjust invalid function calls, fix code styling

* Adjust code quality

* Extract async_translate_state function

* Apply suggestions from code review

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

* Apply suggestions from code review

* Fix tests

* Fix tests

---------

Co-authored-by: Piotr Machowski <PiotrMachowski@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-02-10 10:47:56 +01:00
J. Nick Koston
d1f098c11f Use async_update_entry to update dlna_dmr options in tests (#110117)
needed for #110023
2024-02-10 07:57:58 +01:00
J. Nick Koston
f6d4617c7a Avoid directly changing config entry state in tests (part 2) (#110115)
followup to #110048 for more places
2024-02-10 07:20:15 +01:00
J. Nick Koston
567a179084 Simplify emulated_hue exposed entities cache (#109890)
Also avoids holding stale States in memory which can prevent
garbage collection of linked contexts
2024-02-09 21:43:46 -05:00
J. Nick Koston
b0d3cc150f Use async_update_entry to update esphome options in tests (#110118) 2024-02-09 20:01:33 -06:00
J. Nick Koston
327e54cbfb Bump yalexs to 1.11.2 (#110144)
changelog: https://github.com/bdraco/yalexs/compare/v1.11.1...v1.11.2
2024-02-09 23:30:42 +01:00
Maciej Bieniek
c2818dcb8e Add icon translations to Tractive (#110138)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-09 23:28:56 +01:00
Maciej Bieniek
57bec29266 Add icon translations to NAM (#110135)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-09 23:28:24 +01:00
Maciej Bieniek
0954e4cd73 Add icon translations to GIOS (#110131)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-09 23:28:11 +01:00
Maciej Bieniek
e81a9947e0 Fix typo in sensor icons configuration (#110133)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-09 20:05:01 +01:00
Franck Nijhof
3ac0833f8c Update sentry-sdk to 1.40.3 (#110109) 2024-02-09 20:01:29 +01:00
Marc Mueller
f793fbe492 Update pytest-asyncio to 0.23.5 (#110129) 2024-02-09 19:27:42 +01:00
J. Nick Koston
facf927626 Use async_update_entry in github tests (#110119)
needed for #110023
2024-02-09 18:11:05 +01:00
A Björck
14715c150e Bump yalexs to 1.11.1, fixing camera snapshots from Yale Home (#110089) 2024-02-09 09:09:45 -06:00
J. Nick Koston
9689cb448d Avoid linear search of entity registry in async_extract_referenced_entity_ids (#109667)
* Index area_ids in the entity registry

I missed that these are used in _resolve_area in search.

Eventually we can make async_extract_referenced_entity_ids
a bit faster with this as well

* Avoid linear search of entity registry in async_extract_referenced_entity_ids

needs https://github.com/home-assistant/core/pull/109660
2024-02-09 09:42:30 -05:00
J. Nick Koston
206aaac700 Reduce complexity in the homekit config flow filters (#109850)
* Add typing to entity filters

* Add typing to entity filters

* Add typing to entity filters

* Add typing to entity filters

* tweaks

* tweaks

* tweaks

* tweaks

* tweaks
2024-02-09 09:33:21 -05:00
J. Nick Koston
8e4714c563 Avoid delaying startup in dlna_dmr (#109836)
* Avoid delaying startup in dlna_dmr

fixes #109834

* make sure device info is linked up at startup

* fixes

* update tests

* startup only

* override device info if we have it

* fixes

* make sure its set right away when adding the device

* revert test changes

* coverage

* coverage

* coverage

* coverage

* adjust

* fixes

* more fixes

* coverage

* coverage

* coverage

* tweaks

* tweaks

* Revert "revert test changes"

This reverts commit 014d29297d.

* coverage

* coverage
2024-02-09 09:05:27 -05:00
J. Nick Koston
6e134b325d Make ConfigEntryItems responsible for updating unique ids (#110018)
* Make ConfigEntryItems responsible for updating unique ids

* Make ConfigEntryItems responsible for updating unique ids

* Make ConfigEntryItems responsible for updating unique ids

* Make ConfigEntryItems responsible for updating unique ids

* Make ConfigEntryItems responsible for updating unique ids
2024-02-09 08:51:02 -05:00
J. Nick Koston
ced922bb1a Improve apple_tv error reporting when setup fails (#110071)
* Improve apple_tv error reporting when setup fails

* Improve apple_tv error reporting when setup fails

* Update homeassistant/components/apple_tv/__init__.py

* ensure cleaned up
2024-02-09 08:50:30 -05:00
Erik Montnemery
ae5bef6ffa Fix color mode in flux_led light (#110096) 2024-02-09 14:11:27 +01:00
Erik Montnemery
3ca202a338 Fix scene tests (#110097) 2024-02-09 14:10:59 +01:00
Malte Franken
6499be8528 Bump aio-geojson-usgs-earthquakes to 0.3 (#110084) 2024-02-09 11:31:16 +01:00
Jan Bouwhuis
8aa4157290 Add entry diagnostics to imap integration (#109460) 2024-02-09 11:30:27 +01:00
Franck Nijhof
cfd1f7809f 2024.2.1 (#110078) 2024-02-09 11:04:19 +01:00
Erik Montnemery
793b6aa97d Allow passing version to ConfigEntry.async_update_entry (#110077)
Allow passing minor_version and version to ConfigEntry.async_update_entry
2024-02-09 10:10:25 +01:00
Franck Nijhof
7caf78a926 Update debugpy to 1.8.1 (#110076) 2024-02-09 10:08:23 +01:00
Thomas55555
ec3af2462b Address late review on husqvarna_automower (#109896)
* Address late review on husqvarna_automower

* Add missing credentials string
2024-02-09 09:53:22 +01:00
David Bonnes
86e6fdb57c Bump evohome-async to 0.4.18 (#110056) 2024-02-09 08:49:09 +01:00
Malte Franken
eef5b44282 Bump aio-geojson-geonetnz-volcano to 0.9 (#109940) 2024-02-09 08:45:55 +01:00
J. Nick Koston
b5afdf34f4 Improve ability to debug one time listeners blocking the event loop (#110064) 2024-02-09 08:44:14 +01:00
Christophe Gagnier
720fb7da59 Update pytechnove to 1.2.2 (#110074) 2024-02-09 08:41:48 +01:00
jan iversen
a0abc27612 Avoid key_error in modbus climate with non-defined fan_mode. (#110017) 2024-02-09 08:39:08 +01:00
Michael
d049928be7 Log error and continue on parsing issues of translated strings (#110046) 2024-02-09 08:35:12 +01:00
spycle
d3da6cbcfc Bump pyMicrobot to 0.0.12 (#109970) 2024-02-09 08:33:52 +01:00
Brandon Rothweiler
a3dbe42fa1 Bump py-aosmith to 1.0.8 (#110061) 2024-02-09 08:25:32 +01:00
Franck Nijhof
e7043f5dda Update sentry-sdk to 1.40.2 (#110049) 2024-02-09 08:15:21 +01:00
Jc2k
4f404881dd Remove homekit_controller entity registry entries when backing char or service is gone (#109952) 2024-02-09 07:05:08 +00:00
J. Nick Koston
122ac059bc Convert dhcp watcher to asyncio (#109938) 2024-02-08 22:23:42 -06:00
Allen Porter
261f9c5d62 Cleanup test config entry setup to use best practices (#110070)
* Cleanup test config entry setup to use best practices

* Add missed files
2024-02-08 19:52:40 -08:00
J. Nick Koston
2d8d6ce642 Bump aiodiscover 1.6.1 (#110059)
fixes decoding idna encoding hostnames

changelog: https://github.com/bdraco/aiodiscover/compare/v1.6.0...v1.6.1
2024-02-09 04:27:04 +01:00
Michael Hansen
2681dae60c Matching duplicate named entities is now an error in Assist (#110050)
* Matching duplicate named entities is now an error

* Update snapshot

* Only use area id
2024-02-08 19:38:03 -06:00
J. Nick Koston
02efe41564 Avoid directly changing config entry state in tests (#110048) 2024-02-08 16:31:17 -06:00
Michael
531f2e8443 bump wretry.action@v1.4.4 (#110053) 2024-02-08 23:15:22 +01:00
Bouwe Westerdijk
326c7c0495 Add option-icons for Plugwise Select (#109986) 2024-02-08 20:19:23 +01:00
dependabot[bot]
23fa9103d7 Bump Wandalen/wretry.action from 1.3.0 to 1.4.0 (#109950)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-08 20:14:49 +01:00
Mike Degatano
a0e515df1a Allow disabling home assistant watchdog (#109818) 2024-02-08 20:09:53 +01:00
Bram Kragten
35cb37ffb0 Update frontend to 20240207.1 (#110039) 2024-02-08 20:03:41 +01:00
Marc Mueller
1adbddb754 Update pylint-per-file-ignores to 1.3.2 (#110014) 2024-02-08 17:40:30 +01:00
Robert Resch
69af00b360 Bump deebot-client to 5.1.1 (#109994) 2024-02-08 15:41:37 +01:00
Robert Resch
fa0260a5d5 Bump aioecowitt to 2024.2.1 (#109999) 2024-02-08 15:41:19 +01:00
Erik Montnemery
2f15053311 Don't blow up if config entries have unhashable unique IDs (#109966)
* Don't blow up if config entries have unhashable unique IDs

* Add test

* Add comment on when we remove the guard

* Don't stringify hashable non string unique_id
2024-02-08 15:39:01 +01:00
jan iversen
97c6fd0f8d Allow modbus negative min/max value. (#109995) 2024-02-08 15:34:43 +01:00
Marc Mueller
b329397288 Fix callable import (#110003) 2024-02-08 15:29:55 +01:00
jan iversen
9f50153c8b Allow modbus min/max temperature to be negative. (#109977) 2024-02-08 13:48:33 +01:00
wilburCforce
29d3e17461 Update pylutron to 0.2.11 (#109853) 2024-02-08 13:32:57 +01:00
jan iversen
e968486594 Bump pymodbus to v3.6.4 (#109980) 2024-02-08 13:16:50 +01:00
Marcel van der Veldt
e7213a4192 Handle Matter nodes that become available after startup is done (#109956) 2024-02-08 13:14:10 +01:00
Erik Montnemery
c7957f8e94 Prevent network access in emulated_hue tests (#109991) 2024-02-08 13:00:45 +01:00
jan iversen
55f10656a7 Allow modbus "scale" to be negative. (#109965) 2024-02-08 12:40:32 +01:00
mkmer
168657b724 Catch APIRateLimit in Honeywell (#107806) 2024-02-08 10:51:20 +01:00
Marcel van der Veldt
2d88b77813 Skip polling of unavailable Matter nodes (#109917) 2024-02-08 09:01:48 +01:00
Marcel van der Veldt
d6e617eff8 Bump Python matter server to 5.5.0 (#109894) 2024-02-08 08:59:57 +01:00
Jan-Philipp Benecke
fc5f4bd5b8 Bump aioelectricitymaps to 0.4.0 (#109895) 2024-02-08 08:42:22 +01:00
Michael Hansen
1750f54da4 Assist fixes (#109889)
* Don't pass entity ids in hassil slot lists

* Use first completed response

* Add more tests
2024-02-07 15:13:42 -06:00
Franck Nijhof
9dbf84228e 2024.2.0 (#109883) 2024-02-07 18:31:28 +01:00
Maciej Bieniek
b276a7863b Add missing unique_id check for Shelly Analog Input sensor (#109888)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-07 11:20:53 -06:00
Åke Strandberg
8fd51fcbef Bump myuplink dependency to 0.1.1 (#109878)
Bump myuplink dependeny to 0.1.1
2024-02-07 18:07:53 +01:00
Marc Mueller
de066c7fc0 Reset log level in script tests (#109881) 2024-02-07 17:22:10 +01:00
Maciej Bieniek
b5b09446a1 Add analog input value sensor for Shelly (#109312)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-07 10:22:00 -06:00
Maciej Bieniek
d0384480f5 Test unique IDs for Shelly entities (#109879)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-07 10:18:00 -06:00
Malte Franken
8dd1e741b2 Bump aio-geojson-geonetnz-quakes to 0.16 (#109873) 2024-02-07 16:24:25 +01:00
Jc2k
1ea9b1a158 Add support for air purifiers to HomeKit Device (#109880) 2024-02-07 15:19:42 +00:00
Erik Montnemery
aea81a180c Fix Shelly white light test (#109855) 2024-02-07 15:39:49 +01:00
Erik Montnemery
2e194c4ec3 Fix light color mode in tplink (#109831) 2024-02-07 15:39:36 +01:00
Åke Strandberg
5d1da0b3e4 Remove soft hyphens from myuplink sensor names (#109845)
Remove soft hyphens from sensor names
2024-02-07 15:26:00 +01:00
Matrix
34220200c1 Fix YoLink SpeakerHub support (#107925)
* improve

* Fix when hub offline/online message pushing

* fix as suggestion

* check config entry load state

* Add exception translation
2024-02-07 13:42:33 +01:00
Bram Kragten
521e9eb869 Update frontend to 20240207.0 (#109871) 2024-02-07 12:29:06 +01:00
dcmeglio
1a037da9f5 Add sensor for Ecowitt raw soil moisture value (#109849) 2024-02-07 10:47:40 +01:00
Malte Franken
059c251194 Bump aio-georss-gdacs to 0.9 (#109859) 2024-02-07 10:27:10 +01:00
Marc Mueller
2ae019bfc2 Update syrupy to 4.6.1 (#109860) 2024-02-07 09:56:42 +01:00
Jiayi Chen
4e2f599720 Update Growatt server URLs (#109122) 2024-02-07 09:35:50 +01:00
Thomas55555
6d4ab6c758 Add Husqvarna Automower integration (#109073)
* Add Husqvarna Automower

* Update homeassistant/components/husqvarna_automower/__init__.py

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

* Update homeassistant/components/husqvarna_automower/config_flow.py

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

* Update homeassistant/components/husqvarna_automower/entity.py

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

* Update homeassistant/components/husqvarna_automower/entity.py

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

* Update homeassistant/components/husqvarna_automower/lawn_mower.py

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

* Update homeassistant/components/husqvarna_automower/lawn_mower.py

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

* address review

* add test_config_non_unique_profile

* add missing const

* WIP tests

* tests

* tests

* Update homeassistant/components/husqvarna_automower/api.py

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

* Update homeassistant/components/husqvarna_automower/config_flow.py

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

* Update homeassistant/components/husqvarna_automower/config_flow.py

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

* Update tests/components/husqvarna_automower/conftest.py

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

* .

* loop through test

* Update homeassistant/components/husqvarna_automower/entity.py

* Update homeassistant/components/husqvarna_automower/coordinator.py

* Update homeassistant/components/husqvarna_automower/coordinator.py

* Apply suggestions from code review

* ruff

---------

Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-07 09:27:04 +01:00
Luke Lashley
6f3be3e505 Move Roborock map retrieval to coordinator and made map always diagnostic (#104680)
Co-authored-by: Robert Resch <robert@resch.dev>
2024-02-07 09:13:51 +01:00
Erik Montnemery
586b4ab93d Simplify Hue v2 color mode calculation (#109857) 2024-02-07 08:56:35 +01:00
Josef Zweck
2fc56ff4e4 Add late PR changes to tedee (#109858)
requested changes
2024-02-07 08:53:19 +01:00
Vilppu Vuorinen
5521a39866 Disable energy report based operations with API lib upgrade (#109832)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-02-07 08:45:27 +01:00
Erik Montnemery
b420c65016 Fix hue fallback onoff colormode (#109856)
Co-authored-by: Marcel van der Veldt <m.vanderveldt@outlook.com>
2024-02-07 08:14:55 +01:00
Teemu R
d9f97bc7ec Add tapo virtual integration (#109765) 2024-02-07 06:29:26 +01:00
Joost Lekkerkerker
905e25b3a1 Make integration fields in Analytics Insights optional (#109789) 2024-02-07 06:26:33 +01:00
starkillerOG
8e51affe50 Bump motionblinds to 0.6.20 (#109837) 2024-02-07 06:23:57 +01:00
puddly
26e6bc8a6a Bump ZHA dependency zigpy to 0.62.3 (#109848) 2024-02-07 06:22:54 +01:00
Åke Strandberg
9250dd0355 Add update platform to myuplink (#109786)
* Add update platform to myuplink

* Address comments from review
2024-02-06 23:14:31 +01:00
Joost Lekkerkerker
59e9010b65 Show domain in oauth2 error log (#109708)
* Show token url in oauth2 error log

* Fix tests

* Use domain
2024-02-06 23:03:35 +01:00
Marcel van der Veldt
fd5efd1f79 Add transition support to Matter light platform (#109803)
* Add support for transitions to Matter light platform

* fix the feature check

* add tests
2024-02-06 22:59:55 +01:00
Joost Lekkerkerker
252baa93aa Bump aioecowitt to 2024.2.0 (#109817) 2024-02-06 22:37:20 +01:00
Maciej Bieniek
a6f0b6a005 Ignore trackable without details in Tractive integration (#109814)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-06 22:36:12 +01:00
Franck Nijhof
db16b739a6 Don't block Supervisor entry setup with refreshing updates (#109809) 2024-02-06 22:34:53 +01:00
Joakim Plate
3ec0ea3ef9 Update nibe to 2.8.0 with LOG.SET fixes (#109825)
Update nibe to 2.8.0
2024-02-06 22:06:59 +01:00
Joakim Sørensen
7c233c2bd0 Bump awesomeversion from 23.11.0 to 24.2.0 (#109830) 2024-02-06 21:57:00 +01:00
J. Nick Koston
88086dfa0c Bump aioesphomeapi to 21.0.2 (#109824) 2024-02-06 21:01:10 +01:00
Erik Montnemery
b5f049b84c Bump python-otbr-api to 2.6.0 (#109823) 2024-02-06 21:14:45 +02:00
J. Nick Koston
09c609459d Fix entity services targeting entities outside the platform when using areas/devices (#109810) 2024-02-06 12:41:57 -06:00
Erik Montnemery
674e4ceb2c Make additional methods of google_assistant.AbstractConfig abstract (#109811) 2024-02-06 19:14:12 +01:00
Erik Montnemery
fabcf2948e Bump hass-nabucasa from 0.77.0 to 0.78.0 (#109813) 2024-02-06 19:02:32 +01:00
wittypluck
7d24ae88e6 Mark Unifi bandwidth sensors as unavailable when client disconnects (#109812)
* Set sensor as unavailable instead of resetting value to 0 on disconnect

* Update unit test on unavailable bandwidth sensor
2024-02-06 18:33:10 +01:00
Joost Lekkerkerker
6519b24319 Make bluetooth use naming from the entity description (#97401)
* Make bluetooth use the translation from the entity description

* Remove links to other platforms

* Remove links to other platforms

* Remove links to other platforms

* Add test

* Use is

* Fix test

* Update homeassistant/components/bluetooth/passive_update_processor.py

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

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-06 17:12:15 +01:00
puddly
6295f91a1f Pin chacha20poly1305-reuseable>=0.12.1 (#109807)
* Pin `chacha20poly1305-reuseable`
Prevents a runtime `assert isinstance(cipher, AESGCM)` error

* Update `gen_requirements_all.py` as well
2024-02-06 16:55:51 +01:00
Marc Mueller
545b888034 Update ruff to 0.2.1 (#109796)
* Update ruff to 0.2.1

* Rename config sections

* Update remapped error codes

* Add ignores
2024-02-06 15:41:34 +01:00
puddly
a533fa222e Bump ZHA dependencies (#109770)
* Bump ZHA dependencies

* Bump universal-silabs-flasher to 0.0.18

* Flip `Server_to_Client` enum in ZHA unit test

* Bump zigpy to 0.62.2
2024-02-06 09:40:29 -05:00
Erik Montnemery
0cb913370f Rename google_assistant.AbstractConfig.get_local_agent_user_id (#109798)
* Rename google_assistant.AbstractConfig get_local_agent_user_id to get_local_user_id

* Fix
2024-02-06 15:40:12 +01:00
J. Nick Koston
cf188eabdf Add slots to bluetooth matcher objects (#109768) 2024-02-06 09:40:03 -05:00
Jan-Philipp Benecke
1e5ab3ad47 Bump aioelectricitymaps to 0.3.1 (#109797) 2024-02-06 15:16:15 +01:00
Matthias Alphart
78f21ecc58 Update xknx to 2.12.0 and xknxproject to 3.5.0 (#109787) 2024-02-06 14:30:53 +01:00
Vilppu Vuorinen
198cf28a2a Update MELCloud codeowners (#109793)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2024-02-06 13:27:50 +01:00
Erik Montnemery
1519df6e55 Improve typing of cloud HTTP API (#109780) 2024-02-06 13:09:14 +01:00
Åke Strandberg
25f065a980 Add myuplink sensor descriptions for current and frequency sensors (#109784)
Add device_descriptions for current and frequency sensors
2024-02-06 12:40:03 +01:00
Marc Mueller
5de76c0be0 Include exception when reraising inside except (#109706) 2024-02-06 12:17:39 +01:00
Steven B
6701806ed2 Use has_capability instead of hasattr for ring history (#109791) 2024-02-06 10:55:03 +01:00
Matrix
b8c4821e48 Bump yolink-api to 0.3.7 (#109776) 2024-02-06 10:52:41 +01:00
tronikos
d4c235622f Break long strings in Google generative ai conversation (#109771)
* Update test_init.py

* Update __init__.py
2024-02-06 10:50:58 +01:00
Steven B
f8862f64a1 Bump ring_doorbell to 0.8.7 (#109783) 2024-02-06 10:10:43 +01:00
Jan Bouwhuis
6ca002a6f4 Improve tests of mqtt device triggers (#108318)
Improve tests on mqtt device triggers
2024-02-06 09:38:15 +01:00
Jan Bouwhuis
00947b708f Remove aux heat support from mqtt climate (#109513) 2024-02-06 09:37:39 +01:00
Jan-Philipp Benecke
29462fc991 Change state class of Tesla wall connector session energy entity (#109778) 2024-02-06 09:34:02 +01:00
Joost Lekkerkerker
cc4274bcc0 Fix Radarr health check singularity (#109762)
* Fix Radarr health check singularity

* Fix comment
2024-02-06 07:18:33 +01:00
TheJulianJES
61ce328ce1 Fix docstring length in ZHA sensor class (#109774)
Fix ZHA sensor docstring length
2024-02-06 03:00:45 +01:00
G Johansson
1706156faf Add Process binary sensor in System Monitor (#108585)
* Process binary sensor in System Monitor

* Add repair flow

* add issue

* add platform

* fix repair

* Tests

* Fix tests

* add minor version

* migrate

* Mod repairs

* Fix tests

* config flow test

* Last fixes

* Review comments

* Remove entities during repair

* Remove snapshot
2024-02-06 02:09:05 +01:00
suaveolent
668d036f71 Improve lupusec code quality (#109727)
* renamed async_add_devices

* fixed typo

* patch class instead of __init__

* ensure non blocking get_alarm

* exception handling

* added test case for json decode error

* avoid blockign calls

---------

Co-authored-by: suaveolent <suaveolent@users.noreply.github.com>
2024-02-06 01:20:14 +01:00
TheJulianJES
965f31a9e0 Fix ZHA creating unnecessary "summ received" entity after upgrade (#109268)
* Do not create `current_summ_received` entity until initialized once

* Update zha_devices_list.py to not expect summation received entities

The attribute isn't initialized for these devices in the test (which our check now expects it to be), hence we need to remove them from this list.

* Update sensor tests to have initial state for current_summ_received entity

The attribute needs to be initialized for it to be created which we do by plugging the attribute read.
The test expects the initial state to be "unknown", but hence we plugged the attribute (to create the entity), the state is whatever we plug the attribute read as.

* Update sensor tests to expect not updating current_summ_received entity if it doesn't exist
2024-02-05 19:12:56 -05:00
David F. Mulcahey
13bc018e23 Buffer JsonDecodeError in Flo (#109767) 2024-02-05 18:39:56 -05:00
Erik Montnemery
b7284b92ac Clean up Alexa when logging out from cloud (#109738)
* Clean up Alexa when logging out from cloud

* Add test
2024-02-05 23:58:34 +01:00
J. Nick Koston
6fce8a5403 Avoid linear search of the entity registry in ps4 (#109723) 2024-02-05 17:25:12 -05:00
J. Nick Koston
440212ddce Reduce dict lookups in entity registry indices (#109712) 2024-02-05 17:23:53 -05:00
J. Nick Koston
f73431ac06 Switch utc_to_timestamp to .timestamp() where possible (#109729)
* Switch utc_to_timestamp to .timestamp()

.timestamp() is faster now in newer cpython

```
from homeassistant.util.dt import utc_to_timestamp, utcnow
import timeit
now = utcnow()
print(timeit.timeit('utc_to_timestamp(now)',globals={"now":now,"utc_to_timestamp":utc_to_timestamp}))
print(timeit.timeit('now.timestamp()',globals={"now":now}))
```

utc_to_timestamp = 0.18721245788037777
timestamp = 0.11421508435159922

* compat

* revert

* revert

* revert

* revert

* revert
2024-02-05 23:04:52 +01:00
Vilppu Vuorinen
e399bebbcd Fix compatibility issues with older pymelcloud version (#109757) 2024-02-05 22:30:20 +01:00
G Johansson
4119d20f87 Bump holidays to 0.42 (#109760) 2024-02-05 15:59:02 -05:00
J. Nick Koston
908cedf981 Avoid linear search of entity registry in async_clear_config_entry (#109724) 2024-02-05 14:12:16 -06:00
J. Nick Koston
e9a41e5023 Avoid linear search in entity registry to clear an area (#109735) 2024-02-05 13:53:33 -06:00
Jirka
d27ca83694 Fix string in xiaomi_ble (#109758)
Update strings.json

Fixed typo:
From
"rotate_right_pressed": "Rotate left (pressed)"
to
"rotate_right_pressed": "Rotate right (pressed)"
2024-02-05 21:50:37 +02:00
Michael Hansen
5b1e0b2602 Set default for OSTYPE in run-in-env script (#109731) 2024-02-05 20:23:52 +01:00
Erik Montnemery
49a99559c7 Remove lru cache size limit of TemperatureConverter (#109726) 2024-02-05 20:21:04 +01:00
Jan Bouwhuis
94ccd59123 Fix generic camera error when template renders to an invalid URL (#109737) 2024-02-05 20:19:38 +01:00
Michael
45f44e9216 Use tracked entity friendly name for proximity sensors (#109744)
user tracked entity friendly name
2024-02-05 20:18:59 +01:00
Vilppu Vuorinen
189f3dacfb Reduce MELCloud poll frequency to avoid throttling (#109750) 2024-02-05 20:18:01 +01:00
G Johansson
3752e14362 Add missing new climate feature flags to Mill (#109748) 2024-02-05 20:17:13 +01:00
Bouwe Westerdijk
2899c296a8 Fix incorrectly assigning supported features for plugwise climates (#109749) 2024-02-05 20:15:51 +01:00
Joost Lekkerkerker
2318d28127 Handle startup error in Analytics insights (#109755) 2024-02-05 20:14:34 +01:00
Erik Montnemery
9d42455955 Move async_deinitialize to google_assistant AbstractConfig (#109736) 2024-02-05 19:53:22 +01:00
Simone Chemelli
3294506190 Queue climate calls for Comelit SimpleHome (#109707) 2024-02-05 18:52:58 +01:00
Cyrill Raccaud
53d46acc50 Bump python-bring-api to 3.0.0 (#109720) 2024-02-05 18:51:01 +01:00
Marc Mueller
ed7307cdaf Use builtin TimeoutError [socket.timeout] (#109704) 2024-02-05 18:46:11 +01:00
Marc Mueller
46f8fb3ac1 Use builtin TimeoutError [misc] (#109703) 2024-02-05 18:45:16 +01:00
Jan Bouwhuis
5dfffb0818 Allow weight to be used as total_increasing state_class for sensors (#108505)
* Allow weight to be used as total_increasing state_class for sensors

* Add SensorStateClass.TOTAL
2024-02-05 18:01:06 +01:00
Pascal Reeb
be6399410e Use a single call to add entities in Nuki (#109696)
* Nuki: use a single call to add entities

* Clean up list addition

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-02-05 17:09:18 +01:00
J. Nick Koston
6f28d79651 Copy callbacks instead of slice for event dispatch (#109711)
We established copy is faster in
https://github.com/home-assistant/core/pull/108428#discussion_r1466932262
2024-02-05 17:07:21 +01:00
Joost Lekkerkerker
8df305c881 Remove obsolete check from Proximity (#109701) 2024-02-05 16:32:39 +01:00
Joost Lekkerkerker
aaff8a8c62 Add strings to Ruuvitag BLE (#109717) 2024-02-05 16:26:25 +01:00
Bram Kragten
0e9628bba0 Update frontend to 20240205.0 (#109716) 2024-02-05 16:09:33 +01:00
Joost Lekkerkerker
3bcd367b65 Set Analytics Insights as diagnostic (#109702)
* Set Analytics Insights as diagnostic

* Set Analytics Insights as diagnostic
2024-02-05 16:03:14 +01:00
Erik Montnemery
ebda0472e9 Bump hass-nabucasa from 0.76.0 to 0.77.0 (#109699) 2024-02-05 15:11:39 +01:00
Joakim Sørensen
d49eff651b Fix log string in Traccar Server Coordinator (#109709) 2024-02-05 15:10:32 +01:00
Marc Mueller
bf8bd5ff21 Use dict.get instead of inline if (#109693) 2024-02-05 13:56:10 +01:00
Erik Montnemery
30710815f0 Add test of remote enabling of remote UI (#109698) 2024-02-05 13:07:57 +01:00
Joost Lekkerkerker
70ceddf165 Set shorthand attribute in Epion (#109695) 2024-02-05 12:41:25 +01:00
Marcel van der Veldt
682fff73f5 Bump python matter server to 5.4.1 (#109692) 2024-02-05 12:40:40 +01:00
Joost Lekkerkerker
8022d758ea Add data descriptions to analytics insights (#109694) 2024-02-05 12:30:09 +01:00
Erik Montnemery
f1d3c417f9 Remove homeassistant_yellow config entry if hassio is not present (#109686) 2024-02-05 12:29:25 +01:00
Erik Montnemery
048d9e75e6 Remove homeassistant_green config entry if hassio is not present (#109685) 2024-02-05 12:26:58 +01:00
J. Nick Koston
40166ed51e Avoid linear search of device registry when no areas are referenced in service calls (#109669) 2024-02-05 12:26:08 +01:00
Erik Montnemery
93e0810938 Remove hardkernel config entry if hassio is not present (#109680) 2024-02-05 12:25:26 +01:00
Erik Montnemery
c096ac56db Remove raspberry_pi config entry if hassio is not present (#109687) 2024-02-05 12:23:30 +01:00
Marc Mueller
8b0c9d3d18 Use builtin TimeoutError [t-z] (#109683) 2024-02-05 12:20:36 +01:00
Marc Mueller
438d3b01b9 Use builtin TimeoutError [o-s] (#109682) 2024-02-05 12:14:37 +01:00
Marc Mueller
cd0ee98dba Use builtin TimeoutError [core + helpers] (#109684) 2024-02-05 12:09:54 +01:00
Marc Mueller
a9147cf3dd Use builtin TimeoutError [k-n] (#109681) 2024-02-05 12:08:18 +01:00
Marc Mueller
7a89e58873 Use builtin TimeoutError [e-i] (#109679) 2024-02-05 12:00:37 +01:00
Marc Mueller
c82933175d Use builtin TimeoutError [a-d] (#109678) 2024-02-05 11:31:33 +01:00
Myles Eftos
41a256a3ff Show site state in Amberelectric config flow (#104702) 2024-02-05 10:53:42 +01:00
spycle
bfebde0f79 Bump pyMicrobot to 0.0.10 (#109628) 2024-02-05 10:34:14 +01:00
Kevin Worrel
0bfef71f1b Screenlogic service refactor (#109041) 2024-02-05 09:05:28 +01:00
ollo69
b56dd3f808 Don't create AsusWRT loadavg sensors when unavailable (#106790) 2024-02-05 09:03:43 +01:00
J. Nick Koston
458e1f3a5e Index area_ids in the entity registry (#109660) 2024-02-05 09:01:43 +01:00
Jan Bouwhuis
7ab1cdc2b3 Move nested code to class level as static method in imap coordinator (#109665)
* Move _decode_payload to module level in imap coordinator

* Make static method
2024-02-05 08:59:03 +01:00
David F. Mulcahey
c9fd97c6a3 Buffer TImeoutError in Flo (#109675) 2024-02-05 08:58:08 +01:00
dependabot[bot]
0a8e4b5958 Bump github/codeql-action from 3.23.2 to 3.24.0 (#109677)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 08:55:39 +01:00
J. Nick Koston
57f4f061a6 Use identity check in hassio websocket ingress (#109672) 2024-02-05 08:55:19 +01:00
jjlawren
a5bd0292da Bump plexapi to 4.15.9 (#109676) 2024-02-05 08:52:37 +01:00
Michael
c34f5dd0b9 Add icon translation to proximity (#109664)
add icon translations
2024-02-05 01:36:11 +01:00
Michael
31ad48b2b7 Add missing translation string to Home Assistant Analytics Insights (#109666)
add missing string
2024-02-05 01:27:42 +01:00
Michael
ffe9f0825a Add zone related sensors in proximity (#109630)
* move legacy needed convertions into legacy entity

* add zone related sensors

* fix test coverage

* fix typing

* fix entity name translations

* rename placeholder to tracked_entity
2024-02-05 00:42:07 +01:00
Ernst Klamer
a95a51da05 Add Xiaomi-ble remotes and dimmers (#109327) 2024-02-05 00:30:47 +01:00
Malte Franken
3def42726a Bump georss-generic-client to 0.8 (#109658) 2024-02-05 00:27:49 +01:00
Tucker Kern
3abc48b7c1 Add icons for fan preset modes (#109334)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-02-04 23:58:44 +01:00
Leah Oswald
02fb60b33e Fix home connect remaining progress time (#109525)
* fix remaining progress time for home connect component

The home connect API is sending some default values (on dishwashers) for
the remaining progress time after the program finished. This is a problem
because this value is stored and on every API event, for example opening
the door of a dishwasher, the value for remaining progress time is
updated with this wrong value. So I see a wrong value the whole time the
dishwasher is not running and therefore has no remaining progress time.
This coming fixes this problem and adds a check if the appliance is in
running, pause or finished state, because there we have valid data. In
the other states the new code just returns none like on other edge
cases. Now there is no value if there is no program running.

* fix some formating according to the ruff rules

* fix some formating according to the ruff rules again

* fix alphabetic order of imports

* add check if keys exist in dict before accessing them

check if BSH_OPERATION_STATE and ATTR_VALUE key values exist before
accessing them later in the elif statement

* fix formating because forgotten local ruff run
2024-02-04 23:56:12 +01:00
J. Nick Koston
73589015c3 Improve scalability of DHCP matchers (#109406) 2024-02-04 16:50:08 -06:00
Joost Lekkerkerker
52d27230bc Add icon translations to Random (#109652) 2024-02-04 23:23:10 +01:00
Jan-Philipp Benecke
f18448950c Add icon translations to Utility meter helper (#109656) 2024-02-04 23:21:57 +01:00
Franck Nijhof
945aff6050 Fix Tuya reauth_successful translation string (#109659) 2024-02-04 23:21:18 +01:00
Joost Lekkerkerker
0b3ed92a6e Add icon translations to derivative (#109650) 2024-02-04 23:20:46 +01:00
Joost Lekkerkerker
c3690e74c5 Add icon translations to Counter (#109651) 2024-02-04 23:20:14 +01:00
J. Nick Koston
9fef1938b4 Make get_entries_for_device_id skip disabled devices by default (#109645) 2024-02-04 23:11:56 +01:00
Joost Lekkerkerker
2c0b897658 Allow the helper integrations to omit icon translation field (#109648) 2024-02-04 22:57:11 +01:00
Franck Nijhof
10d3b10da4 Improve Tuya token/reauth handling (#109653) 2024-02-04 22:56:22 +01:00
spycle
63ec20ab5d Fix keymitt_ble config-flow (#109644)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-04 22:50:28 +01:00
Aaron Bach
edc6e3e2f9 Bump aionotion to 2024.02.0 (#109577) 2024-02-04 14:35:08 -07:00
Cody C
770119c8ad Handle GeoJSON int to str conversion when the name is an int (#108937)
Co-authored-by: Chris Roberts <NasaGeek@users.noreply.github.com>
2024-02-04 21:26:05 +01:00
Jan Bouwhuis
7cc0b8a2fe Fix imap message part decoding (#109523) 2024-02-04 21:25:14 +01:00
J. Nick Koston
f37db94f23 Avoid linear search of entity registry in async_get_device_automations (#109633) 2024-02-04 14:22:12 -06:00
J. Nick Koston
6003ae149a Avoid linear search of entity registry in ruckus_unleashed (#109643) 2024-02-04 15:20:55 -05:00
J. Nick Koston
74812261d4 Avoid linear search of entity registry in rainmachine (#109642) 2024-02-04 21:17:40 +01:00
J. Nick Koston
113d38361d Avoid linear search of entity registry in nmap_tracker (#109640) 2024-02-04 15:16:31 -05:00
G Johansson
bc45b31335 Fix repairs for remove dates in Workday (#109626) 2024-02-04 21:15:17 +01:00
J. Nick Koston
babfdaac54 Avoid linear search of entity registry in mikrotik (#109639) 2024-02-04 21:13:23 +01:00
J. Nick Koston
3531444e2e Avoid linear search of entity registry in huawei_lte (#109637) 2024-02-04 21:13:06 +01:00
J. Nick Koston
13a5038c17 Avoid linear search of entity registry in lcn (#109638) 2024-02-04 21:12:43 +01:00
J. Nick Koston
6ccf82d7b1 Avoid linear search of entity registry in keenetic_ndms2 (#109635) 2024-02-04 21:12:24 +01:00
J. Nick Koston
c988d3d427 Avoid linear search of entity registry in guardian (#109634) 2024-02-04 21:11:56 +01:00
J. Nick Koston
b24b4fc237 Use get_entries_for_config_entry_id helper in async_migrate_entries (#109629) 2024-02-04 21:05:48 +01:00
J. Nick Koston
7e3001f843 Remove default values from calls to async_fire (#109613)
There were a few places were we passing unnecessary default values. Since
this code tends to get copied, remove them
2024-02-04 14:49:42 -05:00
J. Nick Koston
a7c074e388 Reduce complexity of shelly button setup (#109625) 2024-02-04 13:38:36 -06:00
G Johansson
7572a73c16 Add debug logger for cpu temp in System Monitor (#109627) 2024-02-04 20:11:28 +01:00
Franck Nijhof
b553bb71e6 Fix Tuya QR code expiry, use native QR selector (#109615)
* Fix Tuya QR code expiry, use native QR selector

* Adjust tests
2024-02-04 18:58:09 +01:00
Joakim Sørensen
e96f574a79 Add diagnostics platform to Traccar Server (#109521) 2024-02-04 18:40:44 +01:00
Franck Nijhof
c14ad6455f Update orjson to 3.9.13 (#109614) 2024-02-04 11:37:16 -06:00
J. Nick Koston
8d4f32645d Add tests for shelly switch unique ids (#109617) 2024-02-04 11:23:33 -06:00
J. Nick Koston
e35c7fde89 Avoid many string lowers in the state machine (#109607) 2024-02-04 17:35:35 +01:00
Cody C
2c91b31233 Remove default name prefix of HomePods from Suggested Area in Apple TV integration (#109489) 2024-02-04 17:22:22 +01:00
David F. Mulcahey
8a9478b714 Update Flo test to address review comment (#109604)
* Update Flo test to address review comment

* update comment

* clean up

* cleanup

* change mock

* remove unnecessary assert

* review comment
2024-02-04 17:05:51 +01:00
J. Nick Koston
3db0331378 Avoid converting to same units when compiling stats (#109531) 2024-02-04 15:21:05 +01:00
Klaas Schoute
9de9852c94 Add SamSam virtual integration (#109602) 2024-02-04 15:18:24 +01:00
Klaas Schoute
7042ae0596 Add ZonderGas virtual integration (#109601) 2024-02-04 15:16:25 +01:00
J. Nick Koston
2f724b042b Avoid looking up services to check if they support responses (#109588)
We already have the Service object as its the value in the
services_map so there is not need to look it up again
2024-02-04 15:15:51 +01:00
G Johansson
e877113b21 Add back logging for core for feature flags in climate (#109572) 2024-02-04 15:15:00 +01:00
J. Nick Koston
a74516a80d Cache path for Store helper (#109587) 2024-02-04 15:13:58 +01:00
Michael
ac8a4f4b05 Redact location names in proximity diagnostics (#109600) 2024-02-04 15:12:08 +01:00
G Johansson
8ef2bece59 Add new climate feature flags to lyric (#109571) 2024-02-04 15:03:48 +01:00
G Johansson
846dae675c Add new climate feature flags to lcn (#109566) 2024-02-04 15:03:14 +01:00
G Johansson
2950c402d7 Fix new climate feature flags in intesishome (#109563) 2024-02-04 15:02:52 +01:00
Josef Zweck
ae70729932 Revert "Add webhook support to tedee integration (#106846)" (#109408) 2024-02-04 15:02:21 +01:00
Joakim Plate
eefc6cd50a Correct flow rate conversion review after merge (#109501) 2024-02-04 15:01:06 +01:00
G Johansson
e109ed53eb Add new climate feature flags to switcher_kis (#109459) 2024-02-04 15:00:31 +01:00
G Johansson
c732668d6e Add migrated climate feature flag to switchbee (#109458) 2024-02-04 14:59:34 +01:00
G Johansson
9831da34ce Add new climate feature flags to esphome (#109428) 2024-02-04 14:57:26 +01:00
G Johansson
baa511b808 Fix group sensor uom's in not convertable device classes (#109580) 2024-02-04 14:56:23 +01:00
Michael
17f1aa644b Avoid duplicate entity names in proximity (#109413)
* avoid duplicate config entry title

* consecutive range 2..10

* use existing logic
2024-02-04 13:26:51 +01:00
G Johansson
6e5a085413 Add new climate feature flags to tuya (#109434) 2024-02-04 11:40:37 +01:00
G Johansson
37f3fcbdaf Add climate feature flags to spider (#109456) 2024-02-04 11:39:04 +01:00
G Johansson
89d77ee8ab Add new climate feature flags for plugwise (#109464) 2024-02-04 11:37:52 +01:00
J. Nick Koston
7d9935d24b Reduce overhead to convert history to float states (#109526) 2024-02-04 11:37:14 +01:00
TheJulianJES
9fbf00bdd3 Move climate feature flags to child classes for airzone_cloud (#109515) 2024-02-04 11:30:30 +01:00
Josef Zweck
6c41540ad8 Bugfix lamarzocco issue (#109596) 2024-02-04 11:29:32 +01:00
G Johansson
83380c0f7d Add new climate feature flags to insteon (#109560) 2024-02-04 10:42:32 +01:00
G Johansson
6e38da15f0 Add migrated climate feature flags to incomfort (#109559) 2024-02-04 10:41:53 +01:00
G Johansson
0b3f4f1720 Add new climate feature flags to honeywell (#109556)
Adds new climate feature flags to honeywell
2024-02-04 10:41:07 +01:00
G Johansson
552b14c5e8 Add new climate feature flags to homematic (#109554)
Adds new climate feature flags to homematic
2024-02-04 10:40:02 +01:00
G Johansson
b655507738 Add new climate feature flags to generic_thermostat (#109548)
Adds new climate feature flags to generic_thermostat
2024-02-04 10:38:09 +01:00
G Johansson
6b6d0606ac Add new climate feature flags to electrasmart (#109542)
Adds new climate feature flags to electrasmart
2024-02-04 10:31:23 +01:00
G Johansson
f154b7f2d9 Add new climate feature flags to econet (#109541)
Adds new climate feature flags to econet
2024-02-04 10:30:09 +01:00
G Johansson
7730efdaa2 Add new climate feature flags to ecobee (#109540)
Adds new climate feature flags to ecobee
2024-02-04 10:28:49 +01:00
G Johansson
d7c6e85cc4 Add new climate feature flags to comelit (#109535)
Adds new climate feature flags to comelit
2024-02-04 10:28:10 +01:00
Cody C
153c82c2d2 Fix empty error modal when adding duplicate Thread integration (#109530) 2024-02-04 10:25:31 +01:00
J. Nick Koston
0a248d0f87 Bump yalexs-ble to 2.4.1 (#109585)
changelog: https://github.com/bdraco/yalexs-ble/compare/v2.4.0...v2.4.1
2024-02-04 10:17:13 +01:00
tronikos
ac20d49c8f Fix Google generative AI service example (#109594)
Update strings.json
2024-02-04 10:13:35 +01:00
Matrix
630c8b28ca Fix yolink abnormal status when LeakSensor detection mode changes to "no water detect" (#109575)
Add no water detect support
2024-02-04 08:27:57 +01:00
G Johansson
f6d2f6117a Fix overkiz climate feature flags for valve heating (#109582)
* Fix overkiz climate feature flags for valve heating

* Update homeassistant/components/overkiz/climate_entities/valve_heating_temperature_interface.py
2024-02-04 03:52:33 +01:00
G Johansson
5041ee3c28 Add new climate feature flags to ephember (#109544)
Adds new climate feature flags to ephember
2024-02-04 03:29:29 +01:00
G Johansson
5f8248dc77 Add migrated climate feature flags to fritzbox (#109547)
Adds migrated climate feature flags to fritzbox
2024-02-04 02:32:35 +01:00
G Johansson
810e5f9f67 Add migrated climate feature flags to livisi (#109569) 2024-02-04 02:31:05 +01:00
G Johansson
a2d574355b Add new climate feature flags to izone (#109565) 2024-02-04 02:30:55 +01:00
G Johansson
470aef7483 Add new climate feature flags to lightwave (#109568) 2024-02-04 02:30:08 +01:00
G Johansson
c94eb436fb Add new climate feature flags to heatmiser (#109551)
Adds new climate feature flags to heatmiser
2024-02-04 02:29:56 +01:00
G Johansson
24be51b223 Add new climate feature flags to iaqualink (#109558) 2024-02-04 02:29:40 +01:00
G Johansson
b376f93fe6 Add migrated climate feature flags to homematicip_cloud (#109555)
Adds migrated climate feature flags to homematicip_cloud
2024-02-04 02:28:45 +01:00
G Johansson
cfeafb410c Add new climate feature flags to huum (#109557)
Adds new climate feature flags to huum
2024-02-04 02:28:33 +01:00
G Johansson
97db23fe82 Add new climate feature flags to intellifire (#109562) 2024-02-04 02:28:15 +01:00
G Johansson
a173655050 Add new climate feature flags to hive (#109553)
Adds new climate feature flags to hive
2024-02-04 02:27:42 +01:00
G Johansson
b5055df374 Add new climate feature flags to hisense (#109552)
Adds new climate feature flags to hisense
2024-02-04 02:27:30 +01:00
G Johansson
5f02d17873 Add new climate feature flags to duotecno (#109539)
Adds new climate feature flags to duotecno
2024-02-04 02:27:04 +01:00
G Johansson
f5ca82923d Add migrated climate feature flags to devolo home control (#109538)
Adds migrated climate feature flags to devolo home control
2024-02-04 02:26:53 +01:00
G Johansson
45d8581bf1 Add new climate feature flags to gree (#109550)
Adds new climate feature flags to gree
2024-02-04 02:26:44 +01:00
G Johansson
3429a4733d Add new climate feature flags to escea (#109545)
Adds new climate feature flags to escea
2024-02-04 02:24:28 +01:00
G Johansson
39bd9cf6a2 Add new climate feature flags to freedompro (#109546)
Adds new climate feature flags to freedompro
2024-02-04 02:24:18 +01:00
G Johansson
760cbaa939 Add new climate feature flags to geniushub (#109549)
Adds new climate feature flags to geniushub
2024-02-04 02:23:59 +01:00
G Johansson
ec6122abd5 Add migrated climate feature flags to daikin (#109537)
Adds migrated climate feature flags to daikin
2024-02-04 02:23:23 +01:00
G Johansson
6661b53530 Add new climate feature flags for airtouch5 (#109422)
* Add new climate feature flags for airtouch5

* adapt
2024-02-04 02:23:06 +01:00
G Johansson
e649fe9380 Add migrated climate feature flags to coolmaster (#109536)
Adds migrated climate feature flags to coolmaster
2024-02-04 02:22:43 +01:00
G Johansson
b49193caf7 Add new climate feature flags to lookin (#109570) 2024-02-03 19:11:02 -06:00
G Johansson
dd587d6fe5 Add new climate feature flags to isy994 (#109564) 2024-02-03 19:10:34 -06:00
G Johansson
ebf533f0ff Add new climate feature flags to ccm15 (#109534)
Adds new climate feature flags to ccm15
2024-02-04 01:18:25 +01:00
G Johansson
96f0fc9ae5 Add ClimateEntityFeatures to airtouch4 (#109421)
* Add ClimateEntityFeatures to airtouch4

* adapt
2024-02-04 00:47:05 +01:00
G Johansson
a7b52c8dd7 Adds new climate feature flags to elkm1 (#109543) 2024-02-04 00:46:47 +01:00
David F. Mulcahey
63da42f394 Prevent Flo devices and entities from going unavailable when a single refresh fails (#109522)
* Prevent Flo devices and entities from going unavailable when a single refresh fails

* review comment
2024-02-03 18:30:00 -05:00
Brett Adams
da29b4ef16 Add Speed Limit to Tessie lock platform (#106527)
* Add speed limit

* Make regex more readable

* Add tests

* Add test

* Ruff

* Remove extra line

* Update snapshot

* Remove bad snapshot
2024-02-03 22:21:19 +01:00
Klaas Schoute
7e299c2142 Bump easyenergy lib to v2.1.1 (#109510) 2024-02-03 20:20:17 +01:00
J. Nick Koston
1c268b1724 Bump mopeka-iot-ble to 0.7.0 (#109516) 2024-02-03 12:11:40 -06:00
Aidas Klimas
978d2a79f6 Bump qingping_ble to 0.10.0 - Add support for GCP22C (Qingping CO2 Temp RH) (#108567)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-02-03 11:23:19 -06:00
Matthias Alphart
ad0ee7d781 Update pyfronius to 0.7.3 (#109507) 2024-02-03 17:34:50 +02:00
J. Nick Koston
5bda4be88f Remove useless _handle_pipeline_event function in ESPHome (#109484) 2024-02-03 14:15:56 +01:00
Cody C
897ea272d6 Update Twinkly DHCP discovery addresses (#109495) 2024-02-03 14:12:55 +01:00
Christopher Fenner
bb8d742423 Ignore gateway devices in ViCare integration (#106477)
* filter unsupported devices

* Update __init__.py

* use debug

* remove dead code
2024-02-03 12:53:22 +01:00
Jurriaan Pruis
3f7d2da35c Bump matrix-nio to 0.24.0 (#109403)
Update matrix-nio to 0.24.0
2024-02-03 12:31:48 +01:00
G Johansson
33f3fb32d8 Add migrated climate feature flags to overkiz (#109463) 2024-02-03 12:25:52 +01:00
Michael Hansen
c6ea57458c Pass slots to error messages instead of IDs [rework] (#109410)
Co-authored-by: tetele <tm.sandu@gmail.com>
2024-02-03 12:14:33 +01:00
G Johansson
29556465de Add migrated climate feature flags to vicare (#109439) 2024-02-03 12:13:52 +01:00
G Johansson
6c8636ae7b Add new climate feature flags to evohome (#109429) 2024-02-03 12:13:20 +01:00
G Johansson
96feec9cbf Add migrated climate feature flags to smartthings (#109426) 2024-02-03 12:11:39 +01:00
G Johansson
8bec20ffa7 Add ClimateEntityFeatures to Nest (#109417) 2024-02-03 12:11:19 +01:00
G Johansson
5b9a3d5bd5 Add migrated ClimateEntityFeature to MQTT (#109419) 2024-02-03 12:08:58 +01:00
Jan-Philipp Benecke
c233a12946 Fix Tankerkoenig diagnostics file to use right format (#109494)
Fix tankerkoenig diagnostics file
2024-02-03 11:51:23 +01:00
G Johansson
98892f5b41 Add new feature flags to melcloud (#109468) 2024-02-03 11:18:40 +01:00
G Johansson
e0f0159304 Add new climate feature flags to blebox (#109478) 2024-02-03 11:18:00 +01:00
G Johansson
f15aa037ef Add new climate feature flags to deconz (#109482) 2024-02-03 11:17:20 +01:00
G Johansson
28337fb941 Add new climate feature flags to demo (#109481) 2024-02-03 11:07:56 +01:00
jjlawren
68797feac5 Do not suggest area for portable Sonos speakers (#109350)
* Do not suggest area for portable speakers

* Update tests

* Improve readability, update tests
2024-02-03 09:20:10 +01:00
Joakim Sørensen
d44b00f851 Change IoT class for Traccar Client (#109493) 2024-02-03 09:14:52 +01:00
Erik Montnemery
fe4dd2cb93 Improve color mode handling in light groups (#109390)
* Improve color mode handling in light groups

* Update config flow test
2024-02-03 09:00:00 +01:00
Joakim Sørensen
6f9876d5e0 Extend the history of Elvia history to 3 years (#109490)
Extend the history of Elvia data to 3 years
2024-02-03 08:16:28 +01:00
G Johansson
a1cbc62ddc Add new climate feature flags to mysensors (#109471)
Adds new climate feature flags to mysensors
2024-02-03 08:03:38 +01:00
Teemu R
5f1d20c5e2 Add new OUIs for tplink (#109437) 2024-02-03 07:50:33 +01:00
J. Nick Koston
53db392150 Convert auth token removal websocket api to normal functions (#109432)
There was nothing being awaited here anymore
2024-02-03 07:47:07 +01:00
Jc2k
0884215130 Bump aiohomekit to 3.1.4 (#109414) 2024-02-03 07:39:35 +01:00
G Johansson
0d881dfc12 Adds new climate feature flags for airzone_cloud (#109424) 2024-02-03 07:06:53 +01:00
G Johansson
8f637d3ca7 Adds migrated climate feature flags for proliphix (#109465) 2024-02-03 07:06:21 +01:00
G Johansson
7666c432e4 Adds new climate feature flags to maxcube (#109467) 2024-02-03 07:05:46 +01:00
G Johansson
82a2980cbd Adds new climate feature flags to melissa (#109469) 2024-02-03 07:05:33 +01:00
G Johansson
eb7d125976 Add migrated climate feature flags to moehlenhoff (#109470) 2024-02-03 07:05:16 +01:00
G Johansson
366da3e01f Adds new climate feature flags to bsblan (#109480) 2024-02-03 07:04:26 +01:00
G Johansson
d4c0a9a847 Adds new climate feature flags to broadlink (#109479) 2024-02-03 07:04:11 +01:00
G Johansson
3e903495fa Adds migrated climate feature flags in balboa (#109477) 2024-02-03 07:03:59 +01:00
G Johansson
b990e96636 Adds new climate feature flags to ambiclimate (#109475) 2024-02-03 07:03:44 +01:00
G Johansson
69f5b5e78e Adds migrated climate feature flags in nuheat (#109474) 2024-02-03 07:03:34 +01:00
G Johansson
3039616133 Adds migrated climate feature flags to nobo_hub (#109473) 2024-02-03 07:03:14 +01:00
G Johansson
c0fd709b3e Add migrated climate feature flags to smarttub (#109427) 2024-02-03 06:42:10 +01:00
G Johansson
9360165ba7 Add migrated climate feature flags to opentherm_gw (#109462) 2024-02-02 22:54:01 -05:00
G Johansson
7b132dc189 Add new climate feature flags to oem (#109461) 2024-02-02 22:51:38 -05:00
G Johansson
9325243ef2 Add new climate feature flags to stiebel_eltron (#109457) 2024-02-02 22:45:06 -05:00
G Johansson
de308fbd55 Add migrated climate feature flags to senz (#109455) 2024-02-02 22:44:04 -05:00
G Johansson
88aec4af72 Add new climate feature flags to screenlogic (#109454) 2024-02-02 22:42:37 -05:00
G Johansson
b7f2ae4e3a Add migrated climate feature flags to schluter (#109452) 2024-02-02 22:41:28 -05:00
G Johansson
a69fe882ff Add migrated climate feature flags to touchline (#109451) 2024-02-02 22:41:08 -05:00
G Johansson
a6b912b282 Add migrated climate feature flags to xs1 (#109441) 2024-02-02 22:40:50 -05:00
G Johansson
3c8bfce3a4 Add migrated climate feature flags to toon (#109450) 2024-02-02 22:40:17 -05:00
G Johansson
26caa85179 Add migrated climate feature flags to tolo (#109449) 2024-02-02 22:39:37 -05:00
G Johansson
e308dcf398 Add new climate feature flags to tfiac (#109448) 2024-02-02 22:39:18 -05:00
G Johansson
f40e2ecb95 Add migrated climate feature flags for tessie (#109447) 2024-02-02 22:38:40 -05:00
G Johansson
04ce480d65 Add migrated climate feature flags to teslemetry (#109446) 2024-02-02 22:37:49 -05:00
G Johansson
96a3aac78e Add new climate feature flags to yolink (#109442) 2024-02-02 22:37:14 -05:00
G Johansson
5462badebf Add migrated climate feature flags to zwave_me (#109445) 2024-02-02 22:36:43 -05:00
G Johansson
1d3c5d92ea Add new climate feature flags to whirlpool (#109440) 2024-02-02 22:36:19 -05:00
G Johansson
bb6051f9c4 Add new climate feature flags to zhong_hong (#109444) 2024-02-02 22:35:16 -05:00
G Johansson
63f78dece0 Add new climate feature flags to venstar (#109436) 2024-02-02 22:33:55 -05:00
G Johansson
fe25975cab Adds migrated climate entity feature for velbus (#109435) 2024-02-02 22:33:42 -05:00
G Johansson
974cee2349 Add migrated feature flags to vera (#109438) 2024-02-02 22:33:03 -05:00
G Johansson
ab5163fb5e Add migrated climate entity features to flexit (#109430) 2024-02-02 22:32:47 -05:00
G Johansson
5c3707ec9c Add new climate feature flags to airzone (#109423) 2024-02-03 04:02:19 +01:00
G Johansson
79bcf60c73 Adds migrated ClimateEntityFeature to Netatmo (#109418) 2024-02-03 03:56:57 +01:00
G Johansson
1fba47fc8e Add new climate feature flags to radiotherm (#109466) 2024-02-03 03:50:24 +01:00
G Johansson
fbb7c9003f Add new ClimateEntityFeature for Tado (#109416) 2024-02-03 03:47:09 +01:00
G Johansson
268c84a379 Add Mill migrated ClimateEntityFeatures (#109415) 2024-02-03 03:41:25 +01:00
G Johansson
0ef95c2d4b Add migrated ClimateEntityFeatures to advantage_air (#109420)
* Add migrated ClimateEntityFeatures to advantage_air

* AdvantageAirZone
2024-02-03 03:30:53 +01:00
Michael Hansen
3347a3f8a6 More thorough checks in ESPHome voice assistant UDP server (#109394)
* More thorough checks in UDP server

* Simplify and change to stop_requested

* Check transport
2024-02-02 21:26:44 -05:00
G Johansson
ae210886c1 Add migrated climate feature flags to nexia (#109472) 2024-02-03 03:26:17 +01:00
G Johansson
61cf7862a0 Adds new climate feature flags in baf (#109476) 2024-02-03 03:26:04 +01:00
G Johansson
16b20403e6 Add migrated climate feature flags to zha (#109443) 2024-02-03 03:06:55 +01:00
Michael Hansen
595dd651bb Bump intents to 2024.2.2 (#109412)
Bump intents to 2024.2.2
2024-02-02 20:13:17 -05:00
G Johansson
3c15a2216d Add migrated climate feature flags to homekit_controller (#109433) 2024-02-03 01:46:27 +01:00
G Johansson
97e6391b9a Add migrated climate feature flags to shelly (#109425) 2024-02-03 01:46:14 +01:00
G Johansson
e0fc328e27 Add new climate feature flags to flexit_bacnet (#109431) 2024-02-03 01:43:32 +01:00
Jan-Philipp Benecke
99fcff47f9 Bump aioelectricitymaps to 0.3.0 (#109399)
* Bump aioelectricitymaps to 0.3.0

* Fix tests
2024-02-03 00:04:41 +02:00
Michael
e567236cac Add diagnostics to proximity (#109393) 2024-02-02 23:03:55 +01:00
Jan-Philipp Benecke
4809327124 Bump aiotankerkoenig to 0.3.0 (#109404) 2024-02-02 23:42:10 +02:00
Erik Montnemery
09ba46ddb9 Mask sensitive data in google_assistant logs (#109366)
* Mask sensitive data in google_assistant logs

* Move common code to homeassistant/util/redact.py

* Move to helpers

* Add tests

* Tweak

* Redact additional logs

* Fix stale docstring

* Don't reveal the length of masked data

* Update test
2024-02-02 22:10:30 +01:00
J. Nick Koston
ae5d4e183a Remove remaning ESPHome files from coveragerc (#109400) 2024-02-02 14:52:09 -06:00
wilburCforce
430b9cef43 Fix device type in Lutron (#109401)
remove testing code
2024-02-02 22:42:53 +02:00
Teemu R
e61864c0b5 Bump python-kasa to 0.6.2.1 (#109397) 2024-02-02 21:24:24 +01:00
Franck Nijhof
2c3a952ef8 Update elgato to 5.1.2 (#109391) 2024-02-02 14:34:00 -05:00
mkmer
7608f0c9ee Add independent session in honeywell (#108435) 2024-02-02 17:31:16 +01:00
Bram Kragten
6b7a984314 Update frontend to 20240202.0 (#109388) 2024-02-02 17:30:07 +01:00
Erik Montnemery
9d22f07fc6 Use send_json_auto_id in conversation tests (#109354) 2024-02-02 15:46:59 +01:00
Jan Rieger
0c3541c194 Add entity description to GPSD (#109320) 2024-02-02 14:44:50 +01:00
Robert Resch
343086a6c8 Improve Ecovacs naming (#109372) 2024-02-02 14:12:26 +01:00
Jan-Philipp Benecke
a6c697c80f Add entity name translations to Tibber (#108797) 2024-02-02 14:03:21 +01:00
Joakim Sørensen
3bab1d7cd5 Specify end_time when importing Elvia data to deal with drift (#109361) 2024-02-02 13:42:07 +01:00
Brett Adams
e328d3ec5e Add Charging sensor to Tessie (#108205) 2024-02-02 13:21:13 +01:00
jan iversen
90ec361fc9 Centralize validation for modbus config (#108906)
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2024-02-02 12:42:12 +01:00
Brett Adams
d3dbd6fa70 Change device class of Auto Seat Heater sensors in Tessie (#109240) 2024-02-02 12:38:57 +01:00
Jan Rieger
a584429ce0 Use translation placeholders in 1-Wire (#109120) 2024-02-02 12:37:23 +01:00
Franck Nijhof
cd1ef93123 Remove suggested area from Verisure (#109364) 2024-02-02 11:43:05 +01:00
Franck Nijhof
a452ad6454 Update sentry-sdk to 1.40.0 (#109363) 2024-02-02 11:33:03 +01:00
Christopher Fenner
03daeda9db Disable less interesting sensors by default in ViCare integration (#109014) 2024-02-02 11:28:51 +01:00
Robert Resch
61e6882b91 Bump deebot_client to 5.1.0 (#109360) 2024-02-02 11:02:00 +01:00
Cyrill Raccaud
f22b71d803 Follow up swiss_public_transport migration fix of unique ids (#107873)
improve migration fix of unique ids
- follow up to #107087
2024-02-02 10:37:49 +01:00
Franck Nijhof
c868b79b5a Update cryptography to 42.0.2 (#109359) 2024-02-02 10:37:04 +01:00
Ståle Storø Hauknes
effd5b8ddd Hide unsupported devices in Airthings BLE config flow (#107648) 2024-02-02 10:24:53 +01:00
Erik Montnemery
4229c35fcd Improve color mode handling in MockLight (#109298) 2024-02-02 09:49:32 +01:00
G Johansson
e3f1997b6f Add TURN_ON/OFF ClimateEntityFeature for KNX (#109138) 2024-02-02 09:48:01 +01:00
jan iversen
543870d5f1 Correct modbus commit validation, too strict on integers (#109338) 2024-02-02 09:46:53 +01:00
Joakim Sørensen
025fe51322 Use a mocked API client in Traccar Server tests (#109358) 2024-02-02 09:36:26 +01:00
Erik Montnemery
1f466e737e Use send_json_auto_id in recorder tests (#109355) 2024-02-02 09:34:43 +01:00
G Johansson
596f61ff07 Add TURN_ON/OFF ClimateEntityFeature for Fibaro (#108963) 2024-02-02 09:33:54 +01:00
G Johansson
b379e9db60 Add migrated ClimateEntityFeature for SwitchBot Cloud (#109136) 2024-02-02 09:33:13 +01:00
G Johansson
8a22a8d4ba Add migrated ClimateEntityFeature for Atag (#108961) 2024-02-02 09:32:50 +01:00
J. Nick Koston
67e6febde4 Ensure the purge entities service cleans up the states_meta table (#109344) 2024-02-02 09:32:17 +01:00
G Johansson
2788576dc9 Add TURN_ON/OFF ClimateEntityFeature for Modbus (#109133) 2024-02-02 09:31:35 +01:00
G Johansson
d5d74005f4 Add migrated ClimateEntityFeature for Nibe Heat Pump (#109140) 2024-02-02 09:31:09 +01:00
Dan
72f1d8ec15 Add Duquesne Light virtual integration supported by opower (#109272)
Co-authored-by: Dan Swartz <3066652+swartzd@users.noreply.github.com>
2024-02-02 09:10:51 +01:00
G Johansson
449790c178 Add Adax migrated ClimateEntityFeatures (#109341) 2024-02-02 09:02:41 +01:00
J. Nick Koston
582d6968b2 Avoid de/recode of bytes to string to bytes when writing json files (#109348) 2024-02-02 09:02:26 +01:00
G Johansson
9204e85b61 Add sensibo migrated ClimateEntityFeatures (#109340)
Adds sensibo migrated ClimateEntityFeatures
2024-02-02 09:01:38 +01:00
J. Nick Koston
155499fafe Load json file as binary instead of decoding to string (#109351) 2024-02-02 09:00:46 +01:00
J. Nick Koston
1c84997c5c Reduce lock contention when all icons are already cached (#109352) 2024-02-02 08:58:55 +01:00
karwosts
b471b9926d Missing template helper translation keys (#109347) 2024-02-02 08:58:03 +01:00
G Johansson
b32371b5c9 Add TURN_ON/OFF ClimateEntityFeature for Matter (#108974)
* Add TURN_ON/OFF ClimateEntityFeature for Matter

* Adjust matter
2024-02-02 07:39:54 +01:00
J. Nick Koston
5a35c2e1e9 Fix stale camera error message in img_util (#109325) 2024-02-01 22:39:44 +01:00
Paul Bottein
8038d833e8 Add device class to tesla wall connector session energy (#109333) 2024-02-01 22:28:02 +01:00
Franck Nijhof
26be6a677c Update Home Assistant base image to 2024.02.0 (#109329) 2024-02-01 22:13:41 +01:00
Joakim Sørensen
3511f35418 Fix custom attribute lookup in Traccar Server (#109331) 2024-02-01 22:06:34 +01:00
Ryan Fleming
c1f883519d Add connect octoprint printer service (#99899)
* Add connect octoprint printer service

* Review changes

* String updates

* Swap exception type
2024-02-01 21:15:41 +01:00
Michael Hansen
a1eaa5cbf2 Migrate to new intent error response keys (#109269) 2024-02-01 21:10:24 +01:00
Raman Gupta
c2525d53dd Add translations for zwave_js entities and services (#109188) 2024-02-01 21:07:47 +01:00
Josh Pettersen
0cc8b2edf9 Remove battery charge sensor from powerwall (#109271) 2024-02-01 14:01:05 -06:00
Michael Hansen
c2c98bd04c Move default response out of sentence trigger registration and into agent (#109317)
* Move default response out of trigger and into agent

* Add test
2024-02-01 20:40:29 +01:00
J. Nick Koston
ed726db974 Fix race in loading service descriptions (#109316) 2024-02-01 12:34:23 -06:00
Brett Adams
c61a2b46d4 Add climate turn on/off feature to Teslemetry (#109241) 2024-02-01 17:09:24 +01:00
Brett Adams
c41f33da71 Add climate on/off feature to Tessie (#109239) 2024-02-01 17:08:41 +01:00
Robert Resch
cb5be4901b Verify Ecovacs mqtt config (#109306) 2024-02-01 17:07:55 +01:00
Maciej Bieniek
fe0228139e Do not use a battery device class for Shelly analog input sensor (#109311)
Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-02-01 17:07:08 +01:00
Josef Zweck
fa17693e3c Bump pytedee_async to 0.2.13 (#109307)
bump
2024-02-01 17:05:02 +01:00
G Johansson
61c82718f2 Don't log warning for core integrations on new feature flags in Climate (#109250)
* Don't log for core integration on Climate new feature flags

* Add test

* Fix test
2024-02-01 16:53:53 +01:00
Marc Mueller
d2dee9e327 Update ruff to 0.1.15 (#109303) 2024-02-01 13:29:01 +01:00
Ståle Storø Hauknes
9bb6d756f1 Bump airthings-ble to 0.6.1 (#109302)
Bump airthings-ble
2024-02-01 12:59:41 +01:00
Raman Gupta
1af25bc010 Remove deprecation warnings for zwave_js climate TURN_ON/TURN_OFF features (#109242) 2024-02-01 11:21:40 +01:00
Jan-Philipp Benecke
286c5faa79 Address late review of Tankerkoenig package move (#109277) 2024-02-01 11:14:33 +01:00
Joakim Sørensen
f791c77f3b Bump hass-nabucasa from 0.75.1 to 0.76.0 (#109296) 2024-02-01 11:11:28 +01:00
Franck Nijhof
6869723003 Fix device class repairs issues UOM placeholders in Group (#109294) 2024-02-01 10:20:52 +01:00
Jan Bouwhuis
459022d030 Remove quality scale platinum from daikin integration (#109292) 2024-02-01 09:30:29 +01:00
Chris Talkington
f87550c909 Update rokuecp to 0.19 (#109100) 2024-02-01 09:08:32 +01:00
Ernst Klamer
697d4987c1 Fix Xiaomi-ble automations for multiple button devices (#109251) 2024-02-01 09:04:02 +01:00
Michael
e11e54fd50 Apply review comments on proximity (#109249)
use a named tuple as TrackedEntityDescriptor
2024-02-01 09:02:38 +01:00
Luis Andrade
175ec81269 bugfix: name missing in getLogger (#109282) 2024-02-01 09:00:22 +01:00
Jan Rieger
421e276185 Add icon translations to GPSd (#108602) 2024-02-01 08:58:32 +01:00
Josef Zweck
a075accbe3 Fix two icon translations for La Marzocco (#109284) 2024-02-01 08:57:12 +01:00
J. Nick Koston
8afcd53af6 Restore support for packages being installed from urls with fragments (#109267) 2024-02-01 08:56:57 +01:00
J. Nick Koston
5d3364521f Fix app name sorting in apple_tv (#109274) 2024-02-01 08:53:18 +01:00
Jan Bouwhuis
723d9c4c8a Fix dalkin climate warnings (#109279) 2024-02-01 08:52:07 +01:00
dependabot[bot]
0caed80320 Bump sigstore/cosign-installer from 3.3.0 to 3.4.0 (#109278)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-01 08:28:23 +01:00
TheJulianJES
c355dd77a4 Fix ZHA update entity not updating installed version (#109260) 2024-02-01 08:26:39 +01:00
J. Nick Koston
5c3bf13ca4 Only decode msg topic once when handling mqtt payloads (#109258) 2024-02-01 03:42:58 +01:00
Joost Lekkerkerker
31094e72a0 Pass verify_ssl to created session in Omada (#109212)
* Pass verify_ssl to created session in Omada

* Fix tests

* Fix tests
2024-02-01 03:38:16 +01:00
Raman Gupta
2b525ed2e9 Make zwave_js last seen sensor enabled by default (#109191)
* Make zwave_js last seen sensor enabled by default

* Add test

* Fix test

* improve tests
2024-02-01 02:55:48 +01:00
Dan
08f8f84f61 Bump opower to 0.3.0 (#109248)
Co-authored-by: Dan Swartz <3066652+swartzd@users.noreply.github.com>
2024-02-01 01:34:33 +01:00
Joost Lekkerkerker
2aead3eefc Fix kitchen sink tests (#109243) 2024-01-31 22:10:32 +01:00
Franck Nijhof
d1c61c911d Bump version to 2024.3.0dev0 (#109238) 2024-01-31 22:05:13 +01:00
Brett Adams
1584f02e71 Fix time to arrival to timestamp in Tessie (#109172)
* Fix time to arrival

* Update snapshot

* Freeze time for snapshot

* Fix docstring

* Add available_fn

* Update snapshot

* Dont use variance for full charge

* Remove unrelated changes

* Revert snapshot

* Rename hours_to_datetime
2024-01-31 15:52:58 -05:00
Steven B
552d14204d Bump ring_doorbell to 0.8.6 (#109199) 2024-01-31 10:32:27 -10:00
J. Nick Koston
729c6db082 Bump govee-ble to 0.31.0 (#109235) 2024-01-31 09:47:31 -10:00
2249 changed files with 67187 additions and 17137 deletions

View File

@@ -73,6 +73,10 @@ omit =
homeassistant/components/apple_tv/browse_media.py
homeassistant/components/apple_tv/media_player.py
homeassistant/components/apple_tv/remote.py
homeassistant/components/aprilaire/__init__.py
homeassistant/components/aprilaire/climate.py
homeassistant/components/aprilaire/coordinator.py
homeassistant/components/aprilaire/entity.py
homeassistant/components/aqualogic/*
homeassistant/components/aquostv/media_player.py
homeassistant/components/arcam_fmj/__init__.py
@@ -89,7 +93,7 @@ omit =
homeassistant/components/aseko_pool_live/entity.py
homeassistant/components/aseko_pool_live/sensor.py
homeassistant/components/asterisk_cdr/mailbox.py
homeassistant/components/asterisk_mbox/*
homeassistant/components/asterisk_mbox/mailbox.py
homeassistant/components/aten_pe/*
homeassistant/components/atome/*
homeassistant/components/aurora/__init__.py
@@ -188,6 +192,7 @@ omit =
homeassistant/components/comelit/const.py
homeassistant/components/comelit/cover.py
homeassistant/components/comelit/coordinator.py
homeassistant/components/comelit/humidifier.py
homeassistant/components/comelit/light.py
homeassistant/components/comelit/sensor.py
homeassistant/components/comelit/switch.py
@@ -359,7 +364,6 @@ omit =
homeassistant/components/escea/__init__.py
homeassistant/components/escea/climate.py
homeassistant/components/escea/discovery.py
homeassistant/components/esphome/manager.py
homeassistant/components/etherscan/sensor.py
homeassistant/components/eufy/*
homeassistant/components/eufylife_ble/__init__.py
@@ -555,6 +559,7 @@ omit =
homeassistant/components/hunterdouglas_powerview/coordinator.py
homeassistant/components/hunterdouglas_powerview/cover.py
homeassistant/components/hunterdouglas_powerview/entity.py
homeassistant/components/hunterdouglas_powerview/number.py
homeassistant/components/hunterdouglas_powerview/select.py
homeassistant/components/hunterdouglas_powerview/sensor.py
homeassistant/components/hunterdouglas_powerview/shade_data.py
@@ -634,12 +639,6 @@ omit =
homeassistant/components/izone/climate.py
homeassistant/components/izone/discovery.py
homeassistant/components/joaoapps_join/*
homeassistant/components/juicenet/__init__.py
homeassistant/components/juicenet/device.py
homeassistant/components/juicenet/entity.py
homeassistant/components/juicenet/number.py
homeassistant/components/juicenet/sensor.py
homeassistant/components/juicenet/switch.py
homeassistant/components/justnimbus/coordinator.py
homeassistant/components/justnimbus/entity.py
homeassistant/components/justnimbus/sensor.py
@@ -765,6 +764,16 @@ omit =
homeassistant/components/meteoclimatic/__init__.py
homeassistant/components/meteoclimatic/sensor.py
homeassistant/components/meteoclimatic/weather.py
homeassistant/components/microbees/__init__.py
homeassistant/components/microbees/api.py
homeassistant/components/microbees/application_credentials.py
homeassistant/components/microbees/button.py
homeassistant/components/microbees/const.py
homeassistant/components/microbees/coordinator.py
homeassistant/components/microbees/entity.py
homeassistant/components/microbees/light.py
homeassistant/components/microbees/sensor.py
homeassistant/components/microbees/switch.py
homeassistant/components/microsoft/tts.py
homeassistant/components/mikrotik/hub.py
homeassistant/components/mill/climate.py
@@ -874,6 +883,7 @@ omit =
homeassistant/components/notion/__init__.py
homeassistant/components/notion/binary_sensor.py
homeassistant/components/notion/sensor.py
homeassistant/components/notion/util.py
homeassistant/components/nsw_fuel_station/sensor.py
homeassistant/components/nuki/__init__.py
homeassistant/components/nuki/binary_sensor.py
@@ -1067,6 +1077,7 @@ omit =
homeassistant/components/renson/sensor.py
homeassistant/components/renson/button.py
homeassistant/components/renson/fan.py
homeassistant/components/renson/switch.py
homeassistant/components/renson/binary_sensor.py
homeassistant/components/renson/number.py
homeassistant/components/renson/time.py
@@ -1535,6 +1546,7 @@ omit =
homeassistant/components/vicare/entity.py
homeassistant/components/vicare/number.py
homeassistant/components/vicare/sensor.py
homeassistant/components/vicare/types.py
homeassistant/components/vicare/utils.py
homeassistant/components/vicare/water_heater.py
homeassistant/components/vilfo/__init__.py
@@ -1572,6 +1584,11 @@ omit =
homeassistant/components/weatherflow/__init__.py
homeassistant/components/weatherflow/const.py
homeassistant/components/weatherflow/sensor.py
homeassistant/components/weatherflow_cloud/__init__.py
homeassistant/components/weatherflow_cloud/const.py
homeassistant/components/weatherflow_cloud/coordinator.py
homeassistant/components/weatherflow_cloud/weather.py
homeassistant/components/webmin/sensor.py
homeassistant/components/wiffi/__init__.py
homeassistant/components/wiffi/binary_sensor.py
homeassistant/components/wiffi/sensor.py
@@ -1695,6 +1712,7 @@ omit =
homeassistant/components/myuplink/application_credentials.py
homeassistant/components/myuplink/coordinator.py
homeassistant/components/myuplink/entity.py
homeassistant/components/myuplink/helpers.py
homeassistant/components/myuplink/sensor.py

View File

@@ -103,7 +103,7 @@ jobs:
- name: Download nightly wheels of frontend
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v3.0.0
uses: dawidd6/action-download-artifact@v3.1.2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/frontend
@@ -114,7 +114,7 @@ jobs:
- name: Download nightly wheels of intents
if: needs.init.outputs.channel == 'dev'
uses: dawidd6/action-download-artifact@v3.0.0
uses: dawidd6/action-download-artifact@v3.1.2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/intents-package
@@ -341,7 +341,7 @@ jobs:
uses: actions/checkout@v4.1.1
- name: Install Cosign
uses: sigstore/cosign-installer@v3.3.0
uses: sigstore/cosign-installer@v3.4.0
with:
cosign-release: "v2.0.2"

View File

@@ -36,7 +36,7 @@ env:
CACHE_VERSION: 5
PIP_CACHE_VERSION: 4
MYPY_CACHE_VERSION: 7
HA_SHORT_VERSION: "2024.2"
HA_SHORT_VERSION: "2024.3"
DEFAULT_PYTHON: "3.11"
ALL_PYTHON_VERSIONS: "['3.11', '3.12']"
# 10.3 is the oldest supported version
@@ -103,7 +103,7 @@ jobs:
echo "key=pre-commit-${{ env.CACHE_VERSION }}-${{
hashFiles('.pre-commit-config.yaml') }}" >> $GITHUB_OUTPUT
- name: Filter for core changes
uses: dorny/paths-filter@v3.0.0
uses: dorny/paths-filter@v3.0.1
id: core
with:
filters: .core_files.yaml
@@ -118,7 +118,7 @@ jobs:
echo "Result:"
cat .integration_paths.yaml
- name: Filter for integration changes
uses: dorny/paths-filter@v3.0.0
uses: dorny/paths-filter@v3.0.1
id: integrations
with:
filters: .integration_paths.yaml
@@ -803,10 +803,11 @@ jobs:
path: pytest-*.txt
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4.3.1
with:
name: coverage-${{ matrix.python-version }}-${{ matrix.group }}
path: coverage.xml
overwrite: true
- name: Check dirty
run: |
./script/check_dirty
@@ -928,11 +929,12 @@ jobs:
path: pytest-*.txt
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4.3.1
with:
name: coverage-${{ matrix.python-version }}-mariadb-${{
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.mariadb }}
path: coverage.xml
overwrite: true
- name: Check dirty
run: |
./script/check_dirty
@@ -1055,11 +1057,12 @@ jobs:
path: pytest-*.txt
- name: Upload coverage artifact
if: needs.info.outputs.skip_coverage != 'true'
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4.3.1
with:
name: coverage-${{ matrix.python-version }}-${{
steps.pytest-partial.outputs.postgresql }}
path: coverage.xml
overwrite: true
- name: Check dirty
run: |
./script/check_dirty
@@ -1076,10 +1079,12 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.1
- name: Download all coverage artifacts
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.3
with:
pattern: coverage-*
- name: Upload coverage to Codecov (full coverage)
if: needs.info.outputs.test_full_suite == 'true'
uses: Wandalen/wretry.action@v1.3.0
uses: Wandalen/wretry.action@v1.4.4
with:
action: codecov/codecov-action@v3.1.3
with: |
@@ -1090,7 +1095,7 @@ jobs:
attempt_delay: 30000
- name: Upload coverage to Codecov (partial coverage)
if: needs.info.outputs.test_full_suite == 'false'
uses: Wandalen/wretry.action@v1.3.0
uses: Wandalen/wretry.action@v1.4.4
with:
action: codecov/codecov-action@v3.1.3
with: |

View File

@@ -2,11 +2,6 @@ name: "CodeQL"
# yamllint disable-line rule:truthy
on:
push:
branches:
- dev
- rc
- master
schedule:
- cron: "30 18 * * 4"
@@ -29,11 +24,11 @@ jobs:
uses: actions/checkout@v4.1.1
- name: Initialize CodeQL
uses: github/codeql-action/init@v3.23.2
uses: github/codeql-action/init@v3.24.5
with:
languages: python
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3.23.2
uses: github/codeql-action/analyze@v3.24.5
with:
category: "/language:python"

View File

@@ -63,16 +63,18 @@ jobs:
) > .env_file
- name: Upload env_file
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4.3.1
with:
name: env_file
path: ./.env_file
overwrite: true
- name: Upload requirements_diff
uses: actions/upload-artifact@v3.1.2
uses: actions/upload-artifact@v4.3.1
with:
name: requirements_diff
path: ./requirements_diff.txt
overwrite: true
core:
name: Build Core wheels ${{ matrix.abi }} for ${{ matrix.arch }} (musllinux_1_2)
@@ -82,19 +84,19 @@ jobs:
strategy:
fail-fast: false
matrix:
abi: ["cp311", "cp312"]
abi: ["cp312"]
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.1
- name: Download env_file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.3
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.3
with:
name: requirements_diff
@@ -120,19 +122,19 @@ jobs:
strategy:
fail-fast: false
matrix:
abi: ["cp311", "cp312"]
abi: ["cp312"]
arch: ${{ fromJson(needs.init.outputs.architectures) }}
steps:
- name: Checkout the repository
uses: actions/checkout@v4.1.1
- name: Download env_file
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.3
with:
name: env_file
- name: Download requirements_diff
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.3
with:
name: requirements_diff

View File

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

View File

@@ -80,6 +80,7 @@ homeassistant.components.anthemav.*
homeassistant.components.apache_kafka.*
homeassistant.components.apcupsd.*
homeassistant.components.api.*
homeassistant.components.apple_tv.*
homeassistant.components.apprise.*
homeassistant.components.aprs.*
homeassistant.components.aqualogic.*

View File

@@ -104,6 +104,8 @@ build.json @home-assistant/supervisor
/tests/components/application_credentials/ @home-assistant/core
/homeassistant/components/apprise/ @caronc
/tests/components/apprise/ @caronc
/homeassistant/components/aprilaire/ @chamberlain2007
/tests/components/aprilaire/ @chamberlain2007
/homeassistant/components/aprs/ @PhilRW
/tests/components/aprs/ @PhilRW
/homeassistant/components/aranet/ @aschmitz @thecode
@@ -157,8 +159,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/binary_sensor/ @home-assistant/core
/tests/components/binary_sensor/ @home-assistant/core
/homeassistant/components/bizkaibus/ @UgaitzEtxebarria
/homeassistant/components/blebox/ @bbx-a @riokuu
/tests/components/blebox/ @bbx-a @riokuu
/homeassistant/components/blebox/ @bbx-a @riokuu @swistakm
/tests/components/blebox/ @bbx-a @riokuu @swistakm
/homeassistant/components/blink/ @fronzbot @mkmer
/tests/components/blink/ @fronzbot @mkmer
/homeassistant/components/blue_current/ @Floris272 @gleeuwen
@@ -329,8 +331,8 @@ build.json @home-assistant/supervisor
/tests/components/ecoforest/ @pjanuario
/homeassistant/components/econet/ @w1ll1am23
/tests/components/econet/ @w1ll1am23
/homeassistant/components/ecovacs/ @OverloadUT @mib1185 @edenhaus
/tests/components/ecovacs/ @OverloadUT @mib1185 @edenhaus
/homeassistant/components/ecovacs/ @OverloadUT @mib1185 @edenhaus @Augar
/tests/components/ecovacs/ @OverloadUT @mib1185 @edenhaus @Augar
/homeassistant/components/ecowitt/ @pvizeli
/tests/components/ecowitt/ @pvizeli
/homeassistant/components/efergy/ @tkdrob
@@ -584,6 +586,8 @@ build.json @home-assistant/supervisor
/tests/components/humidifier/ @home-assistant/core @Shulyaka
/homeassistant/components/hunterdouglas_powerview/ @bdraco @kingy444 @trullock
/tests/components/hunterdouglas_powerview/ @bdraco @kingy444 @trullock
/homeassistant/components/husqvarna_automower/ @Thomas55555
/tests/components/husqvarna_automower/ @Thomas55555
/homeassistant/components/huum/ @frwickst
/tests/components/huum/ @frwickst
/homeassistant/components/hvv_departures/ @vigonotion
@@ -665,8 +669,6 @@ build.json @home-assistant/supervisor
/tests/components/jellyfin/ @j-stienstra @ctalkington
/homeassistant/components/jewish_calendar/ @tsvi
/tests/components/jewish_calendar/ @tsvi
/homeassistant/components/juicenet/ @jesserockz
/tests/components/juicenet/ @jesserockz
/homeassistant/components/justnimbus/ @kvanzuijlen
/tests/components/justnimbus/ @kvanzuijlen
/homeassistant/components/jvc_projector/ @SteveEasley @msavazzi
@@ -766,8 +768,8 @@ build.json @home-assistant/supervisor
/tests/components/lupusec/ @majuss @suaveolent
/homeassistant/components/lutron/ @cdheiser @wilburCForce
/tests/components/lutron/ @cdheiser @wilburCForce
/homeassistant/components/lutron_caseta/ @swails @bdraco @danaues
/tests/components/lutron_caseta/ @swails @bdraco @danaues
/homeassistant/components/lutron_caseta/ @swails @bdraco @danaues @eclair4151
/tests/components/lutron_caseta/ @swails @bdraco @danaues @eclair4151
/homeassistant/components/lyric/ @timmo001
/tests/components/lyric/ @timmo001
/homeassistant/components/mastodon/ @fabaff
@@ -801,6 +803,8 @@ build.json @home-assistant/supervisor
/tests/components/meteoclimatic/ @adrianmo
/homeassistant/components/metoffice/ @MrHarcombe @avee87
/tests/components/metoffice/ @MrHarcombe @avee87
/homeassistant/components/microbees/ @microBeesTech
/tests/components/microbees/ @microBeesTech
/homeassistant/components/mikrotik/ @engrbm87
/tests/components/mikrotik/ @engrbm87
/homeassistant/components/mill/ @danielhiversen
@@ -848,8 +852,8 @@ build.json @home-assistant/supervisor
/tests/components/mysensors/ @MartinHjelmare @functionpointer
/homeassistant/components/mystrom/ @fabaff
/tests/components/mystrom/ @fabaff
/homeassistant/components/myuplink/ @pajzo
/tests/components/myuplink/ @pajzo
/homeassistant/components/myuplink/ @pajzo @astrandb
/tests/components/myuplink/ @pajzo @astrandb
/homeassistant/components/nam/ @bieniu
/tests/components/nam/ @bieniu
/homeassistant/components/nanoleaf/ @milanmeu
@@ -967,8 +971,8 @@ build.json @home-assistant/supervisor
/tests/components/otbr/ @home-assistant/core
/homeassistant/components/ourgroceries/ @OnFreund
/tests/components/ourgroceries/ @OnFreund
/homeassistant/components/overkiz/ @imicknl @vlebourl @tetienne @nyroDev
/tests/components/overkiz/ @imicknl @vlebourl @tetienne @nyroDev
/homeassistant/components/overkiz/ @imicknl @vlebourl @tetienne @nyroDev @tronix117
/tests/components/overkiz/ @imicknl @vlebourl @tetienne @nyroDev @tronix117
/homeassistant/components/ovo_energy/ @timmo001
/tests/components/ovo_energy/ @timmo001
/homeassistant/components/p1_monitor/ @klaasnicolaas
@@ -1125,8 +1129,8 @@ build.json @home-assistant/supervisor
/tests/components/roku/ @ctalkington
/homeassistant/components/romy/ @xeniter
/tests/components/romy/ @xeniter
/homeassistant/components/roomba/ @pschmitt @cyr-ius @shenxn @Xitee1
/tests/components/roomba/ @pschmitt @cyr-ius @shenxn @Xitee1
/homeassistant/components/roomba/ @pschmitt @cyr-ius @shenxn @Xitee1 @Orhideous
/tests/components/roomba/ @pschmitt @cyr-ius @shenxn @Xitee1 @Orhideous
/homeassistant/components/roon/ @pavoni
/tests/components/roon/ @pavoni
/homeassistant/components/rpi_power/ @shenxn @swetoast
@@ -1452,13 +1456,14 @@ build.json @home-assistant/supervisor
/tests/components/v2c/ @dgomes
/homeassistant/components/vacuum/ @home-assistant/core
/tests/components/vacuum/ @home-assistant/core
/homeassistant/components/vallox/ @andre-richter @slovdahl @viiru-
/tests/components/vallox/ @andre-richter @slovdahl @viiru-
/homeassistant/components/vallox/ @andre-richter @slovdahl @viiru- @yozik04
/tests/components/vallox/ @andre-richter @slovdahl @viiru- @yozik04
/homeassistant/components/valve/ @home-assistant/core
/tests/components/valve/ @home-assistant/core
/homeassistant/components/velbus/ @Cereal2nd @brefra
/tests/components/velbus/ @Cereal2nd @brefra
/homeassistant/components/velux/ @Julius2342
/homeassistant/components/velux/ @Julius2342 @DeerMaximum
/tests/components/velux/ @Julius2342 @DeerMaximum
/homeassistant/components/venstar/ @garbled1 @jhollowe
/tests/components/venstar/ @garbled1 @jhollowe
/homeassistant/components/versasense/ @imstevenxyz
@@ -1504,10 +1509,14 @@ build.json @home-assistant/supervisor
/tests/components/weather/ @home-assistant/core
/homeassistant/components/weatherflow/ @natekspencer @jeeftor
/tests/components/weatherflow/ @natekspencer @jeeftor
/homeassistant/components/weatherflow_cloud/ @jeeftor
/tests/components/weatherflow_cloud/ @jeeftor
/homeassistant/components/weatherkit/ @tjhorner
/tests/components/weatherkit/ @tjhorner
/homeassistant/components/webhook/ @home-assistant/core
/tests/components/webhook/ @home-assistant/core
/homeassistant/components/webmin/ @autinerd
/tests/components/webmin/ @autinerd
/homeassistant/components/webostv/ @thecode
/tests/components/webostv/ @thecode
/homeassistant/components/websocket_api/ @home-assistant/core

View File

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

View File

@@ -3,9 +3,10 @@ from __future__ import annotations
import asyncio
import contextlib
from datetime import datetime, timedelta
from datetime import timedelta
import logging
import logging.handlers
from operator import itemgetter
import os
import platform
import sys
@@ -13,13 +14,28 @@ import threading
from time import monotonic
from typing import TYPE_CHECKING, Any
# Import cryptography early since import openssl is not thread-safe
# _frozen_importlib._DeadlockError: deadlock detected by _ModuleLock('cryptography.hazmat.backends.openssl.backend')
import cryptography.hazmat.backends.openssl.backend # noqa: F401
import voluptuous as vol
import yarl
from . import config as conf_util, config_entries, core, loader, requirements
from .components import http
# Pre-import config and lovelace which have no requirements here to avoid
# loading them at run time and blocking the event loop. We do this ahead
# of time so that we do not have to flag frontends deps with `import_executor`
# as it would create a thundering heard of executor jobs trying to import
# frontend deps at the same time.
from .components import (
api as api_pre_import, # noqa: F401
config as config_pre_import, # noqa: F401
http,
lovelace as lovelace_pre_import, # noqa: F401
)
from .const import (
FORMAT_DATETIME,
KEY_DATA_LOGGING as DATA_LOGGING,
REQUIRED_NEXT_PYTHON_HA_RELEASE,
REQUIRED_NEXT_PYTHON_VER,
SIGNAL_BOOTSTRAP_INTEGRATIONS,
@@ -31,21 +47,25 @@ from .helpers import (
device_registry,
entity,
entity_registry,
floor_registry,
issue_registry,
label_registry,
recorder,
restore_state,
template,
translation,
)
from .helpers.dispatcher import async_dispatcher_send
from .helpers.typing import ConfigType
from .setup import (
BASE_PLATFORMS,
DATA_SETUP_STARTED,
DATA_SETUP_TIME,
async_notify_setup_error,
async_set_domains_to_be_loaded,
async_setup_component,
)
from .util import dt as dt_util
from .util.async_ import create_eager_task
from .util.logging import async_activate_log_queue_handler
from .util.package import async_get_user_site, is_virtual_env
@@ -57,7 +77,6 @@ _LOGGER = logging.getLogger(__name__)
ERROR_LOG_FILENAME = "home-assistant.log"
# hass.data key for logging information.
DATA_LOGGING = "logging"
DATA_REGISTRIES_LOADED = "bootstrap_registries_loaded"
LOG_SLOW_STARTUP_INTERVAL = 60
@@ -110,6 +129,7 @@ DEFAULT_INTEGRATIONS = {
#
# Integrations providing core functionality:
"application_credentials",
"backup",
"frontend",
"hardware",
"logger",
@@ -143,15 +163,22 @@ DEFAULT_INTEGRATIONS_SUPERVISOR = {
# These integrations are set up if using the Supervisor
"hassio",
}
DEFAULT_INTEGRATIONS_NON_SUPERVISOR = {
# These integrations are set up if not using the Supervisor
"backup",
}
CRITICAL_INTEGRATIONS = {
# Recovery mode is activated if these integrations fail to set up
"frontend",
}
SETUP_ORDER = {
# Load logging as soon as possible
"logging": LOGGING_INTEGRATIONS,
# Setup frontend
"frontend": FRONTEND_INTEGRATIONS,
# Setup recorder
"recorder": RECORDER_INTEGRATIONS,
# Start up debuggers. Start these first in case they want to wait.
"debugger": DEBUGGER_INTEGRATIONS,
}
async def async_setup_hass(
runtime_config: RuntimeConfig,
@@ -217,7 +244,7 @@ async def async_setup_hass(
)
# Ask integrations to shut down. It's messy but we can't
# do a clean stop without knowing what is broken
with contextlib.suppress(asyncio.TimeoutError):
with contextlib.suppress(TimeoutError):
async with hass.timeout.async_timeout(10):
await hass.async_stop()
@@ -291,17 +318,20 @@ async def async_load_base_functionality(hass: core.HomeAssistant) -> None:
platform.uname().processor # pylint: disable=expression-not-assigned
# Load the registries and cache the result of platform.uname().processor
translation.async_setup(hass)
entity.async_setup(hass)
template.async_setup(hass)
await asyncio.gather(
area_registry.async_load(hass),
device_registry.async_load(hass),
entity_registry.async_load(hass),
issue_registry.async_load(hass),
create_eager_task(area_registry.async_load(hass)),
create_eager_task(device_registry.async_load(hass)),
create_eager_task(entity_registry.async_load(hass)),
create_eager_task(floor_registry.async_load(hass)),
create_eager_task(issue_registry.async_load(hass)),
create_eager_task(label_registry.async_load(hass)),
hass.async_add_executor_job(_cache_uname_processor),
template.async_load_custom_templates(hass),
restore_state.async_load(hass),
hass.config_entries.async_initialize(),
create_eager_task(template.async_load_custom_templates(hass)),
create_eager_task(restore_state.async_load(hass)),
create_eager_task(hass.config_entries.async_initialize()),
)
@@ -324,7 +354,7 @@ async def async_from_config_dict(
if not all(
await asyncio.gather(
*(
async_setup_component(hass, domain, config)
create_eager_task(async_setup_component(hass, domain, config))
for domain in CORE_INTEGRATIONS
)
)
@@ -533,42 +563,73 @@ def _get_domains(hass: core.HomeAssistant, config: dict[str, Any]) -> set[str]:
# Add domains depending on if the Supervisor is used or not
if "SUPERVISOR" in os.environ:
domains.update(DEFAULT_INTEGRATIONS_SUPERVISOR)
else:
domains.update(DEFAULT_INTEGRATIONS_NON_SUPERVISOR)
return domains
async def _async_watch_pending_setups(hass: core.HomeAssistant) -> None:
"""Periodic log of setups that are pending.
class _WatchPendingSetups:
"""Periodic log and dispatch of setups that are pending."""
def __init__(
self, hass: core.HomeAssistant, setup_started: dict[str, float]
) -> None:
"""Initialize the WatchPendingSetups class."""
self._hass = hass
self._setup_started = setup_started
self._duration_count = 0
self._handle: asyncio.TimerHandle | None = None
self._previous_was_empty = True
self._loop = hass.loop
def _async_watch(self) -> None:
"""Periodic log of setups that are pending."""
now = monotonic()
self._duration_count += SLOW_STARTUP_CHECK_INTERVAL
Pending for longer than LOG_SLOW_STARTUP_INTERVAL.
"""
loop_count = 0
setup_started: dict[str, datetime] = hass.data[DATA_SETUP_STARTED]
previous_was_empty = True
while True:
now = dt_util.utcnow()
remaining_with_setup_started = {
domain: (now - setup_started[domain]).total_seconds()
for domain in setup_started
domain: (now - start_time)
for domain, start_time in self._setup_started.items()
}
_LOGGER.debug("Integration remaining: %s", remaining_with_setup_started)
if remaining_with_setup_started or not previous_was_empty:
async_dispatcher_send(
hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
)
previous_was_empty = not remaining_with_setup_started
await asyncio.sleep(SLOW_STARTUP_CHECK_INTERVAL)
loop_count += SLOW_STARTUP_CHECK_INTERVAL
if loop_count >= LOG_SLOW_STARTUP_INTERVAL and setup_started:
self._async_dispatch(remaining_with_setup_started)
if (
self._setup_started
and self._duration_count % LOG_SLOW_STARTUP_INTERVAL == 0
):
# We log every LOG_SLOW_STARTUP_INTERVAL until all integrations are done
# once we take over LOG_SLOW_STARTUP_INTERVAL (60s) to start up
_LOGGER.warning(
"Waiting on integrations to complete setup: %s",
", ".join(setup_started),
", ".join(self._setup_started),
)
loop_count = 0
_LOGGER.debug("Running timeout Zones: %s", hass.timeout.zones)
_LOGGER.debug("Running timeout Zones: %s", self._hass.timeout.zones)
self._async_schedule_next()
def _async_dispatch(self, remaining_with_setup_started: dict[str, float]) -> None:
"""Dispatch the signal."""
if remaining_with_setup_started or not self._previous_was_empty:
async_dispatcher_send(
self._hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, remaining_with_setup_started
)
self._previous_was_empty = not remaining_with_setup_started
def _async_schedule_next(self) -> None:
"""Schedule the next call."""
self._handle = self._loop.call_later(
SLOW_STARTUP_CHECK_INTERVAL, self._async_watch
)
def async_start(self) -> None:
"""Start watching."""
self._async_schedule_next()
def async_stop(self) -> None:
"""Stop watching."""
self._async_dispatch({})
if self._handle:
self._handle.cancel()
self._handle = None
async def async_setup_multi_components(
@@ -581,7 +642,9 @@ async def async_setup_multi_components(
domains_not_yet_setup = domains - hass.config.components
futures = {
domain: hass.async_create_task(
async_setup_component(hass, domain, config), f"setup component {domain}"
async_setup_component(hass, domain, config),
f"setup component {domain}",
eager_start=True,
)
for domain in domains_not_yet_setup
}
@@ -596,17 +659,12 @@ async def async_setup_multi_components(
)
async def _async_set_up_integrations(
async def _async_resolve_domains_to_setup(
hass: core.HomeAssistant, config: dict[str, Any]
) -> None:
"""Set up all the integrations."""
hass.data[DATA_SETUP_STARTED] = {}
setup_time: dict[str, timedelta] = hass.data.setdefault(DATA_SETUP_TIME, {})
watch_task = asyncio.create_task(_async_watch_pending_setups(hass))
) -> tuple[set[str], dict[str, loader.Integration]]:
"""Resolve all dependencies and return list of domains to set up."""
base_platforms_loaded = False
domains_to_setup = _get_domains(hass, config)
needed_requirements: set[str] = set()
# Resolve all dependencies so we know all integrations
@@ -617,48 +675,58 @@ async def _async_set_up_integrations(
old_to_resolve: set[str] = to_resolve
to_resolve = set()
integrations_to_process = [
int_or_exc
for int_or_exc in (
await loader.async_get_integrations(hass, old_to_resolve)
).values()
if isinstance(int_or_exc, loader.Integration)
]
if not base_platforms_loaded:
# Load base platforms right away since
# we do not require the manifest to list
# them as dependencies and we want
# to avoid the lock contention when multiple
# integrations try to resolve them at once
base_platforms_loaded = True
to_get = {*old_to_resolve, *BASE_PLATFORMS}
else:
to_get = old_to_resolve
manifest_deps: set[str] = set()
for itg in integrations_to_process:
resolve_dependencies_tasks: list[asyncio.Task[bool]] = []
integrations_to_process: list[loader.Integration] = []
for domain, itg in (await loader.async_get_integrations(hass, to_get)).items():
if not isinstance(itg, loader.Integration) or domain not in old_to_resolve:
continue
integrations_to_process.append(itg)
integration_cache[domain] = itg
manifest_deps.update(itg.dependencies)
manifest_deps.update(itg.after_dependencies)
needed_requirements.update(itg.requirements)
if not itg.all_dependencies_resolved:
resolve_dependencies_tasks.append(
create_eager_task(
itg.resolve_dependencies(),
name=f"resolve dependencies {domain}",
loop=hass.loop,
)
)
if manifest_deps:
if unseen_deps := manifest_deps - integration_cache.keys():
# If there are dependencies, try to preload all
# the integrations manifest at once and add them
# to the list of requirements we need to install
# so we can try to check if they are already installed
# in a single call below which avoids each integration
# having to wait for the lock to do it individually
deps = await loader.async_get_integrations(hass, manifest_deps)
for dependant_itg in deps.values():
deps = await loader.async_get_integrations(hass, unseen_deps)
for dependant_domain, dependant_itg in deps.items():
if isinstance(dependant_itg, loader.Integration):
integration_cache[dependant_domain] = dependant_itg
needed_requirements.update(dependant_itg.requirements)
resolve_dependencies_tasks = [
itg.resolve_dependencies()
for itg in integrations_to_process
if not itg.all_dependencies_resolved
]
if resolve_dependencies_tasks:
await asyncio.gather(*resolve_dependencies_tasks)
for itg in integrations_to_process:
integration_cache[itg.domain] = itg
for dep in itg.all_dependencies:
if dep in domains_to_setup:
continue
domains_to_setup.add(dep)
to_resolve.add(dep)
@@ -670,31 +738,50 @@ async def _async_set_up_integrations(
hass.async_create_background_task(
requirements.async_load_installed_versions(hass, needed_requirements),
"check installed requirements",
eager_start=True,
)
# Start loading translations for all integrations we are going to set up
# in the background so they are ready when we need them. This avoids a
# lot of waiting for the translation load lock and a thundering herd of
# tasks trying to load the same translations at the same time as each
# integration is loaded.
#
# We do not wait for this since as soon as the task runs it will
# hold the translation load lock and if anything is fast enough to
# wait for the translation load lock, loading will be done by the
# time it gets to it.
hass.async_create_background_task(
translation.async_load_integrations(hass, {*BASE_PLATFORMS, *domains_to_setup}),
"load translations",
eager_start=True,
)
return domains_to_setup, integration_cache
async def _async_set_up_integrations(
hass: core.HomeAssistant, config: dict[str, Any]
) -> None:
"""Set up all the integrations."""
setup_started: dict[str, float] = {}
hass.data[DATA_SETUP_STARTED] = setup_started
setup_time: dict[str, timedelta] = hass.data.setdefault(DATA_SETUP_TIME, {})
watcher = _WatchPendingSetups(hass, setup_started)
watcher.async_start()
domains_to_setup, integration_cache = await _async_resolve_domains_to_setup(
hass, config
)
# Initialize recorder
if "recorder" in domains_to_setup:
recorder.async_initialize_recorder(hass)
# Load logging as soon as possible
if logging_domains := domains_to_setup & LOGGING_INTEGRATIONS:
_LOGGER.info("Setting up logging: %s", logging_domains)
await async_setup_multi_components(hass, logging_domains, config)
# Setup frontend
if frontend_domains := domains_to_setup & FRONTEND_INTEGRATIONS:
_LOGGER.info("Setting up frontend: %s", frontend_domains)
await async_setup_multi_components(hass, frontend_domains, config)
# Setup recorder
if recorder_domains := domains_to_setup & RECORDER_INTEGRATIONS:
_LOGGER.info("Setting up recorder: %s", recorder_domains)
await async_setup_multi_components(hass, recorder_domains, config)
# Start up debuggers. Start these first in case they want to wait.
if debuggers := domains_to_setup & DEBUGGER_INTEGRATIONS:
_LOGGER.debug("Setting up debuggers: %s", debuggers)
await async_setup_multi_components(hass, debuggers, config)
pre_stage_domains: dict[str, set[str]] = {
name: domains_to_setup & domain_group
for name, domain_group in SETUP_ORDER.items()
}
# calculate what components to setup in what stage
stage_1_domains: set[str] = set()
@@ -718,14 +805,13 @@ async def _async_set_up_integrations(
deps_promotion.update(dep_itg.all_dependencies)
stage_2_domains = (
domains_to_setup
- logging_domains
- frontend_domains
- recorder_domains
- debuggers
- stage_1_domains
)
stage_2_domains = domains_to_setup - stage_1_domains
for name, domain_group in pre_stage_domains.items():
if domain_group:
stage_2_domains -= domain_group
_LOGGER.info("Setting up %s: %s", name, domain_group)
await async_setup_multi_components(hass, domain_group, config)
# Enables after dependencies when setting up stage 1 domains
async_set_domains_to_be_loaded(hass, stage_1_domains)
@@ -738,7 +824,7 @@ async def _async_set_up_integrations(
STAGE_1_TIMEOUT, cool_down=COOLDOWN_TIME
):
await async_setup_multi_components(hass, stage_1_domains, config)
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning("Setup timed out for stage 1 - moving forward")
# Add after dependencies when setting up stage 2 domains
@@ -751,7 +837,7 @@ async def _async_set_up_integrations(
STAGE_2_TIMEOUT, cool_down=COOLDOWN_TIME
):
await async_setup_multi_components(hass, stage_2_domains, config)
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning("Setup timed out for stage 2 - moving forward")
# Wrap up startup
@@ -759,18 +845,12 @@ async def _async_set_up_integrations(
try:
async with hass.timeout.async_timeout(WRAP_UP_TIMEOUT, cool_down=COOLDOWN_TIME):
await hass.async_block_till_done()
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning("Setup timed out for bootstrap - moving forward")
watch_task.cancel()
async_dispatcher_send(hass, SIGNAL_BOOTSTRAP_INTEGRATIONS, {})
watcher.async_stop()
_LOGGER.debug(
"Integration setup times: %s",
{
integration: timedelta.total_seconds()
for integration, timedelta in sorted(
setup_time.items(), key=lambda item: item[1].total_seconds()
)
},
dict(sorted(setup_time.items(), key=itemgetter(1))),
)

View File

@@ -1,7 +1,6 @@
"""Adds config flow for AccuWeather."""
from __future__ import annotations
import asyncio
from asyncio import timeout
from typing import Any
@@ -61,7 +60,7 @@ class AccuWeatherFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
longitude=user_input[CONF_LONGITUDE],
)
await accuweather.async_get_location()
except (ApiError, ClientConnectorError, asyncio.TimeoutError, ClientError):
except (ApiError, ClientConnectorError, TimeoutError, ClientError):
errors["base"] = "cannot_connect"
except InvalidApiKeyError:
errors[CONF_API_KEY] = "invalid_api_key"

View File

@@ -1,7 +1,6 @@
"""Config flow for Rollease Acmeda Automate Pulse Hub."""
from __future__ import annotations
import asyncio
from asyncio import timeout
from contextlib import suppress
from typing import Any
@@ -42,7 +41,7 @@ class AcmedaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
}
hubs: list[aiopulse.Hub] = []
with suppress(asyncio.TimeoutError):
with suppress(TimeoutError):
async with timeout(5):
async for hub in aiopulse.Hub.discover():
if hub.id not in already_configured:

View File

@@ -0,0 +1 @@
"""Virtual integration: Acomax."""

View File

@@ -0,0 +1,6 @@
{
"domain": "acomax",
"name": "Acomax",
"integration_type": "virtual",
"supported_by": "motion_blinds"
}

View File

@@ -303,7 +303,7 @@ class AdsEntity(Entity):
try:
async with timeout(10):
await self._event.wait()
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.debug("Variable %s: Timeout during first update", ads_var)
@property

View File

@@ -17,7 +17,8 @@ from homeassistant.components.climate import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
@@ -49,6 +50,24 @@ ADVANTAGE_AIR_HEAT_TARGET = "myAutoHeatTargetTemp"
ADVANTAGE_AIR_COOL_TARGET = "myAutoCoolTargetTemp"
ADVANTAGE_AIR_MYFAN = "autoAA"
HVAC_MODES = [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
HVAC_MODES_MYAUTO = HVAC_MODES + [HVACMode.HEAT_COOL]
SUPPORTED_FEATURES = (
ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON
)
SUPPORTED_FEATURES_MYZONE = SUPPORTED_FEATURES | ClimateEntityFeature.TARGET_TEMPERATURE
SUPPORTED_FEATURES_MYAUTO = (
SUPPORTED_FEATURES | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
@@ -84,34 +103,56 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
_attr_min_temp = 16
_attr_name = None
_enable_turn_on_off_backwards_compatibility = False
_support_preset = ClimateEntityFeature(0)
def __init__(self, instance: AdvantageAirData, ac_key: str) -> None:
"""Initialize an AdvantageAir AC unit."""
super().__init__(instance, ac_key)
self._attr_supported_features = (
ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TURN_OFF
| ClimateEntityFeature.TURN_ON
)
self._attr_hvac_modes = [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
# Set supported features and HVAC modes based on current operating mode
self._attr_preset_modes = [ADVANTAGE_AIR_MYZONE]
# Add "MyTemp" preset if available
if ADVANTAGE_AIR_MYTEMP_ENABLED in self._ac:
self._attr_preset_modes += [ADVANTAGE_AIR_MYTEMP]
self._support_preset = ClimateEntityFeature.PRESET_MODE
# Add "MyAuto" preset if available
if ADVANTAGE_AIR_MYAUTO_ENABLED in self._ac:
self._attr_preset_modes += [ADVANTAGE_AIR_MYAUTO]
self._support_preset = ClimateEntityFeature.PRESET_MODE
# Setup attributes based on current preset
self._async_configure_preset()
def _async_configure_preset(self) -> None:
"""Configure attributes based on preset."""
# Preset Changes
if self._ac.get(ADVANTAGE_AIR_MYAUTO_ENABLED):
# MyAuto
self._attr_supported_features |= (
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
self._attr_preset_mode = ADVANTAGE_AIR_MYAUTO
self._attr_hvac_modes = HVAC_MODES_MYAUTO
self._attr_supported_features = (
SUPPORTED_FEATURES_MYAUTO | self._support_preset
)
self._attr_hvac_modes += [HVACMode.HEAT_COOL]
elif not self._ac.get(ADVANTAGE_AIR_MYTEMP_ENABLED):
elif self._ac.get(ADVANTAGE_AIR_MYTEMP_ENABLED):
# MyTemp
self._attr_preset_mode = ADVANTAGE_AIR_MYTEMP
self._attr_hvac_modes = HVAC_MODES
self._attr_supported_features = SUPPORTED_FEATURES | self._support_preset
else:
# MyZone
self._attr_supported_features |= ClimateEntityFeature.TARGET_TEMPERATURE
self._attr_preset_mode = ADVANTAGE_AIR_MYZONE
self._attr_hvac_modes = HVAC_MODES
self._attr_supported_features = (
SUPPORTED_FEATURES_MYZONE | self._support_preset
)
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._async_configure_preset()
super()._handle_coordinator_update()
@property
def current_temperature(self) -> float | None:
@@ -124,11 +165,7 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
def target_temperature(self) -> float | None:
"""Return the current target temperature."""
# If the system is in MyZone mode, and a zone is set, return that temperature instead.
if (
self._myzone
and not self._ac.get(ADVANTAGE_AIR_MYAUTO_ENABLED)
and not self._ac.get(ADVANTAGE_AIR_MYTEMP_ENABLED)
):
if self._myzone and self.preset_mode == ADVANTAGE_AIR_MYZONE:
return self._myzone["setTemp"]
return self._ac["setTemp"]
@@ -169,14 +206,15 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC Mode and State."""
if hvac_mode == HVACMode.OFF:
await self.async_update_ac({"state": ADVANTAGE_AIR_STATE_OFF})
else:
await self.async_update_ac(
{
"state": ADVANTAGE_AIR_STATE_ON,
"mode": HASS_HVAC_MODES.get(hvac_mode),
}
)
return await self.async_turn_off()
if hvac_mode == HVACMode.HEAT_COOL and self.preset_mode != ADVANTAGE_AIR_MYAUTO:
raise ServiceValidationError("Heat/Cool is not supported in this mode")
await self.async_update_ac(
{
"state": ADVANTAGE_AIR_STATE_ON,
"mode": HASS_HVAC_MODES.get(hvac_mode),
}
)
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set the Fan Mode."""
@@ -198,6 +236,16 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
}
)
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set the preset mode."""
change = {}
if ADVANTAGE_AIR_MYTEMP_ENABLED in self._ac:
change[ADVANTAGE_AIR_MYTEMP_ENABLED] = preset_mode == ADVANTAGE_AIR_MYTEMP
if ADVANTAGE_AIR_MYAUTO_ENABLED in self._ac:
change[ADVANTAGE_AIR_MYAUTO_ENABLED] = preset_mode == ADVANTAGE_AIR_MYAUTO
if change:
await self.async_update_ac(change)
class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
"""AdvantageAir MyTemp Zone control."""

View File

@@ -31,7 +31,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
longitude = entry.data[CONF_LONGITUDE]
station_updates = entry.options.get(CONF_STATION_UPDATES, True)
options = ConnectionOptions(api_key, station_updates, True)
options = ConnectionOptions(api_key, station_updates)
aemet = AEMET(aiohttp_client.async_get_clientsession(hass), options)
try:
await aemet.select_coordinates(latitude, longitude)

View File

@@ -21,7 +21,7 @@ from .const import CONF_STATION_UPDATES, DEFAULT_NAME, DOMAIN
OPTIONS_SCHEMA = vol.Schema(
{
vol.Required(CONF_STATION_UPDATES): bool,
vol.Required(CONF_STATION_UPDATES, default=True): bool,
}
)
OPTIONS_FLOW = {
@@ -45,7 +45,7 @@ class AemetConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
await self.async_set_unique_id(f"{latitude}-{longitude}")
self._abort_if_unique_id_configured()
options = ConnectionOptions(user_input[CONF_API_KEY], False, True)
options = ConnectionOptions(user_input[CONF_API_KEY], False)
aemet = AEMET(aiohttp_client.async_get_clientsession(self.hass), options)
try:
await aemet.select_coordinates(latitude, longitude)

View File

@@ -20,7 +20,7 @@ from aemet_opendata.const import (
AOD_TEMP,
AOD_TEMP_MAX,
AOD_TEMP_MIN,
AOD_TIMESTAMP,
AOD_TIMESTAMP_UTC,
AOD_WIND_DIRECTION,
AOD_WIND_SPEED,
AOD_WIND_SPEED_MAX,
@@ -105,7 +105,7 @@ FORECAST_MAP = {
AOD_PRECIPITATION_PROBABILITY: ATTR_FORECAST_PRECIPITATION_PROBABILITY,
AOD_TEMP_MAX: ATTR_FORECAST_NATIVE_TEMP,
AOD_TEMP_MIN: ATTR_FORECAST_NATIVE_TEMP_LOW,
AOD_TIMESTAMP: ATTR_FORECAST_TIME,
AOD_TIMESTAMP_UTC: ATTR_FORECAST_TIME,
AOD_WIND_DIRECTION: ATTR_FORECAST_WIND_BEARING,
AOD_WIND_SPEED: ATTR_FORECAST_NATIVE_WIND_SPEED,
},
@@ -114,7 +114,7 @@ FORECAST_MAP = {
AOD_PRECIPITATION_PROBABILITY: ATTR_FORECAST_PRECIPITATION_PROBABILITY,
AOD_PRECIPITATION: ATTR_FORECAST_NATIVE_PRECIPITATION,
AOD_TEMP: ATTR_FORECAST_NATIVE_TEMP,
AOD_TIMESTAMP: ATTR_FORECAST_TIME,
AOD_TIMESTAMP_UTC: ATTR_FORECAST_TIME,
AOD_WIND_DIRECTION: ATTR_FORECAST_WIND_BEARING,
AOD_WIND_SPEED_MAX: ATTR_FORECAST_NATIVE_WIND_GUST_SPEED,
AOD_WIND_SPEED: ATTR_FORECAST_NATIVE_WIND_SPEED,

View File

@@ -0,0 +1,44 @@
"""Support for the AEMET OpenData diagnostics."""
from __future__ import annotations
from typing import Any
from aemet_opendata.const import AOD_COORDS
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_UNIQUE_ID,
)
from homeassistant.core import HomeAssistant
from .const import DOMAIN, ENTRY_WEATHER_COORDINATOR
from .coordinator import WeatherUpdateCoordinator
TO_REDACT_CONFIG = [
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_UNIQUE_ID,
]
TO_REDACT_COORD = [
AOD_COORDS,
]
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
aemet_entry = hass.data[DOMAIN][config_entry.entry_id]
coordinator: WeatherUpdateCoordinator = aemet_entry[ENTRY_WEATHER_COORDINATOR]
return {
"api_data": coordinator.aemet.raw_data(),
"config_entry": async_redact_data(config_entry.as_dict(), TO_REDACT_CONFIG),
"coord_data": async_redact_data(coordinator.data, TO_REDACT_COORD),
}

View File

@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/aemet",
"iot_class": "cloud_polling",
"loggers": ["aemet_opendata"],
"requirements": ["AEMET-OpenData==0.4.7"]
"requirements": ["AEMET-OpenData==0.5.1"]
}

View File

@@ -27,7 +27,7 @@ from aemet_opendata.const import (
AOD_TEMP,
AOD_TEMP_MAX,
AOD_TEMP_MIN,
AOD_TIMESTAMP,
AOD_TIMESTAMP_UTC,
AOD_TOWN,
AOD_WEATHER,
AOD_WIND_DIRECTION,
@@ -171,7 +171,7 @@ FORECAST_SENSORS: Final[tuple[AemetSensorEntityDescription, ...]] = (
),
AemetSensorEntityDescription(
key=f"forecast-daily-{ATTR_API_FORECAST_TIME}",
keys=[AOD_TOWN, AOD_FORECAST_DAILY, AOD_FORECAST_CURRENT, AOD_TIMESTAMP],
keys=[AOD_TOWN, AOD_FORECAST_DAILY, AOD_FORECAST_CURRENT, AOD_TIMESTAMP_UTC],
name="Daily forecast time",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=dt_util.parse_datetime,
@@ -179,7 +179,7 @@ FORECAST_SENSORS: Final[tuple[AemetSensorEntityDescription, ...]] = (
AemetSensorEntityDescription(
entity_registry_enabled_default=False,
key=f"forecast-hourly-{ATTR_API_FORECAST_TIME}",
keys=[AOD_TOWN, AOD_FORECAST_HOURLY, AOD_FORECAST_CURRENT, AOD_TIMESTAMP],
keys=[AOD_TOWN, AOD_FORECAST_HOURLY, AOD_FORECAST_CURRENT, AOD_TIMESTAMP_UTC],
name="Hourly forecast time",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=dt_util.parse_datetime,
@@ -286,7 +286,7 @@ WEATHER_SENSORS: Final[tuple[AemetSensorEntityDescription, ...]] = (
),
AemetSensorEntityDescription(
key=ATTR_API_STATION_TIMESTAMP,
keys=[AOD_STATION, AOD_TIMESTAMP],
keys=[AOD_STATION, AOD_TIMESTAMP_UTC],
name="Station timestamp",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=dt_util.parse_datetime,
@@ -326,7 +326,7 @@ WEATHER_SENSORS: Final[tuple[AemetSensorEntityDescription, ...]] = (
),
AemetSensorEntityDescription(
key=ATTR_API_TOWN_TIMESTAMP,
keys=[AOD_TOWN, AOD_FORECAST_HOURLY, AOD_TIMESTAMP],
keys=[AOD_TOWN, AOD_FORECAST_HOURLY, AOD_TIMESTAMP_UTC],
name="Town timestamp",
device_class=SensorDeviceClass.TIMESTAMP,
value_fn=dt_util.parse_datetime,

View File

@@ -22,8 +22,6 @@ CONF_TRACKING_NUMBER: Final = "tracking_number"
DEFAULT_NAME: Final = "aftership"
UPDATE_TOPIC: Final = f"{DOMAIN}_update"
ICON: Final = "mdi:package-variant-closed"
MIN_TIME_BETWEEN_UPDATES: Final = timedelta(minutes=15)
SERVICE_ADD_TRACKING: Final = "add_tracking"

View File

@@ -0,0 +1,13 @@
{
"entity": {
"sensor": {
"packages": {
"default": "mdi:package-variant-closed"
}
}
},
"services": {
"add_tracking": "mdi:package-variant-plus",
"remove_tracking": "mdi:package-variant-minus"
}
}

View File

@@ -35,7 +35,6 @@ from .const import (
CONF_TRACKING_NUMBER,
DEFAULT_NAME,
DOMAIN,
ICON,
MIN_TIME_BETWEEN_UPDATES,
REMOVE_TRACKING_SERVICE_SCHEMA,
SERVICE_ADD_TRACKING,
@@ -135,7 +134,7 @@ class AfterShipSensor(SensorEntity):
_attr_attribution = ATTRIBUTION
_attr_native_unit_of_measurement: str = "packages"
_attr_icon: str = ICON
_attr_translation_key = "packages"
def __init__(self, aftership: AfterShip, name: str) -> None:
"""Initialize the sensor."""

View File

@@ -77,9 +77,8 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
new_data = entry.data.copy()
del new_data[CONF_RADIUS]
entry.version = 2
hass.config_entries.async_update_entry(
entry, data=new_data, options=new_options
entry, data=new_data, options=new_options, version=2
)
_LOGGER.info("Migration to version %s successful", entry.version)

View File

@@ -23,6 +23,13 @@ from .const import DOMAIN, MFCT_ID
_LOGGER = logging.getLogger(__name__)
SERVICE_UUIDS = [
"b42e1f6e-ade7-11e4-89d3-123b93f75cba",
"b42e4a8e-ade7-11e4-89d3-123b93f75cba",
"b42e1c08-ade7-11e4-89d3-123b93f75cba",
"b42e3882-ade7-11e4-89d3-123b93f75cba",
]
@dataclasses.dataclass
class Discovery:
@@ -147,6 +154,9 @@ class AirthingsConfigFlow(ConfigFlow, domain=DOMAIN):
if MFCT_ID not in discovery_info.manufacturer_data:
continue
if not any(uuid in SERVICE_UUIDS for uuid in discovery_info.service_uuids):
continue
try:
device = await self._get_device_data(discovery_info)
except AirthingsDeviceUpdateError:

View File

@@ -242,7 +242,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
# 1 -> 2: One geography per config entry
if version == 1:
version = entry.version = 2
version = 2
# Update the config entry to only include the first geography (there is always
# guaranteed to be at least one):
@@ -255,6 +255,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
unique_id=first_id,
title=f"Cloud API ({first_id})",
data={CONF_API_KEY: entry.data[CONF_API_KEY], **first_geography},
version=version,
)
# For any geographies that remain, create a new config entry for each one:
@@ -379,7 +380,7 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
},
)
else:
entry.version = version
hass.config_entries.async_update_entry(entry, version=version)
LOGGER.info("Migration to version %s successful", version)

View File

@@ -0,0 +1,12 @@
{
"entity": {
"sensor": {
"pollutant_level": {
"default": "mdi:gauge"
},
"pollutant_label": {
"default": "mdi:chemical-weapon"
}
}
}
}

View File

@@ -5,6 +5,7 @@
"config_flow": true,
"dependencies": ["airvisual_pro"],
"documentation": "https://www.home-assistant.io/integrations/airvisual",
"import_executor": true,
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["pyairvisual", "pysmb"],

View File

@@ -42,7 +42,6 @@ GEOGRAPHY_SENSOR_DESCRIPTIONS = (
SensorEntityDescription(
key=SENSOR_KIND_LEVEL,
name="Air pollution level",
icon="mdi:gauge",
device_class=SensorDeviceClass.ENUM,
options=[
"good",
@@ -63,7 +62,6 @@ GEOGRAPHY_SENSOR_DESCRIPTIONS = (
SensorEntityDescription(
key=SENSOR_KIND_POLLUTANT,
name="Main pollutant",
icon="mdi:chemical-weapon",
device_class=SensorDeviceClass.ENUM,
options=["co", "n2", "o3", "p1", "p2", "s2"],
translation_key="pollutant_label",

View File

@@ -7,6 +7,7 @@ from typing import Any, Final
from aioairzone_cloud.const import (
AZD_ACTIVE,
AZD_AIDOOS,
AZD_AQ_ACTIVE,
AZD_ERRORS,
AZD_PROBLEMS,
AZD_SYSTEMS,
@@ -76,6 +77,10 @@ ZONE_BINARY_SENSOR_TYPES: Final[tuple[AirzoneBinarySensorEntityDescription, ...]
device_class=BinarySensorDeviceClass.RUNNING,
key=AZD_ACTIVE,
),
AirzoneBinarySensorEntityDescription(
key=AZD_AQ_ACTIVE,
translation_key="air_quality_active",
),
AirzoneBinarySensorEntityDescription(
attributes={
"warnings": AZD_WARNINGS,

View File

@@ -5,6 +5,10 @@ from typing import Any, Final
from aioairzone_cloud.const import (
AZD_AIDOOS,
AZD_AQ_INDEX,
AZD_AQ_PM_1,
AZD_AQ_PM_2P5,
AZD_AQ_PM_10,
AZD_HUMIDITY,
AZD_TEMP,
AZD_WEBSERVERS,
@@ -20,6 +24,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
@@ -58,6 +63,29 @@ WEBSERVER_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
)
ZONE_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
SensorEntityDescription(
device_class=SensorDeviceClass.AQI,
key=AZD_AQ_INDEX,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.PM1,
key=AZD_AQ_PM_1,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.PM25,
key=AZD_AQ_PM_2P5,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.PM10,
key=AZD_AQ_PM_10,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.TEMPERATURE,
key=AZD_TEMP,

View File

@@ -15,5 +15,12 @@
}
}
}
},
"entity": {
"binary_sensor": {
"air_quality_active": {
"name": "Air Quality active"
}
}
}
}

View File

@@ -1,5 +1,4 @@
"""The aladdin_connect component."""
import asyncio
import logging
from typing import Final
@@ -29,7 +28,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
try:
await acc.login()
except (ClientError, asyncio.TimeoutError, Aladdin.ConnectionError) as ex:
except (ClientError, TimeoutError, Aladdin.ConnectionError) as ex:
raise ConfigEntryNotReady("Can not connect to host") from ex
except Aladdin.InvalidPasswordError as ex:
raise ConfigEntryAuthFailed("Incorrect Password") from ex

View File

@@ -1,7 +1,6 @@
"""Config flow for Aladdin Connect cover integration."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
from typing import Any
@@ -42,7 +41,7 @@ async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> None:
)
try:
await acc.login()
except (ClientError, asyncio.TimeoutError, Aladdin.ConnectionError) as ex:
except (ClientError, TimeoutError, Aladdin.ConnectionError) as ex:
raise ex
except Aladdin.InvalidPasswordError as ex:
@@ -81,7 +80,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
except InvalidAuth:
errors["base"] = "invalid_auth"
except (ClientError, asyncio.TimeoutError, Aladdin.ConnectionError):
except (ClientError, TimeoutError, Aladdin.ConnectionError):
errors["base"] = "cannot_connect"
else:
@@ -117,7 +116,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
except InvalidAuth:
errors["base"] = "invalid_auth"
except (ClientError, asyncio.TimeoutError, Aladdin.ConnectionError):
except (ClientError, TimeoutError, Aladdin.ConnectionError):
errors["base"] = "cannot_connect"
else:

View File

@@ -0,0 +1,13 @@
{
"entity": {
"sensor": {
"alarm_panel_display": {
"default": "mdi:alarm-check"
}
}
},
"services": {
"alarm_keypress": "mdi:dialpad",
"alarm_toggle_chime": "mdi:abc"
}
}

View File

@@ -20,7 +20,7 @@ async def async_setup_entry(
class AlarmDecoderSensor(SensorEntity):
"""Representation of an AlarmDecoder keypad."""
_attr_icon = "mdi:alarm-check"
_attr_translation_key = "alarm_panel_display"
_attr_name = "Alarm Panel Display"
_attr_should_poll = False

View File

@@ -122,7 +122,7 @@ class Auth:
allow_redirects=True,
)
except (asyncio.TimeoutError, aiohttp.ClientError):
except (TimeoutError, aiohttp.ClientError):
_LOGGER.error("Timeout calling LWA to get auth token")
return None

View File

@@ -29,12 +29,20 @@ class AbstractConfig(ABC):
"""Initialize abstract config."""
self.hass = hass
self._enable_proactive_mode_lock = asyncio.Lock()
self._on_deinitialize: list[CALLBACK_TYPE] = []
async def async_initialize(self) -> None:
"""Perform async initialization of config."""
self._store = AlexaConfigStore(self.hass)
await self._store.async_load()
@callback
def async_deinitialize(self) -> None:
"""Remove listeners."""
_LOGGER.debug("async_deinitialize")
while self._on_deinitialize:
self._on_deinitialize.pop()()
@property
def supports_auth(self) -> bool:
"""Return if config supports auth."""

View File

@@ -1,7 +1,6 @@
"""Alexa state report code."""
from __future__ import annotations
import asyncio
from asyncio import timeout
from http import HTTPStatus
import json
@@ -375,7 +374,7 @@ async def async_send_changereport_message(
allow_redirects=True,
)
except (asyncio.TimeoutError, aiohttp.ClientError):
except (TimeoutError, aiohttp.ClientError):
_LOGGER.error("Timeout sending report to Alexa for %s", alexa_entity.entity_id)
return
@@ -531,7 +530,7 @@ async def async_send_doorbell_event_message(
allow_redirects=True,
)
except (asyncio.TimeoutError, aiohttp.ClientError):
except (TimeoutError, aiohttp.ClientError):
_LOGGER.error("Timeout sending report to Alexa for %s", alexa_entity.entity_id)
return

View File

@@ -0,0 +1,18 @@
{
"entity": {
"sensor": {
"general": {
"default": "mdi:transmission-tower"
},
"controlled_load": {
"default": "mdi:clock-outline"
},
"feed_in": {
"default": "mdi:solar-power"
},
"renewables": {
"default": "mdi:solar-power"
}
}
}
}

View File

@@ -27,12 +27,6 @@ from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import ATTRIBUTION, DOMAIN
from .coordinator import AmberUpdateCoordinator, normalize_descriptor
ICONS = {
"general": "mdi:transmission-tower",
"controlled_load": "mdi:clock-outline",
"feed_in": "mdi:solar-power",
}
UNIT = f"{CURRENCY_DOLLAR}/{UnitOfEnergy.KILO_WATT_HOUR}"
@@ -219,7 +213,7 @@ async def async_setup_entry(
name=f"{entry.title} - {friendly_channel_type(channel_type)} Price",
native_unit_of_measurement=UNIT,
state_class=SensorStateClass.MEASUREMENT,
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(AmberPriceSensor(coordinator, description, channel_type))
@@ -230,7 +224,7 @@ async def async_setup_entry(
f"{entry.title} - {friendly_channel_type(channel_type)} Price"
" Descriptor"
),
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(
AmberPriceDescriptorSensor(coordinator, description, channel_type)
@@ -242,7 +236,7 @@ async def async_setup_entry(
name=f"{entry.title} - {friendly_channel_type(channel_type)} Forecast",
native_unit_of_measurement=UNIT,
state_class=SensorStateClass.MEASUREMENT,
icon=ICONS[channel_type],
translation_key=channel_type,
)
entities.append(AmberForecastSensor(coordinator, description, channel_type))
@@ -251,7 +245,7 @@ async def async_setup_entry(
name=f"{entry.title} - Renewables",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:solar-power",
translation_key="renewables",
)
entities.append(AmberGridSensor(coordinator, renewables_description))

View File

@@ -4,7 +4,7 @@ import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import config_validation as cv, issue_registry as ir
from homeassistant.helpers.typing import ConfigType
from . import config_flow
@@ -41,5 +41,18 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Ambiclimate from a config entry."""
ir.async_create_issue(
hass,
DOMAIN,
DOMAIN,
breaks_in_ha_version="2024.4.0",
is_fixable=False,
severity=ir.IssueSeverity.WARNING,
translation_key="integration_removed",
translation_placeholders={
"entries": "/config/integrations/integration/ambiclimate",
},
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True

View File

@@ -0,0 +1,7 @@
{
"services": {
"set_comfort_mode": "mdi:auto-mode",
"send_comfort_feedback": "mdi:thermometer-checked",
"set_temperature_mode": "mdi:thermometer"
}
}

View File

@@ -19,6 +19,12 @@
"access_token": "Unknown error generating an access token."
}
},
"issues": {
"integration_removed": {
"title": "The Ambiclimate integration has been deprecated and will be removed",
"description": "All Ambiclimate services will be terminated, effective March 31, 2024, as Ambi Labs winds down business operations, and the Ambiclimate integration will be removed from Home Assistant.\n\nTo resolve this issue, please remove the integration entries from your Home Assistant setup. [Click here to see your existing Logi Circle integration entries]({entries})."
}
},
"services": {
"set_comfort_mode": {
"name": "Set comfort mode",
@@ -40,7 +46,7 @@
},
"value": {
"name": "Comfort value",
"description": "Send any of the following comfort values: too_hot, too_warm, bit_warm, comfortable, bit_cold, too_cold, freezing\n."
"description": "Send any of the following comfort values: too_hot, too_warm, bit_warm, comfortable, bit_cold, too_cold, freezing."
}
}
},

View File

@@ -111,7 +111,8 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
en_reg = er.async_get(hass)
en_reg.async_clear_config_entry(entry.entry_id)
version = entry.version = 2
version = 2
hass.config_entries.async_update_entry(entry, version=version)
LOGGER.info("Migration to version %s successful", version)

View File

@@ -0,0 +1 @@
"""Virtual integration: AMP motorization."""

View File

@@ -173,6 +173,7 @@ class Analytics:
async def send_analytics(self, _: datetime | None = None) -> None:
"""Send analytics."""
hass = self.hass
supervisor_info = None
operating_system_info: dict[str, Any] = {}
@@ -185,10 +186,10 @@ class Analytics:
await self._store.async_save(dataclass_asdict(self._data))
if self.supervisor:
supervisor_info = hassio.get_supervisor_info(self.hass)
operating_system_info = hassio.get_os_info(self.hass) or {}
supervisor_info = hassio.get_supervisor_info(hass)
operating_system_info = hassio.get_os_info(hass) or {}
system_info = await async_get_system_info(self.hass)
system_info = await async_get_system_info(hass)
integrations = []
custom_integrations = []
addons = []
@@ -214,10 +215,10 @@ class Analytics:
if self.preferences.get(ATTR_USAGE, False) or self.preferences.get(
ATTR_STATISTICS, False
):
ent_reg = er.async_get(self.hass)
ent_reg = er.async_get(hass)
try:
yaml_configuration = await conf_util.async_hass_config_yaml(self.hass)
yaml_configuration = await conf_util.async_hass_config_yaml(hass)
except HomeAssistantError as err:
LOGGER.error(err)
return
@@ -229,8 +230,8 @@ class Analytics:
if not entity.disabled
}
domains = async_get_loaded_integrations(self.hass)
configured_integrations = await async_get_integrations(self.hass, domains)
domains = async_get_loaded_integrations(hass)
configured_integrations = await async_get_integrations(hass, domains)
enabled_domains = set(configured_integrations)
for integration in configured_integrations.values():
@@ -261,7 +262,7 @@ class Analytics:
if supervisor_info is not None:
installed_addons = await asyncio.gather(
*(
hassio.async_get_addon_info(self.hass, addon[ATTR_SLUG])
hassio.async_get_addon_info(hass, addon[ATTR_SLUG])
for addon in supervisor_info[ATTR_ADDONS]
)
)
@@ -276,7 +277,7 @@ class Analytics:
)
if self.preferences.get(ATTR_USAGE, False):
payload[ATTR_CERTIFICATE] = self.hass.http.ssl_certificate is not None
payload[ATTR_CERTIFICATE] = hass.http.ssl_certificate is not None
payload[ATTR_INTEGRATIONS] = integrations
payload[ATTR_CUSTOM_INTEGRATIONS] = custom_integrations
if supervisor_info is not None:
@@ -284,11 +285,11 @@ class Analytics:
if ENERGY_DOMAIN in enabled_domains:
payload[ATTR_ENERGY] = {
ATTR_CONFIGURED: await energy_is_configured(self.hass)
ATTR_CONFIGURED: await energy_is_configured(hass)
}
if RECORDER_DOMAIN in enabled_domains:
instance = get_recorder_instance(self.hass)
instance = get_recorder_instance(hass)
engine = instance.database_engine
if engine and engine.version is not None:
payload[ATTR_RECORDER] = {
@@ -297,9 +298,9 @@ class Analytics:
}
if self.preferences.get(ATTR_STATISTICS, False):
payload[ATTR_STATE_COUNT] = len(self.hass.states.async_all())
payload[ATTR_AUTOMATION_COUNT] = len(
self.hass.states.async_all(AUTOMATION_DOMAIN)
payload[ATTR_STATE_COUNT] = hass.states.async_entity_ids_count()
payload[ATTR_AUTOMATION_COUNT] = hass.states.async_entity_ids_count(
AUTOMATION_DOMAIN
)
payload[ATTR_INTEGRATION_COUNT] = len(integrations)
if supervisor_info is not None:
@@ -307,7 +308,7 @@ class Analytics:
payload[ATTR_USER_COUNT] = len(
[
user
for user in await self.hass.auth.async_get_users()
for user in await hass.auth.async_get_users()
if not user.system_generated
]
)
@@ -329,7 +330,7 @@ class Analytics:
response.status,
self.endpoint,
)
except asyncio.TimeoutError:
except TimeoutError:
LOGGER.error("Timeout sending analytics to %s", ANALYTICS_ENDPOINT_URL)
except aiohttp.ClientError as err:
LOGGER.error(

View File

@@ -5,6 +5,7 @@
"codeowners": ["@home-assistant/core", "@ludeeus"],
"dependencies": ["api", "websocket_api"],
"documentation": "https://www.home-assistant.io/integrations/analytics",
"import_executor": true,
"integration_type": "system",
"iot_class": "cloud_push",
"quality_scale": "internal"

View File

@@ -4,6 +4,7 @@
"codeowners": ["@joostlek"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/analytics_insights",
"import_executor": true,
"integration_type": "service",
"iot_class": "cloud_polling",
"loggers": ["python_homeassistant_analytics"],

View File

@@ -0,0 +1,62 @@
{
"entity": {
"sensor": {
"audio_connections": {
"default": "mdi:speaker"
},
"battery_temperature": {
"default": "mdi:thermometer"
},
"light": {
"default": "mdi:flashlight"
},
"motion": {
"default": "mdi:run"
},
"pressure": {
"default": "mdi:gauge"
},
"proximity": {
"default": "mdi:map-marker-radius"
},
"sound": {
"default": "mdi:speaker"
},
"video_connections": {
"default": "mdi:eye"
}
},
"switch": {
"exposure_lock": {
"default": "mdi:camera"
},
"ffc": {
"default": "mdi:camera-front-variant"
},
"focus": {
"default": "mdi:image-filter-center-focus"
},
"gps_active": {
"default": "mdi:crosshairs-gps"
},
"motion_detect": {
"default": "mdi:flash"
},
"night_vision": {
"default": "mdi:weather-night"
},
"overlay": {
"default": "mdi:monitor"
},
"torch": {
"default": "mdi:white-balance-sunny"
},
"whitebalance_lock": {
"default": "mdi:white-balance-auto"
},
"video_recording": {
"default": "mdi:record-rec"
}
}
}
}

View File

@@ -42,8 +42,8 @@ class AndroidIPWebcamSensorEntityDescription(
SENSOR_TYPES: tuple[AndroidIPWebcamSensorEntityDescription, ...] = (
AndroidIPWebcamSensorEntityDescription(
key="audio_connections",
translation_key="audio_connections",
name="Audio connections",
icon="mdi:speaker",
state_class=SensorStateClass.TOTAL,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda ipcam: ipcam.status_data.get("audio_connections"),
@@ -59,8 +59,8 @@ SENSOR_TYPES: tuple[AndroidIPWebcamSensorEntityDescription, ...] = (
),
AndroidIPWebcamSensorEntityDescription(
key="battery_temp",
translation_key="battery_temperature",
name="Battery temperature",
icon="mdi:thermometer",
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda ipcam: ipcam.get_sensor_value("battery_temp"),
@@ -76,48 +76,48 @@ SENSOR_TYPES: tuple[AndroidIPWebcamSensorEntityDescription, ...] = (
),
AndroidIPWebcamSensorEntityDescription(
key="light",
translation_key="light",
name="Light level",
icon="mdi:flashlight",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda ipcam: ipcam.get_sensor_value("light"),
unit_fn=lambda ipcam: ipcam.get_sensor_unit("light"),
),
AndroidIPWebcamSensorEntityDescription(
key="motion",
translation_key="motion",
name="Motion",
icon="mdi:run",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda ipcam: ipcam.get_sensor_value("motion"),
unit_fn=lambda ipcam: ipcam.get_sensor_unit("motion"),
),
AndroidIPWebcamSensorEntityDescription(
key="pressure",
translation_key="pressure",
name="Pressure",
icon="mdi:gauge",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda ipcam: ipcam.get_sensor_value("pressure"),
unit_fn=lambda ipcam: ipcam.get_sensor_unit("pressure"),
),
AndroidIPWebcamSensorEntityDescription(
key="proximity",
translation_key="proximity",
name="Proximity",
icon="mdi:map-marker-radius",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda ipcam: ipcam.get_sensor_value("proximity"),
unit_fn=lambda ipcam: ipcam.get_sensor_unit("proximity"),
),
AndroidIPWebcamSensorEntityDescription(
key="sound",
translation_key="sound",
name="Sound",
icon="mdi:speaker",
state_class=SensorStateClass.MEASUREMENT,
value_fn=lambda ipcam: ipcam.get_sensor_value("sound"),
unit_fn=lambda ipcam: ipcam.get_sensor_unit("sound"),
),
AndroidIPWebcamSensorEntityDescription(
key="video_connections",
translation_key="video_connections",
name="Video connections",
icon="mdi:eye",
state_class=SensorStateClass.TOTAL,
entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda ipcam: ipcam.status_data.get("video_connections"),

View File

@@ -36,80 +36,80 @@ class AndroidIPWebcamSwitchEntityDescription(
SWITCH_TYPES: tuple[AndroidIPWebcamSwitchEntityDescription, ...] = (
AndroidIPWebcamSwitchEntityDescription(
key="exposure_lock",
translation_key="exposure_lock",
name="Exposure lock",
icon="mdi:camera",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("exposure_lock", True),
off_func=lambda ipcam: ipcam.change_setting("exposure_lock", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="ffc",
translation_key="ffc",
name="Front-facing camera",
icon="mdi:camera-front-variant",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("ffc", True),
off_func=lambda ipcam: ipcam.change_setting("ffc", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="focus",
translation_key="focus",
name="Focus",
icon="mdi:image-filter-center-focus",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.focus(activate=True),
off_func=lambda ipcam: ipcam.focus(activate=False),
),
AndroidIPWebcamSwitchEntityDescription(
key="gps_active",
translation_key="gps_active",
name="GPS active",
icon="mdi:crosshairs-gps",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("gps_active", True),
off_func=lambda ipcam: ipcam.change_setting("gps_active", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="motion_detect",
translation_key="motion_detect",
name="Motion detection",
icon="mdi:flash",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("motion_detect", True),
off_func=lambda ipcam: ipcam.change_setting("motion_detect", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="night_vision",
translation_key="night_vision",
name="Night vision",
icon="mdi:weather-night",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("night_vision", True),
off_func=lambda ipcam: ipcam.change_setting("night_vision", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="overlay",
translation_key="overlay",
name="Overlay",
icon="mdi:monitor",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("overlay", True),
off_func=lambda ipcam: ipcam.change_setting("overlay", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="torch",
translation_key="torch",
name="Torch",
icon="mdi:white-balance-sunny",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.torch(activate=True),
off_func=lambda ipcam: ipcam.torch(activate=False),
),
AndroidIPWebcamSwitchEntityDescription(
key="whitebalance_lock",
translation_key="whitebalance_lock",
name="White balance lock",
icon="mdi:white-balance-auto",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.change_setting("whitebalance_lock", True),
off_func=lambda ipcam: ipcam.change_setting("whitebalance_lock", False),
),
AndroidIPWebcamSwitchEntityDescription(
key="video_recording",
translation_key="video_recording",
name="Video recording",
icon="mdi:record-rec",
entity_category=EntityCategory.CONFIG,
on_func=lambda ipcam: ipcam.record(record=True),
off_func=lambda ipcam: ipcam.record(record=False),

View File

@@ -0,0 +1,145 @@
"""Base AndroidTV Entity."""
from __future__ import annotations
from collections.abc import Awaitable, Callable, Coroutine
import functools
import logging
from typing import Any, Concatenate, ParamSpec, TypeVar
from androidtv.exceptions import LockNotAcquiredException
from androidtv.setup_async import AndroidTVAsync, FireTVAsync
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_CONNECTIONS,
ATTR_IDENTIFIERS,
ATTR_MANUFACTURER,
ATTR_MODEL,
ATTR_SW_VERSION,
CONF_HOST,
CONF_NAME,
)
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.entity import Entity
from . import ADB_PYTHON_EXCEPTIONS, ADB_TCP_EXCEPTIONS, get_androidtv_mac
from .const import DEVICE_ANDROIDTV, DOMAIN
PREFIX_ANDROIDTV = "Android TV"
PREFIX_FIRETV = "Fire TV"
_LOGGER = logging.getLogger(__name__)
_ADBDeviceT = TypeVar("_ADBDeviceT", bound="AndroidTVEntity")
_R = TypeVar("_R")
_P = ParamSpec("_P")
_FuncType = Callable[Concatenate[_ADBDeviceT, _P], Awaitable[_R]]
_ReturnFuncType = Callable[Concatenate[_ADBDeviceT, _P], Coroutine[Any, Any, _R | None]]
def adb_decorator(
override_available: bool = False,
) -> Callable[[_FuncType[_ADBDeviceT, _P, _R]], _ReturnFuncType[_ADBDeviceT, _P, _R]]:
"""Wrap ADB methods and catch exceptions.
Allows for overriding the available status of the ADB connection via the
`override_available` parameter.
"""
def _adb_decorator(
func: _FuncType[_ADBDeviceT, _P, _R],
) -> _ReturnFuncType[_ADBDeviceT, _P, _R]:
"""Wrap the provided ADB method and catch exceptions."""
@functools.wraps(func)
async def _adb_exception_catcher(
self: _ADBDeviceT, *args: _P.args, **kwargs: _P.kwargs
) -> _R | None:
"""Call an ADB-related method and catch exceptions."""
if not self.available and not override_available:
return None
try:
return await func(self, *args, **kwargs)
except LockNotAcquiredException:
# If the ADB lock could not be acquired, skip this command
_LOGGER.info(
(
"ADB command %s not executed because the connection is"
" currently in use"
),
func.__name__,
)
return None
except self.exceptions as err:
_LOGGER.error(
(
"Failed to execute an ADB command. ADB connection re-"
"establishing attempt in the next update. Error: %s"
),
err,
)
await self.aftv.adb_close()
# pylint: disable-next=protected-access
self._attr_available = False
return None
except Exception:
# An unforeseen exception occurred. Close the ADB connection so that
# it doesn't happen over and over again, then raise the exception.
await self.aftv.adb_close()
# pylint: disable-next=protected-access
self._attr_available = False
raise
return _adb_exception_catcher
return _adb_decorator
class AndroidTVEntity(Entity):
"""Defines a base AndroidTV entity."""
_attr_has_entity_name = True
def __init__(
self,
aftv: AndroidTVAsync | FireTVAsync,
entry: ConfigEntry,
entry_data: dict[str, Any],
) -> None:
"""Initialize the AndroidTV base entity."""
self.aftv = aftv
self._attr_unique_id = entry.unique_id
self._entry_data = entry_data
device_class = aftv.DEVICE_CLASS
device_type = (
PREFIX_ANDROIDTV if device_class == DEVICE_ANDROIDTV else PREFIX_FIRETV
)
# CONF_NAME may be present in entry.data for configuration imported from YAML
device_name = entry.data.get(
CONF_NAME, f"{device_type} {entry.data[CONF_HOST]}"
)
info = aftv.device_properties
model = info.get(ATTR_MODEL)
self._attr_device_info = DeviceInfo(
model=f"{model} ({device_type})" if model else device_type,
name=device_name,
)
if self.unique_id:
self._attr_device_info[ATTR_IDENTIFIERS] = {(DOMAIN, self.unique_id)}
if manufacturer := info.get(ATTR_MANUFACTURER):
self._attr_device_info[ATTR_MANUFACTURER] = manufacturer
if sw_version := info.get(ATTR_SW_VERSION):
self._attr_device_info[ATTR_SW_VERSION] = sw_version
if mac := get_androidtv_mac(info):
self._attr_device_info[ATTR_CONNECTIONS] = {(CONNECTION_NETWORK_MAC, mac)}
# ADB exceptions to catch
if not aftv.adb_server_ip:
# Using "adb_shell" (Python ADB implementation)
self.exceptions = ADB_PYTHON_EXCEPTIONS
else:
# Using "pure-python-adb" (communicate with ADB server)
self.exceptions = ADB_TCP_EXCEPTIONS

View File

@@ -0,0 +1,8 @@
{
"services": {
"adb_command": "mdi:console",
"download": "mdi:download",
"upload": "mdi:upload",
"learn_sendevent": "mdi:remote"
}
}

View File

@@ -1,15 +1,12 @@
"""Support for functionality to interact with Android / Fire TV devices."""
from __future__ import annotations
from collections.abc import Awaitable, Callable, Coroutine
from datetime import timedelta
import functools
import hashlib
import logging
from typing import Any, Concatenate, ParamSpec, TypeVar
from typing import Any
from androidtv.constants import APPS, KEYS
from androidtv.exceptions import LockNotAcquiredException
from androidtv.setup_async import AndroidTVAsync, FireTVAsync
import voluptuous as vol
@@ -21,23 +18,13 @@ from homeassistant.components.media_player import (
MediaPlayerState,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_COMMAND,
ATTR_CONNECTIONS,
ATTR_MANUFACTURER,
ATTR_MODEL,
ATTR_SW_VERSION,
CONF_HOST,
CONF_NAME,
)
from homeassistant.const import ATTR_COMMAND
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv, entity_platform
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.util import Throttle
from . import ADB_PYTHON_EXCEPTIONS, ADB_TCP_EXCEPTIONS, get_androidtv_mac
from .const import (
ANDROID_DEV,
ANDROID_DEV_OPT,
@@ -54,10 +41,7 @@ from .const import (
DOMAIN,
SIGNAL_CONFIG_ENTITY,
)
_ADBDeviceT = TypeVar("_ADBDeviceT", bound="ADBDevice")
_R = TypeVar("_R")
_P = ParamSpec("_P")
from .entity import AndroidTVEntity, adb_decorator
_LOGGER = logging.getLogger(__name__)
@@ -73,9 +57,6 @@ SERVICE_DOWNLOAD = "download"
SERVICE_LEARN_SENDEVENT = "learn_sendevent"
SERVICE_UPLOAD = "upload"
PREFIX_ANDROIDTV = "Android TV"
PREFIX_FIRETV = "Fire TV"
# Translate from `AndroidTV` / `FireTV` reported state to HA state.
ANDROIDTV_STATES = {
"off": MediaPlayerState.OFF,
@@ -92,25 +73,11 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Android Debug Bridge entity."""
aftv: AndroidTVAsync | FireTVAsync = hass.data[DOMAIN][entry.entry_id][ANDROID_DEV]
entry_data = hass.data[DOMAIN][entry.entry_id]
aftv: AndroidTVAsync | FireTVAsync = entry_data[ANDROID_DEV]
device_class = aftv.DEVICE_CLASS
device_type = (
PREFIX_ANDROIDTV if device_class == DEVICE_ANDROIDTV else PREFIX_FIRETV
)
# CONF_NAME may be present in entry.data for configuration imported from YAML
device_name: str = entry.data.get(
CONF_NAME, f"{device_type} {entry.data[CONF_HOST]}"
)
device_args = [
aftv,
device_name,
device_type,
entry.unique_id,
entry.entry_id,
hass.data[DOMAIN][entry.entry_id],
]
device_args = [aftv, entry, entry_data]
async_add_entities(
[
AndroidTVDevice(*device_args)
@@ -146,108 +113,25 @@ async def async_setup_entry(
)
_FuncType = Callable[Concatenate[_ADBDeviceT, _P], Awaitable[_R]]
_ReturnFuncType = Callable[Concatenate[_ADBDeviceT, _P], Coroutine[Any, Any, _R | None]]
def adb_decorator(
override_available: bool = False,
) -> Callable[[_FuncType[_ADBDeviceT, _P, _R]], _ReturnFuncType[_ADBDeviceT, _P, _R]]:
"""Wrap ADB methods and catch exceptions.
Allows for overriding the available status of the ADB connection via the
`override_available` parameter.
"""
def _adb_decorator(
func: _FuncType[_ADBDeviceT, _P, _R],
) -> _ReturnFuncType[_ADBDeviceT, _P, _R]:
"""Wrap the provided ADB method and catch exceptions."""
@functools.wraps(func)
async def _adb_exception_catcher(
self: _ADBDeviceT, *args: _P.args, **kwargs: _P.kwargs
) -> _R | None:
"""Call an ADB-related method and catch exceptions."""
if not self.available and not override_available:
return None
try:
return await func(self, *args, **kwargs)
except LockNotAcquiredException:
# If the ADB lock could not be acquired, skip this command
_LOGGER.info(
(
"ADB command %s not executed because the connection is"
" currently in use"
),
func.__name__,
)
return None
except self.exceptions as err:
_LOGGER.error(
(
"Failed to execute an ADB command. ADB connection re-"
"establishing attempt in the next update. Error: %s"
),
err,
)
await self.aftv.adb_close()
# pylint: disable-next=protected-access
self._attr_available = False
return None
except Exception:
# An unforeseen exception occurred. Close the ADB connection so that
# it doesn't happen over and over again, then raise the exception.
await self.aftv.adb_close()
# pylint: disable-next=protected-access
self._attr_available = False
raise
return _adb_exception_catcher
return _adb_decorator
class ADBDevice(MediaPlayerEntity):
class ADBDevice(AndroidTVEntity, MediaPlayerEntity):
"""Representation of an Android or Fire TV device."""
_attr_device_class = MediaPlayerDeviceClass.TV
_attr_has_entity_name = True
_attr_name = None
def __init__(
self,
aftv: AndroidTVAsync | FireTVAsync,
name: str,
dev_type: str,
unique_id: str,
entry_id: str,
entry: ConfigEntry,
entry_data: dict[str, Any],
) -> None:
"""Initialize the Android / Fire TV device."""
self.aftv = aftv
self._attr_unique_id = unique_id
self._entry_id = entry_id
self._entry_data = entry_data
super().__init__(aftv, entry, entry_data)
self._entry_id = entry.entry_id
self._media_image: tuple[bytes | None, str | None] = None, None
self._attr_media_image_hash = None
info = aftv.device_properties
model = info.get(ATTR_MODEL)
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, unique_id)},
model=f"{model} ({dev_type})" if model else dev_type,
name=name,
)
if manufacturer := info.get(ATTR_MANUFACTURER):
self._attr_device_info[ATTR_MANUFACTURER] = manufacturer
if sw_version := info.get(ATTR_SW_VERSION):
self._attr_device_info[ATTR_SW_VERSION] = sw_version
if mac := get_androidtv_mac(info):
self._attr_device_info[ATTR_CONNECTIONS] = {(CONNECTION_NETWORK_MAC, mac)}
self._app_id_to_name: dict[str, str] = {}
self._app_name_to_id: dict[str, str] = {}
self._get_sources = DEFAULT_GET_SOURCES
@@ -256,14 +140,6 @@ class ADBDevice(MediaPlayerEntity):
self.turn_on_command: str | None = None
self.turn_off_command: str | None = None
# ADB exceptions to catch
if not aftv.adb_server_ip:
# Using "adb_shell" (Python ADB implementation)
self.exceptions = ADB_PYTHON_EXCEPTIONS
else:
# Using "pure-python-adb" (communicate with ADB server)
self.exceptions = ADB_TCP_EXCEPTIONS
# Property attributes
self._attr_extra_state_attributes = {
ATTR_ADB_RESPONSE: None,

View File

@@ -1,7 +1,6 @@
"""The Android TV Remote integration."""
from __future__ import annotations
import asyncio
from asyncio import timeout
import logging
@@ -50,7 +49,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except InvalidAuth as exc:
# The Android TV is hard reset or the certificate and key files were deleted.
raise ConfigEntryAuthFailed from exc
except (CannotConnect, ConnectionClosed, asyncio.TimeoutError) as exc:
except (CannotConnect, ConnectionClosed, TimeoutError) as exc:
# The Android TV is network unreachable. Raise exception and let Home Assistant retry
# later. If device gets a new IP address the zeroconf flow will update the config.
raise ConfigEntryNotReady from exc

View File

@@ -4,6 +4,7 @@
"codeowners": ["@tronikos", "@Drafteed"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/androidtv_remote",
"import_executor": true,
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["androidtvremote2"],

View File

@@ -53,7 +53,6 @@ class AnthemAVR(MediaPlayerEntity):
_attr_name = None
_attr_should_poll = False
_attr_device_class = MediaPlayerDeviceClass.RECEIVER
_attr_icon = "mdi:audio-video"
_attr_supported_features = (
MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_MUTE

View File

@@ -0,0 +1,9 @@
{
"entity": {
"sensor": {
"hot_water_availability": {
"default": "mdi:water-thermometer"
}
}
}
}

View File

@@ -33,7 +33,6 @@ STATUS_ENTITY_DESCRIPTIONS: tuple[AOSmithStatusSensorEntityDescription, ...] = (
AOSmithStatusSensorEntityDescription(
key="hot_water_availability",
translation_key="hot_water_availability",
icon="mdi:water-thermometer",
device_class=SensorDeviceClass.ENUM,
options=["low", "medium", "high"],
value_fn=lambda device: HOT_WATER_STATUS_MAP.get(

View File

@@ -19,7 +19,7 @@ _LOGGER = logging.getLogger(__name__)
_DESCRIPTION = BinarySensorEntityDescription(
key="statflag",
name="UPS Online Status",
icon="mdi:heart",
translation_key="online_status",
)
# The bit in STATFLAG that indicates the online status of the APC UPS.
_VALUE_ONLINE_MASK: Final = 0b1000

View File

@@ -1,7 +1,6 @@
"""Config flow for APCUPSd integration."""
from __future__ import annotations
import asyncio
from typing import Any
import voluptuous as vol
@@ -54,7 +53,7 @@ class ConfigFlowHandler(ConfigFlow, domain=DOMAIN):
coordinator = APCUPSdCoordinator(self.hass, host, port)
await coordinator.async_request_refresh()
if isinstance(coordinator.last_exception, (UpdateFailed, asyncio.TimeoutError)):
if isinstance(coordinator.last_exception, (UpdateFailed, TimeoutError)):
errors = {"base": "cannot_connect"}
return self.async_show_form(
step_id="user", data_schema=_SCHEMA, errors=errors

View File

@@ -0,0 +1,155 @@
{
"entity": {
"binary_sensor": {
"online_status": {
"default": "mdi:heart"
}
},
"sensor": {
"alarm_delay": {
"default": "mdi:alarm"
},
"apc_status": {
"default": "mdi:information-outline"
},
"apc_model": {
"default": "mdi:information-outline"
},
"bad_batteries": {
"default": "mdi:information-outline"
},
"battery_replacement_date": {
"default": "mdi:calendar-clock"
},
"battery_status": {
"default": "mdi:information-outline"
},
"cable_type": {
"default": "mdi:ethernet-cable"
},
"total_time_on_battery": {
"default": "mdi:timer-outline"
},
"date": {
"default": "mdi:calendar-clock"
},
"dip_switch_settings": {
"default": "mdi:information-outline"
},
"low_battery_signal": {
"default": "mdi:clock-alert"
},
"driver": {
"default": "mdi:information-outline"
},
"shutdown_delay": {
"default": "mdi:timer-outline"
},
"wake_delay": {
"default": "mdi:timer-outline"
},
"date_and_time": {
"default": "mdi:calendar-clock"
},
"external_batteries": {
"default": "mdi:information-outline"
},
"firmware_version": {
"default": "mdi:information-outline"
},
"hostname": {
"default": "mdi:information-outline"
},
"last_self_test": {
"default": "mdi:calendar-clock"
},
"last_transfer": {
"default": "mdi:transfer"
},
"line_failure": {
"default": "mdi:information-outline"
},
"load_capacity": {
"default": "mdi:gauge"
},
"apparent_power": {
"default": "mdi:gauge"
},
"manufacture_date": {
"default": "mdi:calendar"
},
"master_update": {
"default": "mdi:information-outline"
},
"max_time": {
"default": "mdi:timer-off-outline"
},
"max_battery_charge": {
"default": "mdi:battery-alert"
},
"min_time": {
"default": "mdi:timer-outline"
},
"model": {
"default": "mdi:information-outline"
},
"transfer_count": {
"default": "mdi:counter"
},
"register_1_fault": {
"default": "mdi:information-outline"
},
"register_2_fault": {
"default": "mdi:information-outline"
},
"register_3_fault": {
"default": "mdi:information-outline"
},
"restore_capacity": {
"default": "mdi:battery-alert"
},
"self_test_result": {
"default": "mdi:information-outline"
},
"sensitivity": {
"default": "mdi:information-outline"
},
"serial_number": {
"default": "mdi:information-outline"
},
"startup_time": {
"default": "mdi:calendar-clock"
},
"online_status": {
"default": "mdi:information-outline"
},
"status": {
"default": "mdi:information-outline"
},
"self_test_interval": {
"default": "mdi:information-outline"
},
"time_left": {
"default": "mdi:clock-alert"
},
"time_on_battery": {
"default": "mdi:timer-outline"
},
"ups_mode": {
"default": "mdi:information-outline"
},
"ups_name": {
"default": "mdi:information-outline"
},
"version": {
"default": "mdi:information-outline"
},
"transfer_from_battery": {
"default": "mdi:transfer"
},
"transfer_to_battery": {
"default": "mdi:transfer"
}
}
}
}

View File

@@ -31,43 +31,42 @@ _LOGGER = logging.getLogger(__name__)
SENSORS: dict[str, SensorEntityDescription] = {
"alarmdel": SensorEntityDescription(
key="alarmdel",
translation_key="alarm_delay",
name="UPS Alarm Delay",
icon="mdi:alarm",
),
"ambtemp": SensorEntityDescription(
key="ambtemp",
name="UPS Ambient Temperature",
icon="mdi:thermometer",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
),
"apc": SensorEntityDescription(
key="apc",
translation_key="apc_status",
name="UPS Status Data",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"apcmodel": SensorEntityDescription(
key="apcmodel",
translation_key="apc_model",
name="UPS Model",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"badbatts": SensorEntityDescription(
key="badbatts",
translation_key="bad_batteries",
name="UPS Bad Batteries",
icon="mdi:information-outline",
),
"battdate": SensorEntityDescription(
key="battdate",
translation_key="battery_replacement_date",
name="UPS Battery Replaced",
icon="mdi:calendar-clock",
),
"battstat": SensorEntityDescription(
key="battstat",
translation_key="battery_status",
name="UPS Battery Status",
icon="mdi:information-outline",
),
"battv": SensorEntityDescription(
key="battv",
@@ -80,69 +79,68 @@ SENSORS: dict[str, SensorEntityDescription] = {
key="bcharge",
name="UPS Battery",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:battery",
device_class=SensorDeviceClass.BATTERY,
state_class=SensorStateClass.MEASUREMENT,
),
"cable": SensorEntityDescription(
key="cable",
translation_key="cable_type",
name="UPS Cable Type",
icon="mdi:ethernet-cable",
entity_registry_enabled_default=False,
),
"cumonbatt": SensorEntityDescription(
key="cumonbatt",
translation_key="total_time_on_battery",
name="UPS Total Time on Battery",
icon="mdi:timer-outline",
state_class=SensorStateClass.TOTAL_INCREASING,
),
"date": SensorEntityDescription(
key="date",
translation_key="date",
name="UPS Status Date",
icon="mdi:calendar-clock",
entity_registry_enabled_default=False,
),
"dipsw": SensorEntityDescription(
key="dipsw",
translation_key="dip_switch_settings",
name="UPS Dip Switch Settings",
icon="mdi:information-outline",
),
"dlowbatt": SensorEntityDescription(
key="dlowbatt",
translation_key="low_battery_signal",
name="UPS Low Battery Signal",
icon="mdi:clock-alert",
),
"driver": SensorEntityDescription(
key="driver",
translation_key="driver",
name="UPS Driver",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"dshutd": SensorEntityDescription(
key="dshutd",
translation_key="shutdown_delay",
name="UPS Shutdown Delay",
icon="mdi:timer-outline",
),
"dwake": SensorEntityDescription(
key="dwake",
translation_key="wake_delay",
name="UPS Wake Delay",
icon="mdi:timer-outline",
),
"end apc": SensorEntityDescription(
key="end apc",
translation_key="date_and_time",
name="UPS Date and Time",
icon="mdi:calendar-clock",
entity_registry_enabled_default=False,
),
"extbatts": SensorEntityDescription(
key="extbatts",
translation_key="external_batteries",
name="UPS External Batteries",
icon="mdi:information-outline",
),
"firmware": SensorEntityDescription(
key="firmware",
translation_key="firmware_version",
name="UPS Firmware Version",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"hitrans": SensorEntityDescription(
@@ -153,8 +151,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"hostname": SensorEntityDescription(
key="hostname",
translation_key="hostname",
name="UPS Hostname",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"humidity": SensorEntityDescription(
@@ -162,7 +160,6 @@ SENSORS: dict[str, SensorEntityDescription] = {
name="UPS Ambient Humidity",
native_unit_of_measurement=PERCENTAGE,
device_class=SensorDeviceClass.HUMIDITY,
icon="mdi:water-percent",
state_class=SensorStateClass.MEASUREMENT,
),
"itemp": SensorEntityDescription(
@@ -174,19 +171,19 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"laststest": SensorEntityDescription(
key="laststest",
translation_key="last_self_test",
name="UPS Last Self Test",
icon="mdi:calendar-clock",
),
"lastxfer": SensorEntityDescription(
key="lastxfer",
translation_key="last_transfer",
name="UPS Last Transfer",
icon="mdi:transfer",
entity_registry_enabled_default=False,
),
"linefail": SensorEntityDescription(
key="linefail",
translation_key="line_failure",
name="UPS Input Voltage Status",
icon="mdi:information-outline",
),
"linefreq": SensorEntityDescription(
key="linefreq",
@@ -204,16 +201,16 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"loadpct": SensorEntityDescription(
key="loadpct",
translation_key="load_capacity",
name="UPS Load",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
state_class=SensorStateClass.MEASUREMENT,
),
"loadapnt": SensorEntityDescription(
key="loadapnt",
translation_key="apparent_power",
name="UPS Load Apparent Power",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:gauge",
),
"lotrans": SensorEntityDescription(
key="lotrans",
@@ -223,14 +220,14 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"mandate": SensorEntityDescription(
key="mandate",
translation_key="manufacture_date",
name="UPS Manufacture Date",
icon="mdi:calendar",
entity_registry_enabled_default=False,
),
"masterupd": SensorEntityDescription(
key="masterupd",
translation_key="master_update",
name="UPS Master Update",
icon="mdi:information-outline",
),
"maxlinev": SensorEntityDescription(
key="maxlinev",
@@ -240,14 +237,14 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"maxtime": SensorEntityDescription(
key="maxtime",
translation_key="max_time",
name="UPS Battery Timeout",
icon="mdi:timer-off-outline",
),
"mbattchg": SensorEntityDescription(
key="mbattchg",
translation_key="max_battery_charge",
name="UPS Battery Shutdown",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:battery-alert",
),
"minlinev": SensorEntityDescription(
key="minlinev",
@@ -257,13 +254,13 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"mintimel": SensorEntityDescription(
key="mintimel",
translation_key="min_time",
name="UPS Shutdown Time",
icon="mdi:timer-outline",
),
"model": SensorEntityDescription(
key="model",
translation_key="model",
name="UPS Model",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"nombattv": SensorEntityDescription(
@@ -298,8 +295,8 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"numxfers": SensorEntityDescription(
key="numxfers",
translation_key="transfer_count",
name="UPS Transfer Count",
icon="mdi:counter",
state_class=SensorStateClass.TOTAL_INCREASING,
),
"outcurnt": SensorEntityDescription(
@@ -318,109 +315,109 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
"reg1": SensorEntityDescription(
key="reg1",
translation_key="register_1_fault",
name="UPS Register 1 Fault",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"reg2": SensorEntityDescription(
key="reg2",
translation_key="register_2_fault",
name="UPS Register 2 Fault",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"reg3": SensorEntityDescription(
key="reg3",
translation_key="register_3_fault",
name="UPS Register 3 Fault",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"retpct": SensorEntityDescription(
key="retpct",
translation_key="restore_capacity",
name="UPS Restore Requirement",
native_unit_of_measurement=PERCENTAGE,
icon="mdi:battery-alert",
),
"selftest": SensorEntityDescription(
key="selftest",
translation_key="self_test_result",
name="UPS Self Test result",
icon="mdi:information-outline",
),
"sense": SensorEntityDescription(
key="sense",
translation_key="sensitivity",
name="UPS Sensitivity",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"serialno": SensorEntityDescription(
key="serialno",
translation_key="serial_number",
name="UPS Serial Number",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"starttime": SensorEntityDescription(
key="starttime",
translation_key="startup_time",
name="UPS Startup Time",
icon="mdi:calendar-clock",
),
"statflag": SensorEntityDescription(
key="statflag",
translation_key="online_status",
name="UPS Status Flag",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"status": SensorEntityDescription(
key="status",
translation_key="status",
name="UPS Status",
icon="mdi:information-outline",
),
"stesti": SensorEntityDescription(
key="stesti",
translation_key="self_test_interval",
name="UPS Self Test Interval",
icon="mdi:information-outline",
),
"timeleft": SensorEntityDescription(
key="timeleft",
translation_key="time_left",
name="UPS Time Left",
icon="mdi:clock-alert",
state_class=SensorStateClass.MEASUREMENT,
),
"tonbatt": SensorEntityDescription(
key="tonbatt",
translation_key="time_on_battery",
name="UPS Time on Battery",
icon="mdi:timer-outline",
state_class=SensorStateClass.TOTAL_INCREASING,
),
"upsmode": SensorEntityDescription(
key="upsmode",
translation_key="ups_mode",
name="UPS Mode",
icon="mdi:information-outline",
),
"upsname": SensorEntityDescription(
key="upsname",
translation_key="ups_name",
name="UPS Name",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"version": SensorEntityDescription(
key="version",
translation_key="version",
name="UPS Daemon Info",
icon="mdi:information-outline",
entity_registry_enabled_default=False,
),
"xoffbat": SensorEntityDescription(
key="xoffbat",
translation_key="transfer_from_battery",
name="UPS Transfer from Battery",
icon="mdi:transfer",
),
"xoffbatt": SensorEntityDescription(
key="xoffbatt",
translation_key="transfer_from_battery",
name="UPS Transfer from Battery",
icon="mdi:transfer",
),
"xonbatt": SensorEntityDescription(
key="xonbatt",
translation_key="transfer_to_battery",
name="UPS Transfer to Battery",
icon="mdi:transfer",
),
}

View File

@@ -12,7 +12,6 @@ import voluptuous as vol
from homeassistant.auth.models import User
from homeassistant.auth.permissions.const import POLICY_READ
from homeassistant.bootstrap import DATA_LOGGING
from homeassistant.components.http import (
KEY_HASS,
KEY_HASS_USER,
@@ -23,6 +22,7 @@ from homeassistant.const import (
CONTENT_TYPE_JSON,
EVENT_HOMEASSISTANT_STOP,
EVENT_STATE_CHANGED,
KEY_DATA_LOGGING as DATA_LOGGING,
MATCH_ALL,
URL_API,
URL_API_COMPONENTS,
@@ -175,7 +175,7 @@ class APIEventStream(HomeAssistantView):
msg = f"data: {payload}\n\n"
_LOGGER.debug("STREAM %s WRITING %s", id(stop_obj), msg.strip())
await response.write(msg.encode("UTF-8"))
except asyncio.TimeoutError:
except TimeoutError:
await to_write.put(STREAM_PING_PAYLOAD)
except asyncio.CancelledError:
@@ -222,7 +222,7 @@ class APIStatesView(HomeAssistantView):
if entity_perm(state.entity_id, "read")
)
response = web.Response(
body=b"[" + b",".join(states) + b"]",
body=b"".join((b"[", b",".join(states), b"]")),
content_type=CONTENT_TYPE_JSON,
zlib_executor_size=32768,
)
@@ -472,7 +472,9 @@ class APIErrorLog(HomeAssistantView):
async def get(self, request: web.Request) -> web.FileResponse:
"""Retrieve API error log."""
hass: HomeAssistant = request.app[KEY_HASS]
return web.FileResponse(hass.data[DATA_LOGGING])
response = web.FileResponse(hass.data[DATA_LOGGING])
response.enable_compression()
return response
async def async_services_json(hass: HomeAssistant) -> list[dict[str, Any]]:

View File

@@ -1,8 +1,10 @@
"""The Apple TV integration."""
from __future__ import annotations
import asyncio
import logging
from random import randrange
from typing import TYPE_CHECKING, cast
from typing import Any, cast
from pyatv import connect, exceptions, scan
from pyatv.conf import AppleTV
@@ -25,8 +27,8 @@ from homeassistant.const import (
EVENT_HOMEASSISTANT_STOP,
Platform,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.core import Event, HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.device_registry import DeviceInfo
@@ -40,7 +42,8 @@ from .const import CONF_CREDENTIALS, CONF_IDENTIFIERS, CONF_START_OFF, DOMAIN
_LOGGER = logging.getLogger(__name__)
DEFAULT_NAME = "Apple TV"
DEFAULT_NAME_TV = "Apple TV"
DEFAULT_NAME_HP = "HomePod"
BACKOFF_TIME_LOWER_LIMIT = 15 # seconds
BACKOFF_TIME_UPPER_LIMIT = 300 # Five minutes
@@ -56,14 +59,39 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
manager = AppleTVManager(hass, entry)
if manager.is_on:
await manager.connect_once(raise_missing_credentials=True)
if not manager.atv:
address = entry.data[CONF_ADDRESS]
raise ConfigEntryNotReady(f"Not found at {address}, waiting for discovery")
address = entry.data[CONF_ADDRESS]
try:
await manager.async_first_connect()
except (
exceptions.AuthenticationError,
exceptions.InvalidCredentialsError,
exceptions.NoCredentialsError,
) as ex:
raise ConfigEntryAuthFailed(
f"{address}: Authentication failed, try reconfiguring device: {ex}"
) from ex
except (
asyncio.CancelledError,
exceptions.ConnectionLostError,
exceptions.ConnectionFailedError,
) as ex:
raise ConfigEntryNotReady(f"{address}: {ex}") from ex
except (
exceptions.ProtocolError,
exceptions.NoServiceError,
exceptions.PairingError,
exceptions.BackOffError,
exceptions.DeviceIdMissingError,
) as ex:
_LOGGER.debug(
"Error setting up apple_tv at %s: %s", address, ex, exc_info=ex
)
raise ConfigEntryNotReady(f"{address}: {ex}") from ex
hass.data.setdefault(DOMAIN, {})[entry.unique_id] = manager
async def on_hass_stop(event):
async def on_hass_stop(event: Event) -> None:
"""Stop push updates when hass stops."""
await manager.disconnect()
@@ -94,33 +122,29 @@ class AppleTVEntity(Entity):
_attr_should_poll = False
_attr_has_entity_name = True
_attr_name = None
atv: AppleTVInterface | None = None
def __init__(
self, name: str, identifier: str | None, manager: "AppleTVManager"
) -> None:
def __init__(self, name: str, identifier: str, manager: AppleTVManager) -> None:
"""Initialize device."""
self.atv: AppleTVInterface = None # type: ignore[assignment]
self.manager = manager
if TYPE_CHECKING:
assert identifier is not None
self._attr_unique_id = identifier
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, identifier)},
name=name,
)
async def async_added_to_hass(self):
async def async_added_to_hass(self) -> None:
"""Handle when an entity is about to be added to Home Assistant."""
@callback
def _async_connected(atv):
def _async_connected(atv: AppleTVInterface) -> None:
"""Handle that a connection was made to a device."""
self.atv = atv
self.async_device_connected(atv)
self.async_write_ha_state()
@callback
def _async_disconnected():
def _async_disconnected() -> None:
"""Handle that a connection to a device was lost."""
self.async_device_disconnected()
self.atv = None
@@ -143,10 +167,10 @@ class AppleTVEntity(Entity):
)
)
def async_device_connected(self, atv):
def async_device_connected(self, atv: AppleTVInterface) -> None:
"""Handle when connection is made to device."""
def async_device_disconnected(self):
def async_device_disconnected(self) -> None:
"""Handle when connection was lost to device."""
@@ -158,22 +182,23 @@ class AppleTVManager(DeviceListener):
in case of problems.
"""
atv: AppleTVInterface | None = None
_connection_attempts = 0
_connection_was_lost = False
_task: asyncio.Task[None] | None = None
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
"""Initialize power manager."""
self.config_entry = config_entry
self.hass = hass
self.atv: AppleTVInterface | None = None
self.is_on = not config_entry.options.get(CONF_START_OFF, False)
self._connection_attempts = 0
self._connection_was_lost = False
self._task = None
async def init(self):
async def init(self) -> None:
"""Initialize power management."""
if self.is_on:
await self.connect()
def connection_lost(self, _):
def connection_lost(self, exception: Exception) -> None:
"""Device was unexpectedly disconnected.
This is a callback function from pyatv.interface.DeviceListener.
@@ -184,14 +209,14 @@ class AppleTVManager(DeviceListener):
self._connection_was_lost = True
self._handle_disconnect()
def connection_closed(self):
def connection_closed(self) -> None:
"""Device connection was (intentionally) closed.
This is a callback function from pyatv.interface.DeviceListener.
"""
self._handle_disconnect()
def _handle_disconnect(self):
def _handle_disconnect(self) -> None:
"""Handle that the device disconnected and restart connect loop."""
if self.atv:
self.atv.close()
@@ -199,12 +224,12 @@ class AppleTVManager(DeviceListener):
self._dispatch_send(SIGNAL_DISCONNECTED)
self._start_connect_loop()
async def connect(self):
async def connect(self) -> None:
"""Connect to device."""
self.is_on = True
self._start_connect_loop()
async def disconnect(self):
async def disconnect(self) -> None:
"""Disconnect from device."""
_LOGGER.debug("Disconnecting from device")
self.is_on = False
@@ -218,7 +243,7 @@ class AppleTVManager(DeviceListener):
except Exception: # pylint: disable=broad-except
_LOGGER.exception("An error occurred while disconnecting")
def _start_connect_loop(self):
def _start_connect_loop(self) -> None:
"""Start background connect loop to device."""
if not self._task and self.atv is None and self.is_on:
self._task = asyncio.create_task(self._connect_loop())
@@ -227,11 +252,25 @@ class AppleTVManager(DeviceListener):
"Not starting connect loop (%s, %s)", self.atv is None, self.is_on
)
async def _connect_once(self, raise_missing_credentials: bool) -> None:
"""Connect to device once."""
if conf := await self._scan():
await self._connect(conf, raise_missing_credentials)
async def async_first_connect(self) -> None:
"""Connect to device for the first time."""
connect_ok = False
try:
await self._connect_once(raise_missing_credentials=True)
connect_ok = True
finally:
if not connect_ok:
await self.disconnect()
async def connect_once(self, raise_missing_credentials: bool) -> None:
"""Try to connect once."""
try:
if conf := await self._scan():
await self._connect(conf, raise_missing_credentials)
await self._connect_once(raise_missing_credentials)
except exceptions.AuthenticationError:
self.config_entry.async_start_reauth(self.hass)
await self.disconnect()
@@ -244,9 +283,9 @@ class AppleTVManager(DeviceListener):
pass
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Failed to connect")
self.atv = None
await self.disconnect()
async def _connect_loop(self):
async def _connect_loop(self) -> None:
"""Connect loop background task function."""
_LOGGER.debug("Starting connect loop")
@@ -255,7 +294,8 @@ class AppleTVManager(DeviceListener):
while self.is_on and self.atv is None:
await self.connect_once(raise_missing_credentials=False)
if self.atv is not None:
break
# Calling self.connect_once may have set self.atv
break # type: ignore[unreachable]
self._connection_attempts += 1
backoff = min(
max(
@@ -352,13 +392,17 @@ class AppleTVManager(DeviceListener):
self._connection_was_lost = False
@callback
def _async_setup_device_registry(self):
def _async_setup_device_registry(self) -> None:
attrs = {
ATTR_IDENTIFIERS: {(DOMAIN, self.config_entry.unique_id)},
ATTR_MANUFACTURER: "Apple",
ATTR_NAME: self.config_entry.data[CONF_NAME],
}
attrs[ATTR_SUGGESTED_AREA] = attrs[ATTR_NAME].removesuffix(f" {DEFAULT_NAME}")
attrs[ATTR_SUGGESTED_AREA] = (
attrs[ATTR_NAME]
.removesuffix(f" {DEFAULT_NAME_TV}")
.removesuffix(f" {DEFAULT_NAME_HP}")
)
if self.atv:
dev_info = self.atv.device_info
@@ -379,18 +423,18 @@ class AppleTVManager(DeviceListener):
)
@property
def is_connecting(self):
def is_connecting(self) -> bool:
"""Return true if connection is in progress."""
return self._task is not None
def _address_updated(self, address):
def _address_updated(self, address: str) -> None:
"""Update cached address in config entry."""
_LOGGER.debug("Changing address to %s", address)
self.hass.config_entries.async_update_entry(
self.config_entry, data={**self.config_entry.data, CONF_ADDRESS: address}
)
def _dispatch_send(self, signal, *args):
def _dispatch_send(self, signal: str, *args: Any) -> None:
"""Dispatch a signal to all entities managed by this manager."""
async_dispatcher_send(
self.hass, f"{signal}_{self.config_entry.unique_id}", *args

View File

@@ -3,7 +3,7 @@ from __future__ import annotations
import asyncio
from collections import deque
from collections.abc import Mapping
from collections.abc import Awaitable, Callable, Mapping
from ipaddress import ip_address
import logging
from random import randrange
@@ -13,12 +13,13 @@ from pyatv import exceptions, pair, scan
from pyatv.const import DeviceModel, PairingRequirement, Protocol
from pyatv.convert import model_str, protocol_str
from pyatv.helpers import get_unique_id
from pyatv.interface import BaseConfig, PairingHandler
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.components import zeroconf
from homeassistant.const import CONF_ADDRESS, CONF_NAME, CONF_PIN
from homeassistant.core import callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.data_entry_flow import AbortFlow, FlowResult
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.aiohttp_client import async_get_clientsession
@@ -49,10 +50,12 @@ OPTIONS_FLOW = {
}
async def device_scan(hass, identifier, loop):
async def device_scan(
hass: HomeAssistant, identifier: str | None, loop: asyncio.AbstractEventLoop
) -> tuple[BaseConfig | None, list[str] | None]:
"""Scan for a specific device using identifier as filter."""
def _filter_device(dev):
def _filter_device(dev: BaseConfig) -> bool:
if identifier is None:
return True
if identifier == str(dev.address):
@@ -61,9 +64,12 @@ async def device_scan(hass, identifier, loop):
return True
return any(service.identifier == identifier for service in dev.services)
def _host_filter():
def _host_filter() -> list[str] | None:
if identifier is None:
return None
try:
return [ip_address(identifier)]
ip_address(identifier)
return [identifier]
except ValueError:
return None
@@ -84,6 +90,13 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1
scan_filter: str | None = None
atv: BaseConfig | None = None
atv_identifiers: list[str] | None = None
protocol: Protocol | None = None
pairing: PairingHandler | None = None
protocols_to_pair: deque[Protocol] | None = None
@staticmethod
@callback
def async_get_options_flow(
@@ -92,18 +105,12 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Get options flow for this handler."""
return SchemaOptionsFlowHandler(config_entry, OPTIONS_FLOW)
def __init__(self):
def __init__(self) -> None:
"""Initialize a new AppleTVConfigFlow."""
self.scan_filter = None
self.atv = None
self.atv_identifiers = None
self.protocol = None
self.pairing = None
self.credentials = {} # Protocol -> credentials
self.protocols_to_pair = deque()
self.credentials: dict[int, str | None] = {} # Protocol -> credentials
@property
def device_identifier(self):
def device_identifier(self) -> str | None:
"""Return a identifier for the config entry.
A device has multiple unique identifiers, but Home Assistant only supports one
@@ -118,6 +125,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
existing config entry. If that's the case, the unique_id from that entry is
re-used, otherwise the newly discovered identifier is used instead.
"""
assert self.atv
all_identifiers = set(self.atv.all_identifiers)
if unique_id := self._entry_unique_id_from_identifers(all_identifiers):
return unique_id
@@ -143,7 +151,9 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
self.context["identifier"] = self.unique_id
return await self.async_step_reconfigure()
async def async_step_reconfigure(self, user_input=None):
async def async_step_reconfigure(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Inform user that reconfiguration is about to start."""
if user_input is not None:
return await self.async_find_device_wrapper(
@@ -152,7 +162,9 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return self.async_show_form(step_id="reconfigure")
async def async_step_user(self, user_input=None):
async def async_step_user(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Handle the initial step."""
errors = {}
if user_input is not None:
@@ -170,6 +182,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
await self.async_set_unique_id(
self.device_identifier, raise_on_progress=False
)
assert self.atv
self.context["all_identifiers"] = self.atv.all_identifiers
return await self.async_step_confirm()
@@ -275,8 +288,11 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
context["all_identifiers"].append(unique_id)
raise AbortFlow("already_in_progress")
async def async_found_zeroconf_device(self, user_input=None):
async def async_found_zeroconf_device(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Handle device found after Zeroconf discovery."""
assert self.atv
self.context["all_identifiers"] = self.atv.all_identifiers
# Also abort if an integration with this identifier already exists
await self.async_set_unique_id(self.device_identifier)
@@ -288,7 +304,11 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
self.context["identifier"] = self.unique_id
return await self.async_step_confirm()
async def async_find_device_wrapper(self, next_func, allow_exist=False):
async def async_find_device_wrapper(
self,
next_func: Callable[[], Awaitable[FlowResult]],
allow_exist: bool = False,
) -> FlowResult:
"""Find a specific device and call another function when done.
This function will do error handling and bail out when an error
@@ -306,7 +326,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return await next_func()
async def async_find_device(self, allow_exist=False):
async def async_find_device(self, allow_exist: bool = False) -> None:
"""Scan for the selected device to discover services."""
self.atv, self.atv_identifiers = await device_scan(
self.hass, self.scan_filter, self.hass.loop
@@ -357,8 +377,11 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
if not allow_exist:
raise DeviceAlreadyConfigured()
async def async_step_confirm(self, user_input=None):
async def async_step_confirm(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Handle user-confirmation of discovered node."""
assert self.atv
if user_input is not None:
expected_identifier_count = len(self.context["all_identifiers"])
# If number of services found during device scan mismatch number of
@@ -384,7 +407,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
},
)
async def async_pair_next_protocol(self):
async def async_pair_next_protocol(self) -> FlowResult:
"""Start pairing process for the next available protocol."""
await self._async_cleanup()
@@ -393,8 +416,16 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return await self._async_get_entry()
self.protocol = self.protocols_to_pair.popleft()
assert self.atv
service = self.atv.get_service(self.protocol)
if service is None:
_LOGGER.debug(
"%s does not support pairing (cannot find a corresponding service)",
self.protocol,
)
return await self.async_pair_next_protocol()
# Service requires a password
if service.requires_password:
return await self.async_step_password()
@@ -413,7 +444,7 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
_LOGGER.debug("%s requires pairing", self.protocol)
# Protocol specific arguments
pair_args = {}
pair_args: dict[str, Any] = {}
if self.protocol in {Protocol.AirPlay, Protocol.Companion, Protocol.DMAP}:
pair_args["name"] = "Home Assistant"
if self.protocol == Protocol.DMAP:
@@ -448,8 +479,11 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return await self.async_step_pair_no_pin()
async def async_step_protocol_disabled(self, user_input=None):
async def async_step_protocol_disabled(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Inform user that a protocol is disabled and cannot be paired."""
assert self.protocol
if user_input is not None:
return await self.async_pair_next_protocol()
return self.async_show_form(
@@ -457,9 +491,13 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
description_placeholders={"protocol": protocol_str(self.protocol)},
)
async def async_step_pair_with_pin(self, user_input=None):
async def async_step_pair_with_pin(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Handle pairing step where a PIN is required from the user."""
errors = {}
assert self.pairing
assert self.protocol
if user_input is not None:
try:
self.pairing.pin(user_input[CONF_PIN])
@@ -480,8 +518,12 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
description_placeholders={"protocol": protocol_str(self.protocol)},
)
async def async_step_pair_no_pin(self, user_input=None):
async def async_step_pair_no_pin(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Handle step where user has to enter a PIN on the device."""
assert self.pairing
assert self.protocol
if user_input is not None:
await self.pairing.finish()
if self.pairing.has_paired:
@@ -497,12 +539,15 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
step_id="pair_no_pin",
description_placeholders={
"protocol": protocol_str(self.protocol),
"pin": pin,
"pin": str(pin),
},
)
async def async_step_service_problem(self, user_input=None):
async def async_step_service_problem(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Inform user that a service will not be added."""
assert self.protocol
if user_input is not None:
return await self.async_pair_next_protocol()
@@ -511,8 +556,11 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
description_placeholders={"protocol": protocol_str(self.protocol)},
)
async def async_step_password(self, user_input=None):
async def async_step_password(
self, user_input: dict[str, str] | None = None
) -> FlowResult:
"""Inform user that password is not supported."""
assert self.protocol
if user_input is not None:
return await self.async_pair_next_protocol()
@@ -521,18 +569,20 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
description_placeholders={"protocol": protocol_str(self.protocol)},
)
async def _async_cleanup(self):
async def _async_cleanup(self) -> None:
"""Clean up allocated resources."""
if self.pairing is not None:
await self.pairing.close()
self.pairing = None
async def _async_get_entry(self):
async def _async_get_entry(self) -> FlowResult:
"""Return config entry or update existing config entry."""
# Abort if no protocols were paired
if not self.credentials:
return self.async_abort(reason="setup_failed")
assert self.atv
data = {
CONF_NAME: self.atv.name,
CONF_CREDENTIALS: self.credentials,

View File

@@ -5,6 +5,7 @@
"config_flow": true,
"dependencies": ["zeroconf"],
"documentation": "https://www.home-assistant.io/integrations/apple_tv",
"import_executor": true,
"iot_class": "local_push",
"loggers": ["pyatv", "srptools"],
"requirements": ["pyatv==0.14.3"],

View File

@@ -16,7 +16,15 @@ from pyatv.const import (
ShuffleState,
)
from pyatv.helpers import is_streamable
from pyatv.interface import AppleTV, Playing
from pyatv.interface import (
AppleTV,
AudioListener,
OutputDevice,
Playing,
PowerListener,
PushListener,
PushUpdater,
)
from homeassistant.components import media_source
from homeassistant.components.media_player import (
@@ -101,7 +109,9 @@ async def async_setup_entry(
async_add_entities([AppleTvMediaPlayer(name, config_entry.unique_id, manager)])
class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
class AppleTvMediaPlayer(
AppleTVEntity, MediaPlayerEntity, PowerListener, AudioListener, PushListener
):
"""Representation of an Apple TV media player."""
_attr_supported_features = SUPPORT_APPLE_TV
@@ -116,9 +126,9 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
def async_device_connected(self, atv: AppleTV) -> None:
"""Handle when connection is made to device."""
# NB: Do not use _is_feature_available here as it only works when playing
if self.atv.features.in_state(FeatureState.Available, FeatureName.PushUpdates):
self.atv.push_updater.listener = self
self.atv.push_updater.start()
if atv.features.in_state(FeatureState.Available, FeatureName.PushUpdates):
atv.push_updater.listener = self
atv.push_updater.start()
self._attr_supported_features = SUPPORT_BASE
@@ -126,7 +136,7 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
# "Unsupported" are considered here as the state of such a feature can never
# change after a connection has been established, i.e. an unsupported feature
# can never change to be supported.
all_features = self.atv.features.all_features()
all_features = atv.features.all_features()
for feature_name, support_flag in SUPPORT_FEATURE_MAPPING.items():
feature_info = all_features.get(feature_name)
if feature_info and feature_info.state != FeatureState.Unsupported:
@@ -136,16 +146,18 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
# metadata update arrives (sometime very soon after this callback returns)
# Listen to power updates
self.atv.power.listener = self
atv.power.listener = self
# Listen to volume updates
self.atv.audio.listener = self
atv.audio.listener = self
if self.atv.features.in_state(FeatureState.Available, FeatureName.AppList):
if atv.features.in_state(FeatureState.Available, FeatureName.AppList):
self.hass.create_task(self._update_app_list())
async def _update_app_list(self) -> None:
_LOGGER.debug("Updating app list")
if not self.atv:
return
try:
apps = await self.atv.apps.app_list()
except exceptions.NotSupportedError:
@@ -189,33 +201,56 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
return None
@callback
def playstatus_update(self, _, playing: Playing) -> None:
"""Print what is currently playing when it changes."""
self._playing = playing
def playstatus_update(self, updater: PushUpdater, playstatus: Playing) -> None:
"""Print what is currently playing when it changes.
This is a callback function from pyatv.interface.PushListener.
"""
self._playing = playstatus
self.async_write_ha_state()
@callback
def playstatus_error(self, _, exception: Exception) -> None:
"""Inform about an error and restart push updates."""
def playstatus_error(self, updater: PushUpdater, exception: Exception) -> None:
"""Inform about an error and restart push updates.
This is a callback function from pyatv.interface.PushListener.
"""
_LOGGER.warning("A %s error occurred: %s", exception.__class__, exception)
self._playing = None
self.async_write_ha_state()
@callback
def powerstate_update(self, old_state: PowerState, new_state: PowerState) -> None:
"""Update power state when it changes."""
"""Update power state when it changes.
This is a callback function from pyatv.interface.PowerListener.
"""
self.async_write_ha_state()
@callback
def volume_update(self, old_level: float, new_level: float) -> None:
"""Update volume when it changes."""
"""Update volume when it changes.
This is a callback function from pyatv.interface.AudioListener.
"""
self.async_write_ha_state()
@callback
def outputdevices_update(
self, old_devices: list[OutputDevice], new_devices: list[OutputDevice]
) -> None:
"""Output devices were updated.
This is a callback function from pyatv.interface.AudioListener.
"""
@property
def app_id(self) -> str | None:
"""ID of the current running app."""
if self._is_feature_available(FeatureName.App) and (
app := self.atv.metadata.app
if (
self.atv
and self._is_feature_available(FeatureName.App)
and (app := self.atv.metadata.app) is not None
):
return app.identifier
return None
@@ -223,8 +258,10 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
@property
def app_name(self) -> str | None:
"""Name of the current running app."""
if self._is_feature_available(FeatureName.App) and (
app := self.atv.metadata.app
if (
self.atv
and self._is_feature_available(FeatureName.App)
and (app := self.atv.metadata.app) is not None
):
return app.name
return None
@@ -255,7 +292,7 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
@property
def volume_level(self) -> float | None:
"""Volume level of the media player (0..1)."""
if self._is_feature_available(FeatureName.Volume):
if self.atv and self._is_feature_available(FeatureName.Volume):
return self.atv.audio.volume / 100.0 # from percent
return None
@@ -286,6 +323,8 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
"""Send the play_media command to the media player."""
# If input (file) has a file format supported by pyatv, then stream it with
# RAOP. Otherwise try to play it with regular AirPlay.
if not self.atv:
return
if media_type in {MediaType.APP, MediaType.URL}:
await self.atv.apps.launch_app(media_id)
return
@@ -313,7 +352,8 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
"""Hash value for media image."""
state = self.state
if (
self._playing
self.atv
and self._playing
and self._is_feature_available(FeatureName.Artwork)
and state not in {None, MediaPlayerState.OFF, MediaPlayerState.IDLE}
):
@@ -323,7 +363,11 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
async def async_get_media_image(self) -> tuple[bytes | None, str | None]:
"""Fetch media image of current playing image."""
state = self.state
if self._playing and state not in {MediaPlayerState.OFF, MediaPlayerState.IDLE}:
if (
self.atv
and self._playing
and state not in {MediaPlayerState.OFF, MediaPlayerState.IDLE}
):
artwork = await self.atv.metadata.artwork()
if artwork:
return artwork.bytes, artwork.mimetype
@@ -439,20 +483,24 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
async def async_turn_on(self) -> None:
"""Turn the media player on."""
if self._is_feature_available(FeatureName.TurnOn):
if self.atv and self._is_feature_available(FeatureName.TurnOn):
await self.atv.power.turn_on()
async def async_turn_off(self) -> None:
"""Turn the media player off."""
if (self._is_feature_available(FeatureName.TurnOff)) and (
not self._is_feature_available(FeatureName.PowerState)
or self.atv.power.power_state == PowerState.On
if (
self.atv
and (self._is_feature_available(FeatureName.TurnOff))
and (
not self._is_feature_available(FeatureName.PowerState)
or self.atv.power.power_state == PowerState.On
)
):
await self.atv.power.turn_off()
async def async_media_play_pause(self) -> None:
"""Pause media on media player."""
if self._playing:
if self.atv and self._playing:
await self.atv.remote_control.play_pause()
async def async_media_play(self) -> None:
@@ -519,5 +567,6 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
async def async_select_source(self, source: str) -> None:
"""Select input source."""
if app_id := self._app_list.get(source):
await self.atv.apps.launch_app(app_id)
if self.atv:
if app_id := self._app_list.get(source):
await self.atv.apps.launch_app(app_id)

View File

@@ -15,7 +15,7 @@ from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import AppleTVEntity
from . import AppleTVEntity, AppleTVManager
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
@@ -38,8 +38,10 @@ async def async_setup_entry(
async_add_entities: AddEntitiesCallback,
) -> None:
"""Load Apple TV remote based on a config entry."""
name = config_entry.data[CONF_NAME]
manager = hass.data[DOMAIN][config_entry.unique_id]
name: str = config_entry.data[CONF_NAME]
# apple_tv config entries always have a unique id
assert config_entry.unique_id is not None
manager: AppleTVManager = hass.data[DOMAIN][config_entry.unique_id]
async_add_entities([AppleTVRemote(name, config_entry.unique_id, manager)])
@@ -47,7 +49,7 @@ class AppleTVRemote(AppleTVEntity, RemoteEntity):
"""Device that sends commands to an Apple TV."""
@property
def is_on(self):
def is_on(self) -> bool:
"""Return true if device is on."""
return self.atv is not None
@@ -64,13 +66,13 @@ class AppleTVRemote(AppleTVEntity, RemoteEntity):
num_repeats = kwargs[ATTR_NUM_REPEATS]
delay = kwargs.get(ATTR_DELAY_SECS, DEFAULT_DELAY_SECS)
if not self.is_on:
if not self.atv:
_LOGGER.error("Unable to send commands, not connected to %s", self.name)
return
for _ in range(num_repeats):
for single_command in command:
attr_value = None
attr_value: Any = None
if attributes := COMMAND_TO_ATTRIBUTE.get(single_command):
attr_value = self.atv
for attr_name in attributes:
@@ -81,5 +83,5 @@ class AppleTVRemote(AppleTVEntity, RemoteEntity):
raise ValueError("Command not found. Exiting sequence")
_LOGGER.info("Sending command %s", single_command)
await attr_value() # type: ignore[operator]
await attr_value()
await asyncio.sleep(delay)

View File

@@ -0,0 +1,69 @@
"""The Aprilaire integration."""
from __future__ import annotations
import logging
from pyaprilaire.const import Attribute
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT, EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import Event, HomeAssistant
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers.device_registry import format_mac
from .const import DOMAIN
from .coordinator import AprilaireCoordinator
PLATFORMS: list[Platform] = [Platform.CLIMATE]
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a config entry for Aprilaire."""
host = entry.data[CONF_HOST]
port = entry.data[CONF_PORT]
coordinator = AprilaireCoordinator(hass, entry.unique_id, host, port)
await coordinator.start_listen()
hass.data.setdefault(DOMAIN, {})[entry.unique_id] = coordinator
async def ready_callback(ready: bool):
if ready:
mac_address = format_mac(coordinator.data[Attribute.MAC_ADDRESS])
if mac_address != entry.unique_id:
raise ConfigEntryAuthFailed("Invalid MAC address")
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
async def _async_close(_: Event) -> None:
coordinator.stop_listen()
entry.async_on_unload(
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, _async_close)
)
else:
_LOGGER.error("Failed to wait for ready")
coordinator.stop_listen()
raise ConfigEntryNotReady()
await coordinator.wait_for_ready(ready_callback)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
coordinator: AprilaireCoordinator = hass.data[DOMAIN].pop(entry.unique_id)
coordinator.stop_listen()
return unload_ok

View File

@@ -0,0 +1,302 @@
"""The Aprilaire climate component."""
from __future__ import annotations
from typing import Any
from pyaprilaire.const import Attribute
from homeassistant.components.climate import (
FAN_AUTO,
FAN_ON,
PRESET_AWAY,
PRESET_NONE,
ClimateEntity,
ClimateEntityFeature,
HVACAction,
HVACMode,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import PRECISION_HALVES, PRECISION_WHOLE, UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
DOMAIN,
FAN_CIRCULATE,
PRESET_PERMANENT_HOLD,
PRESET_TEMPORARY_HOLD,
PRESET_VACATION,
)
from .coordinator import AprilaireCoordinator
from .entity import BaseAprilaireEntity
HVAC_MODE_MAP = {
1: HVACMode.OFF,
2: HVACMode.HEAT,
3: HVACMode.COOL,
4: HVACMode.HEAT,
5: HVACMode.AUTO,
}
HVAC_MODES_MAP = {
1: [HVACMode.OFF, HVACMode.HEAT],
2: [HVACMode.OFF, HVACMode.COOL],
3: [HVACMode.OFF, HVACMode.HEAT, HVACMode.COOL],
4: [HVACMode.OFF, HVACMode.HEAT, HVACMode.COOL],
5: [HVACMode.OFF, HVACMode.HEAT, HVACMode.COOL, HVACMode.AUTO],
6: [HVACMode.OFF, HVACMode.HEAT, HVACMode.COOL, HVACMode.AUTO],
}
PRESET_MODE_MAP = {
1: PRESET_TEMPORARY_HOLD,
2: PRESET_PERMANENT_HOLD,
3: PRESET_AWAY,
4: PRESET_VACATION,
}
FAN_MODE_MAP = {
1: FAN_ON,
2: FAN_AUTO,
3: FAN_CIRCULATE,
}
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Add climates for passed config_entry in HA."""
coordinator: AprilaireCoordinator = hass.data[DOMAIN][config_entry.unique_id]
async_add_entities([AprilaireClimate(coordinator, config_entry.unique_id)])
class AprilaireClimate(BaseAprilaireEntity, ClimateEntity):
"""Climate entity for Aprilaire."""
_attr_fan_modes = [FAN_AUTO, FAN_ON, FAN_CIRCULATE]
_attr_min_humidity = 10
_attr_max_humidity = 50
_attr_temperature_unit = UnitOfTemperature.CELSIUS
_attr_translation_key = "thermostat"
@property
def precision(self) -> float:
"""Get the precision based on the unit."""
return (
PRECISION_HALVES
if self.hass.config.units.temperature_unit == UnitOfTemperature.CELSIUS
else PRECISION_WHOLE
)
@property
def supported_features(self) -> ClimateEntityFeature:
"""Get supported features."""
features = 0
if self.coordinator.data.get(Attribute.MODE) == 5:
features = features | ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
else:
features = features | ClimateEntityFeature.TARGET_TEMPERATURE
if self.coordinator.data.get(Attribute.HUMIDIFICATION_AVAILABLE) == 2:
features = features | ClimateEntityFeature.TARGET_HUMIDITY
features = features | ClimateEntityFeature.PRESET_MODE
features = features | ClimateEntityFeature.FAN_MODE
return features
@property
def current_humidity(self) -> int | None:
"""Get current humidity."""
return self.coordinator.data.get(
Attribute.INDOOR_HUMIDITY_CONTROLLING_SENSOR_VALUE
)
@property
def target_humidity(self) -> int | None:
"""Get current target humidity."""
return self.coordinator.data.get(Attribute.HUMIDIFICATION_SETPOINT)
@property
def hvac_mode(self) -> HVACMode | None:
"""Get HVAC mode."""
if mode := self.coordinator.data.get(Attribute.MODE):
if hvac_mode := HVAC_MODE_MAP.get(mode):
return hvac_mode
return None
@property
def hvac_modes(self) -> list[HVACMode]:
"""Get supported HVAC modes."""
if modes := self.coordinator.data.get(Attribute.THERMOSTAT_MODES):
if thermostat_modes := HVAC_MODES_MAP.get(modes):
return thermostat_modes
return []
@property
def hvac_action(self) -> HVACAction | None:
"""Get the current HVAC action."""
if self.coordinator.data.get(Attribute.HEATING_EQUIPMENT_STATUS, 0):
return HVACAction.HEATING
if self.coordinator.data.get(Attribute.COOLING_EQUIPMENT_STATUS, 0):
return HVACAction.COOLING
return HVACAction.IDLE
@property
def current_temperature(self) -> float | None:
"""Get current temperature."""
return self.coordinator.data.get(
Attribute.INDOOR_TEMPERATURE_CONTROLLING_SENSOR_VALUE
)
@property
def target_temperature(self) -> float | None:
"""Get the target temperature."""
hvac_mode = self.hvac_mode
if hvac_mode == HVACMode.COOL:
return self.target_temperature_high
if hvac_mode == HVACMode.HEAT:
return self.target_temperature_low
return None
@property
def target_temperature_step(self) -> float | None:
"""Get the step for the target temperature based on the unit."""
return (
0.5
if self.hass.config.units.temperature_unit == UnitOfTemperature.CELSIUS
else 1
)
@property
def target_temperature_high(self) -> float | None:
"""Get cool setpoint."""
return self.coordinator.data.get(Attribute.COOL_SETPOINT)
@property
def target_temperature_low(self) -> float | None:
"""Get heat setpoint."""
return self.coordinator.data.get(Attribute.HEAT_SETPOINT)
@property
def preset_mode(self) -> str | None:
"""Get the current preset mode."""
if hold := self.coordinator.data.get(Attribute.HOLD):
if preset_mode := PRESET_MODE_MAP.get(hold):
return preset_mode
return PRESET_NONE
@property
def preset_modes(self) -> list[str] | None:
"""Get the supported preset modes."""
presets = [PRESET_NONE, PRESET_VACATION]
if self.coordinator.data.get(Attribute.AWAY_AVAILABLE) == 1:
presets.append(PRESET_AWAY)
hold = self.coordinator.data.get(Attribute.HOLD, 0)
if hold == 1:
presets.append(PRESET_TEMPORARY_HOLD)
elif hold == 2:
presets.append(PRESET_PERMANENT_HOLD)
return presets
@property
def fan_mode(self) -> str | None:
"""Get fan mode."""
if mode := self.coordinator.data.get(Attribute.FAN_MODE):
if fan_mode := FAN_MODE_MAP.get(mode):
return fan_mode
return None
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
cool_setpoint = 0
heat_setpoint = 0
if temperature := kwargs.get("temperature"):
if self.coordinator.data.get(Attribute.MODE) == 3:
cool_setpoint = temperature
else:
heat_setpoint = temperature
else:
if target_temp_low := kwargs.get("target_temp_low"):
heat_setpoint = target_temp_low
if target_temp_high := kwargs.get("target_temp_high"):
cool_setpoint = target_temp_high
if cool_setpoint == 0 and heat_setpoint == 0:
return
await self.coordinator.client.update_setpoint(cool_setpoint, heat_setpoint)
await self.coordinator.client.read_control()
async def async_set_humidity(self, humidity: int) -> None:
"""Set the target humidification setpoint."""
await self.coordinator.client.set_humidification_setpoint(humidity)
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set the fan mode."""
try:
fan_mode_value_index = list(FAN_MODE_MAP.values()).index(fan_mode)
except ValueError as exc:
raise ValueError(f"Unsupported fan mode {fan_mode}") from exc
fan_mode_value = list(FAN_MODE_MAP.keys())[fan_mode_value_index]
await self.coordinator.client.update_fan_mode(fan_mode_value)
await self.coordinator.client.read_control()
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set the HVAC mode."""
try:
mode_value_index = list(HVAC_MODE_MAP.values()).index(hvac_mode)
except ValueError as exc:
raise ValueError(f"Unsupported HVAC mode {hvac_mode}") from exc
mode_value = list(HVAC_MODE_MAP.keys())[mode_value_index]
await self.coordinator.client.update_mode(mode_value)
await self.coordinator.client.read_control()
async def async_set_preset_mode(self, preset_mode: str) -> None:
"""Set the preset mode."""
if preset_mode == PRESET_AWAY:
await self.coordinator.client.set_hold(3)
elif preset_mode == PRESET_VACATION:
await self.coordinator.client.set_hold(4)
elif preset_mode == PRESET_NONE:
await self.coordinator.client.set_hold(0)
else:
raise ValueError(f"Unsupported preset mode {preset_mode}")
await self.coordinator.client.read_scheduling()

View File

@@ -0,0 +1,72 @@
"""Config flow for the Aprilaire integration."""
from __future__ import annotations
import logging
from typing import Any
from pyaprilaire.const import Attribute
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.data_entry_flow import FlowResult
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.device_registry import format_mac
from .const import DOMAIN
from .coordinator import AprilaireCoordinator
STEP_USER_DATA_SCHEMA = vol.Schema(
{
vol.Required(CONF_HOST): str,
vol.Required(CONF_PORT, default=7000): cv.port,
}
)
_LOGGER = logging.getLogger(__name__)
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Aprilaire."""
VERSION = 1
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the initial step."""
if user_input is None:
return self.async_show_form(
step_id="user", data_schema=STEP_USER_DATA_SCHEMA
)
coordinator = AprilaireCoordinator(
self.hass, None, user_input[CONF_HOST], user_input[CONF_PORT]
)
await coordinator.start_listen()
async def ready_callback(ready: bool):
if not ready:
_LOGGER.error("Failed to wait for ready")
try:
ready = await coordinator.wait_for_ready(ready_callback)
finally:
coordinator.stop_listen()
mac_address = coordinator.data.get(Attribute.MAC_ADDRESS)
if ready and mac_address is not None:
await self.async_set_unique_id(format_mac(mac_address))
self._abort_if_unique_id_configured()
return self.async_create_entry(title="Aprilaire", data=user_input)
return self.async_show_form(
step_id="user",
data_schema=STEP_USER_DATA_SCHEMA,
errors={"base": "connection_failed"},
)

View File

@@ -0,0 +1,11 @@
"""Constants for the Aprilaire integration."""
from __future__ import annotations
DOMAIN = "aprilaire"
FAN_CIRCULATE = "Circulate"
PRESET_TEMPORARY_HOLD = "Temporary"
PRESET_PERMANENT_HOLD = "Permanent"
PRESET_VACATION = "Vacation"

View File

@@ -0,0 +1,209 @@
"""The Aprilaire coordinator."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
import logging
from typing import Any, Optional
import pyaprilaire.client
from pyaprilaire.const import MODELS, Attribute, FunctionalDomain
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
import homeassistant.helpers.device_registry as dr
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import BaseDataUpdateCoordinatorProtocol
from .const import DOMAIN
RECONNECT_INTERVAL = 60 * 60
RETRY_CONNECTION_INTERVAL = 10
WAIT_TIMEOUT = 30
_LOGGER = logging.getLogger(__name__)
class AprilaireCoordinator(BaseDataUpdateCoordinatorProtocol):
"""Coordinator for interacting with the thermostat."""
def __init__(
self,
hass: HomeAssistant,
unique_id: str | None,
host: str,
port: int,
) -> None:
"""Initialize the coordinator."""
self.hass = hass
self.unique_id = unique_id
self.data: dict[str, Any] = {}
self._listeners: dict[CALLBACK_TYPE, tuple[CALLBACK_TYPE, object | None]] = {}
self.client = pyaprilaire.client.AprilaireClient(
host,
port,
self.async_set_updated_data,
_LOGGER,
RECONNECT_INTERVAL,
RETRY_CONNECTION_INTERVAL,
)
if hasattr(self.client, "data") and self.client.data:
self.data = self.client.data
@callback
def async_add_listener(
self, update_callback: CALLBACK_TYPE, context: Any = None
) -> Callable[[], None]:
"""Listen for data updates."""
@callback
def remove_listener() -> None:
"""Remove update listener."""
self._listeners.pop(remove_listener)
self._listeners[remove_listener] = (update_callback, context)
return remove_listener
@callback
def async_update_listeners(self) -> None:
"""Update all registered listeners."""
for update_callback, _ in list(self._listeners.values()):
update_callback()
def async_set_updated_data(self, data: Any) -> None:
"""Manually update data, notify listeners and reset refresh interval."""
old_device_info = self.create_device_info(self.data)
self.data = self.data | data
self.async_update_listeners()
new_device_info = self.create_device_info(data)
if (
old_device_info is not None
and new_device_info is not None
and old_device_info != new_device_info
):
device_registry = dr.async_get(self.hass)
device = device_registry.async_get_device(old_device_info["identifiers"])
if device is not None:
new_device_info.pop("identifiers", None)
new_device_info.pop("connections", None)
device_registry.async_update_device(
device_id=device.id,
**new_device_info, # type: ignore[misc]
)
async def start_listen(self):
"""Start listening for data."""
await self.client.start_listen()
def stop_listen(self):
"""Stop listening for data."""
self.client.stop_listen()
async def wait_for_ready(
self, ready_callback: Callable[[bool], Awaitable[bool]]
) -> bool:
"""Wait for the client to be ready."""
if not self.data or Attribute.MAC_ADDRESS not in self.data:
data = await self.client.wait_for_response(
FunctionalDomain.IDENTIFICATION, 2, WAIT_TIMEOUT
)
if not data or Attribute.MAC_ADDRESS not in data:
_LOGGER.error("Missing MAC address")
await ready_callback(False)
return False
if not self.data or Attribute.NAME not in self.data:
await self.client.wait_for_response(
FunctionalDomain.IDENTIFICATION, 4, WAIT_TIMEOUT
)
if not self.data or Attribute.THERMOSTAT_MODES not in self.data:
await self.client.wait_for_response(
FunctionalDomain.CONTROL, 7, WAIT_TIMEOUT
)
if (
not self.data
or Attribute.INDOOR_TEMPERATURE_CONTROLLING_SENSOR_STATUS not in self.data
):
await self.client.wait_for_response(
FunctionalDomain.SENSORS, 2, WAIT_TIMEOUT
)
await ready_callback(True)
return True
@property
def device_name(self) -> str:
"""Get the name of the thermostat."""
return self.create_device_name(self.data)
def create_device_name(self, data: Optional[dict[str, Any]]) -> str:
"""Create the name of the thermostat."""
name = data.get(Attribute.NAME) if data else None
return name if name else "Aprilaire"
def get_hw_version(self, data: dict[str, Any]) -> str:
"""Get the hardware version."""
if hardware_revision := data.get(Attribute.HARDWARE_REVISION):
return (
f"Rev. {chr(hardware_revision)}"
if hardware_revision > ord("A")
else str(hardware_revision)
)
return "Unknown"
@property
def device_info(self) -> DeviceInfo | None:
"""Get the device info for the thermostat."""
return self.create_device_info(self.data)
def create_device_info(self, data: dict[str, Any]) -> DeviceInfo | None:
"""Create the device info for the thermostat."""
if data is None or Attribute.MAC_ADDRESS not in data or self.unique_id is None:
return None
device_info = DeviceInfo(
identifiers={(DOMAIN, self.unique_id)},
name=self.create_device_name(data),
manufacturer="Aprilaire",
)
model_number = data.get(Attribute.MODEL_NUMBER)
if model_number is not None:
device_info["model"] = MODELS.get(model_number, f"Unknown ({model_number})")
device_info["hw_version"] = self.get_hw_version(data)
firmware_major_revision = data.get(Attribute.FIRMWARE_MAJOR_REVISION)
firmware_minor_revision = data.get(Attribute.FIRMWARE_MINOR_REVISION)
if firmware_major_revision is not None:
device_info["sw_version"] = (
str(firmware_major_revision)
if firmware_minor_revision is None
else f"{firmware_major_revision}.{firmware_minor_revision:02}"
)
return device_info

View File

@@ -0,0 +1,46 @@
"""Base functionality for Aprilaire entities."""
from __future__ import annotations
import logging
from pyaprilaire.const import Attribute
from homeassistant.helpers.update_coordinator import BaseCoordinatorEntity
from .coordinator import AprilaireCoordinator
_LOGGER = logging.getLogger(__name__)
class BaseAprilaireEntity(BaseCoordinatorEntity[AprilaireCoordinator]):
"""Base for Aprilaire entities."""
_attr_available = False
_attr_has_entity_name = True
def __init__(
self, coordinator: AprilaireCoordinator, unique_id: str | None
) -> None:
"""Initialize the entity."""
super().__init__(coordinator)
self._attr_device_info = coordinator.device_info
self._attr_unique_id = f"{unique_id}_{self.translation_key}"
self._update_available()
def _update_available(self):
"""Update the entity availability."""
connected: bool = self.coordinator.data.get(
Attribute.CONNECTED, None
) or self.coordinator.data.get(Attribute.RECONNECTING, None)
stopped: bool = self.coordinator.data.get(Attribute.STOPPED, None)
self._attr_available = connected and not stopped
async def async_update(self) -> None:
"""Implement abstract base method."""

View File

@@ -0,0 +1,11 @@
{
"domain": "aprilaire",
"name": "Aprilaire",
"codeowners": ["@chamberlain2007"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/aprilaire",
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["pyaprilaire"],
"requirements": ["pyaprilaire==0.7.0"]
}

View File

@@ -0,0 +1,28 @@
{
"config": {
"step": {
"user": {
"data": {
"host": "[%key:common::config_flow::data::host%]",
"port": "[%key:common::config_flow::data::port%]"
},
"data_description": {
"port": "Usually 7000 or 8000"
}
}
},
"error": {
"connection_failed": "Connection failed. Please check that the host and port is correct."
},
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
}
},
"entity": {
"climate": {
"thermostat": {
"name": "Thermostat"
}
}
}
}

View File

@@ -83,7 +83,7 @@ async def _run_client(hass: HomeAssistant, client: Client, interval: float) -> N
except ConnectionFailed:
await asyncio.sleep(interval)
except asyncio.TimeoutError:
except TimeoutError:
continue
except Exception: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception, aborting arcam client")

View File

@@ -325,9 +325,7 @@ class ArcamFmj(MediaPlayerEntity):
def media_content_type(self) -> MediaType | None:
"""Content type of current playing media."""
source = self._state.get_source()
if source == SourceCodes.DAB:
value = MediaType.MUSIC
elif source == SourceCodes.FM:
if source in (SourceCodes.DAB, SourceCodes.FM):
value = MediaType.MUSIC
else:
value = None

View File

@@ -83,6 +83,7 @@ async def async_pipeline_from_audio_stream(
event_callback: PipelineEventCallback,
stt_metadata: stt.SpeechMetadata,
stt_stream: AsyncIterable[bytes],
wake_word_phrase: str | None = None,
pipeline_id: str | None = None,
conversation_id: str | None = None,
tts_audio_output: str | None = None,
@@ -101,6 +102,7 @@ async def async_pipeline_from_audio_stream(
device_id=device_id,
stt_metadata=stt_metadata,
stt_stream=stt_stream,
wake_word_phrase=wake_word_phrase,
run=PipelineRun(
hass,
context=context,

View File

@@ -10,6 +10,6 @@ DEFAULT_WAKE_WORD_TIMEOUT = 3 # seconds
CONF_DEBUG_RECORDING_DIR = "debug_recording_dir"
DATA_LAST_WAKE_UP = f"{DOMAIN}.last_wake_up"
DEFAULT_WAKE_WORD_COOLDOWN = 2 # seconds
WAKE_WORD_COOLDOWN = 2 # seconds
EVENT_RECORDING = f"{DOMAIN}_recording"

View File

@@ -38,6 +38,17 @@ class SpeechToTextError(PipelineError):
"""Error in speech-to-text portion of pipeline."""
class DuplicateWakeUpDetectedError(WakeWordDetectionError):
"""Error when multiple voice assistants wake up at the same time (same wake word)."""
def __init__(self, wake_up_phrase: str) -> None:
"""Set error message."""
super().__init__(
"duplicate_wake_up_detected",
f"Duplicate wake-up detected for {wake_up_phrase}",
)
class IntentRecognitionError(PipelineError):
"""Error in intent recognition portion of pipeline."""

View File

@@ -55,10 +55,11 @@ from .const import (
CONF_DEBUG_RECORDING_DIR,
DATA_CONFIG,
DATA_LAST_WAKE_UP,
DEFAULT_WAKE_WORD_COOLDOWN,
DOMAIN,
WAKE_WORD_COOLDOWN,
)
from .error import (
DuplicateWakeUpDetectedError,
IntentRecognitionError,
PipelineError,
PipelineNotFound,
@@ -453,9 +454,6 @@ class WakeWordSettings:
audio_seconds_to_buffer: float = 0
"""Seconds of audio to buffer before detection and forward to STT."""
cooldown_seconds: float = DEFAULT_WAKE_WORD_COOLDOWN
"""Seconds after a wake word detection where other detections are ignored."""
@dataclass(frozen=True)
class AudioSettings:
@@ -742,16 +740,22 @@ class PipelineRun:
wake_word_output: dict[str, Any] = {}
else:
# Avoid duplicate detections by checking cooldown
wake_up_key = f"{self.wake_word_entity_id}.{result.wake_word_id}"
last_wake_up = self.hass.data[DATA_LAST_WAKE_UP].get(wake_up_key)
last_wake_up = self.hass.data[DATA_LAST_WAKE_UP].get(
result.wake_word_phrase
)
if last_wake_up is not None:
sec_since_last_wake_up = time.monotonic() - last_wake_up
if sec_since_last_wake_up < wake_word_settings.cooldown_seconds:
_LOGGER.debug("Duplicate wake word detection occurred")
raise WakeWordDetectionAborted
if sec_since_last_wake_up < WAKE_WORD_COOLDOWN:
_LOGGER.debug(
"Duplicate wake word detection occurred for %s",
result.wake_word_phrase,
)
raise DuplicateWakeUpDetectedError(result.wake_word_phrase)
# Record last wake up time to block duplicate detections
self.hass.data[DATA_LAST_WAKE_UP][wake_up_key] = time.monotonic()
self.hass.data[DATA_LAST_WAKE_UP][
result.wake_word_phrase
] = time.monotonic()
if result.queued_audio:
# Add audio that was pending at detection.
@@ -1308,6 +1312,9 @@ class PipelineInput:
stt_stream: AsyncIterable[bytes] | None = None
"""Input audio for stt. Required when start_stage = stt."""
wake_word_phrase: str | None = None
"""Optional key used to de-duplicate wake-ups for local wake word detection."""
intent_input: str | None = None
"""Input for conversation agent. Required when start_stage = intent."""
@@ -1352,6 +1359,25 @@ class PipelineInput:
assert self.stt_metadata is not None
assert stt_processed_stream is not None
if self.wake_word_phrase is not None:
# Avoid duplicate wake-ups by checking cooldown
last_wake_up = self.run.hass.data[DATA_LAST_WAKE_UP].get(
self.wake_word_phrase
)
if last_wake_up is not None:
sec_since_last_wake_up = time.monotonic() - last_wake_up
if sec_since_last_wake_up < WAKE_WORD_COOLDOWN:
_LOGGER.debug(
"Speech-to-text cancelled to avoid duplicate wake-up for %s",
self.wake_word_phrase,
)
raise DuplicateWakeUpDetectedError(self.wake_word_phrase)
# Record last wake up time to block duplicate detections
self.run.hass.data[DATA_LAST_WAKE_UP][
self.wake_word_phrase
] = time.monotonic()
stt_input_stream = stt_processed_stream
if stt_audio_buffer:

View File

@@ -97,7 +97,12 @@ def async_register_websocket_api(hass: HomeAssistant) -> None:
extra=vol.ALLOW_EXTRA,
),
PipelineStage.STT: vol.Schema(
{vol.Required("input"): {vol.Required("sample_rate"): int}},
{
vol.Required("input"): {
vol.Required("sample_rate"): int,
vol.Optional("wake_word_phrase"): str,
}
},
extra=vol.ALLOW_EXTRA,
),
PipelineStage.INTENT: vol.Schema(
@@ -149,12 +154,15 @@ async def websocket_run(
msg_input = msg["input"]
audio_queue: asyncio.Queue[bytes] = asyncio.Queue()
incoming_sample_rate = msg_input["sample_rate"]
wake_word_phrase: str | None = None
if start_stage == PipelineStage.WAKE_WORD:
wake_word_settings = WakeWordSettings(
timeout=msg["input"].get("timeout", DEFAULT_WAKE_WORD_TIMEOUT),
audio_seconds_to_buffer=msg_input.get("audio_seconds_to_buffer", 0),
)
elif start_stage == PipelineStage.STT:
wake_word_phrase = msg["input"].get("wake_word_phrase")
async def stt_stream() -> AsyncGenerator[bytes, None]:
state = None
@@ -189,6 +197,7 @@ async def websocket_run(
channel=stt.AudioChannels.CHANNEL_MONO,
)
input_args["stt_stream"] = stt_stream()
input_args["wake_word_phrase"] = wake_word_phrase
# Audio settings
audio_settings = AudioSettings(
@@ -241,7 +250,7 @@ async def websocket_run(
# Task contains a timeout
async with asyncio.timeout(timeout):
await run_task
except asyncio.TimeoutError:
except TimeoutError:
pipeline_input.run.process_event(
PipelineEvent(
PipelineEventType.ERROR,
@@ -487,7 +496,7 @@ async def websocket_device_capture(
)
try:
with contextlib.suppress(asyncio.TimeoutError):
with contextlib.suppress(TimeoutError):
async with asyncio.timeout(timeout_seconds):
while True:
# Send audio chunks encoded as base64

View File

@@ -15,6 +15,7 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import discovery
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_send, dispatcher_connect
from homeassistant.helpers.issue_registry import IssueSeverity, create_issue
from homeassistant.helpers.typing import ConfigType
_LOGGER = logging.getLogger(__name__)
@@ -50,6 +51,21 @@ def setup(hass: HomeAssistant, config: ConfigType) -> bool:
password: str = conf[CONF_PASSWORD]
hass.data[DOMAIN] = AsteriskData(hass, host, port, password, config)
create_issue(
hass,
DOMAIN,
"deprecated_integration",
breaks_in_ha_version="2024.9.0",
is_fixable=False,
issue_domain=DOMAIN,
severity=IssueSeverity.WARNING,
translation_key="deprecated_integration",
translation_placeholders={
"domain": DOMAIN,
"integration_title": "Asterisk Voicemail",
"mailbox": "mailbox",
},
)
return True

View File

@@ -0,0 +1,8 @@
{
"issues": {
"deprecated_integration": {
"title": "The {integration_title} is being removed",
"description": "{integration_title} is being removed as the `{mailbox}` platform is being removed and {integration_title} supports no other platforms. Remove the `{domain}` configuration from your configuration.yaml file and restart Home Assistant to fix this issue."
}
}
}

View File

@@ -211,10 +211,7 @@ class AsusWrtLegacyBridge(AsusWrtBridge):
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
"""Get list of connected devices."""
try:
api_devices = await self._api.async_get_connected_devices()
except OSError as exc:
raise UpdateFailed(exc) from exc
api_devices = await self._api.async_get_connected_devices()
return {
format_mac(mac): WrtDevice(dev.ip, dev.name, None)
for mac, dev in api_devices.items()
@@ -343,10 +340,7 @@ class AsusWrtHttpBridge(AsusWrtBridge):
async def async_get_connected_devices(self) -> dict[str, WrtDevice]:
"""Get list of connected devices."""
try:
api_devices = await self._api.async_get_connected_devices()
except AsusWrtError as exc:
raise UpdateFailed(exc) from exc
api_devices = await self._api.async_get_connected_devices()
return {
format_mac(mac): WrtDevice(dev.ip, dev.name, dev.node)
for mac, dev in api_devices.items()

View File

@@ -216,7 +216,7 @@ class AsusWrtFlowHandler(ConfigFlow, domain=DOMAIN):
if error is not None:
return error, None
_LOGGER.info(
_LOGGER.debug(
"Successfully connected to the AsusWrt router at %s using protocol %s",
host,
protocol,

View File

@@ -20,7 +20,7 @@ from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.device_registry import DeviceInfo, format_mac
from homeassistant.helpers.dispatcher import async_dispatcher_send
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from homeassistant.util import dt as dt_util, slugify
from .bridge import AsusWrtBridge, WrtDevice
@@ -276,7 +276,7 @@ class AsusWrtRouter:
_LOGGER.debug("Checking devices for ASUS router %s", self.host)
try:
wrt_devices = await self._api.async_get_connected_devices()
except UpdateFailed as exc:
except (OSError, AsusWrtError) as exc:
if not self._connect_error:
self._connect_error = True
_LOGGER.error(

View File

@@ -59,7 +59,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
return await async_setup_august(hass, entry, august_gateway)
except (RequireValidation, InvalidAuth) as err:
raise ConfigEntryAuthFailed from err
except asyncio.TimeoutError as err:
except TimeoutError as err:
raise ConfigEntryNotReady("Timed out connecting to august api") from err
except (AugustApiAIOHTTPError, ClientResponseError, CannotConnect) as err:
raise ConfigEntryNotReady from err
@@ -233,7 +233,7 @@ class AugustData(AugustSubscriberMixin):
return_exceptions=True,
):
if isinstance(result, Exception) and not isinstance(
result, (asyncio.TimeoutError, ClientResponseError, CannotConnect)
result, (TimeoutError, ClientResponseError, CannotConnect)
):
_LOGGER.warning(
"Unexpected exception during initial sync: %s",
@@ -293,7 +293,7 @@ class AugustData(AugustSubscriberMixin):
for device_id in device_ids_list:
try:
await self._async_refresh_device_detail_by_id(device_id)
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.warning(
"Timed out calling august api during refresh of device: %s",
device_id,

View File

@@ -1,7 +1,6 @@
"""Consume the august activity stream."""
from __future__ import annotations
import asyncio
from datetime import datetime
from functools import partial
import logging
@@ -63,11 +62,10 @@ class ActivityStream(AugustSubscriberMixin):
self._update_debounce: dict[str, Debouncer] = {}
self._update_debounce_jobs: dict[str, HassJob] = {}
async def _async_update_house_id_later(
self, debouncer: Debouncer, _: datetime
) -> None:
@callback
def _async_update_house_id_later(self, debouncer: Debouncer, _: datetime) -> None:
"""Call a debouncer from async_call_later."""
await debouncer.async_call()
debouncer.async_schedule_call()
async def async_setup(self) -> None:
"""Token refresh check and catch up the activity stream."""
@@ -128,9 +126,9 @@ class ActivityStream(AugustSubscriberMixin):
_LOGGER.debug("Skipping update because pubnub is connected")
return
_LOGGER.debug("Start retrieving device activities")
await asyncio.gather(
*(debouncer.async_call() for debouncer in self._update_debounce.values())
)
# Await in sequence to avoid hammering the API
for debouncer in self._update_debounce.values():
await debouncer.async_call()
@callback
def async_schedule_house_id_refresh(self, house_id: str) -> None:
@@ -139,7 +137,7 @@ class ActivityStream(AugustSubscriberMixin):
_async_cancel_future_scheduled_updates(future_updates)
debouncer = self._update_debounce[house_id]
self._hass.async_create_task(debouncer.async_call())
debouncer.async_schedule_call()
# Schedule two updates past the debounce time
# to ensure we catch the case where the activity
# api does not update right away and we need to poll

View File

@@ -26,7 +26,8 @@
}
],
"documentation": "https://www.home-assistant.io/integrations/august",
"import_executor": true,
"iot_class": "cloud_push",
"loggers": ["pubnub", "yalexs"],
"requirements": ["yalexs==1.11.2", "yalexs-ble==2.4.1"]
"requirements": ["yalexs==1.11.4", "yalexs-ble==2.4.2"]
}

View File

@@ -43,12 +43,17 @@ class AugustSubscriberMixin:
async def _async_refresh(self, time: datetime) -> None:
"""Refresh data."""
@callback
def _async_scheduled_refresh(self, now: datetime) -> None:
"""Call the refresh method."""
self._hass.async_create_task(self._async_refresh(now), eager_start=True)
@callback
def _async_setup_listeners(self) -> None:
"""Create interval and stop listeners."""
self._unsub_interval = async_track_time_interval(
self._hass,
self._async_refresh,
self._async_scheduled_refresh,
self._update_interval,
name="august refresh",
)

View File

@@ -578,6 +578,7 @@ def websocket_refresh_tokens(
connection.send_result(msg["id"], tokens)
@callback
@websocket_api.websocket_command(
{
vol.Required("type"): "auth/delete_refresh_token",
@@ -585,8 +586,7 @@ def websocket_refresh_tokens(
}
)
@websocket_api.ws_require_user()
@websocket_api.async_response
async def websocket_delete_refresh_token(
def websocket_delete_refresh_token(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Handle a delete refresh token request."""
@@ -601,6 +601,7 @@ async def websocket_delete_refresh_token(
connection.send_result(msg["id"], {})
@callback
@websocket_api.websocket_command(
{
vol.Required("type"): "auth/delete_all_refresh_tokens",
@@ -609,8 +610,7 @@ async def websocket_delete_refresh_token(
}
)
@websocket_api.ws_require_user()
@websocket_api.async_response
async def websocket_delete_all_refresh_tokens(
def websocket_delete_all_refresh_tokens(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Handle delete all refresh tokens request."""

View File

@@ -1,7 +1,6 @@
"""Helpers to resolve client ID/secret."""
from __future__ import annotations
import asyncio
from html.parser import HTMLParser
from ipaddress import ip_address
import logging
@@ -102,7 +101,7 @@ async def fetch_redirect_uris(hass: HomeAssistant, url: str) -> list[str]:
if chunks == 10:
break
except asyncio.TimeoutError:
except TimeoutError:
_LOGGER.error("Timeout while looking up redirect_uri %s", url)
except aiohttp.client_exceptions.ClientSSLError:
_LOGGER.error("SSL error while looking up redirect_uri %s", url)

View File

@@ -701,7 +701,7 @@ class AutomationEntity(BaseAutomationEntity, RestoreEntity):
await super().async_will_remove_from_hass()
await self.async_disable()
async def _async_enable_automation(self, event: Event) -> None:
async def _async_enable_automation(self) -> None:
"""Start automation on startup."""
# Don't do anything if no longer enabled or already attached
if not self._is_enabled or self._async_detach_triggers is not None:
@@ -709,6 +709,11 @@ class AutomationEntity(BaseAutomationEntity, RestoreEntity):
self._async_detach_triggers = await self._async_attach_triggers(True)
@callback
def _async_create_enable_automation_task(self, event: Event) -> None:
"""Create a task to enable the automation."""
self.hass.async_create_task(self._async_enable_automation(), eager_start=True)
async def async_enable(self) -> None:
"""Enable this automation entity.
@@ -726,7 +731,7 @@ class AutomationEntity(BaseAutomationEntity, RestoreEntity):
return
self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STARTED, self._async_enable_automation
EVENT_HOMEASSISTANT_STARTED, self._async_create_enable_automation_task
)
self.async_write_ha_state()

View File

@@ -1,7 +1,6 @@
"""Config validation helper for the automation integration."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
from contextlib import suppress
from typing import Any
@@ -255,15 +254,15 @@ async def async_validate_config_item(
async def async_validate_config(hass: HomeAssistant, config: ConfigType) -> ConfigType:
"""Validate config."""
# No gather here since _try_async_validate_config_item is unlikely to suspend
# and the cost of creating many tasks is not worth the benefit.
automations = list(
filter(
lambda x: x is not None,
await asyncio.gather(
*(
_try_async_validate_config_item(hass, p_config)
for _, p_config in config_per_platform(config, DOMAIN)
)
),
[
await _try_async_validate_config_item(hass, p_config)
for _, p_config in config_per_platform(config, DOMAIN)
],
)
)

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