Compare commits

...

880 Commits

Author SHA1 Message Date
Paulus Schoutsen 65a9bd661d Bumped version to 2023.6.0b1 2023-05-31 21:17:59 -04:00
Paulus Schoutsen fb50f0d875 Bump frontend to 20230601.0 (#93884) 2023-05-31 21:17:51 -04:00
puddly d6f2e1cdff Increase Zigbee command retries (#93877)
* Enable retries for requests

* Update unit tests

* Account for fewer group retries in unit tests
2023-05-31 21:17:50 -04:00
Álvaro Fernández Rojas d10dd54d88 Update aioairzone-cloud to v0.1.7 (#93871)
* Update aioairzone-cloud to v0.1.7

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

* airzone_cloud: fix copy&paste description

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-31 21:17:49 -04:00
Diogo Gomes 22ed622152 Delay filter integration until after HA has started (#91034)
* delay filter start

* Update homeassistant/components/filter/sensor.py

* Update homeassistant/components/filter/sensor.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 21:17:48 -04:00
Diogo Gomes 408f0bdd6b Always update Filter sensors attr on new_state (#89096)
* always update attr

* reset filter on unit change
2023-05-31 21:17:47 -04:00
Franck Nijhof ab2e891e91 Bumped version to 2023.6.0b0 2023-05-31 17:55:47 +02:00
Raman Gupta cb616cdf4e Move Z-Wave refresh value service out of task (#93866) 2023-05-31 11:52:01 -04:00
Bram Kragten 22e7c9cc76 Update frontend to 20230531.0 (#93862) 2023-05-31 17:23:13 +02:00
Matthias Alphart 7b7ea24303 Update knx-frontend to 2023.5.31.141540 (#93864) 2023-05-31 17:20:53 +02:00
Raman Gupta f1552304e1 Give zwave_js platinum quality score (#93845) 2023-05-31 17:15:44 +02:00
Raman Gupta bd8c88f51b Add error handling for all zwave_js service calls (#93846)
* Add error handling for all service calls

* Switch siren to use internal function

* Remove failing checks

* Revert change to poll service, add comments, and add additional error handling

* Add error handling for ping and refresh + review comment + add tests

* Add test for statistics entity refresh
2023-05-31 11:09:01 -04:00
Paulus Schoutsen 927b59fe5a Simplify get pipeline method (#93865) 2023-05-31 10:06:03 -05:00
Justin Vanderhooft 4bade86dcc Add time component to Melnor Bluetooth integration (#93652)
* Add time component to Melnor Bluetooth integration

* Apply suggestions from code review

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 11:00:52 -04:00
c0ffeeca7 c3a3ddcfa4 Standardize spelling of TTS and STT (#93857)
* Standardize spelling of TTS and STT

* Apply suggestions from code review

* Update homeassistant/components/tts/media_source.py

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-31 11:00:19 -04:00
Mark Kennedy b03dbeaed5 Block legacy get-mac in preference of getmac (#87712)
Co-authored-by: GnatorX <garvinpang@protonmail.com>
2023-05-31 16:57:45 +02:00
Diego Rodríguez Royo 3cf8ae64c8 Matter cover position improvements (#92278) 2023-05-31 16:08:01 +02:00
Dominik c8c368340d Glances: Improve performance (#93852)
* Improve performance

* Apply suggestions from code review

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-31 09:17:23 -04:00
Luke 1d7498378e Add Status indicator light switch to Roborock (#93842)
add status indicator light switch
2023-05-31 14:26:39 +02:00
Yuxin Wang 676b6ab706 Add support for "days" unit for STESTI sensor in APCUPSD integration (#93844)
Add a test case for self test interval
2023-05-31 14:25:46 +02:00
Álvaro Fernández Rojas 21771457d1 Use library constants for Airzone Cloud diagnostics (#93858)
airzone_cloud: diagnostics: use constants from library

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-31 14:22:53 +02:00
David F. Mulcahey 0f4dec534c Bump ZHA quirks (#93860) 2023-05-31 14:14:49 +02:00
Raman Gupta b3990d48d2 Improve Z-Wave support for Ultraviolet multilevel sensor values (#93848)
Improve support for Ultraviolet multilevel sensor values
2023-05-31 13:31:02 +02:00
Raman Gupta 1eb1ea08b0 Add support for Energy Production CC sensors (#93839) 2023-05-31 13:28:07 +02:00
Marc Mueller c72477811e Fix event typing (#93859) 2023-05-31 12:33:56 +02:00
G Johansson f7b15dbf84 Fix Timer change service (#93469) 2023-05-31 12:00:45 +02:00
Jan Bouwhuis fa4d9b2c08 Rework mqtt climate platform to simplify implementation water_heater platform (#93751)
* Rework to simplify water_heater platform

* Remove unused type hints

* Split shared and specific subscriptions

* Convert to abstract class
2023-05-31 11:12:58 +02:00
Erik Montnemery 59c6220b7c Subscribe to device registry changes from entities (#93601)
* Subscribe to device registry changes from entities

* Use async_track_device_registry_updated_event

* Fix unsubscribe

* Fix logic, add tests
2023-05-31 11:01:55 +02:00
Raman Gupta 204215e0f2 Cleanup unnecessary pylance warnings (#93849) 2023-05-31 10:15:21 +02:00
Erik Montnemery b5f5e1c8c3 Add empty config schema to integrations t-z (#93853) 2023-05-31 10:13:26 +02:00
Erik Montnemery ef4dea07cd Improve no-yaml warning (#93851) 2023-05-31 10:11:02 +02:00
Erik Montnemery 24ed53cebe Drop incorrect CONFIG_SCHEMA from the homeassistant integration (#93850) 2023-05-31 10:10:44 +02:00
G Johansson 3f3b833034 Add issue when integration key YAML not supported (#93807)
* Add issue when integration key YAML not supported

* Fix feedback

* Fix review

* Update homeassistant/components/homeassistant/strings.json

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-05-31 09:56:33 +02:00
Jan Bouwhuis 661aedde90 Remove MQTT platform schema warnings (#93785) 2023-05-31 09:02:48 +02:00
Raman Gupta 4119d3198a Support zwave config parameters not on endpoint 0 (#93383)
* Support zwave config parameters not on endpoint 0

* Update device automation logic

* Make endpoint required

* Update homeassistant/components/zwave_js/services.py

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

* Update homeassistant/components/zwave_js/services.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-05-30 23:52:12 -04:00
Luke 8244887bb3 Rename confusing device info in Roborock (#93843)
rename confusing device info
2023-05-31 05:33:18 +02:00
Teemu R 23c5e60be0 Swallow error 40000 for songpal power on/off (#80563)
* Swallow error 40000 for songpal power on/off

* Move ERROR_REQUEST_RETRY to consts

* Add tests for the swallow exception behavior

* Update tests/components/songpal/test_media_player.py

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-05-30 22:58:41 -04:00
Luke 81561d4d3e Add non coordinated Entity to Roborock (#93841)
switch to non coordinator entity
2023-05-30 22:58:27 -04:00
Raman Gupta 8cd8355ab1 Bump zwave-js-server-python to 0.49.0 (#93835)
* Bump zwave-js-server-python to 0.49.0

* fix tests
2023-05-30 22:40:55 -04:00
leranp 4a3f341444 Language codes for Hebrew (#93681)
* Language codes for Hebrew

There is 2 optional code for Hebrew:
he-IL is the new code
iw-IL is the old code , the google cloud STT for example is using the old code (iw)

* Update language.py

* Update test_language.py

* Update test_language.py

* Update test_language.py

* Simplify duplicate language check

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-05-30 22:27:32 -04:00
mkmer bfec3d68dd Calculate _attr_native_value when no restore state and appliance is running in Whirlpool (#88559)
* Initialize _attr_native_value when running

* Fix return type on update_sensor_state()
move init at startup if _attr_native_value is None

* allow update _attr_native_value when running and none
2023-05-30 21:48:39 -04:00
J. Nick Koston fba826ae9e Migrate restore_state helper to use registry loading pattern (#93773)
* Migrate restore_state helper to use registry loading pattern

As more entities have started using restore_state over time, it
has become a startup bottleneck as each entity being added is
creating a task to load restore state data that is already loaded
since it is a singleton

We now use the same pattern as the registry helpers

* fix refactoring error -- guess I am tired

* fixes

* fix tests

* fix more

* fix more

* fix zha tests

* fix zha tests

* comments

* fix error

* add missing coverage

* s/DATA_RESTORE_STATE_TASK/DATA_RESTORE_STATE/g
2023-05-30 20:48:17 -05:00
starkillerOG b91c6911d9 Reolink autotrack streams for TrackMix and high/low resolution snapshots (#90591)
* Add auto track stream for Trackmix connected to NVR

* Enable autotracking stream by default

* Add snapshot high/low resolution

* Improve naming

* fix snapshots camera's not beeing added

* keep unique ID the same

* fix styling
2023-05-30 21:42:58 -04:00
Emory Penney 9eac0458dd Obihai to have common unique_ids with DHCP or without (#91239)
* DHCPInfo and get_mac_address case mismatch

* Switch to format_mac

* Run black
2023-05-30 21:40:59 -04:00
Dominik f6d3b0618e Glances: Add error handling for invalid sensor data (#93542)
* Set sensor to Unavailable
when native_value is invalid

* Add unit tests for sensors
2023-05-30 21:35:33 -04:00
G Johansson ac8d8dccd2 Add translation for Trafikverket Weatherstation sensor (#87315)
* Trafikverket weatherstation translate sensor

* Fix enums
2023-05-30 21:25:31 -04:00
G Johansson 6736ed67ba Translate config flow for sensor measurement option in group (#87374)
* Translate config flow

* reset en

* Delete en.json
2023-05-30 21:23:47 -04:00
G Johansson 5e1c9ba80d Translate entity names for Yale Smart Living (#93560) 2023-05-30 21:22:11 -04:00
J. Nick Koston 466eec2f04 Add a debounce to ld2410 to prevent it from overwhelming the state machine with many devices (#93819)
* Add a debounce to ld2410 to prevent it from overwhelming the state machine

fixes #86665

* set time on debounce
2023-05-30 21:13:49 -04:00
Luke 049582ec50 Add Switch platform to Roborock (#93833)
* init

* add switch platform

* remove stale comments

* remove stale list

* set entity category to config
2023-05-30 21:10:28 -04:00
Jan Bouwhuis 3a7f9ab57d Remove mqtt sensor support for last_reset_topic (#93792)
* Remove mqtt sensor support for `last_reset_topic`

* Add cases for empty last reset messages
2023-05-30 21:07:07 -04:00
andarotajo d421a51576 Add coordinator to dwd_weather_warnings (#93720)
* Add data coordinator

* Specify coordinator data type

* Apply code review changes
2023-05-30 20:22:27 -04:00
J. Nick Koston 3186ddb095 Speed up setting up event trackers (#93823)
noticed in https://github.com/home-assistant/core/pull/93601 that
the cost of creating the function in the closure was a bit expensive
since we do it once per entity
2023-05-30 20:12:52 -04:00
J. Nick Koston 9f0d3bfce8 Use ReadOnlyDict for entity registry options (#93824)
* Use ReadOnlyDict for entity registry options

While reviewing #93601 it was noticed this was slow at startup
https://github.com/home-assistant/core/pull/93601#issuecomment-1568958280

This is a first pass attempt to improve the performance

* fix tests
2023-05-30 20:11:39 -04:00
Stefan Agner 31e217a11e Update iotawattpy to use our own fork (#93830)
Unfortunately iotawattpy got dormant. Use our fork hosted at in the
[home-assistant-libs/iotawattpy](https://github.com/home-assistant-libs/iotawattpy)
repository and available on PyPI as ha-iotawatt instead.

The first release of the fork also contains a fix for issue #82869.
2023-05-30 20:03:21 -04:00
Yuxin Wang 0653aed49f Directly check string representation of sensor states in APCUPSD tests (#93783)
* Directly check the string representation of sensor states

* Fix expected state value for sensor.ups_nominal_output_power
2023-05-30 20:01:05 -04:00
Tudor Sandu fe472e6c5b Fix error if a custom_sentences file is empty (#93530)
* Fix #93528

* Log warning file is invalid

* More explicit log warning message

* Rewrite log message
2023-05-30 19:53:52 -04:00
Jesse Hills d7d9143a44 Add speech detection and conversation_id to esphome voice assistant (#93578)
* Add speech detection to esphome voice assistant

* Timeout after silence
Ensure events are sent before finish is called

* use va_version 3 instead of ESPHome version

* Convert repeated fixtures to factory

* Add some v3 tests

* Add conversation_id

* Bump aioesphomeapi to 13.8.0

* Fix missed buffering of detected chunk

* Alter log message

* Updates

* Spelling

* Fix return type
2023-05-30 19:49:22 -04:00
starkillerOG 49f10eecaa Fix false reolink ONVIF webhook warning (#91015) 2023-05-30 23:13:08 +02:00
Franck Nijhof 58259f1103 Get nightly intents from new intents-package repo (#93826)
Get nighlty intents from new intents-package repo
2023-05-30 16:10:08 -05:00
Ville Skyttä c7c4ee13c3 Import util.dt as dt_util in remaining tests, enforce with ruff (#93765)
* Import `util.dt` as `dt_util` in remaining tests, enforce with ruff

* Fix `util.dt` import in pvpc_hourly_pricing tests
2023-05-30 23:30:31 +03:00
Michael Hansen 1dcabae760 Don't skip chunk before speech (#93825) 2023-05-30 22:18:55 +02:00
Michael Hansen 9f4c9f1ce3 Bump intents to 2023.5.30 (#93822) 2023-05-30 22:11:08 +02:00
Mike Degatano c25b26214b Add docker config repair for supervisor issue (#93820) 2023-05-30 22:08:45 +02:00
Raman Gupta 05c3d8bb37 Add zwave_js node statistics sensors (#91714)
* Add node statistics sensors

* fix tests and don't let controller state leak across tests

* Add background RSSI

* Remove extra logging statement

* fix test

* comments

* setup platform once

* Add static properties to entity description

* Update homeassistant/components/zwave_js/sensor.py

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

* don't dupe attribute values in entity description

* fix exception

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-05-30 20:44:32 +02:00
Jan Bouwhuis 1e0770ff8a Add ssl_verify option to imap integration (#93811)
* Add ssl_verify option to imap integration

* Add test
2023-05-30 19:48:47 +02:00
Franck Nijhof 46d8885023 Use deployment environment in GitHub build actions (#93800) 2023-05-30 19:43:59 +02:00
J. Nick Koston 89cc57c0d6 Fix double state write on camera added to hass when rtsp_to_webrtc is present (#93806) 2023-05-30 19:43:48 +02:00
J. Nick Koston 17d1c0733d Remove outdated HAOS check from bluetooth (#93809) 2023-05-30 19:41:51 +02:00
G Johansson 105608792e Fix switch acting as toggle in Sensibo (#93810)
* Fix switch as toogle

* typing
2023-05-30 20:39:03 +03:00
Jan Bouwhuis 74741c7634 Fix imap advanced settings not shown (#93813) 2023-05-30 20:37:07 +03:00
Luke c678664d9a Add translations to Roborock fan speed (#93801) 2023-05-30 18:52:55 +02:00
Luke de3406c856 Add more information to Roborock Status (#93636)
Co-authored-by: Humberto Gontijo <humberto.gontijo@clevertech.biz>
2023-05-30 18:51:57 +02:00
Franck Nijhof 8e05e3850b Deprecate Python 3.10 (#93794) 2023-05-30 18:46:33 +02:00
Raman Gupta 65187c6f11 Add zwave config parameter entities (#92223)
* Add zwave config parameter entities

* Remove unused entity const

* remove unusued imports

* review comments

* switch to reserved values

* fix test
2023-05-30 11:49:55 -04:00
Erik Montnemery 55c2bb59c8 Fix race in rfxtrx config flow (#93804)
* Fix race in rfxtrx config flow

* Add timeout

* Use async_timeout.timeout
2023-05-30 17:45:33 +02:00
Raman Gupta 90bf5429ca Add support for Window Covering CC (#93314)
* Refactor zwave_js.cover and improve test coverage

* Remove extra fixtures

* cleanup old stuff

* Get coverage to 100

* Add support for Window Covering CC

* fix bug

* typo

* remove redundant stuff

* slight change to improve readability

* Add device class

* Update to match specs
2023-05-30 11:26:23 -04:00
PeteRager 6a8d18ab35 Sonos setup fails with unhandled exceptions on discovery messages (#90648)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-05-30 10:09:13 -05:00
Erik Montnemery 11299c4537 Deduplicate Thread datasets based on EXTPANID (#93795)
* Deduplicate Thread datasets based on EXTPANID

* Apply suggestions from code review
2023-05-30 16:16:56 +02:00
Erik Montnemery d05d67414a Teach search about blueprints (#78535) 2023-05-30 15:04:35 +02:00
Franck Nijhof 24e1243da7 Delay release of HA Python release until Docker is ready (#93798) 2023-05-30 14:39:19 +02:00
Diego Rodríguez Royo 1a9da67a28 Add tilt support to Matter cover (#92256) 2023-05-30 13:05:14 +02:00
Erik Montnemery 16d8c8d4d5 Bump python-otbr-api to 2.1.0 (#93790)
* Bump python-otbr-api to 2.1.0

* Fix tests
2023-05-30 12:47:46 +02:00
Franck Nijhof 4596ff0ce5 Merge branch 'master' into dev 2023-05-30 12:13:15 +02:00
Brandon Rothweiler c513934f25 Fix broken URL in MQTT discovery log message (#93778) 2023-05-30 11:39:55 +02:00
Álvaro Fernández Rojas 2df49b416c Add WebServer sensors to Airzone Cloud (#93757) 2023-05-30 10:23:14 +02:00
Erik Montnemery 901624ad6f Adapt otbr to upstream openthread REST API changes (#93544)
* Adapt otbr to upstream openthread REST API changes

* Bump python-otbr-api to 2.0.0
2023-05-30 10:11:21 +02:00
G Johansson 49ae298c55 Use entity attributes in Obihai sensor (#93564) 2023-05-30 08:35:47 +02:00
J. Nick Koston c25ccb90a4 Speed up creating automations (#93776)
Creating the inner coroutine for each automation to be run at started
was expensive when the user had 1000s of automations
2023-05-29 22:51:35 -05:00
Luke c129b4d0c2 Remove unneeded icon for Roborock sensor (#93774)
removed unneeded icon
2023-05-29 22:45:53 -04:00
Allen Porter 01a6173cc9 Fix failing todoist test that used timezone before set by fixture (#93775)
* Fix failing todoist test that used timezone before set by fixture

* Merge fix for dt -> dt_util
2023-05-29 22:45:22 -04:00
Marc Mueller 4cbbfaf55a Update pydantic to 1.10.8 (#93772) 2023-05-29 20:48:26 -05:00
J. Nick Koston cc107bd0b7 Add a filter to the tasmota device registry listener (#93640)
We can avoid creating a task when the event is not
a remove which will be most cases
2023-05-29 20:59:51 -04:00
J. Nick Koston 493d78f070 Avoid dict comp in statistic_during_period if there is no conversion (#93699) 2023-05-29 20:59:15 -04:00
J. Nick Koston 53fe74e055 Reduce overhead to fetch integrations (#93767)
We call this path over and over during startup and most
of the time the integration is already loaded. We want
that case to be the short path
2023-05-29 20:58:51 -04:00
rikroe 1ea202a5bc Add charging switch to BMW Connected Drive (#93737)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-29 23:48:13 +02:00
mover85 07dd34b04a Bump pydaikin 2.9.1 (#93635) 2023-05-29 23:44:05 +02:00
J. Nick Koston b063a54295 Reduce overhead to match homekit zeroconf discoveries (#93753) 2023-05-29 23:42:12 +02:00
Joost Lekkerkerker df6317f65e Add entity name translations to Buienradar (#91511)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-29 23:36:53 +02:00
rikroe 52ef4a3b75 Ensure state update after BMW remote service execution (#93745)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-29 23:28:06 +02:00
Raman Gupta 24290e5d08 Add datetime platform (#81943)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-05-29 23:24:15 +02:00
Ville Skyttä 940942a74a Import util.dt as dt_util in components/[p-s]* (#93761) 2023-05-30 00:09:42 +03:00
Ville Skyttä 2e59ae9e90 Import util.dt as dt_util in components/[k-o]* (#93760) 2023-05-29 23:02:14 +02:00
Ville Skyttä ced67e5800 Import util.dt as dt_util in components/[a-d]* (#93756) 2023-05-30 00:02:06 +03:00
Ville Skyttä 5aadd7ffc9 Import util.dt as dt_util in components/[g-i]* (#93759) 2023-05-30 00:01:00 +03:00
Ville Skyttä 1ce74ba25c Import util.dt as dt_util in components/[t-z]* (#93763) 2023-05-29 23:00:43 +02:00
Ville Skyttä 70c49824d7 Import util.dt as dt_util in components/[e-f]* (#93758) 2023-05-30 00:00:11 +03:00
Álvaro Fernández Rojas 6aa01e1441 Add Aidoo sensors to Airzone Cloud (#93541) 2023-05-29 21:58:53 +02:00
Erik Montnemery 8b662dc94f Detect attempt to setup config entry integration via YAML (#93589) 2023-05-29 21:01:47 +02:00
Erik Montnemery ef68f2c3ff Add empty config schema to integrations d-h (#93645) 2023-05-29 21:00:08 +02:00
Erik Montnemery 9c01ea003c Add empty config schema to integrations i-o (#93698) 2023-05-29 20:58:00 +02:00
Erik Montnemery 8896b27f70 Add empty config schema to integrations p-s (#93700) 2023-05-29 20:57:18 +02:00
J. Nick Koston 6cc5bee960 Fix onvif setup failing when unable to parse camera time (#93677) 2023-05-29 20:53:52 +02:00
J. Nick Koston 2f1f32f0bb Make unit converter use a factory to avoid looking up the ratios each conversion (#93706) 2023-05-29 20:50:40 +02:00
Jerome Garec 7f3f2eea38 Add overkiz control for ATLANTIC_PASS_APC_HEATING_ZONE (#93712) 2023-05-29 20:42:46 +02:00
J. Nick Koston 9443ca89bc Handle exceptions to prevent disconnect when esphome state subscription raises (#93723) 2023-05-29 20:41:50 +02:00
Yuxin Wang a547181984 Fix unit inference for ITEMP field for APCUPSD integration (#93724) 2023-05-29 20:40:36 +02:00
J. Nick Koston 17fadbcf4a Reduce overhead to update unifiprotect entity (#93725) 2023-05-29 20:39:34 +02:00
Erik Montnemery 8053073a77 Add empty config schema to integrations a-c (#93608) 2023-05-29 14:38:33 -04:00
G Johansson 171ce747c1 Remove nextcloud YAML configuration (#93550) 2023-05-29 20:33:29 +02:00
Ville Skyttä f5cba290ad Access datetime.datetime and .time directly in caldav (#93688) 2023-05-29 20:27:47 +02:00
Álvaro Fernández Rojas a3ce1ac497 Fix possible KeyError exception in Airzone Cloud (#93747)
airzone_cloud: fix KeyError for Aidoo installations

Some Airzone Cloud installations might be limited to Aidoo devices. In that
case, the library will provide AZD_AIDOOS, but it won't provide AZD_ZONES,
resulting in a KeyError exception.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-29 13:22:42 -05:00
Joakim Plate 067fc079a3 Don't mock non async with AsyncMock (#93749) 2023-05-29 20:20:27 +02:00
Joakim Plate 617ff24b9b Fix missed case for device tuple fallback in rfxtrx (#93575)
* rfxtrx: add missed case for device tuple fallback

Previously the code was prepared for a backward compatible
migration of tuples, where both styles of identifiers might exist
in device registry at the same time.

This place was sadly missed

* No need to raise special, we can assert instead

* Add some basic tests
2023-05-29 19:59:11 +02:00
G Johansson e1ef027461 Address late review comments for Command Line (#93743)
* Late review comments

* Rephrase
2023-05-29 19:45:42 +02:00
Stephan Uhle 64ee1e8e43 Bump pysml to 0.0.12 (#93686) 2023-05-29 19:41:32 +02:00
Luke 3b4273d018 Add Roborock Clean time sensors (#93637)
* add clean time information

* add sensor test

* update to cleaning time

* fix sensor test
2023-05-29 09:40:35 -07:00
J. Nick Koston 3c5475a558 Drop codeowner for radiotherm (#93744) 2023-05-29 18:03:36 +02:00
mkmer b42a5bab89 Bump Blinkpy to 0.21.0 (#93735) 2023-05-29 17:48:08 +02:00
J. Nick Koston db931132a8 Fix thread leak in onvif discovery (#93742) 2023-05-29 17:06:13 +02:00
J. Nick Koston 3db59908ca Switch mqtt to use async_track_device_registry_updated_event (#93603) 2023-05-29 09:43:01 -05:00
Jan Bouwhuis c44a7fe358 Do not trigger reload when unloading or reloading MQTT entry (#93588)
* Do not trigger reload when unloading MQTT entry

* More cleanup

* cleanup async_reload_manual_mqtt_items

* Add test

* Improve test

* Remove unuse mocks from test

* Add discovery item in test
2023-05-29 15:44:09 +02:00
G Johansson 46e7486ce6 Move yaml configuration to integration key for command_line (#92824)
* Inital init commit

* bs and cover

* notify

* sensor

* switch

* Issues

* Finalize __init__

* First pass tests

* Fix Binary sensors

* Test cover

* Test notify

* Test sensor

* Tests switch

* Fix coverage

* Add codeowner

* Fix caplog

* test issue

* Flaky test notify

* Fix async

* Adjust yaml structure

* Change yaml format again

* Issue strings

* Fix tests

* string review comment
2023-05-29 08:00:50 +02:00
Joost Lekkerkerker 20d1a0fc77 Add Options flow to YouTube (#93667)
* Add Options flow to YouTube

* Add strings for options flow

* Add strings for options flow

* Add strings for options flow
2023-05-28 21:44:45 -04:00
Marvin Wichmann 795ef075da Restore original websocket commands for config entries (#93707)
Restore original websocket commands and add "config_entries/get_single"
2023-05-28 21:40:35 -04:00
Erik Montnemery 5f584d5dbd Fix typo in switcher_kis (#93702) 2023-05-28 22:39:41 +02:00
G Johansson c6feb30c31 Raise issue "does not support platform setup" (#93585)
* Raise issue on platform missing

* Modify issue

* Remove deprecation

* Fix strings

* Strings

* Last strings

* strings to common
2023-05-28 21:53:32 +02:00
Joost Lekkerkerker 68c646be40 Improve async youtube (#93685)
* Improve async youtube

* Improve async youtube
2023-05-28 08:48:43 -07:00
Erik Montnemery 25b5ad7de4 Fix typo in ping (#93701) 2023-05-28 10:11:46 -05:00
J. Nick Koston 083cf7a38b Fix refactoring error with updating polling entities in sequence (#93693)
* Fix refactoring error with updating in sequence

see #93649

* coverage

* make sure entities are being updated in parallel

* make sure entities are being updated in sequence
2023-05-28 16:20:48 +02:00
Erik Montnemery 49c3a8886f Make cv.empty_config_schema log an error instead of raise (#93646)
* Make cv.empty_config_schema log an error instead of raise

* Add test

* Update homeassistant/helpers/config_validation.py

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>

---------

Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
2023-05-28 15:54:22 +02:00
Matthias Alphart 7ff1c79514 Update xknx to 2.10.0 and knx-frontend to 2023.5.28.94855 (#93694) 2023-05-28 15:22:38 +02:00
Jan Bouwhuis 4c0d169cfc Fix imap parsing non rfc compliant date crash (#93630)
* Fix imap parsing non rfc compliant date crash

* Use parsedate_to_datetime from mail.utils
2023-05-28 13:28:11 +02:00
Joost Lekkerkerker 202c9071a4 Improve Youtube integration (#93683)
* Fix feedback

* Fix feedback
2023-05-28 10:52:30 +02:00
Sven Serlier 41882d833d Update dialogflow URL (#93616)
Update URL
2023-05-28 08:52:52 +02:00
Erik Montnemery 02b76be0ba Use config entry setup in cast tests (#93595)
* Use config entry setup in cast tests

* Remove import step from config flow

* Remove import tests

* Fix tests
2023-05-27 21:07:54 -04:00
Joost Lekkerkerker fad3a4e168 Improve OpenSky typing (#93666)
* Add types to OpenSky

* Update .strict-typing

* Add types to OpenSky
2023-05-27 20:58:04 -04:00
J. Nick Koston 5f5951e71c Add hardware model to onvif config flow discovery (#93676) 2023-05-27 19:47:13 -05:00
Joost Lekkerkerker f3037d0b84 Add reauth flow to Youtube (#93670) 2023-05-27 20:29:18 -04:00
J. Nick Koston cc12698f26 Make diagnostics dataclasses sloted (#93600)
Now available since our minimum python version is 3.10

Saves a tiny bit of ram
2023-05-27 20:04:39 -04:00
J. Nick Koston 0a9c4f15c4 Add event helper to dispatch device registry updates by device_id (#93602)
* Add event helper to dispatch device registry updates by device_id

* Update homeassistant/helpers/event.py

* dry

* dry

* reduce

* reduce

* reorder

* reduce

* cleanup stack depth

* dry

* fix double lookup

* remove unused

* collapse
2023-05-27 20:04:09 -04:00
J. Nick Koston e1b7d68134 Speed up processing subscribe_events and subscribe_entites when user has read all permissions (#93611)
Speed up processing subscribe_events and subscribe_entites when user the read all permissions
2023-05-27 19:59:46 -04:00
J. Nick Koston 67d9fa8b22 Disable call_soon for device tracker device registry updates (#93638)
Run device tracker device registry updates immediately
without the call_soon delay. This listener does not
need a delay and it only adds overhead in this case.
2023-05-27 19:58:27 -04:00
J. Nick Koston b966ff7a3d Await in sequence when we know we will be blocked by the entity platform semaphore (#93649)
* Defer creating tasks we know are going to wait on the entity platform semaphore

When looking at whats going on with aiomonitor-ng, I noticed
we end up creating a lot of tasks that block waiting for the
executor because of the entity platform parallel_updates semaphore.

When we know the tasks are going to block we now await them
in sequence to avoid feeding the loop a herd of tasks that
will block on the semaphore

* change during iteration fix

* change during iteration fix

* cleanup

* cleanup

* fix vizio test
2023-05-27 19:58:02 -04:00
J. Nick Koston a56b5994e5 Disable polling for samsungtv remote entities (#93650)
These entities do not have a defined state, there is no reason to poll
2023-05-27 19:55:48 -04:00
J. Nick Koston 460d04fc07 Disable polling on energy sensors (#93651)
These sensors do not implement async_update so no
polling is needed
2023-05-27 19:54:40 -04:00
J. Nick Koston 5feceee588 Improve performance when serializing small bits of JSON (#93653)
* Improve performance when serializing small bits of JSON

Making json_bytes a partial reduced the run time to
build the small JSON messages by ~18.75%

We serialize a lot of small messages over the websocket

* typing
2023-05-27 19:53:52 -04:00
J. Nick Koston c721cbd10c Collapse valid state check when creating a state (#93655)
Inline valid state check when creating a state

This was added in #9696 and only used in one place so
it does not need to be another function
2023-05-27 19:53:08 -04:00
J. Nick Koston 560e744f1e Reduce overhead to filter entities in the recorder (#93656)
* Reduce overhead to filter entities in the recorder

* fix type
2023-05-27 19:52:42 -04:00
J. Nick Koston 5a0b25479e Use httpx instead of requests for mjpeg camera images that need digest to avoid jump to executor (#93244)
* Use httpx instead of requests for mjpeg camera images that need digest

Avoids jump to executor

* Use httpx instead of requests for mjpeg camera images that need digest

Avoids jump to executor

* stream as well

* fix

* fix
2023-05-27 19:46:46 -04:00
J. Nick Koston 3a1389c3b4 Switch some frequently called call_laters to call_at (#93659)
* Switch some frequently called call_laters to call_at

call_at is a bit faster than call_later since call_later
is a wrapper around call_at.

We call at lot of these at startup so it helps a bit when
we are resource constrained

* update test

* update test
2023-05-27 19:45:35 -04:00
Álvaro Fernández Rojas 94ad9643b5 Update aioairzone to v0.6.1 (#93629) 2023-05-27 18:25:49 -05:00
Joost Lekkerkerker e4c51d43f0 Add YouTube integration (#92988)
* Add YouTube stub

* Add YouTube stub

* Add YouTube stub

* Add YouTube stub

* Add Youtube stub

* Add Youtube stub

* Add tests

* Add tests

* Add tests

* Clean up

* Add test for options flow

* Fix feedback

* Fix feedback

* Remove obsolete request

* Catch exceptions

* Parallelize latest video calls

* Apply suggestions from code review

Co-authored-by: Robert Hillis <tkdrob4390@yahoo.com>

* Add youtube to google brands

* Fix feedback

* Fix feedback

* Fix test

* Fix test

* Add unit test for http error

* Update homeassistant/components/youtube/coordinator.py

Co-authored-by: Robert Hillis <tkdrob4390@yahoo.com>

* Fix black

* Fix feedback

* Fix feedback

* Fix tests

---------

Co-authored-by: Robert Hillis <tkdrob4390@yahoo.com>
2023-05-27 11:21:12 -07:00
Aaron Godfrey bb170a2bbf Fix todoist end time for tasks with due date in the future (#91874)
Fix end time for tasks with due date in the future.

Co-authored-by: Allen Porter <allen@thebends.org>
2023-05-27 10:09:11 -07:00
Artem Draft c5e425d075 Bump androidtvremote2 to 0.0.9 (#93634) 2023-05-27 09:49:57 +02:00
Raj Laud 236ee8be04 Bump pysqueezebox to 0.6.2 (#93573) 2023-05-26 14:53:40 -05:00
Erik Montnemery d4462829f5 Add CONFIG_SCHEMA to analytics (#93598) 2023-05-26 16:29:32 +02:00
Paul Frank 0bf9bb15f6 Use entity attributes in mystrom (#93591)
* Migrated proprties to _attr_

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/light.py

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

* Update homeassistant/components/mystrom/switch.py

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

* Update homeassistant/components/mystrom/switch.py

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

* review comment

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-26 16:22:59 +02:00
Erik Montnemery 5671934b34 Fix sharkiq tests (#93597) 2023-05-26 15:35:06 +02:00
Erik Montnemery 5b654c8b79 Fix mill tests (#93596) 2023-05-26 15:20:46 +02:00
Bram Kragten b51f82719e Update frontend to 20230526.0 (#93581) 2023-05-26 12:39:52 +02:00
G Johansson af9ee8bc4a Remove obihai YAMl configuration (#93549) 2023-05-26 08:41:21 +02:00
G Johansson 1f467fcc6a Remove EDL21 YAML configuration (#93551) 2023-05-26 08:38:44 +02:00
G Johansson 3633062024 Remove platform yaml Frontier Silicon (#93552) 2023-05-26 08:24:08 +02:00
Jan Bouwhuis d852ba8b09 Remove redundant stub_blueprint_populate fixture for MQTT integration (#93570)
Remove redundant stub_blueprint_populate fixture
2023-05-26 08:13:45 +02:00
Jan Bouwhuis ec98e22330 Add type hints for stub_blueprint_populate fixture (#93568)
Add typehints for stub_blueprint_populate fixture
2023-05-26 08:13:13 +02:00
Franck Nijhof 9e53bca452 Add entity name translations to Rituals Perfume Genie (#92549) 2023-05-26 08:09:29 +02:00
J. Nick Koston 88893121a1 Increase timeout for test_purge_many_old_events (#93579) 2023-05-25 22:38:44 -05:00
J. Nick Koston 48485fc2bf Complete persistent notifications migration (#92828)
* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* Complete migration of persistent notifications

Persistent notifications are no longer stored in
the state machine and no longer fire events

* fixes

* fixes

* fixes

* ws test

* update tests

* update tests

* fix more tests

* fix more tests

* more fixes

* fix

* fix person

* fix person

* keep whitelist

* use singleton
2023-05-25 23:09:13 -04:00
J. Nick Koston e2b69fc470 Significantly improve performance of conversation default_agent listening for new states (#93577)
Use the async_track_state_added_domain helper instead of tracking
all state changes and rejecting them as it is already optimized
for this job
2023-05-25 23:04:38 -04:00
J. Nick Koston f251c464e2 Fix history start time state returning None with some postgresql versions (#93555)
* Add additional coverage to history websocket api

related issue #93258

* Add additional coverage to history websocket api

related issue #93258

* Fix results when union query ends up at the end instead of front

* Apply suggestions from code review

* resort

* zero instead

* fix exception

* fix tests
2023-05-25 22:18:19 -04:00
J. Nick Koston 61e57872c3 Fix not retrying on connection reset during nexia config entry setup (#93576)
* Fix not retrying on connection reset during nexia config entry setup

fixes
```
2023-05-26 00:15:39.129 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry Alexander for nexia
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 558, in _request
    resp = await req.send(conn)
           ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client_reqrep.py", line 670, in send
    await writer.write_headers(status_line, self.headers)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 130, in write_headers
    self._write(buf)
  File "/usr/local/lib/python3.11/site-packages/aiohttp/http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/nexia/__init__.py", line 47, in async_setup_entry
    await nexia_home.login()
  File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 385, in login
    request = await self.post_url(self.API_MOBILE_ACCOUNTS_SIGN_IN_URL, payload)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/nexia/home.py", line 157, in post_url
    response: aiohttp.ClientResponse = await self.session.post(
                                       ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/aiohttp/client.py", line 572, in _request
    raise ClientOSError(*exc.args) from exc
aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport
```

* coverage
2023-05-25 21:52:44 -04:00
J. Nick Koston d9b43fc43f Significantly speed up recorder event listener (#93532)
* Significantly speed up recorder event listener

This code is called every time an event happens since it
subscribes to all events. Its our most frequently called
listener out of the box.

It used to have a seperate filter function but it was
later combined after core had some previous refactoring.

It was never optimized after that happened.

This change reduces the run time by ~70%

* decruft
2023-05-25 21:44:12 -04:00
J. Nick Koston 10aa49be2b Speed up async_active_zone by avoiding dict lookups (#93427)
Speed up async_active_zone by avoding dict lookups
2023-05-25 21:37:18 -04:00
Justin Vanderhooft accee4b5ef Add support for configuring built-in Melnor Bluetooth scheduling system (#93333) 2023-05-25 20:06:22 -05:00
Maciej Bieniek e6a214595b Avoid KeyError when specifying the consumption type in Shelly integration (#93561)
Avoid KeyError when specifying the consumption type
2023-05-25 23:12:25 +02:00
Maciej Bieniek eb058a3d41 Add illuminance sensor for Shelly gen2 devices (#93559) 2023-05-25 23:10:44 +02:00
starkillerOG f5358d3863 Bump reolink-aio to 0.5.16 (#93540) 2023-05-25 22:15:33 +02:00
Artem Draft 70e20815c7 Mark as assumed_state LG Netcast media player (#93543)
Mark as assumed_state LG Netcast media player
2023-05-25 22:47:13 +03:00
Erik Montnemery a71c097aeb Revert "Allow setting an entity's name by its device class" (#93539) 2023-05-25 17:20:54 +02:00
Álvaro Fernández Rojas f7404e2ee0 Update aioairzone-cloud to v0.1.6 (#93513) 2023-05-25 17:18:28 +02:00
J. Nick Koston 25a33b6b37 Bump zeroconf to 0.63.0 (#93533)
changelog: https://github.com/python-zeroconf/python-zeroconf/compare/0.62.0...0.63.0

performance improvements
2023-05-25 16:52:31 +02:00
Dominik eb617e85f3 Use DEFAULT_SCAN_INTERVAL as update interval for glances (#93535)
Use default scan interval constant
2023-05-25 16:51:57 +02:00
Philip Peitsch 6c66af4e41 Add ability to send custom keys to Samsung TV (#83439)
* Add SamsungTV Remote entity with support for turn-off and send command

* Fix SamsungTV remote tests
2023-05-25 15:55:44 +02:00
Joost Lekkerkerker a96215bf2e Lastfm config flow (#92299)
* Move constant values to separate file

* Move constant values to separate file

* Add config flow to lastfm

* Add tests

* Add config flow to lastfm

* Add tests

* Add tests

* Add tests

* Add extra form for main user and autofill with friends

* Add extra form for main user and autofill with friends

* Add extra form for main user and autofill with friends

* Add extra form for main user and autofill with friends

* Add OptionsFlow

* Add tests

* Fix feedback

* Fix feedback

* Fix feedback

* Fix feedback

* Fix test

* Apply suggestions from code review

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

* Update config_flow.py

* Update config_flow.py

* Update config_flow.py

* Update homeassistant/components/lastfm/config_flow.py

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

* Add tests

* Cleanup

* Update config_flow.py

* Update config_flow.py

* Update config_flow.py

* Fix test

* Fix feedback

* Codeowner lastfm

* Fix feedback

* Fix feedback

* Parametrize errors

* Parametrize errors

* Parametrize errors

* Finish tests

---------

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-05-25 14:48:16 +02:00
J. Nick Koston e09e4f14d6 Speed up setting state (#93472) 2023-05-25 07:34:07 -05:00
Erik Montnemery 3cca338c6e Improve blueprint test fixtures (#93519) 2023-05-25 13:45:19 +02:00
badewanne1234 393dbb6dc0 Fix of cover-tilt in homekit_controller (#91631)
* Fix of cover-tilt in homekit_controller

* Fix of cover-tilt and its tests
2023-05-25 12:41:42 +02:00
IceBotYT 9231010402 Code quality improvements and debug logs for LaCrosse View (#91979)
* Code quality improvements and debug logs for LaCrosse View

* Remove unrelated files

* Remove version bump

* Revert "Remove version bump"

This reverts commit ed440899f9.

* Revert "Remove unrelated files"

This reverts commit d9b48ae4f9.
2023-05-25 12:37:16 +02:00
Erik Montnemery 3fc0c9a325 Improve TTS test fixtures (#93517) 2023-05-25 11:59:20 +02:00
Dara Adib e2daffc117 Fix exception handling in Microsoft TTS (#92556)
pycsspeechtts uses the requests library, but Microsoft TTS previously
caught HTTPException from the standard library. This is changed to
catch requests.HTTPError and return `(None, None)` consistent with
other TTS integrations. This will properly raise HomeAssistantError
for display in the frontend.

Follow up to PR #92215 which adds tests for Microsoft TTS.
2023-05-25 11:29:13 +02:00
starkillerOG 4ef315b32a Add Kodi keypress event (#93321)
* Add keypress events

* Fix styling

* fix tests

* improve tests

* Revert device trigger

* Add entity_id to event for ease of filtering
2023-05-25 11:11:29 +02:00
RenierM26 f86cc34644 Add Ezviz number entity (#93366)
* Initial commit

* Add number entity.

* update coveragerc

* Add services back and add depreciation repair.

* Remove redundant typing declaration.

* Case change in strings.

* Apply cleanups from simular pull request.

* Commit suggestions.
2023-05-25 11:09:47 +02:00
Jan Bouwhuis 1b5d207984 Add imap custom event data template (#93423)
* Add imap custom event template

* Add template validation
2023-05-25 11:05:25 +02:00
Álvaro Fernández Rojas 6cd766ef1f Add Airzone Cloud diagnostics (#93465)
* airzone_cloud: add diagnostics support

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

* airzone_cloue: remove unused import

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

* airzone_cloud: diagnostics: redact additional API keys

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-25 11:04:57 +02:00
Dara Adib 663f66a2b2 Scrape Microsoft TTS supported languages (#91988)
* Update Microsoft TTS supported languages

`script.microsoft_tts` scrapes Microsoft Azure documentation for
the list of supported languages and saves them to
`homeassistant.generated.microsoft_tts` for use in the component.

This adds support for more TTS languages, like fa-ir (Persian).

* Improve xpath query for Microsoft TTS languages

* Remove asserts for Microsoft TTS languages

* Add more tests for Microsoft TTS languages
2023-05-25 10:46:34 +02:00
disaster37 6e8472b90f Fix/arest switch (#91553)
* Fix arest switch to set output when connection is lost

Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>

* fix: lint

Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>

---------

Signed-off-by: disaster37 <linuxworkgroup@hotmail.com>
2023-05-25 10:45:15 +02:00
Matrix e744632164 YoLink Power Failure Alarm (#91934)
* add ys-7106

* expose mute property

* add volume entity description

* add beep entity description

* fix as suggest
2023-05-25 10:44:51 +02:00
dependabot[bot] 6df44ff5d5 Bump actions/setup-python from 4.6.0 to 4.6.1 (#93512)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4.6.0...v4.6.1)

---
updated-dependencies:
- dependency-name: actions/setup-python
  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>
2023-05-25 09:48:52 +02:00
Marc Mueller 64118ee011 Improve hydrawise typing (#93503)
* Improve hydrawise generic typing

* Enable strict typing

* Remove unused code
2023-05-25 07:58:59 +02:00
J. Nick Koston f8d918ca4a Small speedup to unifiprotect attribute lookups (#93507) 2023-05-25 07:51:45 +02:00
J. Nick Koston c63e3c3bf1 Update prometheus tests to avoid patching utcnow (#93505) 2023-05-25 07:15:14 +02:00
Marcel van der Veldt 2bb46c8a9e Fix for missing/corrupt names of Matter devices (#92073)
* Fix missing names on some devices/bridges

* guard for None devicetype (just in case)

* Update homeassistant/components/matter/adapter.py

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

* Update homeassistant/components/matter/adapter.py

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

* Update homeassistant/components/matter/adapter.py

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

* Update homeassistant/components/matter/adapter.py

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

* black and isort

* Code quality

* Add tests

* Add coverage test, add None for empty string

---------

Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
Co-authored-by: jbouwh <jan@jbsoft.nl>
2023-05-25 03:50:13 +02:00
Michał Modzelewski 33387bf418 Readable paired device names for Apple TV airplay and companion protocols (#93449)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-05-24 20:07:49 -05:00
J. Nick Koston 7ec6e03d5d Update sensor tests to avoid patching utcnow (#93497) 2023-05-24 19:54:08 -05:00
Michał Modzelewski d5e09bd4c3 Support volume level push updates in apple_tv integration (#93496) 2023-05-24 18:28:29 -05:00
J. Nick Koston 9dcd73b308 Update recorder tests to avoid patching utcnow (#93489) 2023-05-24 17:47:42 -05:00
J. Nick Koston f8d8f5caba Update statistics tests to avoid patching utcnow (#93499) 2023-05-24 17:38:38 -05:00
J. Nick Koston f5eb872eaf Update state helper test to avoid patching utcnow (#93484) 2023-05-24 17:38:09 -05:00
J. Nick Koston ee62584570 Add constraint for pyminiaudio to 1.57 (#93501) 2023-05-24 17:03:37 -05:00
J. Nick Koston 40a47c72f4 Update history tests to avoid patching utcnow (#93487) 2023-05-24 16:09:26 -05:00
J. Nick Koston 45b1ad36b1 Bump onvif-zeep-async to 3.1.8 (#93464) 2023-05-24 15:38:54 -05:00
J. Nick Koston 0160c8c14f Update switch tests to avoid patching utcnow (#93491) 2023-05-24 15:28:38 -05:00
J. Nick Koston bf2c12dcf2 Update remote tests to avoid patching utcnow (#93492) 2023-05-24 15:28:22 -05:00
J. Nick Koston 33c2cb9895 Fix integration trapezoidal test (#93494) 2023-05-24 15:24:15 -05:00
J. Nick Koston 41aa3e223e Update light tests to avoid patching utcnow (#93490) 2023-05-24 15:21:40 -05:00
J. Nick Koston 1f5916cb4d Update statistics tests to avoid patching utcnow (#93485) 2023-05-24 14:53:33 -05:00
Raman Gupta f0874791d8 Refactor zwave_js.cover (#93433)
* Refactor zwave_js.cover and improve test coverage

* Remove extra fixtures

* cleanup old stuff

* Get coverage to 100

* Remove redundant stuff

* Revert all changes to tests

* Update conftest.py
2023-05-24 15:37:33 -04:00
Luke 46c63dd70b Fix Roborock Sensor test failing (#93488)
fix roborock sensors
2023-05-24 21:35:05 +02:00
Álvaro Fernández Rojas f5a235beee Fix Airzone min/max climate temperatures (#93161)
* airzone: climate: fix max/min temps

The library now provides AZD_ABS_TEMP_MAX/AZD_ABS_TEMP_MIN which are useful for
devices with different max/min temperatures depending on the current working
mode (HEAT vs COOL).
These new values will have the highest/lowest max/min of both modes.
Until now, the max/min of the current working mode (HEAT/COOL) would be set
when starting Home Assistant, limiting the temperature range if the device
mode was changed after that.

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

* airzone: climate: update max/min temps

Some devices have different max/min climate temps depending on the active
mode (HEAT vs COOL), so we should update these values.

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

* Revert "airzone: climate: update max/min temps"

This reverts commit 988194d486.

* Revert "Revert "airzone: climate: update max/min temps""

This reverts commit e4ead24f71.

* tests: airzone: add max/min climate changes test

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

* tests: airzone: fix dict copy

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-24 21:18:59 +02:00
J. Nick Koston 5c6ed8f6d5 Use call_at for events instead call_later (#93431)
Co-authored-by: Jan Bouwhuis <jbouwh@users.noreply.github.com>
2023-05-24 21:04:07 +02:00
Erik Montnemery 30d9d7d905 Minor adjustment of tts typing (#93450) 2023-05-24 21:02:55 +02:00
Erik Montnemery 68379dd55a Improve TTS cache dir mocking (#93468) 2023-05-24 21:00:35 +02:00
epenet 6057aeee2f Prevent NumberEntity and RestoreEntity inheritance (#93467) 2023-05-24 20:59:14 +02:00
J. Nick Koston dc3826f68e Update generic_hygrostat tests to avoid patching utcnow (#93476) 2023-05-24 20:57:56 +02:00
J. Nick Koston cff72f9653 Update derivative tests to avoid patching utcnow (#93477) 2023-05-24 20:54:50 +02:00
J. Nick Koston 70c1fe8c6c Update integration tests to avoid patching utcnow (#93480) 2023-05-24 20:54:11 +02:00
Luke 8dd9482bb5 Add Roborock Consumable sensors (#91972)
* add sensors to roborock

* add value_fn typing

* fixed strings

* Update homeassistant/components/roborock/sensor.py

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

* change to work time instead of time left

* added time left back

* fixed tests

* made diagnostic

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-05-24 20:31:02 +02:00
J. Nick Koston e80579e52f Update generic_thermostat tests to avoid patching utcnow (#93479) 2023-05-24 13:17:28 -05:00
J. Nick Koston da5ad4a17d Update binary_sensor tests to avoid patching utcnow (#93474) 2023-05-24 13:17:11 -05:00
Raman Gupta 3e84c374f4 Improve zwave.cover tests (#93458)
* Improve zwave.cover tests

* Update conftest.py
2023-05-24 18:51:15 +02:00
J. Nick Koston 08c8c22fac Fix non threadsafe call in xiaomi_aqara again (#93461)
Fix non threadsafe call in xiaomi_aqara

The original fix in #93405 was ineffective and only moved the problem

fixes #93400
2023-05-24 18:21:44 +02:00
Martin Malina d2d21b4158 Show current day in met weather forecast (#91891)
Version 0.10.0 of pyMetno added the option
to defined range_start when calling get_forecast:
https://github.com/Danielhiversen/pyMetno/pull/35/files

So let's use that to include today in the forecast.
2023-05-24 16:07:59 +02:00
Vova-SH f8fdeeabc2 Add resize_keyboard and one_time_keyboard attributes to telegram bot service (#91613)
* Add new params for telegram bot

Add resize_keyboard and one_time_keyboard attributes

* Apply review changes

* Update homeassistant/components/telegram_bot/__init__.py

* Update __init__.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-24 16:07:22 +02:00
starkillerOG 16780bf4c2 Prevent firmware update error when internet blocked for Reolink camera (#91738)
* Prevent firmware update error when internet blocked

* fix styling

* switch back to async_config_entry_first_refresh

* fix still raising when starting

* missing return

* Catch CancelledError
2023-05-24 15:16:35 +02:00
MarkGodwin e97b331942 Add gateway WAN/LAN port connectivity entities to TP-Link Omada (#91905)
* Add gateway WAN/LAN port status entities

* Fix copy pasta comments

* Add omada binary_sensor to coveragerc
2023-05-24 15:12:51 +02:00
Raman Gupta 872cd47e87 Add proper support for zwave_js Indicator CC (#90248)
* Add proper support for zwave_js Indicator CC

* remove stale test

* Make all indicators diagnostic

* only set entity category if it is specified

* Only set properties from discovery if specified

* Conditionally set assumed state as well

* fix const name

* Don't create task

* Disable property keys 3-5 by default

* add additional dispatcher_connects so we catch all signals

* be consistent about order

* rename new discovery parameter

* comment

* exclude property keys 3-5

* fix remove logic

* add comment so I don't forget

* Switch entity category to config where necessary

* cut line

* less lines

* Update homeassistant/components/zwave_js/switch.py

Co-authored-by: kpine <keith.pine@gmail.com>

* Move async_remove to respond to interview started event

* Set up listener immediately so we don't wait for platform creation

* remove dupe import

* black

* append

---------

Co-authored-by: kpine <keith.pine@gmail.com>
2023-05-24 09:09:38 -04:00
Raman Gupta 66f7218b68 Do optimistic state update for Z-Wave multilevel switch entities (#90490)
* Do optimistic state update for Z-Wave multilevel switch entities

* simplify

* define constant for setting value to previous value

* Rework to only consider value of 255 and only places where we know that the previous state is known by the integration due to the service being called

* missed commit

* better code

* Add tests and use constant from lib

* fix logic

* fix bug

* Add comments with more details
2023-05-24 09:04:11 -04:00
Raman Gupta 3e93dd6a01 Update name for Notification CC sensors and buttons (#93019)
* Update name for Notification CC sensors and buttons

* Add comment with reference to names
2023-05-24 09:00:37 -04:00
rappenze 83f206a6fe Code cleanup: Separate fibaro scene logic (#91895)
* Code cleanup fibaro scene

* Remove duplicated code

* Fixes
2023-05-24 14:57:35 +02:00
rappenze 11accd8ba7 Set available state in fibaro integration (#91893) 2023-05-24 14:54:10 +02:00
Aaron Godfrey 89f1677307 Fix todoist state updates (#91915)
* Update event when coordinator updates data.

* Move function to make diff easier to view

* Actually make it easier to view

* Move all tasks calculation to extra_state_attributes.
2023-05-24 14:46:13 +02:00
ad0p ef24e508f8 Bump pydeconz to v112 (#91924)
* Bump pydeconz to v112

* PR review - add suggested_display_precision

* Test - fix

* Bump pydeconz to v112

* PR review - add suggested_display_precision

* Fix tests

---------

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
2023-05-24 14:43:02 +02:00
Jeff Grieger 7e165021a3 Fix directv attribute media_position_updated_at (#92383)
* Fix directv attribute media_position_updated_at

Fix to update media_position_updated_at attribute when media_position attribute is updated.

* Do not update media_position_updated_at when paused
2023-05-24 14:22:56 +02:00
David Knowles ace45f31ff Add a DataUpdateCoordinator to Hydrawise (#93223)
* Add a DataUpdateCoordinator to Hydrawise

* Replace DATA_HYDRAWISE with DOMAIN

* Replace persistent notification with a ConfigEntryNotReady exception

* Changes requested during PR review

* Add a type annotation to the `monitored_conditions` field.

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-24 14:07:37 +02:00
Colin Robbins f355f0cc6d Add UDP listener in Lightwave (#85385) 2023-05-24 13:44:12 +02:00
epenet c475273145 Prevent SensorEntity and RestoreEntity inheritance (#88971) 2023-05-24 12:49:35 +02:00
Joost Lekkerkerker db33aadcbb Implement OpenSky library (#92814)
* Implement OpenSky library

* Move function to library

* Fix feedback
2023-05-24 12:48:55 +02:00
Tom Schneider 0ca0ed3a31 Bump pygti and change the request for the new api version (#92283)
Bump pygti and change request for the new api version
2023-05-24 12:43:36 +02:00
Mike Heath 2a7ba60574 Fully Kiosk: Truncate long URLs (#92347)
* Truncate long URLs

URL's longer than 256 characters will result in a
`homeassistant.exceptions.InvalidStateError`. This fixes that problem
and adds 2 extra_state_attributes: `full_url`, and `truncated`.

Fixes #89249

* Refactor to use function ref in entity description
2023-05-24 12:32:26 +02:00
Erik Montnemery 937ebb374c Enable strict type checks of cloud (#92576)
* Enable strict type checks of cloud

* Fix circular import

* Address review comments

* Apply suggestions from code review
2023-05-24 11:46:11 +02:00
Franck Nijhof a8ce4d3c66 Remove legacy translations from electrasmart (#93446) 2023-05-24 11:42:49 +02:00
Álvaro Fernández Rojas 746a47f094 Update aioairzone-cloud to v0.1.3 (#93443) 2023-05-24 11:37:41 +02:00
Mike Degatano 08a719e09e Add backup location and mount failed repair (#93126)
* Add backup location and mount failed repair

* Fix coverage

* Change storage_location to backup_location

* Use backticks

* Update homeassistant/helpers/selector.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-24 10:33:41 +02:00
Raman Gupta 9b53484e2e Remove unused zwave discovery logic (#93436) 2023-05-24 10:02:50 +02:00
Jafar Atili 7bc9e1ae9f Bump PySwitchbee to 1.8.0 (#92348)
* fix

* fixes

* bump pyswitchbee

* bump pyswitchbee

* bump pyswitchbee

* fix

* bump pyswitchbee

* Apply suggestions from code review

---------

Co-authored-by: Jafar Atili <jafar.atili@axonius.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-24 09:44:36 +02:00
Ludy a310b5c1c3 remove template deprecated function device_trigger.py (#93419)
remove template deprecated fun `device_trigger.py`
2023-05-24 09:42:44 +02:00
Mike Degatano 2906caf4d1 Fix reference string in data disk repair (#93220)
* Fix reference string in data disk repair

* Use backticks
2023-05-24 09:42:30 +02:00
epenet 7c72b97d79 Use SnapshotAssertion in Renault tests (part 2) (#92395) 2023-05-24 09:39:37 +02:00
epenet dc14b83249 Add ability to unload demo integration (#92515)
* Add unload to demo integration

* Adjust config tests to use kitchen_sink

* Use async_unload_platforms
2023-05-24 09:38:29 +02:00
Joost Lekkerkerker 326d80f4f7 Move Twitch constants to separate file (#92605)
* Move Twitch constants to separate file

* Move Twitch constants to separate file

* Move Twitch constants to separate file

* Update branch
2023-05-24 09:18:20 +02:00
Guido Schmitz 9363fa6561 Update quality scale of devolo Home Control (#92646)
Update quality scale
2023-05-24 09:16:41 +02:00
ollo69 62ccecb690 Change utility_meter log level for invalid old state (#93026) 2023-05-24 09:10:51 +02:00
jjlawren abf08f66a4 Bump sonos-websocket to 0.1.2 (#93429)
Bump sonos-websocket to 0.1.2
2023-05-24 08:38:16 +02:00
Jesse Hills bb39b99a3f ESPHome fix changing light color_mode (#93434) 2023-05-24 08:37:42 +02:00
uvjustin 67515f8ac3 Bump ha-av to v10.1.0 (#93420) 2023-05-24 08:28:04 +02:00
Chris Talkington 5bdc830664 Bump rokuecp to 0.18.0 (#93424) 2023-05-24 08:27:20 +02:00
Dara Adib 3bd6dea63b Add tests for Microsoft TTS (#92215)
* Add tests for Microsoft TTS

* Update requirements_test_all

* Update tests/components/microsoft/__init__.py

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-24 08:25:03 +02:00
Ludy 3c7e6bf3cc Add missing constants trigger_typeand condition_type (#93415)
* Add missing `trigger_type`and  ´condition_type`

* auto generate `TURNED_ON` and  `TURNED_OFF`
2023-05-24 08:22:52 +02:00
Álvaro Fernández Rojas a29adc0a6a Airzone select improvements (#92894)
* airzone: select: remove unneed .keys()

Fixes late comment when select platform was introduced.

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

* airzone: select: make options translatable

This was a late comment when the select platform was introduced.

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

* airzone: select: change options to lists (from enums)

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

* tests: airzone: fix python 3.10 tests

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

* airzone: select: add manual dict values

This was requested in order to keep control of the translation strings.

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

* Revert "airzone: select: add manual dict values"

This reverts commit b818a2674d.

* Revert "tests: airzone: fix python 3.10 tests"

This reverts commit 93f8bd1430.

* Revert "airzone: select: change options to lists (from enums)"

This reverts commit e503a1dd3a.

* airzone: select: options: copy dict to list

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

* airzone: select: use degree symbol

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-24 08:21:24 +02:00
luar123 869f970e59 Fix Snapcast connection issues (#93010)
* Add (dis)connect and update listeners, terminate connection and reconnect. Set availability

* Pass entry_id to constructor
2023-05-24 08:16:09 +02:00
Tom a43dcaf812 Plugwise add value_fn for select (#93375)
* Plugwise prepare value_fn for select

* Plugwise prepare value_fn for select

* Try proposed options

* Fix initial defs

---------

Co-authored-by: Bouwe Westerdijk <11290930+bouwew@users.noreply.github.com>
2023-05-24 07:56:17 +02:00
J. Nick Koston d8493a41aa Add Yale Home virtual integration (#93364)
* Add Yale Home virtual integration

Yale split all their customers outside of North America off into
a new brand recently

https://www.yalehome.com/in/en/news/news/introducing-the-new-yale-home-app#:~:text=The%20Yale%20Home%20app,products%20and%20new%20products%20alike.

* init

* brands
2023-05-24 07:21:49 +02:00
Franck Nijhof 3107d7514c 2023.5.4 (#93422) 2023-05-23 23:51:57 +02:00
Franck Nijhof 264bed1af7 Bumped version to 2023.5.4 2023-05-23 21:54:57 +02:00
J. Nick Koston 63b81d86ef Fix race in tracking pending writes in recorder (#93414) 2023-05-23 21:54:33 +02:00
Marcel van der Veldt 41702410f7 Bump Matter server library to 3.4.1 and address changes (#93411)
* bump python matter server to 3.4.1

* address renamed attribute names in sdk 1.1

* ignore AllClustersAppServerExample

* clusters.ColorControl.Bitmaps.ColorCapabilities

* address discovery schemas

* fix all fixtures due to attribute rename

* bump python matter server to 3.4.1

* address renamed attribute names in sdk 1.1

* ignore AllClustersAppServerExample

* clusters.ColorControl.Bitmaps.ColorCapabilities

* address discovery schemas

* fix all fixtures due to attribute rename

* lint

* update requirements_all
2023-05-23 21:54:30 +02:00
J. Nick Koston 0f888340da Fix non threadsafe call xiaomi_aqara (#93405) 2023-05-23 21:54:26 +02:00
epenet fce2275083 Bump httpx to 0.24.1 (#93396) 2023-05-23 21:53:42 +02:00
J. Nick Koston cc94a9f4bb Fix august configuration url with Yale Home brand (#93361)
* Fix august configuration url with Yale Home brand

changelog: https://github.com/bdraco/yalexs/compare/v1.4.6...v1.5.0

* bump
2023-05-23 21:51:24 +02:00
Dominik dbbd9265d6 Bump glances_api to 0.4.2 (#93352) 2023-05-23 21:51:20 +02:00
Raman Gupta d1ee479e31 Bump zwave-js-server-python to 0.48.1 (#93342)
* Bump zwave-js-server-python to 0.48.1

* fix mypy
2023-05-23 21:51:16 +02:00
Aaron Bach e1cd5b627a Bump aionotion to 2023.05.5 (#93334) 2023-05-23 21:51:13 +02:00
Steven Looman 97bbc52c75 Bump async-upnp-client to 0.33.2 (#93329)
* Bump async-upnp-client to 0.33.2

* Fix tests
2023-05-23 21:51:09 +02:00
J. Nick Koston 1a0035798b Add support for Yale Home brand to august (#93214) 2023-05-23 21:51:06 +02:00
J. Nick Koston 65c5e70064 Disconnect yale access locks at the stop event (#93192) 2023-05-23 21:51:02 +02:00
Brett Adams 9bfd636ade Add Fan and Dry HVAC modes to Advantage Air MyTemp preset (#93189) 2023-05-23 21:50:59 +02:00
rikroe 8ebd827667 Fix china login for bmw_connected_drive (#93180)
* Bump bimmer_connected to 0.13.5

* Fix snapshots after dependency bump

* Load gcid from config entry if available

* Add tests

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-23 21:50:55 +02:00
J. Nick Koston 94130b7134 Bump pyatv to 0.11.0 (#93172) 2023-05-23 21:50:52 +02:00
Aaron Bach 0d432a4dd3 Bump regenmaschine to 2023.05.1 (#93139) 2023-05-23 21:50:49 +02:00
Diogo Gomes fab670434e Better handling of source sensor unavailability in Riemman Integration (#93137)
* refactor and increase coverage

* fix log order
2023-05-23 21:50:45 +02:00
Maciej Bieniek 40c0447292 Bump accuweather to version 0.5.2 (#93130) 2023-05-23 21:50:42 +02:00
Jan Bouwhuis 397864c497 Fix last imap message is not reset on empty search (#93119) 2023-05-23 21:50:39 +02:00
J. Nick Koston fa6834347a Bump pyunifiprotect to 4.9.0 (#93106)
changelog: https://github.com/AngellusMortis/pyunifiprotect/compare/v4.8.3...v4.9.0
2023-05-23 21:50:35 +02:00
J. Nick Koston a9afccb406 Fix ONVIF cameras that change the xaddr for the pull point service (#93104) 2023-05-23 21:50:32 +02:00
Nerdix c200c9fb4b Increase timeout to 30 seconds for homeassistant_alerts integration (#93089) 2023-05-23 21:50:29 +02:00
MatthewFlamm ce98324da3 Fix NWS error with no observation (#92997)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-23 21:50:26 +02:00
Michael Mraka cd195b7f50 Update solax state class for sensors with no units (#92914)
Update sensor.py

Units.NONE is used for text entities which are not measurements.
Marking them so breaks their history.
2023-05-23 21:50:23 +02:00
J. Nick Koston 367198a20c Fix onvif cameras that cannot parse relative time (#92711)
* Fix onvif cameras that cannot parse relative time

The spec requires that the camera can parse relative or absolute timestamps
However there are many cameras that cannot parse time correctly.

Much of the event code has been offloaded to the library and
support to determine if the camera has broken time and switch
to absolute timestamps is now built into the library

* adjust verison

* fixes

* bump

* bump

* bump

* more fixes

* preen

* fix resume

* one more fix

* fix race in webhook setup

* bump to 3.1.3 which has more fixes for broken camera firmwares

* bump 3.1.4 for more fixes

* fix

* fix comment

* bump

* fix url limit

* bump

* more fixes

* old hik uses -s
2023-05-23 21:50:20 +02:00
Daniel Gangl 5b0d53389c Fix weather handling in zamg (#85635)
* TypeError handling in weather

* Check for None

* Use walrus operator as proposed
2023-05-23 21:50:05 +02:00
J. Nick Koston f09abb0f2e Fix race in tracking pending writes in recorder (#93414) 2023-05-23 21:47:31 +02:00
Brett Adams f6e7b727b0 Add Fan and Dry HVAC modes to Advantage Air MyTemp preset (#93189) 2023-05-23 21:32:47 +02:00
Marcel van der Veldt 56d2048ffa Bump Matter server library to 3.4.1 and address changes (#93411)
* bump python matter server to 3.4.1

* address renamed attribute names in sdk 1.1

* ignore AllClustersAppServerExample

* clusters.ColorControl.Bitmaps.ColorCapabilities

* address discovery schemas

* fix all fixtures due to attribute rename

* bump python matter server to 3.4.1

* address renamed attribute names in sdk 1.1

* ignore AllClustersAppServerExample

* clusters.ColorControl.Bitmaps.ColorCapabilities

* address discovery schemas

* fix all fixtures due to attribute rename

* lint

* update requirements_all
2023-05-23 20:42:09 +02:00
Patrick Li 46103f56c4 Fix trusted_users group schema (#92847)
* Fix trusted_users group schema

* Add tests for CONFIG_SCHEMA
2023-05-23 20:11:25 +02:00
andarotajo fa366e59e0 Improve dwd_weather_warnings code quality (#92738)
Improve code quality by removing unnecessary data
2023-05-23 19:34:47 +02:00
epenet 160fce781d Bump httpx to 0.24.1 (#93396) 2023-05-23 12:31:03 -05:00
Álvaro Fernández Rojas 8edb253ace Add Airzone Cloud integration (#93238)
* airzone-cloud: add new integration

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

* Add missing aioairzone-cloud to test requirements

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

* Update aioairzone-cloud to v0.0.4

Allows to handle TooManyRequests exception on coordinator.

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

* aioairzone_cloud: reduce API requests

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

* airzone_cloud: remove system_zone_id

As opposed to the Local API of Airzone devices, the Cloud API provides unique
IDs for both systems and zones, so we can remove the system_zone_id copied from
the Local API integration.

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

* airzone_cloud: minor improvements

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

* tests: airzone_cloud: simplify mock_get_webserver

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

* Update aioairzone to v0.0.5

- Add token refresh and relogin support.
- Improve fetching installation devices.

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

* airzone_cloud: add to strict typing

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

* Update aioairzone to v0.0.7

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

* trigger CI

* airzone_cloud: remove unneeded api_get_user call

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

* Add Airzone brand

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

* Update aioairzone to v0.1.1

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

* airzone_cloud: use unique_id instead of entry_id

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

* airzone_cloud: remove special handling of TooManyRequests

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

* airzone_cloud: bump coordinator timeout to 30s

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

* airzone_cloud: make AirzoneEntity an ABC

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

* airzone_cloud: fix strings typo

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

* tests: airzone_cloud: simplify webserver mock

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

* Update aioairzone-cloud to v0.1.2

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-23 19:22:50 +02:00
Michael Mraka 8bf22014ce Update solax state class for sensors with no units (#92914)
Update sensor.py

Units.NONE is used for text entities which are not measurements.
Marking them so breaks their history.
2023-05-23 19:20:04 +02:00
Álvaro Fernández Rojas 942089d590 Add QNAP QSW firmware update support (#92869)
* qnap_qsw: add firmware update support

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

* tests: qnap_qsw: remove backup leftovers

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

* tests: qnap_qsw: remove backup leftovers v2

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

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-23 19:10:33 +02:00
chiefdragon 9672db0354 Add new preset to Tado to enable geofencing mode (#92877)
* Add new preset to Tado to enable geofencing mode
Add new 'auto' preset mode to enable Tado to be set to auto geofencing
mode.  The existing ‘home’ and ‘away’ presets switched Tado into manual
geofencing mode and there was no way to restore it to auto mode.
Note 1: Since preset modes (home, away and auto) apply to the Tado home
holistically, irrespective of the Tado climate entity used to select
the preset, three new sensors have been added to display the state of
the Tado home
Note 2: Auto mode is only supported if the Auto Assist skill is enabled
in the owner's Tado home. Various checks have been added to ensure the
Tado supports auto geofencing and if it is not supported, the preset is
not listed in the preset modes available

* Update codeowners in manifest.json

* Update main codeowners file for Tado component
2023-05-23 19:08:00 +02:00
J. Nick Koston 761943e1e6 Fix non threadsafe call xiaomi_aqara (#93405) 2023-05-23 18:56:27 +02:00
Aaron Bach fdf40fd1e5 Remove @bachya as a Slack codeowner (#93408)
* Remove @bachya as a Slack codeowner

* Manifest
2023-05-23 18:55:55 +02:00
Tom Harris e2fb1de0d9 Clean up Insteon config_flow (#93004)
* Clean up config_flow

* Remove unnecessary logging

* Remove logger

* Add more tests

* Test closing modem connection

* Simplify patching
2023-05-23 17:31:17 +02:00
Erik Montnemery d62cdf3d65 Improve error message for sensors with a non-numeric value (#93399)
* Improve error message for sensors with a non-numeric value

* Address review comment
2023-05-23 15:54:24 +02:00
rikroe f8f83906f8 Add climate on/off for supported BMW vehicles (#92962)
* Add switch platform

* Add tests

* Remove separate button

* Bump coverage

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-23 15:21:29 +02:00
J. Nick Koston 28fa6f541f Bump ifaddr to 0.2.0 (#93377) 2023-05-23 14:18:26 +02:00
J. Nick Koston bb8dfc9470 Bump protobuf to 4.23.1 (#93338) 2023-05-23 13:16:20 +02:00
RenierM26 497fa1980b Add Ezviz update entity (#85377)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-05-23 12:32:14 +02:00
epenet c23718d13d Cleanup samsungtv strings (#93395) 2023-05-23 12:06:19 +02:00
erikbadman 2721874f13 Get kostal plenticore hostname id from get_settings (#93008)
* Get hostname id from get_settings

* Add try except in get_hostname_id function

* Update tests after adding get_hostname_id function

* Revert "Update tests after adding get_hostname_id function"

This reverts commit 5fa4e533cb.

* Add test for G2 models in config flow.

* Add test for helper module.

* Fix test for numbers.

* Revert "Add try except in get_hostname_id function"

This reverts commit 059f5bd9b4.

* Update variable name with known hostname ids to be private

---------

Co-authored-by: Stefan Gmeiner <stefangm42@gmail.com>
2023-05-23 11:42:54 +02:00
epenet 1dccb8a9a9 Cleanup deprecated YAML from samsungtv (#93392) 2023-05-23 11:33:51 +02:00
Paul Frank d0d74eb30e Bump mystrom to 2.2.0 (#93389) 2023-05-23 11:28:33 +02:00
Álvaro Fernández Rojas 7e1a946705 Support Airzone temperature ranges (HEAT_COOL) (#93110)
* airzone: climate: add Temperature range support

This is useful for HEAT_COOL climate mode (Airzone AUTO).

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

* trigger CI

---------

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2023-05-23 11:23:32 +02:00
luar123 86ad5ad113 Change snapcast to local_push (#93113) 2023-05-23 11:21:50 +02:00
Diogo Gomes e100bcfaea Better handling of source sensor unavailability in Riemman Integration (#93137)
* refactor and increase coverage

* fix log order
2023-05-23 11:19:29 +02:00
Erik Montnemery b754f03eb1 Add WS command for getting a config entry (#93387)
* Add WS command for getting a config entry

* Update tests
2023-05-23 10:44:02 +02:00
Dominik 657d285e8f Bump glances_api to 0.4.2 (#93352) 2023-05-22 23:15:01 +02:00
Tom 400263cf04 Plugwise binary_sensor typing improvement (#93371)
Typing miss correction (spotted by epenet)
2023-05-22 23:02:42 +02:00
Tom af3bbdee82 Plugwise add value_fn for switch (#93345)
* Plugwise add value_fn for switch

* Skip none as suggested
2023-05-22 22:15:02 +02:00
Maciej Bieniek 71466e5012 Add new sensors to AccuWeather (#93362)
* Add solar irradiance and condition sensors

* Use entity_registry_enabled_by_default fixture
2023-05-22 21:55:54 +02:00
Franck Nijhof d2a39e0e6f Update requests to 2.31.0 (#93363) 2023-05-22 20:48:56 +02:00
Guido Schmitz 91da7516d0 Use snapshots in devolo_home_control tests (#93202) 2023-05-22 18:16:57 +02:00
Matthias Alphart b10e73e2d4 Configurable KNX Telegram history size (#93248)
* Configurable KNX Telegram history size

* Add maximum value to description
2023-05-22 18:09:59 +02:00
Raman Gupta 3bf9eaffdf Bugfix and add test coverage for zwave_js.light (#93257)
Add test coverage for zwave_js.light
2023-05-22 12:08:29 -04:00
Raman Gupta 18eeeaaf68 Refactor zwave_js.fan and add tests (#93256)
* Refactor zwave_js.fan and add tests

* fix const
2023-05-22 12:08:13 -04:00
Raman Gupta 03300c24da Bugfix and small refactor for zwave_js.device_action (#93261)
Improve test coverage for zwave_js.device_action
2023-05-22 18:04:04 +02:00
Raman Gupta e1dd7118e0 Refactor zwave_js.sensor and add test coverage (#93259)
* Refactor zwave_js.sensor and add test coverage

* use walrus

* inherit config parameter class from list class

* use walrus in more places

* improve config parameter test
2023-05-22 11:58:10 -04:00
Raman Gupta d6997d8656 Improve test coverage for zwave_js.trigger (#93260)
Improve coverage for zwave_js.trigger
2023-05-22 17:55:03 +02:00
J. Nick Koston 5d02be5d7f Fix august configuration url with Yale Home brand (#93361)
* Fix august configuration url with Yale Home brand

changelog: https://github.com/bdraco/yalexs/compare/v1.4.6...v1.5.0

* bump
2023-05-22 10:39:56 -05:00
Jan Bouwhuis a81fe517c1 Make mqtt device_tracker state_topic optional when json_attribute_topic is used (#93322)
* Make device_tracker state_topic optional

* No state_topic needed
2023-05-22 15:49:18 +02:00
David Knowles 4d44d60e73 Move HydrawiseEntity into entity.py (#93359) 2023-05-22 15:47:32 +02:00
Franck Nijhof 9eca234948 Update Home Assistant base image to 2023.05.0 (#93350) 2023-05-22 15:45:29 +02:00
Franck Nijhof 7537667e53 Adjust counter to not restore configuration parameters (#93344) 2023-05-22 15:27:44 +02:00
Franck Nijhof f2899a19c1 Deprecate counter.configure service (#93343) 2023-05-22 15:27:33 +02:00
Dmitry Vlasov 6df030a455 Update zwave-me-ws version to 0.4.3 (#93348)
Up zwave-me-ws to 0.4.3
2023-05-22 15:20:18 +02:00
David Knowles ab8a13ae6b Add myself as a code owner of the Hydrawise integration (#93358) 2023-05-22 15:15:20 +02:00
David Knowles 3d6d650a16 Move Hydrawise constants into const.py (#93357) 2023-05-22 15:11:32 +02:00
Raman Gupta ec12d9a197 Improve test coverage for zwave_js (#93262) 2023-05-22 12:20:01 +02:00
Jan Bouwhuis 5bc825a8ab Add advanced imap option to set custom event max message size (#93163) 2023-05-22 12:14:06 +02:00
Raman Gupta 4b67839e19 Bump zwave-js-server-python to 0.48.1 (#93342)
* Bump zwave-js-server-python to 0.48.1

* fix mypy
2023-05-22 11:06:34 +02:00
Aaron Bach d16452bed7 Bump aionotion to 2023.05.5 (#93334) 2023-05-22 10:14:52 +02:00
Tom 79cafd5a46 Plugwise prepare typing for binary_sensor (#93162) 2023-05-22 09:19:00 +02:00
J. Nick Koston aa937b1640 Use slots for template RenderInfo (#93337) 2023-05-22 08:52:49 +02:00
Franck Nijhof 31c0374c98 Update apprise to 1.4.0 (#93331) 2023-05-22 07:31:02 +02:00
Franck Nijhof 69770bac22 Update sentry-sdk to 1.23.1 (#93330) 2023-05-21 22:09:52 -04:00
Steven Looman 63c2b5868e Bump async-upnp-client to 0.33.2 (#93329)
* Bump async-upnp-client to 0.33.2

* Fix tests
2023-05-21 17:17:08 -05:00
Álvaro Fernández Rojas c3cd60e0cb Fix pressure for AEMET stations close to sea level (#87094) 2023-05-21 22:17:26 +02:00
Luke 2cc9fcc977 Add scaffolds to vscode tasks (#92015) 2023-05-21 21:29:33 +02:00
Joost Lekkerkerker c12fae4775 Bump TwitchAPI to 3.10.0 (#92418)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-05-21 21:13:59 +02:00
J. Nick Koston e27554f7a6 Improve http handler performance (#93324) 2023-05-21 13:36:03 -05:00
J. Nick Koston ab0d35df92 Add zeroconf support to roomba (#93309) 2023-05-21 16:12:19 +02:00
Ernst Klamer 40c74ad5b7 Add support for sleepy BTHome devices (#92991)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-05-21 09:01:09 -05:00
starkillerOG 5821a563c7 Bump motionblinds to 0.6.18 (#93300) 2023-05-21 15:20:50 +02:00
henryptung 8a0f3a8c88 Fix Broadlink discovery for new RM Mini3 (again) (#93158) 2023-05-21 14:53:06 +02:00
Maciej Bieniek d47e58fb38 Bump accuweather to version 1.0.0 (#93305) 2023-05-21 14:50:10 +02:00
J. Nick Koston 90984c34a9 Fix double call to options in sensor state (#93311) 2023-05-21 15:42:19 +03:00
J. Nick Koston 780f9bcdc0 Fix shutdown being delayed for cancelling tasks (#93287) 2023-05-21 14:17:34 +02:00
rikroe 72c76d35cc Bump bimmer_connected to 0.13.6 (#93307) 2023-05-21 14:16:47 +02:00
G Johansson e676cbe9f2 Fix import issue in Workday (#92727)
* Workday fix import

* Messages
2023-05-21 10:13:36 +02:00
G Johansson ddb9a6e33c Add change service to timer (#84775)
* Add change service

* test subtract

* Test no change if timer not running

* Modify example

* Raise

* Finalize

* test event

* Fix tests

* Fix tracking time
2023-05-21 10:11:08 +02:00
J. Nick Koston fc7a421a48 Fix lookin falling back to polling too quickly (#93227) 2023-05-20 14:41:16 -05:00
J. Nick Koston cbee514c2a Bump sqlalchemy to 2.0.15 (#93293) 2023-05-20 14:26:33 -05:00
J. Nick Koston 2a2b19ed7c Add support for Yale Home brand to august (#93214) 2023-05-20 09:42:19 -05:00
Mick Vleeshouwer fa415480d6 Bump pyoverkiz to 1.7.9 (#93275)
Update PyOverkiz to v1.7.9
2023-05-20 12:52:43 +01:00
Jafar Atili 1935e126bf Add new integration to control Electra Smart HVAC devices (#70361)
* Added new integration to support Electra Smart (HVAC)

* fixes + option to set scan interval

* renamed the module to electrasmart and added unittests

* added non tested files to .coveragerc

* changed the usage from UpdateCoordinator to each entity updates it self

* small fixes

* increased pypi package version, increased polling timeout to 60 seconds, improved error handling

* PARALLEL_UPDATE=1 to prevent multi access to the API

* code improvements

* aligned with the new HA APIs

* fixes

* fixes

* more

* fixes

* more

* more

* handled re-atuh flow

* fixed test

* removed hvac action

* added shabat mode

* tests: 100% coverage

* ran hassfest

* Update homeassistant/components/electrasmart/manifest.json

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

* Update homeassistant/components/electrasmart/manifest.json

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

* Update homeassistant/components/electrasmart/manifest.json

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

* Update homeassistant/components/electrasmart/climate.py

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

* address Shay's comments

* address Shay's comments

* address more comments

---------

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2023-05-20 13:13:32 +03:00
Tom Brien 09a8479cf0 Add MASK wallets to Coinbase (#90742) 2023-05-19 22:31:19 +01:00
Luke 0ce1117287 Bump Roborock to 17.0 adding device specific support and bugfixes (#92547)
* init commit

* use official version release

* remove options

* moved first refresh to gather

* add extra tests

* remove model_sepcification

* remove old mqtt test

* bump to 13.4

* fix dndtimer

* bump to 14.1

* add status back

* bump to 17.0

* remove error as it is not used

* addressing mr comments

* making enum access use get()

* add check for empty hass data
2023-05-18 20:55:39 -07:00
J. Nick Koston aebded049b Mark oralb devices as sleepy (#93250) 2023-05-18 16:32:24 -05:00
J. Nick Koston be08bb5ba6 Convert proximity to be async (#93241) 2023-05-18 16:32:12 -05:00
Jan Čermák 3cdcfb1654 Bump rapt-ble to v0.1.1 (#93242) 2023-05-18 14:15:39 -05:00
Ville Skyttä cb22154b36 Capture warnings.warn and friends messages in logs (#85875)
The default behavior of these warnings is to go to stderr, which in
some setups goes easily unnoticed. For example in Docker based ones,
they end up only in the container logs, and not e.g. in the HA log.

Capture these to make them available in logs where other such messages
are, and to make them subject to filtering as usual.
https://docs.python.org/3/library/logging.html#logging.captureWarnings
2023-05-18 21:41:13 +03:00
Guido Schmitz 3abcffe3a0 Raise on reauth in devolo Home Network switch platform (#92850) 2023-05-18 11:28:17 -05:00
Andre Lengwenus 0fca90127b Bump pypck to 0.7.17 (#93234) 2023-05-18 11:26:37 -05:00
J. Nick Koston 763b898621 Add always connected option to Yale Access Bluetooth (#93224)
* Add always connected option to Yale Access Bluetooth

If the lock does not support push updates via advertisements or you want lock operation to be more responsive, you can enable always connected mode. Always connected will cause the lock to stay connected to Home Assistant via Bluetooth, which will use more battery.

* Update homeassistant/components/yalexs_ble/config_flow.py

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

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-05-18 10:48:04 -05:00
J. Nick Koston 2eef2ed911 Add option to disable webhooks in ONVIF (#93186) 2023-05-18 10:34:09 -05:00
Ville Skyttä 0c51de25a2 Update UpCloud config entry data on successful reconfig (#68718)
* Update UpCloud config entry data on successful reconfig

* Add already configured test

* Improve success case request mocking

So that the data fetch that might happen in the background after success
won't trash the test log with misleading errors.

* Simplify already configured test

Thanks-to: Martin Hjelmare <marhje52@gmail.com>
2023-05-18 16:04:27 +03:00
Joakim Plate ae7930c0ad Use entity translation in dsmr (#93017)
* Use entity translation in dsmr

* Combine a few strings
2023-05-17 22:31:04 +02:00
epenet 6481ee3c82 Fix lingering timers in yeelight (#92118) 2023-05-17 22:08:49 +02:00
epenet dad3fbf5e2 Fix lingering timer in esphome (#92533) 2023-05-17 22:05:44 +02:00
J. Nick Koston 3f43184187 Speed up signing paths (#93127) 2023-05-17 22:01:13 +02:00
MatthewFlamm d0460d5424 Fix NWS error with no observation (#92997)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-17 22:00:13 +02:00
Aaron Bach b9798e4f4f Add support for SimpliSafe Smoke+CO detector (#93217) 2023-05-17 21:56:49 +02:00
Michael Benz 0828cc0e44 Add light entity to Tuya Air Purifiers (#92861) 2023-05-17 20:16:54 +01:00
Franck Nijhof 1173039392 Add virtual integration: Whisper (#93183) 2023-05-17 13:34:09 +02:00
Franck Nijhof 08fd0fd441 Add virtual integration: Piper (#93182) 2023-05-17 13:33:52 +02:00
J. Nick Koston af1bac8745 Disconnect yale access locks at the stop event (#93192) 2023-05-17 13:25:28 +02:00
Nerdix 7cdd6b4cbc Increase timeout to 30 seconds for homeassistant_alerts integration (#93089) 2023-05-17 13:15:28 +02:00
J. Nick Koston 00b600bfa8 Fix ONVIF cameras that change the xaddr for the pull point service (#93104) 2023-05-17 13:14:31 +02:00
Franck Nijhof fb7c579216 Add missing entity attribute translations to humidifier entity component (#93206) 2023-05-17 13:10:08 +02:00
J. Nick Koston 32481065a8 Increase size of valid entity id cache (#93125) 2023-05-17 13:06:52 +02:00
Ziv f564a0ca24 Fix failure to register services in dynalite (#93069)
* fixed bug that fails to register services when there is no YAML config

* style improvement per thecode's suggestion
2023-05-17 14:05:36 +03:00
Matthias Alphart c522ea855d KNX Group Monitor: Load latest 50 Telegrams on start (#93153)
* remove impossible test

IndividualAddress telegrams are not processed by xknx.telegram_queue

* Use Telegrams helper class for group monitor messages

* Store 50 telegrams in deque for group monitor

* Send recent telegrams at once on connection of group monitor

* Update KNX-frontend to support group monitor prepopulation
2023-05-17 09:58:00 +02:00
J. Nick Koston b993fe1c9d Cache generation of the service descriptions (#93131) 2023-05-16 21:42:37 -05:00
tronikos 6c56ceead0 Create Google Generative AI Conversation integration (#93156)
* Copy openai_conversation to google_generative_ai_conversation
This is to improve diff of the next commit with the actual implementation.

Commands used:
cp -r homeassistant/components/openai_conversation/ homeassistant/components/google_generative_ai_conversation/
cp -r tests/components/openai_conversation/ tests/components/google_generative_ai_conversation/

find homeassistant/components/google_generative_ai_conversation/ tests/components/google_generative_ai_conversation/ -type f | xargs sed -i \
-e 's@openai_conversation@google_generative_ai_conversation@g' \
-e 's@OpenAI Conversation@Google Generative AI Conversation@g' \
-e 's@balloob@tronikos@g'

* Add google_generative_ai_conversation to Google brand

* Google Generative AI Conversation

* Sync recent openai changes

* handle empty responses
2023-05-16 21:05:56 -04:00
rikroe defc23cc7c Fix china login for bmw_connected_drive (#93180)
* Bump bimmer_connected to 0.13.5

* Fix snapshots after dependency bump

* Load gcid from config entry if available

* Add tests

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-17 02:03:01 +02:00
J. Nick Koston 210c309770 Bump pyatv to 0.11.0 (#93172) 2023-05-16 18:52:18 -05:00
Aaron Bach e48961d29b Bump regenmaschine to 2023.05.1 (#93139) 2023-05-16 16:28:20 -06:00
J. Nick Koston bf16f6b104 Remove as_compressed_state cache (#93169)
* Remove as_compressed_state cache

All calls to as_compressed_state are now covered by a higher level
JSON cache so there is no need to store these in memory anymore

* Remove as_compressed_state cache

All calls to as_compressed_state are now covered by a higher level
JSON cache so there is no need to store these in memory anymore
2023-05-16 12:39:16 -05:00
Ville Skyttä e949344dd9 Huawei LTE connection management cleanups (#85929)
* Disconnect rather than just logout at end of config flow

Neither the connection or the requests session will be reused, so
there's no reason just to logout. Do all of the connection closure
so we get all of huawei-lte-api's cleanups explicitly done.

* Name connect functions consistently, analoguous to disconnect
2023-05-16 20:34:03 +03:00
Maciej Bieniek 685016052b Bump accuweather to version 0.5.2 (#93130) 2023-05-16 11:38:17 -05:00
Álvaro Fernández Rojas e5c12122e2 Update aioairzone to v0.5.6 (#93146) 2023-05-16 12:51:22 +02:00
epenet 9bd49e4f1d Fix lingering timer in usgs_earthquakes_feed (#93084) 2023-05-16 11:13:14 +02:00
J. Nick Koston 32b70ea133 Bump PyJWT to 2.7.0 (#93128) 2023-05-16 10:26:04 +02:00
J. Nick Koston 99265a983a Speed up reconnects by caching state serialize (#93050) 2023-05-16 02:33:12 -05:00
J. Nick Koston 9c039a17ea Bump guppy3 to 3.1.3 (#93124) 2023-05-16 08:26:17 +02:00
epenet f6b700372a Allow wemo config entry to be unloaded (#93082)
* Fix lingering timer in wemo

* Also stop the subscriptions
2023-05-16 06:31:31 +02:00
Guido Schmitz 36332eb441 Bump devolo_plc_api to 1.3.1 (#93099) 2023-05-15 20:12:44 -05:00
Matthias Alphart 2f8e8901fc Add KNX interface device trigger for telegrams (#93102)
* telegram device trigger initial

* add Telegrams helper class

to parse and convert Telegram only once instead of once per device trigger

* translation

* label for extra_field

* test device trigger

* test trigger callback removal

* rename extra_field key to same name as used in trigger

* typo
2023-05-15 22:59:29 +02:00
J. Nick Koston 72a6d3a748 Re-enable cleanup_closed on cpython >= 3.11.4 (#93120) 2023-05-15 21:29:41 +02:00
luar123 d8d4446563 Bump snapcast to 2.3.3 (#93112)
bump snapcast to 2.3.3
2023-05-15 22:29:28 +03:00
J. Nick Koston b400c53159 Bump pyunifiprotect to 4.9.0 (#93106)
changelog: https://github.com/AngellusMortis/pyunifiprotect/compare/v4.8.3...v4.9.0
2023-05-15 22:26:29 +03:00
J. Nick Koston 64623283b2 Bump aioesphomeapi to 13.7.5 (#93121)
performance improvements

changelog: https://github.com/esphome/aioesphomeapi/compare/v13.7.4...v13.7.5
2023-05-15 22:24:17 +03:00
luar123 209650dca1 Remove snapcast friendly_name attribute (#93116)
Remove friendly_name attribute and fix names
2023-05-15 22:23:24 +03:00
epenet b38a7aabe9 Fix lingering timer in withings (#93085) 2023-05-15 21:20:20 +02:00
Pascal Vizeli cf957f1880 Bump aioecowitt 2023.5.0 (#93094) 2023-05-15 21:19:27 +02:00
Jan Bouwhuis c97e0f11a5 Fix last imap message is not reset on empty search (#93119) 2023-05-15 21:15:10 +02:00
Daniel Gangl d12ea0040f Fix weather handling in zamg (#85635)
* TypeError handling in weather

* Check for None

* Use walrus operator as proposed
2023-05-15 19:26:02 +02:00
epenet 48ab74eedf Add missing mock in wiffi tests (#93083) 2023-05-15 11:15:19 +02:00
Jens Østergaard Nielsen 01dc27e2a2 Remove default unit of measurement in IHC sensors (#93054)
Remove sensor default unit of measurement
2023-05-15 09:50:39 +02:00
Stephan Uhle 55c675d0fd Bump pysml to 0.0.11 (#93035)
Updated pysml to 0.0.11
2023-05-15 09:15:22 +02:00
Pieter Viljoen 77f99e4162 Add MEASUREMENT state class to Sense Voltage sensors (#93044)
Add MEASUREMENT to Voltage sensors
2023-05-15 09:11:12 +02:00
J. Nick Koston ef887e529f Fix onvif cameras that cannot parse relative time (#92711)
* Fix onvif cameras that cannot parse relative time

The spec requires that the camera can parse relative or absolute timestamps
However there are many cameras that cannot parse time correctly.

Much of the event code has been offloaded to the library and
support to determine if the camera has broken time and switch
to absolute timestamps is now built into the library

* adjust verison

* fixes

* bump

* bump

* bump

* more fixes

* preen

* fix resume

* one more fix

* fix race in webhook setup

* bump to 3.1.3 which has more fixes for broken camera firmwares

* bump 3.1.4 for more fixes

* fix

* fix comment

* bump

* fix url limit

* bump

* more fixes

* old hik uses -s
2023-05-14 16:08:39 -04:00
J. Nick Koston d5a0824924 Use futures instead of asyncio.Event for async_get_integrations (#93060)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-05-14 14:42:04 -05:00
Paulus Schoutsen e0a97ec90d 2023.5.3 (#93066) 2023-05-14 13:00:18 -04:00
J. Nick Koston b95405a7e9 Small performance improvements to state diff messages (#92963)
Adds missing test coverage
2023-05-14 12:28:34 -04:00
J. Nick Koston 3314eed8d1 Switch to using a ContextVar for template RenderInfo (#93016)
The ContextVar is about 40% faster than the attr
and dict lookups
2023-05-14 12:23:31 -04:00
J. Nick Koston 2848f8648d Log last message when websocket reaches peak limit (#93038)
When we hit the absolute limit, we would log the last messages as
it was key to finding out the source. We now do the same when
we hit the peak limit
2023-05-14 12:22:19 -04:00
Paulus Schoutsen 1f6a601fc9 Bumped version to 2023.5.3 2023-05-14 12:11:32 -04:00
Aaron Bach ff14277805 Fix a series of bugs due to Notion API changes (#93039)
* Fix a series of bugs due to Notion API changes

* Simplify

* Reduce blast radius

* Reduce blast radius

* Fix tests
2023-05-14 12:11:22 -04:00
J. Nick Koston 6424dee231 Fix sslv2/sslv3 with unverified connections (#93037)
In #90191 we use the same ssl context for httpx now to avoid
a memory leak, but httpx previously allowed sslv2/sslv3 for
unverified connections

This reverts to the behavior before #90191
2023-05-14 12:11:21 -04:00
J. Nick Koston 13c51e9c34 Disable cleanup_closed for aiohttp.TCPConnector with cpython 3.11.1+ (#93013)
* Disable cleanup_closed for aiohttp.TCPConnector with cpython 3.11.2+

There is currently a relatively fast memory leak when using
cpython 3.11.2+ and cleanup_closed with aiohttp

For my production instance it was leaking ~450MiB per day
of `MemoryBIO`, `SSLProtocol`, `SSLObject`, `_SSLProtocolTransport`
`memoryview`, and `managedbuffer` objects

see https://github.com/aio-libs/aiohttp/issues/7252
see https://github.com/python/cpython/pull/98540

* Update homeassistant/helpers/aiohttp_client.py
2023-05-14 12:11:20 -04:00
puddly 304c34a119 Bump bellows to 0.35.5 to fix Aqara Zigbee connectivity issue (#92999)
Bump bellows to 0.35.5
2023-05-14 12:11:19 -04:00
starkillerOG d840d27f2d Bump reolink-aio to 0.5.15 (#92979) 2023-05-14 12:11:18 -04:00
Michael a8cf3fadaa Fix remove of device when surveillance station is not used in Synology DSM (#92957) 2023-05-14 12:11:17 -04:00
Joost Lekkerkerker a3f3b43c20 Bump python-vehicle to 1.0.1 (#92933) 2023-05-14 12:11:17 -04:00
Robert Hillis b0520ccb94 Bump eternalegypt to 0.0.16 (#92919) 2023-05-14 12:11:16 -04:00
Jonathan Keslin fe308e26dc Bump volvooncall to 0.10.3 to fix sensor type error (#92913) 2023-05-14 12:11:15 -04:00
Michael 60fb71159d Fix uptime sensor deviation detection in Fritz!Tools (#92907) 2023-05-14 12:11:14 -04:00
G Johansson 413dbe89e5 Fix already_configured string in workday (#92901)
* Fix already_configured string in workday

* Fix strings
2023-05-14 12:11:13 -04:00
J. Nick Koston 7abe9f1f9a Bump bluetooth-auto-recovery to 1.2.0 (#92893) 2023-05-14 12:11:12 -04:00
Glenn Waters 252b99f00b Bump UPB integration library to 0.5.4 (#92879) 2023-05-14 12:11:11 -04:00
J. Nick Koston 8e407334b7 Add ONVIF services to diagnostics (#92878) 2023-05-14 12:11:10 -04:00
puddly 91faa31e8c Bump ZHA dependencies (#92870) 2023-05-14 12:11:09 -04:00
Michael Hansen 5e77de35bd Allow "no" to match "nb" in language util (#92862)
* Allow "no" to match "nb"

* Adjust comparison for speed
2023-05-14 12:11:09 -04:00
jjlawren c1b18dcbba Bump sonos-websocket to 0.1.1 (#92834) 2023-05-14 12:11:08 -04:00
Diogo Gomes 3c45bda0e8 Don't try to restore unavailable nor unknown states (#92825) 2023-05-14 12:11:07 -04:00
Álvaro Fernández Rojas 7361c29cba Update aioairzone to v0.5.5 (#92812) 2023-05-14 12:11:06 -04:00
Álvaro Fernández Rojas a551de06c7 Fix Airzone Auto operation mode (#92796) 2023-05-14 12:11:05 -04:00
Erik Montnemery 84ce2f13f2 Fix race in Alexa async_enable_proactive_mode (#92785) 2023-05-14 12:11:04 -04:00
Álvaro Fernández Rojas 5c949bd862 Update aioairzone to v0.5.3 (#92780) 2023-05-14 12:11:03 -04:00
Keilin Bickar 16020d8ab9 Bump asyncsleepiq to 1.3.5 (#92759) 2023-05-14 12:11:02 -04:00
karwosts f866d6100d Fix zwave_js services example data (#92748) 2023-05-14 12:11:01 -04:00
Brandon Rothweiler 8d0da78fab Increase timeout to 30 seconds for Mazda integration (#92744) 2023-05-14 12:11:00 -04:00
J. Nick Koston 7173a4f377 Bump aioesphomeapi to 3.7.4 to fix proxied BLE connections not retrying right away on error (#92741) 2023-05-14 12:11:00 -04:00
Eduard van Valkenburg d4acb2a381 Update deprecated functions in SIA (#92737)
update deprecated functions
2023-05-14 12:10:59 -04:00
Shay Levy b1111eb2c7 Bump aiowebostv to 0.3.3 to fix Python 3.11 support (#92736)
Bump aiowebostv to 0.3.3
2023-05-14 12:10:58 -04:00
Mick Vleeshouwer 4895ca218f Bump pyoverkiz to 1.7.8 (#92702) 2023-05-14 12:10:57 -04:00
Aaron Bach 91e9d21548 Bump aionotion to 2023.05.1 (#92697) 2023-05-14 12:10:56 -04:00
J. Nick Koston 996c6c4a92 Fix onvif reauth when device returns a http 401/403 error (#92690) 2023-05-14 12:10:55 -04:00
J. Nick Koston 96ff24aa2f Always request at least one zone for multi-zone LIFX devices (#92683) 2023-05-14 12:08:33 -04:00
J. Nick Koston dcc5940f9b Fix parallel_updates being acquired too late for entity executor jobs (#92681)
* Fix parallel_updates being acquired too late for entity executor jobs

* tweak
2023-05-14 12:08:33 -04:00
rikroe dd51bba677 Bump bimmer_connected to 0.13.3 (#92648)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-14 12:08:32 -04:00
Luke ac9da5c167 Roborock continue on failed mqtt disconnect (#92502)
continue on async disconnect failure
2023-05-14 12:08:31 -04:00
J. Nick Koston e073f091b1 Cache ip address stringify in zeroconf (#92800)
stringify IPv6 addresses is expensive, and since zeroconf sees the same
ones over and over again an LRU can avoid the constant stringify
2023-05-14 12:07:38 -04:00
Aaron Bach 637941df4d Fix a series of bugs due to Notion API changes (#93039)
* Fix a series of bugs due to Notion API changes

* Simplify

* Reduce blast radius

* Reduce blast radius

* Fix tests
2023-05-14 12:07:15 -04:00
J. Nick Koston e593ceaaf2 Fix sslv2/sslv3 with unverified connections (#93037)
In #90191 we use the same ssl context for httpx now to avoid
a memory leak, but httpx previously allowed sslv2/sslv3 for
unverified connections

This reverts to the behavior before #90191
2023-05-13 20:16:11 -04:00
J. Nick Koston 7d371a33bb Disable cleanup_closed for aiohttp.TCPConnector with cpython 3.11.1+ (#93013)
* Disable cleanup_closed for aiohttp.TCPConnector with cpython 3.11.2+

There is currently a relatively fast memory leak when using
cpython 3.11.2+ and cleanup_closed with aiohttp

For my production instance it was leaking ~450MiB per day
of `MemoryBIO`, `SSLProtocol`, `SSLObject`, `_SSLProtocolTransport`
`memoryview`, and `managedbuffer` objects

see https://github.com/aio-libs/aiohttp/issues/7252
see https://github.com/python/cpython/pull/98540

* Update homeassistant/helpers/aiohttp_client.py
2023-05-13 20:15:02 -04:00
imerla1 a9778c4236 fixed typo (#93029) 2023-05-13 21:05:55 +02:00
puddly 61cd36d628 Bump bellows to 0.35.5 to fix Aqara Zigbee connectivity issue (#92999)
Bump bellows to 0.35.5
2023-05-13 14:06:22 -04:00
Justas 0437926db8 Adding newly supported language codes to Google TTS (#93030) 2023-05-13 14:03:20 -04:00
G Johansson 01e131b278 Fix already_configured string in workday (#92901)
* Fix already_configured string in workday

* Fix strings
2023-05-13 10:42:04 +02:00
J. Nick Koston 81796fbf7b Bump orjson to 3.8.12 (#92935)
changes: https://github.com/ijl/orjson/releases/tag/3.8.12
2023-05-13 10:06:32 +03:00
starkillerOG 051d631504 Poll Reolink motion when ONVIF not available (#92837)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-05-12 18:48:32 +02:00
J. Nick Koston 8711735ec0 Improve websocket throughput and reduce latency (#92967) 2023-05-13 00:13:57 +09:00
Erik Montnemery 9a70f47049 Teach UnitlessRatioConverter about ppm and ppb (#92989) 2023-05-12 16:46:37 +02:00
Matrix 7807df4426 Fix yolink dimmer Incorrect state update (#92986)
fix state update
2023-05-12 16:15:04 +02:00
starkillerOG 4a50c3fbae Bump reolink-aio to 0.5.15 (#92979) 2023-05-12 23:04:36 +09:00
Michael e883fef8ab Fix remove of device when surveillance station is not used in Synology DSM (#92957) 2023-05-12 23:02:42 +09:00
Álvaro Fernández Rojas 45e7283584 Add Airzone fan speed support (#92840) 2023-05-12 22:56:17 +09:00
Jan Bouwhuis a05c20a498 Filter replaying unrelated retained MQTT messages when subscribing to share topics (#88826)
* Do not replay already processed retained subscr.

* Add tests

* Always replay wildcards

* Update tests for debouncer

* Rework for retained topics

* Fix test

* Correct comment

* Add cleanup and test

* Fix key error

* Correct helper

* Rename mock

* Add comment on function _retained_init

* Always replay initial retained payload

* Apply suggestion moving msg.retain to outer check

* Improve test on edge case

* Improve comment formatting

* Follow up comment - improve comments on test

* Update homeassistant/components/mqtt/client.py

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

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-12 15:23:05 +02:00
Robert Hillis bd7e943efe Move Netgear LTE services to their own file (#92945)
* Move Netgear LTE services to their own file

* Update homeassistant/components/netgear_lte/services.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-12 15:18:34 +02:00
Erik Montnemery 30f52b8d96 Minor typing adjustment in entity_platform (#92978) 2023-05-12 15:17:01 +02:00
J. Nick Koston 93bfd7d8d0 Small speed up to validating entity ids (#92970) 2023-05-12 15:04:09 +02:00
Piotr Tobolski 02b5d643e7 Add unique_id support to history_stats sensor (#92972) 2023-05-12 15:03:06 +02:00
J. Nick Koston 24284fe379 Speed up validating domains in templates (#92975)
This path gets called quite a bit since most templates
access the state via states.DOMAIN...
2023-05-12 14:57:51 +02:00
Erik Montnemery 5a7c3aaa2d Add sensor device class volatile_organic_compounds_parts (#92973) 2023-05-12 14:37:54 +02:00
Erik Montnemery 7546e8efa4 Remove stale comment from sensor.const (#92974) 2023-05-12 14:34:29 +02:00
Robert Hillis b4e85b7692 Move Netgear LTE entity to its own file (#92944) 2023-05-12 13:29:56 +02:00
Álvaro Fernández Rojas e9705364a8 Fix Airzone Auto operation mode (#92796) 2023-05-12 16:07:29 +09:00
J. Nick Koston 809f394ff5 Bump sqlalchemy to 2.0.13 (#92936) 2023-05-12 04:37:16 +09:00
Joost Lekkerkerker 30c35e7398 Bump python-vehicle to 1.0.1 (#92933) 2023-05-11 21:31:17 +02:00
Ian 0fcf8f968b Move nextbus constants and utils (#92211)
* NextBus: Move general components to const and util

* Remove not yet used code
2023-05-11 17:28:29 +01:00
Robert Hillis aee3f115d6 Move Netgear LTE constants to their own file (#92924)
* Move Netgear LTE parts to their own files

* Revert to only move constants

* uno mas
2023-05-11 16:49:11 +01:00
J. Nick Koston 52c773a776 Always request at least one zone for multi-zone LIFX devices (#92683) 2023-05-11 12:02:32 +02:00
Erik Montnemery c1f716487c Include data for entire periods in response to recorder/statistics_during_period (#92848)
* Include data for entire periods in response to recorder/statistics_during_period

* Break out function for calculating the end of the month
2023-05-11 11:28:33 +02:00
Franck Nijhof 67d5ca4894 Mark entities from the sun as diagnostic (#92909) 2023-05-11 18:27:19 +09:00
Bram Kragten 75f8ea48f4 Add tts get engine ws command (#92336)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-05-11 10:51:00 +02:00
Erik Montnemery 4568207f9b Support calculating changes between consecutive sum statistics (#92823)
* Support calculating changes between consecutive sum statistics

* Add support for unit conversion when calculating change

* Don't include sum in WS response unless requested

* Improve tests

* Break out calculating change to its own function

* Improve test coverage
2023-05-11 10:05:58 +02:00
J. Nick Koston 8b57d31eba Add ONVIF services to diagnostics (#92878) 2023-05-11 17:03:31 +09:00
Jonathan Keslin c14efef582 Bump volvooncall to 0.10.3 to fix sensor type error (#92913) 2023-05-11 09:42:04 +02:00
epenet 949e8f7b13 Migrate rest notify to httpx (#90769) 2023-05-11 08:26:16 +01:00
Michael 26f7843800 Fix uptime sensor deviation detection in Fritz!Tools (#92907) 2023-05-11 09:10:06 +02:00
J. Nick Koston bf2cfb8edf Bump bluetooth-auto-recovery to 1.2.0 (#92893) 2023-05-11 08:58:29 +02:00
epenet 0cc3e8200c Fix lingering timer in iaqualink (#92856) 2023-05-11 08:55:36 +02:00
epenet 2c79adad5e Fix lingering timer in flux (#92573) 2023-05-11 08:54:51 +02:00
Ståle Storø Hauknes fbd06e0745 Add model name to Airthings integration (#92921) 2023-05-11 08:44:38 +02:00
Marc Mueller 2b59adc955 Update mypy to 1.3.0 (#92911) 2023-05-11 08:38:08 +02:00
J. Nick Koston 3c8659d5d7 Fix missing f-string in async_track_utc_time_change (#92916) 2023-05-11 08:37:15 +02:00
Ståle Storø Hauknes 2ea21e9c2a Adjust link for Airthings (cloud) devices (#92922) 2023-05-11 08:31:23 +02:00
Robert Hillis 14752fdfc2 Bump eternalegypt to 0.0.16 (#92919) 2023-05-10 20:32:14 -04:00
Ziv dd7db85529 User config flow and custom panel for Dynalite integration (#77181) 2023-05-11 00:17:23 +02:00
Matthias Alphart 6250b0a230 Add a custom panel for KNX with a group monitor (#92355)
* Add KNX panel

* provide project data for the panel group monitor

* upload and delete project from panel

* test project store

* more tests

* finish tests

* use integers for DPTBinary payload monitor display

* add project to diagnostics

* require new frontend version

* update knx_frontend

* review suggestions

* update xknxproject to 3.1.0

---------

Co-authored-by: Marvin Wichmann <me@marvin-wichmann.de>
2023-05-11 00:13:22 +02:00
Flo 0f2caf864a Alexa Intent: Use the 'id' field and expose nearest resolutions as variables (#86709)
* Use the 'id' field and nearest resolutions
Expose nearest Resolution (ID and Value) as Variables

* Add more specific type hints

* Change type definition of request

* Add deprecation warning and remove variables

* Remove deprecation warning & update tests

* Fix wrong value assignment

* revert future changes
2023-05-10 21:25:08 +02:00
Franck Nijhof 97cac66195 Add counter.set_value service (#92863) 2023-05-10 18:52:10 +02:00
puddly 98b91bcad9 Bump ZHA dependencies (#92870) 2023-05-10 18:04:46 +02:00
Glenn Waters 74c26fb5e0 Bump UPB integration library to 0.5.4 (#92879) 2023-05-10 18:03:38 +02:00
Dave T 4d26486c98 Add minor comment to assist development in aurora_abb_powerone (#90936)
Add comment to assist development
2023-05-10 15:53:00 +02:00
Kashif Khan 7439ca5b1a Bump azure-servicebus to 7.10.0 (#92866) 2023-05-10 12:36:44 +02:00
Malte Franken 649557ed2e Add config flow to geo_json_events (#87062)
* migrated geo_json_events integration to config flow

* improve test coverage

* code reformatting

* fix tests

* fix entity manager

* changes after review

* improve test coverage and fixed form

* remove unused code

* remove commented out code

* changes after review

* make title prettier

* fixed tests

* simplified code

* changes after review

* fix test

* push deprecation out

* changes after review

* changes after review

* changes after review

* changes after review

* changes after review

* removed scan interval from user flow and import flow
2023-05-10 10:28:45 +02:00
Arkadii Yakovets 0c0d59d3e2 Correct workday strings typo (#92880) 2023-05-10 09:47:42 +02:00
epenet be040f8259 Bump samsungtvws to 2.6.0 (#92876) 2023-05-10 08:52:38 +09:00
Diogo Gomes 23e24d75dc Don't try to restore unavailable nor unknown states (#92825) 2023-05-09 22:22:06 +02:00
Jan Bouwhuis 9e9073d5da Move raise on MQTT publish outside lock (#92860)
* Move raise outside lock

* Move log too
2023-05-09 20:55:29 +02:00
Michael Hansen 5d6ccd6a32 Allow "no" to match "nb" in language util (#92862)
* Allow "no" to match "nb"

* Adjust comparison for speed
2023-05-09 13:46:57 -05:00
Erik Montnemery 7d29d584fd Fix race in Alexa async_enable_proactive_mode (#92785) 2023-05-09 19:58:00 +02:00
Erik Montnemery 67c1051305 Allow setting an entity's name by its device class (#90767)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-05-09 18:55:55 +02:00
epenet 337b59ba23 Fix lingering timer in hassio (#92854) 2023-05-09 18:42:04 +02:00
kernelpanic85 923276a333 Bump panacotta to 0.2 (#92797) 2023-05-09 18:28:10 +02:00
epenet 5f7496f97b Fix lingering timer in hue light tests (#92858) 2023-05-09 17:07:23 +02:00
Jan Bouwhuis 25549eed85 Debounce and group mqtt unsubscribes (#92201)
* Debounce MQTT unsubscribes and merge to one call

* Make _async_unsubscribe a callback

* Make sure unsubscribes are processed

* Move debug log out of lock

* Reduce calls and raise outside lock

* Cancel any unsubscribe when queing

* Copy pending unsubscribes

* Only convert topics to list once

* No copy needed

* Typo in comment
2023-05-09 16:36:19 +02:00
Álvaro Fernández Rojas 0199c6f5b2 Update aioairzone to v0.5.5 (#92812) 2023-05-09 09:21:47 +02:00
epenet cc9de2cc21 Drop unused argument in hassio (#92820) 2023-05-09 08:54:55 +02:00
jjlawren 04c298b772 Bump sonos-websocket to 0.1.1 (#92834) 2023-05-09 07:58:56 +02:00
G Johansson 0bda869553 Lock entity options (#88139) 2023-05-08 22:06:11 +02:00
J. Nick Koston cdc4b315e5 Bump aioesphomeapi to 3.7.4 to fix proxied BLE connections not retrying right away on error (#92741) 2023-05-08 18:56:06 +02:00
Jan Bouwhuis 689c6fbef7 Merge pending MQTT subscribes to a single call to the paho client (#92172)
* Merge mqtt subscribes in one call

* Cleanup

* cleanup, log outside of lock

* Remove function wrapper

* Add test that we bundle subscriptions
2023-05-08 15:37:25 +02:00
Álvaro Fernández Rojas bafb01246a Update aioairzone to v0.5.3 (#92780) 2023-05-08 15:16:16 +02:00
Erik Montnemery 043812bfc3 Bump hass-nabucasa to 0.67.1 (#92484)
* Bump hass-nabucasa to 0.67.1

* Fix typing
2023-05-08 10:51:47 +02:00
G Johansson 6ad4e13b38 Manual trigger entity and refactor command_line switch (#91506)
* TriggerEntity to CoordinatorTriggerEntity

* _render_templates

* split manual vs coordinator

* name

* ManualTriggerEntity

* value

* Remove ManualTriggerEntity

* ManualTriggerEntity

* process_manual_data

* Add test

* imports

* Move ManualTriggerEntity

* cmd_line switch

* Review comments

* Fix templating

* Review comments

* Remove unneeded logging
2023-05-08 10:19:37 +02:00
G Johansson 2e65b77b2b Bump pytrafikverket to 0.3.3 (#92761) 2023-05-07 22:03:37 +02:00
Stephan Uhle d14af51f56 Add debug logs for EDL21 (#92763) 2023-05-07 21:24:42 +02:00
Keilin Bickar 86e5efd929 Bump asyncsleepiq to 1.3.5 (#92759) 2023-05-07 20:58:14 +02:00
Brandon Rothweiler bfb38d2f9c Increase timeout to 30 seconds for Mazda integration (#92744) 2023-05-07 17:32:11 +02:00
karwosts 266905a9d3 Fix zwave_js services example data (#92748) 2023-05-07 17:31:25 +02:00
G Johansson 5b8e72feda Fix regression in rainbird (#92745) 2023-05-07 17:11:55 +02:00
Joakim Plate 6fe596b64f Bump nibe to 2.2.0 (#92740) 2023-05-07 17:11:34 +02:00
Robert Hillis 54b303dfea Cleanup after removing D-Link yaml (#92739) 2023-05-07 16:49:34 +02:00
Robert Hillis e753a33fd7 Fix regression in Skybell (#92735) 2023-05-07 16:48:49 +02:00
Eduard van Valkenburg 28efeb9d9e Update deprecated functions in SIA (#92737)
update deprecated functions
2023-05-07 16:47:02 +02:00
Shay Levy 78fa7fc5da Bump aiowebostv to 0.3.3 to fix Python 3.11 support (#92736)
Bump aiowebostv to 0.3.3
2023-05-07 16:33:15 +03:00
Guido Schmitz f165a41b7a Add button platform to devolo Home Network (#85834)
* Add Start WPS button

* Add remaining buttons

* Set correct entity categories

* Inherit from DevoloEntity

* Fix mypy

* Apply feedback

* Raise on DevicePasswordProtected

* Fix ruff

* Really fix ruff

* Adapt to recent development

* Change error message
2023-05-07 14:53:46 +02:00
Gerard 8c67e96e38 Add AC current limit and Pre entry climatization (#92688)
* Add AC current limit and Pre entry climatization

Additional information available for EVs

* Add pre entry climatization

* Fix mypy error

* Change for black and mypy
2023-05-07 12:46:00 +02:00
Austin Mroczek 16c915864b Add diagnostic sensors for TotalConnect (#73152)
* add diagnostic sensors

* test binary_sensor.py file

* add tests for binary sensor

* fix zone type checks and error on unknown

* improve entity tests

* hide entities by default

* Revert "hide entities by default"

This reverts commit 9808d732471385e45ccc5f7c3aea93bfecbdfa6f.

* Update homeassistant/components/totalconnect/binary_sensor.py

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

* update binary_sensor per comments

* update test

* move to _attr_extra_state_attributes

* no spaces in unique_id

* update per balloob suggestions

* fix typing

* fix black and mypy

* Apply suggestions from code review

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

* add more to binary_sensor tests

* remove unused import

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-05-07 10:27:33 +02:00
andarotajo bf6d429339 Add config flow to dwd_weather_warnings (#91040)
* Add config flow to dwd_weather_warnings

* Add additional test for more coverage

* Apply code review changes

* Apply further code review changes

* Rename constant for configuration

* Apply code review changes

* Simplify config flow code
2023-05-07 10:26:39 +02:00
Thijs W b22c45ea29 Fix radio_id can be unavailable (#92698)
Allow radio_id to be unavailable
2023-05-07 08:59:36 +02:00
G Johansson 2c5cad4ca0 Clean config flow for SQL (#92332) 2023-05-07 01:42:37 +02:00
J. Nick Koston f47f49c9a1 Reduce overhead to check bluetooth logging (#92512) 2023-05-07 01:30:54 +02:00
J. Nick Koston ce3cb5864a Improve reliablity of recorder purge test (#92641) 2023-05-07 01:28:43 +02:00
epenet 7cb25e9710 Fix lingering timer in generic_hygrostat (#92575) 2023-05-07 01:28:10 +02:00
G Johansson 7e19bb4ee0 Minor cleanup config flow Workday (#92163) 2023-05-07 00:55:06 +02:00
J. Nick Koston c624e50b60 Update onvif error checking to use explict None check (#92642) 2023-05-07 00:47:15 +02:00
Mick Vleeshouwer 4a2af45e37 Change IO_OUTLET_ENGINE sensor from Liter to Cubic Meters Per Hour in Overkiz (#92704) 2023-05-07 00:44:26 +02:00
Mick Vleeshouwer 99ab7c5a37 Bump pyoverkiz to 1.7.8 (#92702) 2023-05-07 00:36:21 +02:00
J. Nick Koston d05724a42a Fix onvif reauth when device returns a http 401/403 error (#92690) 2023-05-07 00:12:24 +02:00
G Johansson d66305ddd3 Remove dlink yaml import (#92590) 2023-05-07 00:01:58 +02:00
Marc Mueller 14fd5b7cda Update pylint to 2.17.4 (#92703) 2023-05-06 23:21:31 +02:00
Aaron Bach c634d8f940 Bump aionotion to 2023.05.1 (#92697) 2023-05-06 13:11:57 -05:00
G Johansson 9538d8bcfe Bump pysensibo to 1.0.28 (#92684) 2023-05-06 12:02:09 -05:00
Luke 3f8ffcae73 Bump anova_wifi to 0.10.0 to add better debug (#92686)
add more debig
2023-05-06 18:32:44 +02:00
G Johansson 080ce51ed9 Remove issue from pushover (#92595)
* Remove issue pushover

* Remove strings
2023-05-06 16:49:34 +02:00
J. Nick Koston 4c3e98b77c Fix parallel_updates being acquired too late for entity executor jobs (#92681)
* Fix parallel_updates being acquired too late for entity executor jobs

* tweak
2023-05-06 16:46:00 +02:00
Artem Draft d816da9355 Add media_player platform to Android TV Remote (#91677) 2023-05-06 09:18:34 -05:00
Christoffer Poulsen 053eaad2bd Add charging target sensor to bmw_connected_drive (#92628)
* Add chaging status sensor

* Add unit type based on review
2023-05-06 11:57:53 +02:00
Joakim Plate f9fe3f4af4 Add nibe heat pump water heater entities (#79099)
* Add water heater platform

* Enable water heater platform

* No need to set target temp feature

* Split out preset mode

* Switch to parameters from lib

* Drop presets

* Add missing callback to coordinator update

* Drop support for heatpump activity

- Current entity model does not support it

* Handle s series lack of mappings

* Protect for missing operation modes to set
2023-05-06 11:41:11 +02:00
Sebastian Lövdahl e680ec6247 Remove deprecated Vallox YAML configuration (#91096)
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-05-06 10:23:14 +02:00
rikroe 7e041a95c9 Bump bimmer_connected to 0.13.3 (#92648)
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-05-06 10:05:57 +02:00
rikroe 9a65a89aa4 Improve internet/API error handling for BMW (#90274)
* Improve internet/API error handling

* Switch to library exceptions for HTTP status errors

* Remove duplicate logging after reconnect

* Raise UpdateFailed instead of custom log handling

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-05-06 10:00:37 +02:00
Matthias Alphart 1af1f4db0c Fix devolo home lint errors from ruff (#92649) 2023-05-05 17:11:05 -05:00
Guido Schmitz b195d5d1db Assemble platforms upfront in devolo Home Network (#80126)
* Assemble platforms upfront in devolo Home Network

* Add tests

* Optimize mocks

* Use async_forward_entry_setups

* Adapt tests to newly added switch platform
2023-05-05 23:01:57 +02:00
Tom Harris bdd786b1f0 Cleanup Insteon to use Platform vs DOMAIN constants (#92366)
* Utilize Platform constant

* Use Platform constant
2023-05-05 21:32:51 +02:00
Guido Schmitz 2b3f7ad70d Add diagnostics to devolo Home Control (#86069)
* Add diagnostics to devolo Home Control

* Apply feedback
2023-05-05 21:24:42 +02:00
Paulus Schoutsen e904edb12e 2023.5.2 (#92610) 2023-05-05 15:23:51 -04:00
mkmer 774f1c8ef9 Dont reload integration on auth error in Aladdin Connect (#92399)
Remove reload on auth error
2023-05-05 21:22:55 +02:00
mkmer 7a57435e8c Address connection error wording in Honeywell (#92488)
Connection error wording in Honeywell
2023-05-05 21:21:22 +02:00
Luke f326dd919b Roborock continue on failed mqtt disconnect (#92502)
continue on async disconnect failure
2023-05-05 21:20:30 +02:00
G Johansson 82b4368d1d Bump pytrafikverket to 0.3.1 (#92425)
* Bump pytrafikverket 0.3.0

* 0.3.1

* mypy

* Fix exceptions
2023-05-05 21:19:16 +02:00
G Johansson 85dcd4007c Remove yaml config issue from steam_online (#92592)
Remove yaml config issue from steam
2023-05-05 21:02:40 +02:00
G Johansson e597b3a862 Remove issue from skybell (#92602)
Remove issue
2023-05-05 20:56:49 +02:00
Steve Easley 6bbcf2f689 Add JVC Projector integration (#84748)
* Initial commit of jvcprojector

* Renamed domain

* Initial commit

* Support for v1.0.6 device api

* Fixed failing test

* Removed TYPE_CHECKING constant

* Removed jvc brand

* Removed constant rename

* Renaming more constants

* Renaming yet more constants

* Improved config_flow tests

* More changes based on feedback

* Moved config_flow dependency

* Removed default translation title

* Removed translation file

* Order manifest properly
2023-05-05 20:44:53 +02:00
J. Nick Koston ddebfb3ac5 Fix duplicate ONVIF sensors (#92629)
Some cameras do not configure the video source correctly
when using webhooks but work fine with PullPoint which
results in duplicate sensors
2023-05-05 14:41:00 -04:00
J. Nick Koston fe57901b5f Add support for visitor detections to onvif (#92350) 2023-05-05 14:40:59 -04:00
J. Nick Koston 73d4c73dbb Fix missing ONVIF events when switching from PullPoint to webhooks (#92627)
We now let the PullPoint subscription expire instead of explicitly
unsubscribing when pausing the subscription. We will still unsubscribe
it if Home Assistant is shutdown or the integration is reloaded

Some cameras will cancel ALL subscriptions when we do an unsubscribe
so we want to let the PullPoint subscription expire instead
of explicitly cancelling it.
2023-05-05 14:39:32 -04:00
Bram Kragten f1bccef224 Update frontend to 20230503.3 (#92617) 2023-05-05 14:39:31 -04:00
Joost Lekkerkerker cf243fbe11 Lower scan interval for OpenSky (#92593)
* Lower scan interval for opensky to avoid hitting rate limit

* Lower scan interval for opensky to avoid hitting rate limit

* Update homeassistant/components/opensky/sensor.py

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

* Update homeassistant/components/opensky/sensor.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-05 14:39:30 -04:00
J. Nick Koston 35c48d3d0e Improve reliability of ONVIF subscription renewals (#92551)
* Improve reliablity of onvif subscription renewals

upstream changelog: https://github.com/hunterjm/python-onvif-zeep-async/compare/v2.0.0...v2.1.0

* ```
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/onvif/client.py", line 75, in _async_wrap_connection_error_retry
    return await func(*args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/onvif/event.py", line 441, in _async_call_pullpoint_subscription_renew
    await self._pullpoint_subscription.Renew(SUBSCRIPTION_RELATIVE_TIME)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
    return await self._proxy._binding.send_async(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
    response = await client.transport.post_xml(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 235, in post_xml
    response = await self.post(address, message, headers)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 220, in post
    response = await self.client.post(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1845, in post
    return await self.request(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout
```

* adjust timeouts for slower tplink cameras

* tweak

* more debug

* tweak

* adjust message

* tweak

* Revert "tweak"

This reverts commit 10ee2a8de7.

* give time in seconds

* revert

* revert

* Update homeassistant/components/onvif/event.py

* Update homeassistant/components/onvif/event.py
2023-05-05 14:39:29 -04:00
J. Nick Koston bcbc8539a6 Fix missing ONVIF events when switching from PullPoint to webhooks (#92627)
We now let the PullPoint subscription expire instead of explicitly
unsubscribing when pausing the subscription. We will still unsubscribe
it if Home Assistant is shutdown or the integration is reloaded

Some cameras will cancel ALL subscriptions when we do an unsubscribe
so we want to let the PullPoint subscription expire instead
of explicitly cancelling it.
2023-05-05 14:38:36 -04:00
J. Nick Koston c8c1466c06 Fix duplicate ONVIF sensors (#92629)
Some cameras do not configure the video source correctly
when using webhooks but work fine with PullPoint which
results in duplicate sensors
2023-05-05 14:32:55 -04:00
Bram Kragten cd02a67847 Update frontend to 20230503.3 (#92617) 2023-05-05 14:27:48 -04:00
Joost Lekkerkerker 6d1e607756 Lower scan interval for OpenSky (#92593)
* Lower scan interval for opensky to avoid hitting rate limit

* Lower scan interval for opensky to avoid hitting rate limit

* Update homeassistant/components/opensky/sensor.py

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

* Update homeassistant/components/opensky/sensor.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-05 14:27:28 -04:00
J. Nick Koston 9a589a3a54 Improve reliability of ONVIF subscription renewals (#92551)
* Improve reliablity of onvif subscription renewals

upstream changelog: https://github.com/hunterjm/python-onvif-zeep-async/compare/v2.0.0...v2.1.0

* ```
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/onvif/client.py", line 75, in _async_wrap_connection_error_retry
    return await func(*args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/components/onvif/event.py", line 441, in _async_call_pullpoint_subscription_renew
    await self._pullpoint_subscription.Renew(SUBSCRIPTION_RELATIVE_TIME)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
    return await self._proxy._binding.send_async(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 156, in send_async
    response = await client.transport.post_xml(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 235, in post_xml
    response = await self.post(address, message, headers)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/transports.py", line 220, in post
    response = await self.client.post(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1845, in post
    return await self.request(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1530, in request
    return await self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1617, in send
    response = await self._send_handling_auth(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1645, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_client.py", line 1719, in _send_single_request
    response = await transport.handle_async_request(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 352, in handle_async_request
    with map_httpcore_exceptions():
  File "/opt/homebrew/Cellar/python@3.10/3.10.10_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 153, in __exit__
    self.gen.throw(typ, value, traceback)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ReadTimeout
```

* adjust timeouts for slower tplink cameras

* tweak

* more debug

* tweak

* adjust message

* tweak

* Revert "tweak"

This reverts commit 10ee2a8de7.

* give time in seconds

* revert

* revert

* Update homeassistant/components/onvif/event.py

* Update homeassistant/components/onvif/event.py
2023-05-05 14:26:58 -04:00
Jan Bouwhuis 53e533af6b Improve and enforce type hints for imap (#92325) 2023-05-05 19:21:57 +02:00
G Johansson e41a75f617 Remove yaml import rainbird (#92599) 2023-05-05 16:53:40 +02:00
G Johansson 835be4758a Remove deprecated service for rainbird (#92601) 2023-05-05 07:22:07 -07:00
epenet 70bfbde8aa Add ability to shutdown a coordinator on STOP (#92611) 2023-05-05 16:05:03 +02:00
ollo69 8001ed865d Fix switchbot binary sensor translation key (#92557) 2023-05-05 08:04:11 -05:00
Paulus Schoutsen 15ef53cd9a Bumped version to 2023.5.2 2023-05-05 08:47:12 -04:00
Erik Montnemery fb29e1a14e Bump hatasmota to 0.6.5 (#92585)
* Bump hatasmota to 0.6.5

* Fix tests
2023-05-05 08:47:08 -04:00
epenet f8c3586f6b Fix hassio get_os_info retry (#92569) 2023-05-05 08:47:07 -04:00
Paulus Schoutsen e8808b5fe7 Re-run expose entities migration if first time failed (#92564)
* Re-run expose entities migration if first time failed

* Count number of exposed entities

* Add tests

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-05-05 08:47:06 -04:00
J. Nick Koston 82c0967716 Bump elkm1-lib to 2.2.2 (#92560)
changelog: https://github.com/gwww/elkm1/compare/2.2.1...2.2.2

fixes #92467
2023-05-05 08:47:05 -04:00
J. Nick Koston 163823d2a5 Allow duplicate state updates when force_update is set on an esphome sensor (#92553)
* Allow duplicate states when force_update is set on an esphome sensor

fixes #91221

* Update homeassistant/components/esphome/entry_data.py

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>

---------

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>
2023-05-05 08:47:04 -04:00
puddly 2dd1ce2047 Handle invalid ZHA cluster handlers (#92543)
* Do not crash on startup when an invalid cluster handler is encountered

* Add a unit test
2023-05-05 08:47:03 -04:00
J. Nick Koston 241cacde62 Bump aioesphomeapi to 13.7.3 to fix disconnecting while handshake is in progress (#92537)
Bump aioesphomeapi to 13.7.3

fixes #92432
2023-05-05 08:47:02 -04:00
Erik Montnemery 8a11ee81c4 Improve cloud migration (#92520)
* Improve cloud migration

* Tweak

* Use entity_ids func

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-05-05 08:47:01 -04:00
J. Nick Koston e3762724a3 Fix blocking I/O in the event loop when starting ONVIF (#92518) 2023-05-05 08:47:00 -04:00
karwosts b973825833 Fix scene service examples (#92501) 2023-05-05 08:46:59 -04:00
Eduard van Valkenburg b2fcbbe50e Fix for SIA Code not being handled well (#92469)
* updated sia requirements

* updates because of changes in package

* linting and other small fixes

* fix for unknown code

* added same to alarm_control_panel
2023-05-05 08:46:58 -04:00
Francesco Carnielli d96b37a004 Fix power sensor state_class in Netatmo integration (#92468) 2023-05-05 08:46:57 -04:00
DDanii affece8857 Fix transmission error handling (#91548)
* transmission error handle fix

* added unexpected case tests
2023-05-05 08:46:56 -04:00
epenet b222c58642 Fix hassio get_os_info retry (#92569) 2023-05-05 08:43:56 -04:00
epenet 802e907a35 Migrate rest switch to httpx (#90768) 2023-05-05 14:43:39 +02:00
Erik Montnemery 5843c1fa3b Bump hatasmota to 0.6.5 (#92585)
* Bump hatasmota to 0.6.5

* Fix tests
2023-05-05 08:40:30 -04:00
epenet 176820d665 Fix lingering timer in freedns (#92572)
* Fix lingering timer in freedns

* type hint
2023-05-05 14:11:31 +02:00
Paulus Schoutsen 19dcc8c88f Re-run expose entities migration if first time failed (#92564)
* Re-run expose entities migration if first time failed

* Count number of exposed entities

* Add tests

---------

Co-authored-by: Erik <erik@montnemery.com>
2023-05-05 08:11:09 -04:00
epenet 6f3c9324ac Fix lingering timer in hdmi_cec (#92579) 2023-05-05 14:10:44 +02:00
G Johansson e55f2173f8 Use selectors in Trafikverket Train (#92554)
Use selectors
2023-05-05 13:29:00 +02:00
Eduard van Valkenburg 1976232d5a Fix for SIA Code not being handled well (#92469)
* updated sia requirements

* updates because of changes in package

* linting and other small fixes

* fix for unknown code

* added same to alarm_control_panel
2023-05-05 10:47:49 +02:00
epenet 603aa759d3 Fix KeyError in rest (#92464) 2023-05-05 09:05:31 +02:00
DDanii 9ce062411d Fix transmission error handling (#91548)
* transmission error handle fix

* added unexpected case tests
2023-05-05 08:42:51 +02:00
Erik Montnemery b6664ce367 Improve cloud migration (#92520)
* Improve cloud migration

* Tweak

* Use entity_ids func

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-05-04 23:10:43 -04:00
J. Nick Koston 3f630493ff Allow duplicate state updates when force_update is set on an esphome sensor (#92553)
* Allow duplicate states when force_update is set on an esphome sensor

fixes #91221

* Update homeassistant/components/esphome/entry_data.py

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>

---------

Co-authored-by: pdw-mb <pdw@mythic-beasts.com>
2023-05-04 22:21:42 -04:00
J. Nick Koston 6dd88a767b Bump elkm1-lib to 2.2.2 (#92560)
changelog: https://github.com/gwww/elkm1/compare/2.2.1...2.2.2

fixes #92467
2023-05-04 22:20:25 -04:00
J. Nick Koston 785faf4380 Bump aioesphomeapi to 13.7.3 to fix disconnecting while handshake is in progress (#92537)
Bump aioesphomeapi to 13.7.3

fixes #92432
2023-05-04 22:18:20 -04:00
puddly 5f22b0c6cc Handle invalid ZHA cluster handlers (#92543)
* Do not crash on startup when an invalid cluster handler is encountered

* Add a unit test
2023-05-04 20:02:17 -04:00
Franck Nijhof 9e529d1d59 Refactor of unique ID and entity description handling in Rituals Perfume Genie (#92545) 2023-05-04 21:54:28 +02:00
rrooggiieerr 7b8936b420 Add support for setting NumberMode using NumberEntityDescription (#92427) 2023-05-04 21:41:32 +02:00
Franck Nijhof 7d00804f13 Add entity descriptions to selects of Rituals Perfume Genie (#92522) 2023-05-04 20:13:04 +02:00
Franck Nijhof 80e9219546 Add entity descriptions to sensors of Rituals Perfume Genie (#92527) 2023-05-04 20:12:52 +02:00
Erik Montnemery a72bcfde4a Refactor multipan options flow (#92175) 2023-05-04 19:50:43 +02:00
Jan Bouwhuis 56dcb908bc Wait for mqtt client to become available (#92524) 2023-05-04 19:48:32 +02:00
Franck Nijhof 677ab5837f Add entity descriptions to switch of Rituals Perfume Genie (#92531) 2023-05-04 19:20:58 +02:00
Franck Nijhof dd3ae96d5f Add entity descriptions to numbers of Rituals Perfume Genie (#92486) 2023-05-04 19:13:05 +02:00
epenet 628236209b Fix lingering timer in cloud (#92498) 2023-05-04 19:10:44 +02:00
J. Nick Koston 7987b00d89 Fix blocking I/O in the event loop when starting ONVIF (#92518) 2023-05-04 12:05:29 -05:00
epenet e0903b8bc4 Fix lingering timer in duckdns (#92516) 2023-05-04 19:03:54 +02:00
epenet 4d77c6f27f Fix lingering timer in elkm1 (#92517) 2023-05-04 19:03:26 +02:00
epenet b6930c0f04 Fix lingering timer in demo geo_location (#92514) 2023-05-04 19:02:52 +02:00
Erik Montnemery 887e656570 Small improvement of assist_pipeline test coverage (#92115) 2023-05-04 19:01:41 +02:00
Paulus Schoutsen bce18bf61a 2023.5.1 (#92513) 2023-05-04 12:45:55 -04:00
Francesco Carnielli 57af4672d5 Fix power sensor state_class in Netatmo integration (#92468) 2023-05-04 17:36:31 +02:00
karwosts 8237d6b9f0 Fix scene service examples (#92501) 2023-05-04 17:35:52 +02:00
Paulus Schoutsen eda0731e60 Bumped version to 2023.5.1 2023-05-04 10:23:58 -04:00
Bram Kragten 238c87055f Update frontend to 20230503.2 (#92508) 2023-05-04 10:23:53 -04:00
Erik Montnemery 4b4464a3de Force migration of cloud settings to exposed_entities (#92499) 2023-05-04 10:23:52 -04:00
J. Nick Koston a07fbdd61c Bump bluetooth-auto-recovery 1.1.2 (#92495)
Improve handling when getting the power state times out

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/compare/v1.1.1...v1.1.2
2023-05-04 10:23:52 -04:00
J. Nick Koston 3126ebe9d6 Fix lifx light strips when color zones are not initially populated (#92487)
fixes #92456
2023-05-04 10:23:51 -04:00
Aaron Bach 89aec9d356 Bump aionotion to 2023.05.0 (#92451) 2023-05-04 10:23:49 -04:00
J. Nick Koston 0cfa566ff6 Fix onvif cameras with invalid encodings in device info (#92450)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-04 10:23:49 -04:00
J. Nick Koston fffece95f5 Fix onvif setup when time set service is not functional (#92447) 2023-05-04 10:23:48 -04:00
Bram Kragten d66fabb5b5 Update frontend to 20230503.2 (#92508) 2023-05-04 10:22:48 -04:00
J. Nick Koston 36cb8a7184 Bump bluetooth-auto-recovery 1.1.2 (#92495)
Improve handling when getting the power state times out

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/compare/v1.1.1...v1.1.2
2023-05-04 09:53:43 -04:00
Erik Montnemery e14be8b0ab Force migration of cloud settings to exposed_entities (#92499) 2023-05-04 09:53:28 -04:00
J. Nick Koston 9b74cb9507 Fix lifx light strips when color zones are not initially populated (#92487)
fixes #92456
2023-05-04 08:55:47 -04:00
epenet 8a9b9c35e0 Fix lingering timer in lifx (#92476)
* Fix lingering timer in lifx

* Remove duplicate code
2023-05-04 14:06:38 +02:00
Franck Nijhof a73a66bb0c Add entity descriptions to binary sensors of Rituals Perfume Genie (#92485) 2023-05-04 13:54:57 +02:00
J. Nick Koston 41515249a0 Fix onvif cameras with invalid encodings in device info (#92450)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-05-04 06:48:13 -05:00
epenet 95023ecf08 Fix lingering timer in rfxtrx (#92461) 2023-05-04 12:27:17 +02:00
Erik Montnemery 78da1168db Adjust type hints in CloudClient (#92465) 2023-05-04 12:26:52 +02:00
Franck Nijhof 46bf0e59f3 Move naming of entities in Rituals Perfume Genie (#92482) 2023-05-04 12:25:22 +02:00
J. Nick Koston 5ee6595998 Bump dbus-fast to 1.86.0 (#92435) 2023-05-04 12:24:26 +02:00
epenet 9fca594777 Fix lingering timer in rflink (#92460) 2023-05-04 12:23:45 +02:00
Aaron Bach b0b53574f9 Bump aionotion to 2023.05.0 (#92451) 2023-05-04 12:21:58 +02:00
epenet 71b86e9f97 Fix lingering timer in sabnzbd (#92462) 2023-05-04 12:19:40 +02:00
J. Nick Koston 88019d70fe Bump zeroconf to 0.62.0 (#92444) 2023-05-04 12:18:08 +02:00
J. Nick Koston 322c5152be Fix onvif setup when time set service is not functional (#92447) 2023-05-04 11:50:12 +02:00
epenet 7dc5d131b4 Fix lingering timer in jewish_calendar (#92470) 2023-05-04 11:38:24 +02:00
epenet a4a795e35b Fix lingering timer in kira tests (#92471) 2023-05-04 11:28:05 +02:00
epenet 8ab8b7152a Fix lingering timer in kostal_plenticore (#92473) 2023-05-04 11:27:17 +02:00
epenet 6836e15d98 Add type hints to tests (#92477) 2023-05-04 11:25:35 +02:00
epenet 3b4828d736 Drop tmpdir from media_source tests (#92478) 2023-05-04 11:24:29 +02:00
epenet 1cca6f7c9e Fix lingering timer in shelly (#92466) 2023-05-04 10:34:15 +02:00
J. Nick Koston ef9bcd9285 Bump zeroconf to 0.61.0 (#92424)
changelog: https://github.com/python-zeroconf/python-zeroconf/compare/0.60.0...0.61.0
2023-05-04 00:09:35 +03:00
Franck Nijhof c61e29709c 2023.5.0 (#92422) 2023-05-03 20:46:28 +02:00
Michael Hansen 458fe17a48 Bump voip-utils to 0.0.7 (#92372) 2023-05-03 20:02:45 +02:00
Franck Nijhof 15fdefd23b Bumped version to 2023.5.0 2023-05-03 19:44:53 +02:00
Michael Hansen 576f9600b5 Pass OPUS payload ID through VoIP (#92421) 2023-05-03 19:44:34 +02:00
Michael Hansen aa78962a9a Pass OPUS payload ID through VoIP (#92421) 2023-05-03 19:43:14 +02:00
Franck Nijhof 7a62574360 Bumped version to 2023.5.0b9 2023-05-03 18:59:42 +02:00
Erik Montnemery 0251d677d8 Migrate cloud settings for all Google entities (#92416) 2023-05-03 18:59:32 +02:00
Michael Hansen 2cd9b94ecb Skip unexposed entities in intent handlers (#92415)
* Filter intent handler entities by exposure

* Add test for skipping unexposed entities
2023-05-03 18:59:29 +02:00
Erik Montnemery 3cd2ab2319 Migrate cloud settings for all Alexa entities (#92413)
* Migrate cloud settings for all Alexa entities

* Also set settings for unknown entities
2023-05-03 18:59:25 +02:00
J. Nick Koston 4f0d403393 Bump bluetooth-auto-recovery to 1.1.1 (#92412)
* Bump bluetooth-auto-recovery to 1.1.0

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/releases/tag/v1.1.0

In https://github.com/home-assistant/operating-system/issues/2485 is was discovered that a more aggressive reset strategy is needed due to a yet unsolved bug in the linux 6.1.x kernel series

* bump to 1.1.1 since event 47 cannot be decoded (newer kernels only)
2023-05-03 18:59:22 +02:00
Bram Kragten b558cf8b59 Update frontend to 20230503.1 (#92410) 2023-05-03 18:59:18 +02:00
Erik Montnemery 820c7b77ce Update cloud WS API for getting entity (#92409)
* Update cloud WS API for getting entity

* Adjust comment
2023-05-03 18:59:15 +02:00
Erik Montnemery 9d0fc916fc Use exposed_entities API in cloud tests (#92408) 2023-05-03 18:59:11 +02:00
Erik Montnemery 387f07a97f Include all entities in cloud lists (#92406) 2023-05-03 18:59:08 +02:00
J. Nick Koston 44968cfc7c Handle webhook URL rejection in onvif (#92405) 2023-05-03 18:59:04 +02:00
Erik Montnemery c6751bed86 Allow setting google disable 2fa flag on any entity (#92403)
* Allow setting google disable 2fa flag on any entity

* Fix test

* Include disable_2fa flag in cloud/google_assistant/entities/get
2023-05-03 18:59:01 +02:00
Bram Kragten b87e3860d9 Update frontend to 20230503.0 (#92402) 2023-05-03 18:58:57 +02:00
David F. Mulcahey 8ef6bd85f5 Bump ZHA quirks (#92400) 2023-05-03 18:58:54 +02:00
Erik Montnemery ad4fed4f60 Allow exposing any entity to the default conversation agent (#92398)
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 18:58:51 +02:00
Erik Montnemery 1050895657 Don't use storage collection helper in ExposedEntities (#92396)
* Don't use storage collection helper in ExposedEntities

* Fix tests
2023-05-03 18:58:47 +02:00
Erik Montnemery c31d657206 Improve exposed entities tests (#92389) 2023-05-03 18:58:44 +02:00
repaxan 88343bed77 Add ZHA binding for window coverings (#92387) 2023-05-03 18:58:40 +02:00
Artem Draft 51a10a84da Bump pybravia to 0.3.3 (#92378) 2023-05-03 18:58:35 +02:00
Erik Montnemery a9d8bc989e Migrate cloud settings for all Google entities (#92416) 2023-05-03 18:56:48 +02:00
Erik Montnemery 51be90d87e Migrate cloud settings for all Alexa entities (#92413)
* Migrate cloud settings for all Alexa entities

* Also set settings for unknown entities
2023-05-03 12:39:27 -04:00
J. Nick Koston 4abf0ddeb9 Bump bluetooth-auto-recovery to 1.1.1 (#92412)
* Bump bluetooth-auto-recovery to 1.1.0

https://github.com/Bluetooth-Devices/bluetooth-auto-recovery/releases/tag/v1.1.0

In https://github.com/home-assistant/operating-system/issues/2485 is was discovered that a more aggressive reset strategy is needed due to a yet unsolved bug in the linux 6.1.x kernel series

* bump to 1.1.1 since event 47 cannot be decoded (newer kernels only)
2023-05-03 12:18:47 -04:00
Michael Hansen 74560ab139 Skip unexposed entities in intent handlers (#92415)
* Filter intent handler entities by exposure

* Add test for skipping unexposed entities
2023-05-03 12:18:31 -04:00
Bram Kragten 2ae3e90238 Update frontend to 20230503.1 (#92410) 2023-05-03 17:27:42 +02:00
Erik Montnemery f089f52504 Update cloud WS API for getting entity (#92409)
* Update cloud WS API for getting entity

* Adjust comment
2023-05-03 17:06:42 +02:00
Erik Montnemery 470c3a0f5f Use exposed_entities API in cloud tests (#92408) 2023-05-03 16:50:43 +02:00
Erik Montnemery b71f98e8b7 Include all entities in cloud lists (#92406) 2023-05-03 16:14:04 +02:00
Erik Montnemery 31de1b17e8 Allow setting google disable 2fa flag on any entity (#92403)
* Allow setting google disable 2fa flag on any entity

* Fix test

* Include disable_2fa flag in cloud/google_assistant/entities/get
2023-05-03 09:55:38 -04:00
J. Nick Koston 20942ab26f Handle webhook URL rejection in onvif (#92405) 2023-05-03 15:46:53 +02:00
Bram Kragten 9162bad4da Update frontend to 20230503.0 (#92402) 2023-05-03 15:46:14 +02:00
Erik Montnemery 0126cfa9d9 Allow exposing any entity to the default conversation agent (#92398)
* Allow exposing any entity to the default conversation agent

* Tweak

* Fix race, update tests

* Update tests
2023-05-03 09:45:54 -04:00
David F. Mulcahey 6a8668effc Bump ZHA quirks (#92400) 2023-05-03 08:35:53 -04:00
repaxan 1d6b08e194 Add ZHA binding for window coverings (#92387) 2023-05-03 08:35:20 -04:00
Erik Montnemery 4860a8d1e8 Don't use storage collection helper in ExposedEntities (#92396)
* Don't use storage collection helper in ExposedEntities

* Fix tests
2023-05-03 12:39:22 +02:00
Erik Montnemery 7aa94f97c0 Improve exposed entities tests (#92389) 2023-05-03 10:49:01 +02:00
Artem Draft d417cbaf0f Bump pybravia to 0.3.3 (#92378) 2023-05-03 08:52:56 +02:00
Paulus Schoutsen 1baa4d5109 Fix deserialize bug + add test coverage (#92382) 2023-05-02 22:38:54 -04:00
Bram Kragten 5ed41d3d51 Update frontend to 20230502.0 (#92373) 2023-05-02 22:41:35 +02:00
Michael Hansen 17db1aa38b Bump voip-utils to 0.0.7 (#92372) 2023-05-02 22:39:41 +02:00
Erik Montnemery e3c16e634b Allow exposing entities not in the entity registry to assistants (#92363) 2023-05-02 22:08:09 +02:00
John Pettitt cc4e741cfa Increase default timeout in sense (#90556)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-05-02 09:50:34 -05:00
J. Nick Koston a9d992c2de Add support for visitor detections to onvif (#92350) 2023-05-02 12:19:27 +02:00
Raman Gupta 9f7c085652 Clean up zwave_js.cover (#92353) 2023-05-02 12:18:19 +02:00
J. Nick Koston c0fa078b0b Start onvif events later (#92354) 2023-05-02 12:17:01 +02:00
J. Nick Koston 2636a46a5f Bump ulid-transform to 0.7.2 (#92344) 2023-05-02 08:46:14 +02:00
J. Nick Koston 86f8147782 Bump zeroconf to 0.60.0 (#92335) 2023-05-01 22:51:30 +02:00
Raman Gupta 5dd3209e42 Add date and time platforms to core files (#92343) 2023-05-01 22:50:44 +02:00
Bram Kragten a6d6d59c93 Update frontend to 20230501.0 (#92339) 2023-05-01 22:49:38 +02:00
Franck Nijhof a7088e767e Migrate unique IDs of Rituals Perfume Genie (#92342)
* Migrate unique IDs of Rituals Perfume Genie

* Fix doc string
2023-05-01 22:46:38 +02:00
Michael Hansen 40896514eb Bump voip-utils to 0.0.6 (#92334) 2023-05-01 22:43:27 +02:00
Michael Hansen b1d6f3afc0 Allow configuring SIP port in VoIP (#92210)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-05-01 22:42:27 +02:00
Marc Mueller d66056cfab Improve fritz generic typing (#92327) 2023-05-01 21:11:40 +02:00
J. Nick Koston 324df197d1 Avoid starting ONVIF PullPoint if the camera reports its unsupported (#92333) 2023-05-01 18:33:52 +02:00
David F. Mulcahey 2bc2c4a651 Don't poll ZHA electrical measurement sensors unnecessarily (#92330) 2023-05-01 18:32:40 +02:00
Paulus Schoutsen adaae46178 Add voip configuration url (#92326) 2023-05-01 16:20:37 +02:00
G Johansson 9795699669 Fix db_url issue in SQL (#92324)
* db_url fix

* Add test

* assert entry.options
2023-05-01 16:17:01 +02:00
Luke 7b5d26d3fa Bump anova version (#92206)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-05-01 11:15:29 +02:00
J. Nick Koston ede1f08c51 Reduce size of migration transactions to accommodate slow/busy systems (#92312)
* Reduce size of migration transactions to accommodate slow/busy systems

related issue #91489

* handle overloaded RPIs better
2023-04-30 23:18:00 -04:00
J. Nick Koston 30dd8b9f3a Retry onvif setup when it is unexpectedly cancelled (#92313)
* Retry onvif setup when it is unexpectedly cancelled

fixes #92308

* Retry onvif setup when it is unexpectedly cancelled

fixes #92308
2023-04-30 23:12:01 -04:00
J. Nick Koston 32f6dd4a82 Bump sqlalchemy to 2.0.12 (#92315)
changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html#change-2.0.12
2023-04-30 23:11:29 -04:00
Allen Porter e7433c42b9 Cleanup code from nest yaml migration and OOB auth deprecation (#92311) 2023-04-30 18:00:40 -07:00
Raman Gupta c0d0c89293 Add time platform (#81949) 2023-04-30 22:33:51 +02:00
Allen Porter 6f63ed07f9 Deprecate legacy Works With Nest (again) (#92304) 2023-04-30 21:56:29 +02:00
Franck Nijhof 5cbf08f89a Only store and pass around coordinator in Rituals Perfume Genie (#92298) 2023-04-30 21:32:14 +02:00
J. Nick Koston bb4c03ce3c Avoid returning statistics columns that the metadata knows are impossible (#92095) 2023-04-30 20:46:26 +02:00
Raman Gupta d138bbe26e Add date platform (#81948) 2023-04-30 20:34:57 +02:00
J. Nick Koston f95f2d1cfc Prevent pysnmp from being installed as it does not work with newer python (#92292) 2023-04-30 20:13:47 +02:00
epenet b969790e95 Use SnapshotAssertion in Renault tests (#90778) 2023-04-30 18:55:31 +02:00
stickpin 9317ddb1c7 Home Connect add WasherDryer support (#90673) 2023-04-30 18:50:51 +02:00
Joost Lekkerkerker cd52e05075 Move lastfm constants to separate file (#92289) 2023-04-30 18:09:02 +02:00
J. Nick Koston ed286fc223 Fix august lock state when API reports locking and locked with the same timestamp (#92276) 2023-04-30 18:08:12 +02:00
J. Nick Koston 4fcf05c202 Ensure onvif webhook can be registered (#92295) 2023-04-30 18:06:38 +02:00
J. Nick Koston a08cda3cfe Bump beacontools to fix conflict with construct<2.10 and >=2.8.16 (#92293) 2023-04-30 18:06:09 +02:00
Maximilian 696e714190 Bump pynina to 0.3.0 (#92286) 2023-04-30 18:05:22 +02:00
Jan Bouwhuis 7a43b29f38 Fix mqtt not available when starting snips (#92296) 2023-04-30 17:35:24 +02:00
Franck Nijhof 2cc31d6a5b Extract Rituals Perfume Genie DataUpdateCoordinator into module (#92284) 2023-04-30 17:07:55 +02:00
J. Nick Koston b629bf37bb Bump bleak to 0.20.2 (#92294) 2023-04-30 17:07:00 +02:00
Robert Hillis 464c81ec9d Add missing fstrings in Local Calendar (#92288) 2023-04-30 06:15:57 -07:00
Tomer Figenblat 2cb73b4a1f Remove myself from switcher_kis codeowners (#92277)
chore: remove myself switcher_kis codeowners

Signed-off-by: Tomer Figenblat <tomer@tomfi.info>
2023-04-30 11:19:46 +03:00
J. Nick Koston 193b2694a9 Handle AttributeError from wrong port in ONVIF config flow (#92272)
* Handle AttributeError from wrong port in ONVIF config flow

fixes
```
2023-04-29 19:17:22.289 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohttp/web_protocol.py", line 433, in _handle_request
    resp = await request_handler(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/security_filter.py", line 85, in security_filter_middleware
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/ban.py", line 80, in ban_middleware
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/auth.py", line 235, in auth_middleware
    return await handler(request)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/view.py", line 146, in handle
    result = await result
  File "/Users/bdraco/home-assistant/homeassistant/components/config/config_entries.py", line 180, in post
    return await super().post(request, flow_id)
  File "/Users/bdraco/home-assistant/homeassistant/components/http/data_validator.py", line 72, in wrapper
    result = await method(view, request, data, *args, **kwargs)
  File "/Users/bdraco/home-assistant/homeassistant/helpers/data_entry_flow.py", line 110, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 271, in async_configure
    result = await self._async_handle_step(
  File "/Users/bdraco/home-assistant/homeassistant/data_entry_flow.py", line 367, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/Users/bdraco/home-assistant/homeassistant/components/onvif/config_flow.py", line 233, in async_step_configure
    errors, description_placeholders = await self.async_setup_profiles()
  File "/Users/bdraco/home-assistant/homeassistant/components/onvif/config_flow.py", line 277, in async_setup_profiles
    await device.update_xaddrs()
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/onvif/client.py", line 433, in update_xaddrs
    capabilities = await devicemgmt.GetCapabilities({"Category": "All"})
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/proxy.py", line 64, in __call__
    return await self._proxy._binding.send_async(
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 164, in send_async
    return self.process_reply(client, operation_obj, response)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/wsdl/bindings/soap.py", line 204, in process_reply
    doc = parse_xml(content, self.transport, settings=client.settings)
  File "/Users/bdraco/home-assistant/venv/lib/python3.10/site-packages/zeep/loader.py", line 51, in parse_xml
    docinfo = elementtree.getroottree().docinfo
AttributeError: NoneType object has no attribute getroottree
```

* port

* Revert "port"

This reverts commit 4693f3f33a.

* misfire
2023-04-29 21:17:56 -04:00
J. Nick Koston 1a82b353e0 Auto repair incorrect collation on MySQL schema (#92270)
* Auto repair incorrect collation on MySQL schema

As we do more union queries in 2023.5.x if there is a mismatch
between collations on tables, they will fail with an error
that is hard for the user to figure out how to fix

`Error executing query: (MySQLdb.OperationalError) (1271, "Illegal mix of collations for operation UNION")`

This was reported in the #beta channel and by PM from others
so the problem is not isolated to a single user

https://discord.com/channels/330944238910963714/427516175237382144/1100908739910963272

* test with ascii since older maraidb versions may not work otherwise

* Revert "test with ascii since older maraidb versions may not work otherwise"

This reverts commit 787fda1aefcd8418a28a8a8f430e7e7232218ef8.t

* older version need to check collation_server because the collation is not reflected if its the default
2023-04-29 21:17:09 -04:00
Franck Nijhof 3a5a9a90b2 Update orjson to 3.8.11 (#92228) 2023-04-29 20:22:33 -04:00
Franck Nijhof 7d518c5484 Update coverage to 7.2.4 (#92229) 2023-04-29 20:22:15 -04:00
Franck Nijhof 3363830ede Fix incorrect entity category for SmartThings sensors (#92232) 2023-04-29 20:21:55 -04:00
Franck Nijhof ed3c1d9b59 Fix incorrect entity category for huawei_lte sensors (#92235) 2023-04-29 20:21:38 -04:00
Robert Hillis a5044227a8 Fix Google Mail Sensor key error (#92262)
Fix Google Mail key error
2023-04-29 20:20:43 -04:00
Michael 895c0be82c Fix call deflection update in Fritz!Tools (#92267)
fix
2023-04-29 20:19:41 -04:00
Franck Nijhof e2636587f8 Add myself as codeowner to Rituals perfume genie (#92261) 2023-04-29 18:49:52 -05:00
Jan Bouwhuis 9468aed689 Fix MQTT certificate files setup (#92266) 2023-04-30 00:01:44 +02:00
Franck Nijhof bff7119230 Update requests to 2.29.0 (#92231) 2023-04-29 23:44:20 +02:00
Ian 1f2da1217b NextBus: Correct iot_class (#92208) 2023-04-29 21:41:35 +02:00
shbatm d9e0681123 Remove deprecated ISY994 Insteon and variable sensor entities (#92255) 2023-04-29 21:40:58 +02:00
J. Nick Koston b0b4134ded Handle onvif errors when detail is returned as bytes (#92259) 2023-04-29 21:33:25 +02:00
J. Nick Koston f38d45151a Pin pyasn1 and pysnmplib since pyasn1 0.5.0 has breaking changes and pysnmp-pyasn1 and pyasn1 are both using the pyasn1 namespace (#92254) 2023-04-29 21:32:57 +02:00
Michael Hansen c35aabe497 Add VoIP error tone (#92260)
* Play error tone when pipeline error occurs

* Play listening tone at the start of each cycle
2023-04-29 15:24:56 -04:00
Franck Nijhof b9f2b0ad8b Update pyfibaro to 0.7.1 (#92248) 2023-04-29 19:06:14 +02:00
J. Nick Koston 11131070ab Bump pyunifiprotect to 4.8.3 (#92251) 2023-04-29 18:59:44 +02:00
IceBotYT d23bd2ad68 Add diagnostics to LaCrosse View (#92212) 2023-04-29 18:53:40 +02:00
Michael ac4d9216d6 Turn AVM FRITZ!Box Tools call deflection switches into coordinator entities (#91913)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-04-29 18:51:38 +02:00
IceBotYT d8bc37c695 Bump LaCrosse View to version 1.0.1 (#92213) 2023-04-29 18:50:22 +02:00
Bouwe Westerdijk e08d5d240d Bump plugwise to v0.31.1 (#92249) 2023-04-29 18:49:15 +02:00
J. Nick Koston e136070718 Speed up purging the database (#92247) 2023-04-29 18:45:14 +02:00
Mick Vleeshouwer 0e0ab4427b Revert "Add silent option for DynamicShutter (ogp:Shutter) in Overkiz" (#91354) 2023-04-29 18:34:21 +02:00
Diogo Gomes a48a07bd8d Removing self from SQL sensor CODEOWNERS (#92250) 2023-04-29 18:27:39 +02:00
Franck Nijhof 37723792c7 Fix unknown/unavailable source sensor in Filter entities (#92241) 2023-04-29 17:47:04 +02:00
rikroe 1028841690 Move BMW Target SoC to number platform (#91081)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-04-29 17:41:34 +02:00
Franck Nijhof acc4b001cd Fix history YAML deprecation (#92238) 2023-04-29 08:02:34 -04:00
Franck Nijhof 06c4da2bb6 Fix incorrect entity category for flux_led sensors (#92234) 2023-04-29 06:11:50 -05:00
Franck Nijhof f8942e7dcc Fix incorrect entity category for isy994 sensors (#92233) 2023-04-29 06:10:52 -05:00
Rajeevan 44186bb731 Fix solaredge-local protobuf exception (#92090) 2023-04-29 11:33:43 +02:00
epenet 7dfbfd45ae Cleanup onewire tests (#92117) 2023-04-29 11:18:16 +02:00
Tom Harris 58c5d98958 Fix Insteon scenes with disabled entities (#92137) 2023-04-29 11:16:04 +02:00
Allen Porter 282d5f4488 Add more detail to invalid rrule calendar error message (#92222)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-04-29 09:57:30 +02:00
Michael Davie 4511e91cfd Bump env_canada to 0.5.34 (#92216)
Bump env_canada to v.0.5.34
2023-04-29 07:17:52 +02:00
Raman Gupta 96455c74f0 Use enum sensor device class in Z-Wave (#92029)
* Use enum sensor device class where appropriate

* update docstring
2023-04-28 23:24:35 -04:00
jjlawren 65837c9075 Bump sonos-websocket to 0.1.0 (#92209)
Bump sonos-websocket to 0.1.0
2023-04-28 16:10:48 -05:00
epenet c483860560 Fix lingering timer in qld_bushfire (#92189) 2023-04-28 21:16:26 +02:00
epenet c303487c1b Fix lingering timer in feedreader (#92180) 2023-04-28 21:16:08 +02:00
J. Nick Koston 07d1a16efd Add as_dict cache to Context and Event (#92162) 2023-04-28 21:15:39 +02:00
epenet 67a7de1869 Improve init type hints in enocean (#92176) 2023-04-28 21:14:37 +02:00
Sven Serlier 8c64eda58f Update URLs in PR template (#92194) 2023-04-28 21:12:26 +02:00
epenet 397a5ff992 Fix lingering timer in broadlink (#92179) 2023-04-28 21:08:08 +02:00
Sven Serlier a0cd0b3c6c Fix typo in anova integration (#92191) 2023-04-28 21:07:17 +02:00
epenet d366b43866 Fix lingering timer in lifx discovery (#92185) 2023-04-28 21:06:32 +02:00
J. Nick Koston e156d3132e Ensure purge can cleanup old format detached states in the database (#92145) 2023-04-28 21:03:59 +02:00
J. Nick Koston 293fb374ed Fix missing preset_mode feature in bond fans (#92202) 2023-04-28 21:03:16 +02:00
Paul Bottein 75560aab1b Update frontend to 20230428.0 (#92190) 2023-04-28 21:01:28 +02:00
Jean-François Roy 57f41958e6 Add missing PRESET_MODE feature to BAF fans (#92200) 2023-04-28 21:00:54 +02:00
Jan Bouwhuis cff7829a8d Fix mqtt subscribe debouncer initial delay too long when birth message is disabled (#92188)
Fix mqtt subscribe deboucer initial delay
2023-04-28 18:56:22 +02:00
Erik Montnemery f8f7de5d5a Remove homeassistant from conversation dependencies (#92170)
* Remove homeassistant from conversation dependencies

* Fix tests
2023-04-28 18:17:48 +02:00
David F. Mulcahey e6438dabff Fix ZHA device triggers (#92186)
* Fix missing endpoint data on ZHA events

* revert to flat structure

* update test
2023-04-28 11:29:24 -04:00
Erik Montnemery ebd9cd096a Keep expose setting in sync for assist (#92158)
* Keep expose setting in sync for assist

* Fix initialization, add test

* Fix tests

* Add AgentManager.async_setup

* Fix typo

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-04-28 15:59:21 +02:00
J. Nick Koston 2bfa521068 Fix hassio with python3.11 (#92178) 2023-04-28 15:38:32 +02:00
Nolan Gilley c3d3bc4b74 Upgrade lakeside to 0.13 (#92173) 2023-04-28 14:30:10 +02:00
Erik Montnemery ec1ae7e2df Remove homeassistant from cloud dependencies (#92169) 2023-04-28 14:27:06 +02:00
Raman Gupta 6b829ca57b Bump pyvizio to 0.1.61 (#92161) 2023-04-28 11:31:16 +02:00
Robert Svensson cad0310193 Fix lingering timer in Axis library (#92143) 2023-04-28 11:41:21 +03:00
Franck Nijhof 0411b384dd Fix release build for armhf, exclude pandas (#92159) 2023-04-28 09:53:04 +02:00
J. Nick Koston 3a95a1fd8a Fix ignored apple tvs being scanned over and over (#92150) 2023-04-28 09:52:20 +02:00
Luke a6a485e59f Bump Roborock to 0.8.3 (#92151) 2023-04-28 09:49:35 +02:00
G Johansson d648a93dcb Fix options flow Workday (#92140)
* Fix options flow workday

* simpler
2023-04-28 09:44:23 +02:00
jjlawren 4ce1106243 Properly resolve media_source URLs for Sonos announcements (#92154)
Properly resolve media_source URLs for Sonos announcements
2023-04-27 23:51:51 -04:00
puddly 9d0dd0b784 Fix ZHA startup failure with the Konke button (#92144)
* Ensure devices with bad cluster subclasses do not prevent startup

* Explicitly unit test an affected SML001 device

* Do not use invalid `hue_occupancy` attribute name

* Actually remove `hue_occupancy`

* Bump ZHA dependencies
2023-04-27 18:35:07 -04:00
Franck Nijhof cdbffee781 Remove legacy pip resolver (#92124)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-04-27 22:39:29 +02:00
J. Nick Koston 89d8bda4ba Bump pyTibber to 0.27.2 (#92136) 2023-04-27 22:00:07 +02:00
Luke efec50c8f0 Bump roborock to 0.8.1 for beta fixes (#92131)
* bump to 0.8.1

* add tests for new config flow errors

* removed logs for known errors
2023-04-27 21:10:34 +02:00
Franck Nijhof ac21f69ad0 Add add-on discovery URL and title to Wyoming integration (#92129) 2023-04-27 19:51:26 +02:00
Paul Bottein 52816a8cd4 Update frontend to 20230427.0 (#92123) 2023-04-27 19:07:56 +02:00
J. Nick Koston 47b289b632 Bump sqlalchemy to 2.0.11 to fix a critical regression with postgresql (#92126) 2023-04-27 18:52:43 +02:00
Franck Nijhof 15c2ed7b04 Cleanup pybluez from machine builds (#92122) 2023-04-27 18:02:26 +02:00
Erik Montnemery 2522c6d697 Add WS command cloud/alexa/entities/get (#92121)
* Add WS command cloud/alexa/entities/get

* Fix bugs, add test
2023-04-27 17:10:29 +02:00
Franck Nijhof 3aa82e122c Remove usbutils from machine builds (#91942) 2023-04-27 17:10:07 +02:00
puddly f9ac1f3839 Add a channel changing API to ZHA (#92076)
* Expose channel changing over the websocket API

* Expose channel changing as a service

* Type annotate some existing unit test fixtures

* Add unit tests

* Rename `api.change_channel` to `api.async_change_channel`

* Expand on channel migration in the service description

* Remove channel changing service, we only really need the websocket API

* Update homeassistant/components/zha/websocket_api.py

* Black

---------

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-04-27 11:04:22 -04:00
Franck Nijhof f7f950a273 Update Home Assistant base image to 2023.04.2 - Python 3.11 (#92114) 2023-04-27 14:53:12 +02:00
Doug Hoffman 24acc71519 Resolve warnings due to incorrectly defined entities in airthings_ble (#92097)
* airthings_ble: Define state_class only in SensorEntityDescription

* airthings_ble: Drop incompatible device_class for voc
2023-04-27 13:44:42 +02:00
Joakim Sørensen 0ef29bfc0c Add filters to upcoming launch library launches (#92110)
Add filters to upcoming launches
2023-04-27 13:36:43 +02:00
epenet 7801eeb063 Use snapshot in onewire diagnostics tests (#92112) 2023-04-27 13:34:13 +02:00
epenet aac750a44f Improve TAI8570 ignore tests in onewire (#92113)
Improve TAI8570 tests in onewire
2023-04-27 13:33:30 +02:00
Erik Montnemery 7215f6320e Avoid exposing unsupported entities to Alexa (#92107)
* Avoid exposing unsupported entities to Alexa

* Update homeassistant/components/cloud/alexa_config.py

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

---------

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-04-27 13:31:24 +02:00
Thijs W 21d887dd04 Fix frontier_silicon not retrying setup and missing strings (#92111)
Address late review comments for frontier_silicon config flow
2023-04-27 13:14:25 +02:00
Erik Montnemery 65c9d4a4ae Avoid exposing unsupported entities to Google Assistant (#92105)
* Avoid exposing unsupported entities to Google Assistant

* Add Google Assistant specific support sets

* Add test
2023-04-27 10:38:21 +02:00
avee87 a164530a64 Remove name attribute from transmission services manifest (#92083) 2023-04-27 09:45:49 +02:00
Franck Nijhof bd72ea11fc Update sentry-sdk to 1.21.0 (#92087) 2023-04-27 09:43:34 +02:00
Raman Gupta 7d2243344e Fix vizio integration_type (#92103) 2023-04-27 09:22:03 +02:00
Paulus Schoutsen 7c696754ed Use pipeline ID in event (#92100)
* Use pipeline ID in event

* Fix tests
2023-04-26 22:40:17 -04:00
Jesse Hills 32ed45084a ESPHome voice assistant: Version 2 - Stream raw tts audio back to device for playback (#92052)
* Send raw audio back

* Update tests

* More tests

* Fix docstrings and remove unused patches

* More tests

* MORE

* Only set raw for v2
2023-04-26 22:24:29 -04:00
Paulus Schoutsen ddc2807361 Fix capitalization names Assist entities (#92098)
* Fix capitalization names Assist entities

* Adjust names to be 'in progress'

* Update tests/components/esphome/test_binary_sensor.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-04-26 22:13:21 -04:00
Franck Nijhof 13fc22aa3c Update syrupy to 4.0.2 (#92089) 2023-04-27 01:39:49 +02:00
Franck Nijhof 9f885a68ff Update YARL to 1.9.2 (#92086) 2023-04-27 01:39:32 +02:00
Michael 4e7f39e3d0 Fix reconfigure by SSDP or Zeroconf discovery in Synology DSM (#92088) 2023-04-27 00:52:17 +02:00
Jesse Hills 29ca43acf6 Set pipeline_id from pipeline select (#92085) 2023-04-27 10:29:08 +12:00
Joakim Sørensen fdfd567ee5 Bump pylaunches from 1.3.0 to 1.4.0 (#92061) 2023-04-26 23:01:22 +02:00
Franck Nijhof b5edf47454 Bump version to 2023.6.0dev0 (#92081) 2023-04-26 22:58:26 +02:00
Michael Hansen 929bfd3dfc Bump intents to 2023.4.26 (#92070)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-04-26 22:31:35 +02:00
1645 changed files with 59032 additions and 16724 deletions
+3 -1
View File
@@ -20,6 +20,8 @@ base_platforms: &base_platforms
- homeassistant/components/camera/**
- homeassistant/components/climate/**
- homeassistant/components/cover/**
- homeassistant/components/date/**
- homeassistant/components/datetime/**
- homeassistant/components/device_tracker/**
- homeassistant/components/diagnostics/**
- homeassistant/components/fan/**
@@ -39,6 +41,7 @@ base_platforms: &base_platforms
- homeassistant/components/stt/**
- homeassistant/components/switch/**
- homeassistant/components/text/**
- homeassistant/components/time/**
- homeassistant/components/tts/**
- homeassistant/components/update/**
- homeassistant/components/vacuum/**
@@ -137,7 +140,6 @@ other: &other
requirements: &requirements
- .github/workflows/**
- homeassistant/package_constraints.txt
- script/pip_check
- requirements*.txt
- pyproject.toml
+7 -1
View File
@@ -227,6 +227,7 @@ omit =
homeassistant/components/dunehd/__init__.py
homeassistant/components/dunehd/media_player.py
homeassistant/components/dwd_weather_warnings/const.py
homeassistant/components/dwd_weather_warnings/coordinator.py
homeassistant/components/dwd_weather_warnings/sensor.py
homeassistant/components/dweet/*
homeassistant/components/ebox/sensor.py
@@ -327,9 +328,11 @@ omit =
homeassistant/components/ezviz/binary_sensor.py
homeassistant/components/ezviz/camera.py
homeassistant/components/ezviz/coordinator.py
homeassistant/components/ezviz/number.py
homeassistant/components/ezviz/entity.py
homeassistant/components/ezviz/sensor.py
homeassistant/components/ezviz/switch.py
homeassistant/components/ezviz/update.py
homeassistant/components/faa_delays/__init__.py
homeassistant/components/faa_delays/binary_sensor.py
homeassistant/components/familyhub/camera.py
@@ -788,6 +791,7 @@ omit =
homeassistant/components/nibe_heatpump/select.py
homeassistant/components/nibe_heatpump/sensor.py
homeassistant/components/nibe_heatpump/switch.py
homeassistant/components/nibe_heatpump/water_heater.py
homeassistant/components/niko_home_control/light.py
homeassistant/components/nilu/air_quality.py
homeassistant/components/nissan_leaf/*
@@ -1292,10 +1296,10 @@ omit =
homeassistant/components/toon/switch.py
homeassistant/components/torque/sensor.py
homeassistant/components/totalconnect/__init__.py
homeassistant/components/totalconnect/binary_sensor.py
homeassistant/components/touchline/climate.py
homeassistant/components/tplink_lte/*
homeassistant/components/tplink_omada/__init__.py
homeassistant/components/tplink_omada/binary_sensor.py
homeassistant/components/tplink_omada/controller.py
homeassistant/components/tplink_omada/coordinator.py
homeassistant/components/tplink_omada/entity.py
@@ -1535,6 +1539,8 @@ omit =
homeassistant/components/zwave_me/sensor.py
homeassistant/components/zwave_me/siren.py
homeassistant/components/zwave_me/switch.py
homeassistant/components/electrasmart/climate.py
homeassistant/components/electrasmart/__init__.py
[report]
# Regexes for lines to exclude from consideration
+3 -3
View File
@@ -104,8 +104,8 @@ To help with the load of incoming pull requests:
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[manifest-docs]: https://developers.home-assistant.io/docs/en/creating_integration_manifest.html
[quality-scale]: https://developers.home-assistant.io/docs/en/next/integration_quality_scale_index.html
[dev-checklist]: https://developers.home-assistant.io/docs/development_checklist/
[manifest-docs]: https://developers.home-assistant.io/docs/creating_integration_manifest/
[quality-scale]: https://developers.home-assistant.io/docs/integration_quality_scale_index/
[docs-repository]: https://github.com/home-assistant/home-assistant.io
[perfect-pr]: https://developers.home-assistant.io/docs/review-process/#creating-the-perfect-pr
+21 -6
View File
@@ -29,7 +29,7 @@ jobs:
fetch-depth: 0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -62,7 +62,8 @@ jobs:
build_python:
name: Build PyPi package
needs: init
environment: ${{ needs.init.outputs.channel }}
needs: ["init", "build_base"]
runs-on: ubuntu-latest
if: github.repository_owner == 'home-assistant' && needs.init.outputs.publish == 'true'
steps:
@@ -70,7 +71,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -123,7 +124,7 @@ jobs:
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
repo: home-assistant/intents
repo: home-assistant/intents-package
branch: main
workflow: nightly.yaml
workflow_conclusion: success
@@ -131,7 +132,7 @@ jobs:
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.channel == 'dev'
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -140,7 +141,7 @@ jobs:
shell: bash
run: |
python3 -m pip install packaging tomli
python3 -m pip install --use-deprecated=legacy-resolver .
python3 -m pip install .
version="$(python3 script/version_bump.py nightly)"
if [[ "$(ls home_assistant_frontend*.whl)" =~ ^home_assistant_frontend-(.*)-py3-none-any.whl$ ]]; then
@@ -174,6 +175,18 @@ jobs:
python -m script.gen_requirements_all
fi
- name: Adjustments for armhf
if: matrix.arch == 'armhf'
run: |
# Pandas has issues building on armhf, it is expected they
# will drop the platform in the near future (they consider it
# "flimsy" on 386). The following packages depend on pandas,
# so we comment them out.
sed -i "s|env_canada|# env_canada|g" requirements_all.txt
sed -i "s|noaa-coops|# noaa-coops|g" requirements_all.txt
sed -i "s|pyezviz|# pyezviz|g" requirements_all.txt
sed -i "s|pykrakenapi|# pykrakenapi|g" requirements_all.txt
- name: Download Translations
run: python3 -m script.translations download
env:
@@ -287,6 +300,7 @@ jobs:
publish_ha:
name: Publish version files
environment: ${{ needs.init.outputs.channel }}
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_machine"]
runs-on: ubuntu-latest
@@ -320,6 +334,7 @@ jobs:
publish_container:
name: Publish meta container for ${{ matrix.registry }}
environment: ${{ needs.init.outputs.channel }}
if: github.repository_owner == 'home-assistant'
needs: ["init", "build_base"]
runs-on: ubuntu-latest
+16 -52
View File
@@ -32,7 +32,7 @@ env:
CACHE_VERSION: 5
PIP_CACHE_VERSION: 4
MYPY_CACHE_VERSION: 4
HA_SHORT_VERSION: 2023.5
HA_SHORT_VERSION: 2023.6
DEFAULT_PYTHON: "3.10"
ALL_PYTHON_VERSIONS: "['3.10', '3.11']"
# 10.3 is the oldest supported version
@@ -209,7 +209,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -253,7 +253,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -299,7 +299,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -348,7 +348,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -386,7 +386,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
@@ -494,7 +494,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -544,8 +544,8 @@ jobs:
. venv/bin/activate
python --version
pip install --cache-dir=$PIP_CACHE -U "pip>=21.0,<23.2" setuptools wheel
pip install --cache-dir=$PIP_CACHE -r requirements_all.txt --use-deprecated=legacy-resolver
pip install --cache-dir=$PIP_CACHE -r requirements_test.txt --use-deprecated=legacy-resolver
pip install --cache-dir=$PIP_CACHE -r requirements_all.txt
pip install --cache-dir=$PIP_CACHE -r requirements_test.txt
pip install -e .
hassfest:
@@ -562,7 +562,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -594,7 +594,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -627,7 +627,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -671,7 +671,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
@@ -719,42 +719,6 @@ jobs:
python --version
mypy homeassistant/components/${{ needs.info.outputs.integrations_glob }}
pip-check:
runs-on: ubuntu-22.04
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
needs:
- info
- base
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJson(needs.info.outputs.python_versions) }}
name: Run pip check ${{ matrix.python-version }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.6.0
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.3.1
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Run pip check
run: |
. venv/bin/activate
./script/pip_check $PIP_CACHE
pytest:
runs-on: ubuntu-22.04
if: |
@@ -790,7 +754,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -916,7 +880,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
@@ -1024,7 +988,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ matrix.python-version }}
id: python
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ matrix.python-version }}
check-latest: true
+1 -1
View File
@@ -22,7 +22,7 @@ jobs:
uses: actions/checkout@v3.5.2
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.6.0
uses: actions/setup-python@v4.6.1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
-11
View File
@@ -141,7 +141,6 @@ jobs:
run: |
requirement_files="requirements_all.txt requirements_diff.txt"
for requirement_file in ${requirement_files}; do
sed -i "s|# azure-servicebus|azure-servicebus|g" ${requirement_file}
sed -i "s|# pybluez|pybluez|g" ${requirement_file}
sed -i "s|# beacontools|beacontools|g" ${requirement_file}
sed -i "s|# fritzconnection|fritzconnection|g" ${requirement_file}
@@ -187,7 +186,6 @@ jobs:
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;grpcio;sqlalchemy;protobuf
legacy: true
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"
@@ -202,7 +200,6 @@ jobs:
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;grpcio;sqlalchemy;protobuf
legacy: true
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"
@@ -266,12 +263,6 @@ jobs:
# beacontools requires PyBluez.
# sed -i "s|# beacontools|beacontools|g" ${requirement_file}
# azure-servicebus requires uamqp, which requires OpenSSL 1.1 to
# compile/build. This is not available on Alpine 3.17. The compat
# layer offered by Alpine conflicts, so we have no way to build
# this package.
# sed -i "s|# azure-servicebus|azure-servicebus|g" ${requirement_file}
# It doesn't build for some reason, so we skip it for now.
# Bumping to the latest version (4.7.0.72) supporting Python 3.11
# doesn't help. Reverted bump in #91871. There are 8 registered
@@ -334,7 +325,6 @@ jobs:
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;grpcio;sqlalchemy;protobuf
legacy: true
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtaa"
@@ -349,7 +339,6 @@ jobs:
env-file: true
apk: "bluez-dev;libffi-dev;openssl-dev;glib-dev;eudev-dev;libxml2-dev;libxslt-dev;libpng-dev;libjpeg-turbo-dev;tiff-dev;cups-dev;gmp-dev;mpfr-dev;mpc1-dev;ffmpeg-dev;gammu-dev;yaml-dev;openblas-dev;fftw-dev;lapack-dev;gfortran;blas-dev;eigen-dev;freetype-dev;glew-dev;harfbuzz-dev;hdf5-dev;libdc1394-dev;libtbb-dev;mesa-dev;openexr-dev;openjpeg-dev;uchardet-dev"
skip-binary: aiohttp;grpcio;sqlalchemy;protobuf
legacy: true
constraints: "homeassistant/package_constraints.txt"
requirements-diff: "requirements_diff.txt"
requirements: "requirements_all.txtab"
+8
View File
@@ -49,6 +49,7 @@ homeassistant.components.air_quality.*
homeassistant.components.airly.*
homeassistant.components.airvisual.*
homeassistant.components.airzone.*
homeassistant.components.airzone_cloud.*
homeassistant.components.aladdin_connect.*
homeassistant.components.alarm_control_panel.*
homeassistant.components.alert.*
@@ -86,6 +87,7 @@ homeassistant.components.camera.*
homeassistant.components.canary.*
homeassistant.components.clickatell.*
homeassistant.components.clicksend.*
homeassistant.components.cloud.*
homeassistant.components.configurator.*
homeassistant.components.cover.*
homeassistant.components.cpuspeed.*
@@ -105,6 +107,7 @@ homeassistant.components.dormakaba_dkey.*
homeassistant.components.dsmr.*
homeassistant.components.dunehd.*
homeassistant.components.efergy.*
homeassistant.components.electrasmart.*
homeassistant.components.elgato.*
homeassistant.components.elkm1.*
homeassistant.components.emulated_hue.*
@@ -166,10 +169,12 @@ homeassistant.components.homekit_controller.utils
homeassistant.components.homewizard.*
homeassistant.components.http.*
homeassistant.components.huawei_lte.*
homeassistant.components.hydrawise.*
homeassistant.components.hyperion.*
homeassistant.components.ibeacon.*
homeassistant.components.image_processing.*
homeassistant.components.image_upload.*
homeassistant.components.imap.*
homeassistant.components.input_button.*
homeassistant.components.input_select.*
homeassistant.components.integration.*
@@ -177,6 +182,7 @@ homeassistant.components.iqvia.*
homeassistant.components.isy994.*
homeassistant.components.jellyfin.*
homeassistant.components.jewish_calendar.*
homeassistant.components.jvc_projector.*
homeassistant.components.kaleidescape.*
homeassistant.components.knx.*
homeassistant.components.kraken.*
@@ -230,6 +236,7 @@ homeassistant.components.oncue.*
homeassistant.components.onewire.*
homeassistant.components.open_meteo.*
homeassistant.components.openexchangerates.*
homeassistant.components.opensky.*
homeassistant.components.openuv.*
homeassistant.components.otbr.*
homeassistant.components.overkiz.*
@@ -284,6 +291,7 @@ homeassistant.components.smhi.*
homeassistant.components.snooz.*
homeassistant.components.sonarr.*
homeassistant.components.speedtestdotnet.*
homeassistant.components.sql.*
homeassistant.components.ssdp.*
homeassistant.components.statistics.*
homeassistant.components.steamist.*
+39 -2
View File
@@ -103,7 +103,7 @@
{
"label": "Install all Requirements",
"type": "shell",
"command": "pip3 install --use-deprecated=legacy-resolver -r requirements_all.txt",
"command": "pip3 install -r requirements_all.txt",
"group": {
"kind": "build",
"isDefault": true
@@ -117,7 +117,7 @@
{
"label": "Install all Test Requirements",
"type": "shell",
"command": "pip3 install --use-deprecated=legacy-resolver -r requirements_test_all.txt",
"command": "pip3 install -r requirements_test_all.txt",
"group": {
"kind": "build",
"isDefault": true
@@ -137,6 +137,26 @@
"kind": "build",
"isDefault": true
}
},
{
"label": "Run scaffold",
"detail": "Add new functionality to a integration using a scaffold.",
"type": "shell",
"command": "python3 -m script.scaffold ${input:scaffoldName} --integration ${input:integrationName}",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Create new integration",
"detail": "Use the scaffold to create a new integration.",
"type": "shell",
"command": "python3 -m script.scaffold integration",
"group": {
"kind": "build",
"isDefault": true
}
}
],
"inputs": [
@@ -144,6 +164,23 @@
"id": "integrationName",
"type": "promptString",
"description": "For which integration should the task run?"
},
{
"id": "scaffoldName",
"type": "pickString",
"options": [
"backup",
"config_flow",
"config_flow_discovery",
"config_flow_helper",
"config_flow_oauth2",
"device_action",
"device_condition",
"device_trigger",
"reproduce_state",
"significant_change"
],
"description": "Which scaffold should be run?"
}
]
}
+38 -15
View File
@@ -59,6 +59,8 @@ build.json @home-assistant/supervisor
/tests/components/airvisual_pro/ @bachya
/homeassistant/components/airzone/ @Noltari
/tests/components/airzone/ @Noltari
/homeassistant/components/airzone_cloud/ @Noltari
/tests/components/airzone_cloud/ @Noltari
/homeassistant/components/aladdin_connect/ @mkmer
/tests/components/aladdin_connect/ @mkmer
/homeassistant/components/alarm_control_panel/ @home-assistant/core
@@ -80,8 +82,8 @@ build.json @home-assistant/supervisor
/tests/components/android_ip_webcam/ @engrbm87
/homeassistant/components/androidtv/ @JeffLIrion @ollo69
/tests/components/androidtv/ @JeffLIrion @ollo69
/homeassistant/components/androidtv_remote/ @tronikos
/tests/components/androidtv_remote/ @tronikos
/homeassistant/components/androidtv_remote/ @tronikos @Drafteed
/tests/components/androidtv_remote/ @tronikos @Drafteed
/homeassistant/components/anova/ @Lash-L
/tests/components/anova/ @Lash-L
/homeassistant/components/anthemav/ @hyralex
@@ -211,6 +213,8 @@ build.json @home-assistant/supervisor
/tests/components/color_extractor/ @GenericStudent
/homeassistant/components/comfoconnect/ @michaelarnauts
/tests/components/comfoconnect/ @michaelarnauts
/homeassistant/components/command_line/ @gjohansson-ST
/tests/components/command_line/ @gjohansson-ST
/homeassistant/components/compensation/ @Petro31
/tests/components/compensation/ @Petro31
/homeassistant/components/config/ @home-assistant/core
@@ -234,6 +238,10 @@ build.json @home-assistant/supervisor
/homeassistant/components/cups/ @fabaff
/homeassistant/components/daikin/ @fredrike
/tests/components/daikin/ @fredrike
/homeassistant/components/date/ @home-assistant/core
/tests/components/date/ @home-assistant/core
/homeassistant/components/datetime/ @home-assistant/core
/tests/components/datetime/ @home-assistant/core
/homeassistant/components/debugpy/ @frenck
/tests/components/debugpy/ @frenck
/homeassistant/components/deconz/ @Kane610
@@ -288,6 +296,7 @@ build.json @home-assistant/supervisor
/homeassistant/components/dunehd/ @bieniu
/tests/components/dunehd/ @bieniu
/homeassistant/components/dwd_weather_warnings/ @runningman84 @stephan192 @Hummel95 @andarotajo
/tests/components/dwd_weather_warnings/ @runningman84 @stephan192 @Hummel95 @andarotajo
/homeassistant/components/dynalite/ @ziv1234
/tests/components/dynalite/ @ziv1234
/homeassistant/components/eafm/ @Jc2k
@@ -306,6 +315,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/egardia/ @jeroenterheerdt
/homeassistant/components/eight_sleep/ @mezz64 @raman325
/tests/components/eight_sleep/ @mezz64 @raman325
/homeassistant/components/electrasmart/ @jafar-atili
/tests/components/electrasmart/ @jafar-atili
/homeassistant/components/elgato/ @frenck
/tests/components/elgato/ @frenck
/homeassistant/components/elkm1/ @gwww @bdraco
@@ -448,6 +459,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/google_assistant_sdk/ @tronikos
/tests/components/google_assistant_sdk/ @tronikos
/homeassistant/components/google_cloud/ @lufton
/homeassistant/components/google_generative_ai_conversation/ @tronikos
/tests/components/google_generative_ai_conversation/ @tronikos
/homeassistant/components/google_mail/ @tkdrob
/tests/components/google_mail/ @tkdrob
/homeassistant/components/google_sheets/ @tkdrob
@@ -532,7 +545,7 @@ build.json @home-assistant/supervisor
/tests/components/hunterdouglas_powerview/ @bdraco @kingy444 @trullock
/homeassistant/components/hvv_departures/ @vigonotion
/tests/components/hvv_departures/ @vigonotion
/homeassistant/components/hydrawise/ @ptcryan
/homeassistant/components/hydrawise/ @dknowles2 @ptcryan
/homeassistant/components/hyperion/ @dermotduffy
/tests/components/hyperion/ @dermotduffy
/homeassistant/components/ialarm/ @RyuzakiKK
@@ -606,6 +619,8 @@ build.json @home-assistant/supervisor
/tests/components/juicenet/ @jesserockz
/homeassistant/components/justnimbus/ @kvanzuijlen
/tests/components/justnimbus/ @kvanzuijlen
/homeassistant/components/jvc_projector/ @SteveEasley
/tests/components/jvc_projector/ @SteveEasley
/homeassistant/components/kaiterra/ @Michsior14
/homeassistant/components/kaleidescape/ @SteveEasley
/tests/components/kaleidescape/ @SteveEasley
@@ -640,6 +655,8 @@ build.json @home-assistant/supervisor
/tests/components/lametric/ @robbiet480 @frenck @bachya
/homeassistant/components/landisgyr_heat_meter/ @vpathuis
/tests/components/landisgyr_heat_meter/ @vpathuis
/homeassistant/components/lastfm/ @joostlek
/tests/components/lastfm/ @joostlek
/homeassistant/components/launch_library/ @ludeeus @DurgNomis-drol
/tests/components/launch_library/ @ludeeus @DurgNomis-drol
/homeassistant/components/laundrify/ @xLarry
@@ -783,6 +800,7 @@ build.json @home-assistant/supervisor
/homeassistant/components/netdata/ @fabaff
/homeassistant/components/netgear/ @hacf-fr @Quentame @starkillerOG
/tests/components/netgear/ @hacf-fr @Quentame @starkillerOG
/homeassistant/components/netgear_lte/ @tkdrob
/homeassistant/components/network/ @home-assistant/core
/tests/components/network/ @home-assistant/core
/homeassistant/components/nexia/ @bdraco
@@ -860,6 +878,7 @@ build.json @home-assistant/supervisor
/homeassistant/components/opengarage/ @danielhiversen
/tests/components/opengarage/ @danielhiversen
/homeassistant/components/openhome/ @bazwilliams
/homeassistant/components/opensky/ @joostlek
/homeassistant/components/opentherm_gw/ @mvn23
/tests/components/opentherm_gw/ @mvn23
/homeassistant/components/openuv/ @bachya
@@ -954,8 +973,8 @@ build.json @home-assistant/supervisor
/tests/components/radarr/ @tkdrob
/homeassistant/components/radio_browser/ @frenck
/tests/components/radio_browser/ @frenck
/homeassistant/components/radiotherm/ @bdraco @vinnyfuria
/tests/components/radiotherm/ @bdraco @vinnyfuria
/homeassistant/components/radiotherm/ @vinnyfuria
/tests/components/radiotherm/ @vinnyfuria
/homeassistant/components/rainbird/ @konikvranik @allenporter
/tests/components/rainbird/ @konikvranik @allenporter
/homeassistant/components/raincloud/ @vanstinator
@@ -997,8 +1016,8 @@ build.json @home-assistant/supervisor
/tests/components/ridwell/ @bachya
/homeassistant/components/risco/ @OnFreund
/tests/components/risco/ @OnFreund
/homeassistant/components/rituals_perfume_genie/ @milanmeu
/tests/components/rituals_perfume_genie/ @milanmeu
/homeassistant/components/rituals_perfume_genie/ @milanmeu @frenck
/tests/components/rituals_perfume_genie/ @milanmeu @frenck
/homeassistant/components/rmvtransport/ @cgtobi
/tests/components/rmvtransport/ @cgtobi
/homeassistant/components/roborock/ @humbertogontijo @Lash-L
@@ -1093,8 +1112,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/sky_hub/ @rogerselwyn
/homeassistant/components/skybell/ @tkdrob
/tests/components/skybell/ @tkdrob
/homeassistant/components/slack/ @bachya @tkdrob
/tests/components/slack/ @bachya @tkdrob
/homeassistant/components/slack/ @tkdrob
/tests/components/slack/ @tkdrob
/homeassistant/components/sleepiq/ @mfugate1 @kbickar
/tests/components/sleepiq/ @mfugate1 @kbickar
/homeassistant/components/slide/ @ualex73
@@ -1144,8 +1163,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/splunk/ @Bre77
/homeassistant/components/spotify/ @frenck
/tests/components/spotify/ @frenck
/homeassistant/components/sql/ @dgomes @gjohansson-ST @dougiteixeira
/tests/components/sql/ @dgomes @gjohansson-ST @dougiteixeira
/homeassistant/components/sql/ @gjohansson-ST @dougiteixeira
/tests/components/sql/ @gjohansson-ST @dougiteixeira
/homeassistant/components/squeezebox/ @rajlaud
/tests/components/squeezebox/ @rajlaud
/homeassistant/components/srp_energy/ @briglx
@@ -1187,8 +1206,8 @@ build.json @home-assistant/supervisor
/tests/components/switchbee/ @jafar-atili
/homeassistant/components/switchbot/ @bdraco @danielhiversen @RenierM26 @murtas @Eloston @dsypniewski
/tests/components/switchbot/ @bdraco @danielhiversen @RenierM26 @murtas @Eloston @dsypniewski
/homeassistant/components/switcher_kis/ @tomerfi @thecode
/tests/components/switcher_kis/ @tomerfi @thecode
/homeassistant/components/switcher_kis/ @thecode
/tests/components/switcher_kis/ @thecode
/homeassistant/components/switchmate/ @danielhiversen @qiz-li
/homeassistant/components/syncthing/ @zhulik
/tests/components/syncthing/ @zhulik
@@ -1199,8 +1218,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/synology_srm/ @aerialls
/homeassistant/components/system_bridge/ @timmo001
/tests/components/system_bridge/ @timmo001
/homeassistant/components/tado/ @michaelarnauts
/tests/components/tado/ @michaelarnauts
/homeassistant/components/tado/ @michaelarnauts @chiefdragon
/tests/components/tado/ @michaelarnauts @chiefdragon
/homeassistant/components/tag/ @balloob @dmulcahey
/tests/components/tag/ @balloob @dmulcahey
/homeassistant/components/tailscale/ @frenck
@@ -1234,6 +1253,8 @@ build.json @home-assistant/supervisor
/tests/components/tile/ @bachya
/homeassistant/components/tilt_ble/ @apt-itude
/tests/components/tilt_ble/ @apt-itude
/homeassistant/components/time/ @home-assistant/core
/tests/components/time/ @home-assistant/core
/homeassistant/components/time_date/ @fabaff
/tests/components/time_date/ @fabaff
/homeassistant/components/tmb/ @alemuro
@@ -1401,6 +1422,8 @@ build.json @home-assistant/supervisor
/tests/components/yolink/ @matrixd2
/homeassistant/components/youless/ @gjong
/tests/components/youless/ @gjong
/homeassistant/components/youtube/ @joostlek
/tests/components/youtube/ @joostlek
/homeassistant/components/zamg/ @killer0071234
/tests/components/zamg/ @killer0071234
/homeassistant/components/zengge/ @emontnemery
-3
View File
@@ -18,7 +18,6 @@ RUN \
--no-index \
--only-binary=:all: \
--find-links "${WHEELS_LINKS}" \
--use-deprecated=legacy-resolver \
-r homeassistant/requirements.txt
COPY requirements_all.txt home_assistant_frontend-* home_assistant_intents-* homeassistant/
@@ -43,7 +42,6 @@ RUN \
--no-index \
--only-binary=:all: \
--find-links "${WHEELS_LINKS}" \
--use-deprecated=legacy-resolver \
-r homeassistant/requirements_all.txt
## Setup Home Assistant Core
@@ -54,7 +52,6 @@ RUN \
--no-index \
--only-binary=:all: \
--find-links "${WHEELS_LINKS}" \
--use-deprecated=legacy-resolver \
-e ./homeassistant \
&& python3 -m compileall \
homeassistant/homeassistant
+2 -2
View File
@@ -45,9 +45,9 @@ WORKDIR /workspaces
# Install Python dependencies from requirements
COPY requirements.txt ./
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
RUN pip3 install -r requirements.txt --use-deprecated=legacy-resolver
RUN pip3 install -r requirements.txt
COPY requirements_test.txt requirements_test_pre_commit.txt ./
RUN pip3 install -r requirements_test.txt --use-deprecated=legacy-resolver
RUN pip3 install -r requirements_test.txt
RUN rm -rf requirements.txt requirements_test.txt requirements_test_pre_commit.txt homeassistant/
# Set the default shell to bash instead of sh
+5 -5
View File
@@ -1,11 +1,11 @@
image: homeassistant/{arch}-homeassistant
shadow_repository: ghcr.io/home-assistant
build_from:
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.04.0
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.04.0
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.04.0
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.04.0
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.04.0
aarch64: ghcr.io/home-assistant/aarch64-homeassistant-base:2023.05.0
armhf: ghcr.io/home-assistant/armhf-homeassistant-base:2023.05.0
armv7: ghcr.io/home-assistant/armv7-homeassistant-base:2023.05.0
amd64: ghcr.io/home-assistant/amd64-homeassistant-base:2023.05.0
i386: ghcr.io/home-assistant/i386-homeassistant-base:2023.05.0
codenotary:
signer: notary@home-assistant.io
base_image: notary@home-assistant.io
+2 -2
View File
@@ -93,7 +93,7 @@ class _PyJWTWithVerify(PyJWT):
# nothing slips through.
assert "exp" in payload, "exp claim is required"
assert "iat" in payload, "iat claim is required"
self._validate_claims( # type: ignore[no-untyped-call]
self._validate_claims(
payload=payload,
options=merged_options,
issuer=issuer,
@@ -102,7 +102,7 @@ class _PyJWTWithVerify(PyJWT):
return payload
_jwt = _PyJWTWithVerify() # type: ignore[no-untyped-call]
_jwt = _PyJWTWithVerify()
verify_and_decode = _jwt.verify_and_decode
unverified_hs256_token_decode = lru_cache(maxsize=JWT_TOKEN_CACHE_SIZE)(
partial(
@@ -46,7 +46,7 @@ CONFIG_SCHEMA = AUTH_PROVIDER_SCHEMA.extend(
[
vol.Or(
cv.uuid4_hex,
vol.Schema({vol.Required(CONF_GROUP): cv.uuid4_hex}),
vol.Schema({vol.Required(CONF_GROUP): str}),
)
],
)
+11 -4
View File
@@ -19,6 +19,7 @@ import yarl
from . import config as conf_util, config_entries, core, loader
from .components import http
from .const import (
FORMAT_DATETIME,
REQUIRED_NEXT_PYTHON_HA_RELEASE,
REQUIRED_NEXT_PYTHON_VER,
SIGNAL_BOOTSTRAP_INTEGRATIONS,
@@ -31,6 +32,7 @@ from .helpers import (
entity_registry,
issue_registry,
recorder,
restore_state,
template,
)
from .helpers.dispatcher import async_dispatcher_send
@@ -247,6 +249,7 @@ async def load_registries(hass: core.HomeAssistant) -> None:
issue_registry.async_load(hass),
hass.async_add_executor_job(_cache_uname_processor),
template.async_load_custom_templates(hass),
restore_state.async_load(hass),
)
@@ -347,7 +350,6 @@ def async_enable_logging(
fmt = (
"%(asctime)s.%(msecs)03d %(levelname)s (%(threadName)s) [%(name)s] %(message)s"
)
datefmt = "%Y-%m-%d %H:%M:%S"
if not log_no_color:
try:
@@ -362,7 +364,7 @@ def async_enable_logging(
logging.getLogger().handlers[0].setFormatter(
ColoredFormatter(
colorfmt,
datefmt=datefmt,
datefmt=FORMAT_DATETIME,
reset=True,
log_colors={
"DEBUG": "cyan",
@@ -378,7 +380,12 @@ def async_enable_logging(
# If the above initialization failed for any reason, setup the default
# formatting. If the above succeeds, this will result in a no-op.
logging.basicConfig(format=fmt, datefmt=datefmt, level=logging.INFO)
logging.basicConfig(format=fmt, datefmt=FORMAT_DATETIME, level=logging.INFO)
# Capture warnings.warn(...) and friends messages in logs.
# The standard destination for them is stderr, which may end up unnoticed.
# This way they're where other messages are, and can be filtered as usual.
logging.captureWarnings(True)
# Suppress overly verbose logs from libraries that aren't helpful
logging.getLogger("requests").setLevel(logging.WARNING)
@@ -430,7 +437,7 @@ def async_enable_logging(
_LOGGER.error("Error rolling over log file: %s", err)
err_handler.setLevel(logging.INFO if verbose else logging.WARNING)
err_handler.setFormatter(logging.Formatter(fmt, datefmt=datefmt))
err_handler.setFormatter(logging.Formatter(fmt, datefmt=FORMAT_DATETIME))
logger = logging.getLogger("")
logger.addHandler(err_handler)
+5
View File
@@ -0,0 +1,5 @@
{
"domain": "airzone",
"name": "Airzone",
"integrations": ["airzone", "airzone_cloud"]
}
+3 -1
View File
@@ -6,6 +6,7 @@
"google_assistant_sdk",
"google_cloud",
"google_domains",
"google_generative_ai_conversation",
"google_mail",
"google_maps",
"google_pubsub",
@@ -16,6 +17,7 @@
"google",
"nest",
"cast",
"dialogflow"
"dialogflow",
"youtube"
]
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"domain": "yale",
"name": "Yale",
"integrations": ["august", "yale_smart_alarm", "yalexs_ble"]
"integrations": ["august", "yale_smart_alarm", "yalexs_ble", "yale_home"]
}
@@ -121,12 +121,12 @@ class AccuWeatherDataUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
async def _async_update_data(self) -> dict[str, Any]:
"""Update data via library."""
forecast: list[dict[str, Any]] = []
try:
async with timeout(10):
current = await self.accuweather.async_get_current_conditions()
forecast = (
await self.accuweather.async_get_forecast() if self.forecast else {}
)
if self.forecast:
forecast = await self.accuweather.async_get_daily_forecast()
except (
ApiError,
ClientConnectorError,
@@ -8,5 +8,5 @@
"iot_class": "cloud_polling",
"loggers": ["accuweather"],
"quality_scale": "platinum",
"requirements": ["accuweather==0.5.1"]
"requirements": ["accuweather==1.0.0"]
}
@@ -16,6 +16,7 @@ from homeassistant.const import (
CONCENTRATION_PARTS_PER_CUBIC_METER,
PERCENTAGE,
UV_INDEX,
UnitOfIrradiance,
UnitOfLength,
UnitOfSpeed,
UnitOfTemperature,
@@ -104,6 +105,16 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
native_unit_of_measurement=UnitOfTime.HOURS,
value_fn=lambda data: cast(float, data),
),
AccuWeatherSensorDescription(
key="LongPhraseDay",
name="Condition day",
value_fn=lambda data: cast(str, data),
),
AccuWeatherSensorDescription(
key="LongPhraseNight",
name="Condition night",
value_fn=lambda data: cast(str, data),
),
AccuWeatherSensorDescription(
key="Mold",
icon="mdi:blur",
@@ -154,6 +165,22 @@ FORECAST_SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
),
AccuWeatherSensorDescription(
key="SolarIrradianceDay",
icon="mdi:weather-sunny",
name="Solar irradiance day",
entity_registry_enabled_default=False,
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
),
AccuWeatherSensorDescription(
key="SolarIrradianceNight",
icon="mdi:weather-sunny",
name="Solar irradiance night",
entity_registry_enabled_default=False,
native_unit_of_measurement=UnitOfIrradiance.WATTS_PER_SQUARE_METER,
value_fn=lambda data: cast(float, data[ATTR_VALUE]),
),
AccuWeatherSensorDescription(
key="ThunderstormProbabilityDay",
icon="mdi:weather-lightning",
@@ -1,8 +1,7 @@
"""Support for the AccuWeather service."""
from __future__ import annotations
from statistics import mean
from typing import Any, cast
from typing import cast
from homeassistant.components.weather import (
ATTR_FORECAST_CONDITION,
@@ -120,15 +119,10 @@ class AccuWeatherEntity(
ATTR_FORECAST_TIME: utc_from_timestamp(item["EpochDate"]).isoformat(),
ATTR_FORECAST_NATIVE_TEMP: item["TemperatureMax"]["Value"],
ATTR_FORECAST_NATIVE_TEMP_LOW: item["TemperatureMin"]["Value"],
ATTR_FORECAST_NATIVE_PRECIPITATION: self._calc_precipitation(item),
ATTR_FORECAST_PRECIPITATION_PROBABILITY: round(
mean(
[
item["PrecipitationProbabilityDay"],
item["PrecipitationProbabilityNight"],
]
)
),
ATTR_FORECAST_NATIVE_PRECIPITATION: item["TotalLiquidDay"]["Value"],
ATTR_FORECAST_PRECIPITATION_PROBABILITY: item[
"PrecipitationProbabilityDay"
],
ATTR_FORECAST_NATIVE_WIND_SPEED: item["WindDay"]["Speed"]["Value"],
ATTR_FORECAST_WIND_BEARING: item["WindDay"]["Direction"]["Degrees"],
ATTR_FORECAST_CONDITION: [
@@ -137,18 +131,3 @@ class AccuWeatherEntity(
}
for item in self.coordinator.data[ATTR_FORECAST]
]
@staticmethod
def _calc_precipitation(day: dict[str, Any]) -> float:
"""Return sum of the precipitation."""
precip_sum = 0
precip_types = ["Rain", "Snow", "Ice"]
for precip in precip_types:
precip_sum = sum(
[
precip_sum,
day[f"{precip}Day"]["Value"],
day[f"{precip}Night"]["Value"],
]
)
return round(precip_sum, 1)
@@ -91,6 +91,16 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
_attr_max_temp = 32
_attr_min_temp = 16
_attr_hvac_modes = [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
_attr_supported_features = ClimateEntityFeature.FAN_MODE
def __init__(self, instance: AdvantageAirData, ac_key: str) -> None:
"""Initialize an AdvantageAir AC unit."""
super().__init__(instance, ac_key)
@@ -98,36 +108,14 @@ class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
# Set supported features and HVAC modes based on current operating mode
if self._ac.get(ADVANTAGE_AIR_MYAUTO_ENABLED):
# MyAuto
self._attr_supported_features = (
ClimateEntityFeature.FAN_MODE
| ClimateEntityFeature.TARGET_TEMPERATURE
self._attr_supported_features |= (
ClimateEntityFeature.TARGET_TEMPERATURE
| ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)
self._attr_hvac_modes = [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.HEAT_COOL,
]
elif self._ac.get(ADVANTAGE_AIR_MYTEMP_ENABLED):
# MyTemp
self._attr_supported_features = ClimateEntityFeature.FAN_MODE
self._attr_hvac_modes = [HVACMode.OFF, HVACMode.COOL, HVACMode.HEAT]
else:
self._attr_hvac_modes += [HVACMode.HEAT_COOL]
elif not self._ac.get(ADVANTAGE_AIR_MYTEMP_ENABLED):
# MyZone
self._attr_supported_features = (
ClimateEntityFeature.FAN_MODE | ClimateEntityFeature.TARGET_TEMPERATURE
)
self._attr_hvac_modes = [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
self._attr_supported_features |= ClimateEntityFeature.TARGET_TEMPERATURE
# Add "ezfan" mode if supported
if self._ac.get(ADVANTAGE_AIR_AUTOFAN):
@@ -26,6 +26,7 @@ from aemet_opendata.const import (
AEMET_ATTR_STATION_DATE,
AEMET_ATTR_STATION_HUMIDITY,
AEMET_ATTR_STATION_LOCATION,
AEMET_ATTR_STATION_PRESSURE,
AEMET_ATTR_STATION_PRESSURE_SEA,
AEMET_ATTR_STATION_TEMPERATURE,
AEMET_ATTR_STORM_PROBABILITY,
@@ -318,6 +319,8 @@ class WeatherUpdateCoordinator(DataUpdateCoordinator):
pressure = format_float(
station_data[AEMET_ATTR_STATION_PRESSURE_SEA]
)
elif AEMET_ATTR_STATION_PRESSURE in station_data:
pressure = format_float(station_data[AEMET_ATTR_STATION_PRESSURE])
if AEMET_ATTR_STATION_TEMPERATURE in station_data:
temperature = format_float(
station_data[AEMET_ATTR_STATION_TEMPERATURE]
+5 -1
View File
@@ -150,10 +150,14 @@ class AirthingsHeaterEnergySensor(CoordinatorEntity, SensorEntity):
self._attr_unique_id = f"{airthings_device.device_id}_{entity_description.key}"
self._id = airthings_device.device_id
self._attr_device_info = DeviceInfo(
configuration_url="https://dashboard.airthings.com/",
configuration_url=(
"https://dashboard.airthings.com/devices/"
f"{airthings_device.device_id}"
),
identifiers={(DOMAIN, airthings_device.device_id)},
name=airthings_device.name,
manufacturer="Airthings",
model=airthings_device.device_type.replace("_", " ").lower().title(),
)
@property
@@ -65,24 +65,28 @@ SENSORS_MAPPING_TEMPLATE: dict[str, SensorEntityDescription] = {
key="temperature",
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
name="Temperature",
),
"humidity": SensorEntityDescription(
key="humidity",
device_class=SensorDeviceClass.HUMIDITY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
name="Humidity",
),
"pressure": SensorEntityDescription(
key="pressure",
device_class=SensorDeviceClass.PRESSURE,
native_unit_of_measurement=UnitOfPressure.MBAR,
state_class=SensorStateClass.MEASUREMENT,
name="Pressure",
),
"battery": SensorEntityDescription(
key="battery",
device_class=SensorDeviceClass.BATTERY,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
entity_category=EntityCategory.DIAGNOSTIC,
name="Battery",
),
@@ -90,12 +94,13 @@ SENSORS_MAPPING_TEMPLATE: dict[str, SensorEntityDescription] = {
key="co2",
device_class=SensorDeviceClass.CO2,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
state_class=SensorStateClass.MEASUREMENT,
name="co2",
),
"voc": SensorEntityDescription(
key="voc",
device_class=SensorDeviceClass.VOLATILE_ORGANIC_COMPOUNDS,
native_unit_of_measurement=CONCENTRATION_PARTS_PER_BILLION,
state_class=SensorStateClass.MEASUREMENT,
name="VOC",
icon="mdi:cloud",
),
@@ -103,6 +108,7 @@ SENSORS_MAPPING_TEMPLATE: dict[str, SensorEntityDescription] = {
key="illuminance",
device_class=SensorDeviceClass.ILLUMINANCE,
native_unit_of_measurement=LIGHT_LUX,
state_class=SensorStateClass.MEASUREMENT,
name="Illuminance",
),
}
@@ -150,7 +156,6 @@ class AirthingsSensor(
):
"""Airthings BLE sensors for the device."""
_attr_state_class = SensorStateClass.MEASUREMENT
_attr_has_entity_name = True
def __init__(
+103 -20
View File
@@ -3,18 +3,26 @@ from __future__ import annotations
from typing import Any, Final
from aioairzone.common import OperationMode
from aioairzone.common import OperationAction, OperationMode
from aioairzone.const import (
API_COOL_SET_POINT,
API_HEAT_SET_POINT,
API_MODE,
API_ON,
API_SET_POINT,
AZD_DEMAND,
API_SPEED,
AZD_ACTION,
AZD_COOL_TEMP_SET,
AZD_DOUBLE_SET_POINT,
AZD_HEAT_TEMP_SET,
AZD_HUMIDITY,
AZD_MASTER,
AZD_MODE,
AZD_MODES,
AZD_NAME,
AZD_ON,
AZD_SPEED,
AZD_SPEEDS,
AZD_TEMP,
AZD_TEMP_MAX,
AZD_TEMP_MIN,
@@ -24,6 +32,12 @@ from aioairzone.const import (
)
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
ClimateEntity,
ClimateEntityFeature,
HVACAction,
@@ -39,12 +53,29 @@ from .const import API_TEMPERATURE_STEP, DOMAIN, TEMP_UNIT_LIB_TO_HASS
from .coordinator import AirzoneUpdateCoordinator
from .entity import AirzoneZoneEntity
HVAC_ACTION_LIB_TO_HASS: Final[dict[OperationMode, HVACAction]] = {
OperationMode.STOP: HVACAction.OFF,
OperationMode.COOLING: HVACAction.COOLING,
OperationMode.HEATING: HVACAction.HEATING,
OperationMode.FAN: HVACAction.FAN,
OperationMode.DRY: HVACAction.DRYING,
BASE_FAN_SPEEDS: Final[dict[int, str]] = {
0: FAN_AUTO,
1: FAN_LOW,
}
FAN_SPEED_MAPS: Final[dict[int, dict[int, str]]] = {
2: BASE_FAN_SPEEDS
| {
2: FAN_HIGH,
},
3: BASE_FAN_SPEEDS
| {
2: FAN_MEDIUM,
3: FAN_HIGH,
},
}
HVAC_ACTION_LIB_TO_HASS: Final[dict[OperationAction, HVACAction]] = {
OperationAction.COOLING: HVACAction.COOLING,
OperationAction.DRYING: HVACAction.DRYING,
OperationAction.FAN: HVACAction.FAN,
OperationAction.HEATING: HVACAction.HEATING,
OperationAction.IDLE: HVACAction.IDLE,
OperationAction.OFF: HVACAction.OFF,
}
HVAC_MODE_LIB_TO_HASS: Final[dict[OperationMode, HVACMode]] = {
OperationMode.STOP: HVACMode.OFF,
@@ -83,6 +114,9 @@ async def async_setup_entry(
class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
"""Define an Airzone sensor."""
_speeds: dict[int, str] = {}
_speeds_reverse: dict[str, int] = {}
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
@@ -97,16 +131,45 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
self._attr_unique_id = f"{self._attr_unique_id}_{system_zone_id}"
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
self._attr_target_temperature_step = API_TEMPERATURE_STEP
self._attr_max_temp = self.get_airzone_value(AZD_TEMP_MAX)
self._attr_min_temp = self.get_airzone_value(AZD_TEMP_MIN)
self._attr_temperature_unit = TEMP_UNIT_LIB_TO_HASS[
self.get_airzone_value(AZD_TEMP_UNIT)
]
self._attr_hvac_modes = [
HVAC_MODE_LIB_TO_HASS[mode] for mode in self.get_airzone_value(AZD_MODES)
]
if (
self.get_airzone_value(AZD_SPEED) is not None
and self.get_airzone_value(AZD_SPEEDS) is not None
):
self._set_fan_speeds()
if self.get_airzone_value(AZD_DOUBLE_SET_POINT):
self._attr_supported_features |= (
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
)
self._async_update_attrs()
def _set_fan_speeds(self) -> None:
self._attr_supported_features |= ClimateEntityFeature.FAN_MODE
speeds = self.get_airzone_value(AZD_SPEEDS)
max_speed = max(speeds)
if _speeds := FAN_SPEED_MAPS.get(max_speed):
self._speeds = _speeds
else:
for speed in speeds:
if speed == 0:
self._speeds[speed] = FAN_AUTO
else:
self._speeds[speed] = f"{int(round((speed * 100) / max_speed, 0))}%"
self._speeds[1] = FAN_LOW
self._speeds[int(round((max_speed + 1) / 2, 0))] = FAN_MEDIUM
self._speeds[max_speed] = FAN_HIGH
self._speeds_reverse = {v: k for k, v in self._speeds.items()}
self._attr_fan_modes = list(self._speeds_reverse)
async def async_turn_on(self) -> None:
"""Turn the entity on."""
params = {
@@ -121,6 +184,13 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
}
await self._async_update_hvac_params(params)
async def async_set_fan_mode(self, fan_mode: str) -> None:
"""Set fan mode."""
params = {
API_SPEED: self._speeds_reverse.get(fan_mode),
}
await self._async_update_hvac_params(params)
async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
"""Set hvac mode."""
params = {}
@@ -140,9 +210,12 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new target temperature."""
params = {
API_SET_POINT: kwargs.get(ATTR_TEMPERATURE),
}
params = {}
if ATTR_TEMPERATURE in kwargs:
params[API_SET_POINT] = kwargs[ATTR_TEMPERATURE]
if ATTR_TARGET_TEMP_LOW in kwargs and ATTR_TARGET_TEMP_HIGH in kwargs:
params[API_COOL_SET_POINT] = kwargs[ATTR_TARGET_TEMP_LOW]
params[API_HEAT_SET_POINT] = kwargs[ATTR_TARGET_TEMP_HIGH]
await self._async_update_hvac_params(params)
@callback
@@ -156,14 +229,24 @@ class AirzoneClimate(AirzoneZoneEntity, ClimateEntity):
"""Update climate attributes."""
self._attr_current_temperature = self.get_airzone_value(AZD_TEMP)
self._attr_current_humidity = self.get_airzone_value(AZD_HUMIDITY)
self._attr_hvac_action = HVAC_ACTION_LIB_TO_HASS[
self.get_airzone_value(AZD_ACTION)
]
if self.get_airzone_value(AZD_ON):
mode = self.get_airzone_value(AZD_MODE)
self._attr_hvac_mode = HVAC_MODE_LIB_TO_HASS[mode]
if self.get_airzone_value(AZD_DEMAND):
self._attr_hvac_action = HVAC_ACTION_LIB_TO_HASS[mode]
else:
self._attr_hvac_action = HVACAction.IDLE
self._attr_hvac_mode = HVAC_MODE_LIB_TO_HASS[
self.get_airzone_value(AZD_MODE)
]
else:
self._attr_hvac_action = HVACAction.OFF
self._attr_hvac_mode = HVACMode.OFF
self._attr_max_temp = self.get_airzone_value(AZD_TEMP_MAX)
self._attr_min_temp = self.get_airzone_value(AZD_TEMP_MIN)
self._attr_target_temperature = self.get_airzone_value(AZD_TEMP_SET)
if self.supported_features & ClimateEntityFeature.FAN_MODE:
self._attr_fan_mode = self._speeds.get(self.get_airzone_value(AZD_SPEED))
if self.supported_features & ClimateEntityFeature.TARGET_TEMPERATURE_RANGE:
self._attr_target_temperature_high = self.get_airzone_value(
AZD_HEAT_TEMP_SET
)
self._attr_target_temperature_low = self.get_airzone_value(
AZD_COOL_TEMP_SET
)
@@ -7,6 +7,7 @@ from typing import Any
from aioairzone.const import (
API_SYSTEM_ID,
API_ZONE_ID,
AZD_AVAILABLE,
AZD_FIRMWARE,
AZD_FULL_NAME,
AZD_ID,
@@ -66,6 +67,11 @@ class AirzoneSystemEntity(AirzoneEntity):
)
self._attr_unique_id = entry.unique_id or entry.entry_id
@property
def available(self) -> bool:
"""Return system availability."""
return super().available and self.get_airzone_value(AZD_AVAILABLE)
def get_airzone_value(self, key: str) -> Any:
"""Return system value by key."""
value = None
@@ -130,6 +136,11 @@ class AirzoneZoneEntity(AirzoneEntity):
)
self._attr_unique_id = entry.unique_id or entry.entry_id
@property
def available(self) -> bool:
"""Return zone availability."""
return super().available and self.get_airzone_value(AZD_AVAILABLE)
def get_airzone_value(self, key: str) -> Any:
"""Return zone value by key."""
value = None
@@ -11,5 +11,5 @@
"documentation": "https://www.home-assistant.io/integrations/airzone",
"iot_class": "local_polling",
"loggers": ["aioairzone"],
"requirements": ["aioairzone==0.5.2"]
"requirements": ["aioairzone==0.6.1"]
}
+13 -11
View File
@@ -1,7 +1,7 @@
"""Support for the Airzone sensors."""
from __future__ import annotations
from dataclasses import dataclass, replace
from dataclasses import dataclass
from typing import Any, Final
from aioairzone.common import GrilleAngle, SleepTimeout
@@ -41,14 +41,14 @@ class AirzoneSelectDescription(SelectEntityDescription, AirzoneSelectDescription
GRILLE_ANGLE_DICT: Final[dict[str, int]] = {
"90º": GrilleAngle.DEG_90,
"50º": GrilleAngle.DEG_50,
"45º": GrilleAngle.DEG_45,
"40º": GrilleAngle.DEG_40,
"90deg": GrilleAngle.DEG_90,
"50deg": GrilleAngle.DEG_50,
"45deg": GrilleAngle.DEG_45,
"40deg": GrilleAngle.DEG_40,
}
SLEEP_DICT: Final[dict[str, int]] = {
"Off": SleepTimeout.SLEEP_OFF,
"off": SleepTimeout.SLEEP_OFF,
"30m": SleepTimeout.SLEEP_30,
"60m": SleepTimeout.SLEEP_60,
"90m": SleepTimeout.SLEEP_90,
@@ -61,21 +61,27 @@ ZONE_SELECT_TYPES: Final[tuple[AirzoneSelectDescription, ...]] = (
entity_category=EntityCategory.CONFIG,
key=AZD_COLD_ANGLE,
name="Cold Angle",
options=list(GRILLE_ANGLE_DICT),
options_dict=GRILLE_ANGLE_DICT,
translation_key="grille_angles",
),
AirzoneSelectDescription(
api_param=API_HEAT_ANGLE,
entity_category=EntityCategory.CONFIG,
key=AZD_HEAT_ANGLE,
name="Heat Angle",
options=list(GRILLE_ANGLE_DICT),
options_dict=GRILLE_ANGLE_DICT,
translation_key="grille_angles",
),
AirzoneSelectDescription(
api_param=API_SLEEP,
entity_category=EntityCategory.CONFIG,
key=AZD_SLEEP,
name="Sleep",
options=list(SLEEP_DICT),
options_dict=SLEEP_DICT,
translation_key="sleep_times",
),
)
@@ -91,14 +97,10 @@ async def async_setup_entry(
for system_zone_id, zone_data in coordinator.data[AZD_ZONES].items():
for description in ZONE_SELECT_TYPES:
if description.key in zone_data:
_desc = replace(
description,
options=list(description.options_dict.keys()),
)
entities.append(
AirzoneZoneSelect(
coordinator,
_desc,
description,
entry,
system_zone_id,
zone_data,
@@ -23,5 +23,25 @@
}
}
}
},
"entity": {
"select": {
"grille_angles": {
"state": {
"90deg": "90°",
"50deg": "50°",
"45deg": "45°",
"40deg": "40°"
}
},
"sleep_times": {
"state": {
"off": "[%key:common::state::off%]",
"30m": "30 minutes",
"60m": "60 minutes",
"90m": "90 minutes"
}
}
}
}
}
@@ -0,0 +1,48 @@
"""The Airzone Cloud integration."""
from __future__ import annotations
from aioairzone_cloud.cloudapi import AirzoneCloudApi
from aioairzone_cloud.common import ConnectionOptions
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_ID, CONF_PASSWORD, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import aiohttp_client
from .const import DOMAIN
from .coordinator import AirzoneUpdateCoordinator
PLATFORMS: list[Platform] = [Platform.SENSOR]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Airzone Cloud from a config entry."""
options = ConnectionOptions(
entry.data[CONF_USERNAME],
entry.data[CONF_PASSWORD],
)
airzone = AirzoneCloudApi(aiohttp_client.async_get_clientsession(hass), options)
await airzone.login()
inst_list = await airzone.list_installations()
for inst in inst_list:
if inst.get_id() == entry.data[CONF_ID]:
airzone.select_installation(inst)
await airzone.update_installation(inst)
coordinator = AirzoneUpdateCoordinator(hass, airzone)
await coordinator.async_config_entry_first_refresh()
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
return unload_ok
@@ -0,0 +1,116 @@
"""Config flow for Airzone Cloud."""
from __future__ import annotations
from typing import Any
from aioairzone_cloud.cloudapi import AirzoneCloudApi
from aioairzone_cloud.common import ConnectionOptions
from aioairzone_cloud.const import AZD_ID, AZD_NAME, AZD_WEBSERVERS
from aioairzone_cloud.exceptions import AirzoneCloudError, LoginError
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_ID, CONF_PASSWORD, CONF_USERNAME
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.selector import (
SelectOptionDict,
SelectSelector,
SelectSelectorConfig,
SelectSelectorMode,
)
from .const import DOMAIN
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle config flow for an Airzone Cloud device."""
airzone: AirzoneCloudApi
async def async_step_inst_pick(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the installation selection."""
errors = {}
options: dict[str, str] = {}
inst_desc = None
inst_id = None
if user_input is not None:
inst_id = user_input[CONF_ID]
try:
inst_list = await self.airzone.list_installations()
except AirzoneCloudError:
errors["base"] = "cannot_connect"
else:
for inst in inst_list:
_data = inst.data()
_id = _data[AZD_ID]
options[_id] = f"{_data[AZD_NAME]} {_data[AZD_WEBSERVERS][0]} ({_id})"
if _id is not None and _id == inst_id:
inst_desc = options[_id]
if user_input is not None and inst_desc is not None:
await self.async_set_unique_id(inst_id)
self._abort_if_unique_id_configured()
user_input[CONF_USERNAME] = self.airzone.options.username
user_input[CONF_PASSWORD] = self.airzone.options.password
return self.async_create_entry(title=inst_desc, data=user_input)
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{
vol.Required(CONF_ID): SelectSelector(
SelectSelectorConfig(
options=[
SelectOptionDict(value=k, label=v)
for k, v in options.items()
],
mode=SelectSelectorMode.DROPDOWN,
)
),
}
),
errors=errors,
)
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the initial step."""
errors = {}
if user_input is not None:
if CONF_ID in user_input:
return await self.async_step_inst_pick(user_input)
self.airzone = AirzoneCloudApi(
aiohttp_client.async_get_clientsession(self.hass),
ConnectionOptions(
user_input[CONF_USERNAME],
user_input[CONF_PASSWORD],
),
)
try:
await self.airzone.login()
except (AirzoneCloudError, LoginError):
errors["base"] = "cannot_connect"
else:
return await self.async_step_inst_pick()
return self.async_show_form(
step_id="user",
data_schema=vol.Schema(
{
vol.Required(CONF_USERNAME): str,
vol.Required(CONF_PASSWORD): str,
}
),
errors=errors,
)
@@ -0,0 +1,8 @@
"""Constants for the Airzone Cloud integration."""
from typing import Final
DOMAIN: Final[str] = "airzone_cloud"
MANUFACTURER: Final[str] = "Airzone"
AIOAIRZONE_CLOUD_TIMEOUT_SEC: Final[int] = 30
@@ -0,0 +1,43 @@
"""The Airzone Cloud integration coordinator."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from aioairzone_cloud.cloudapi import AirzoneCloudApi
from aioairzone_cloud.exceptions import AirzoneCloudError
import async_timeout
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const import AIOAIRZONE_CLOUD_TIMEOUT_SEC, DOMAIN
SCAN_INTERVAL = timedelta(seconds=60)
_LOGGER = logging.getLogger(__name__)
class AirzoneUpdateCoordinator(DataUpdateCoordinator[dict[str, Any]]):
"""Class to manage fetching data from the Airzone Cloud device."""
def __init__(self, hass: HomeAssistant, airzone: AirzoneCloudApi) -> None:
"""Initialize."""
self.airzone = airzone
super().__init__(
hass,
_LOGGER,
name=DOMAIN,
update_interval=SCAN_INTERVAL,
)
async def _async_update_data(self) -> dict[str, Any]:
"""Update data via library."""
async with async_timeout.timeout(AIOAIRZONE_CLOUD_TIMEOUT_SEC):
try:
await self.airzone.update()
except AirzoneCloudError as error:
raise UpdateFailed(error) from error
return self.airzone.data()
@@ -0,0 +1,144 @@
"""Support for the Airzone Cloud diagnostics."""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
from aioairzone_cloud.const import (
API_CITY,
API_GROUP_ID,
API_LOCATION_ID,
API_OLD_ID,
API_PIN,
API_STAT_AP_MAC,
API_STAT_SSID,
API_USER_ID,
AZD_WIFI_MAC,
RAW_DEVICES_STATUS,
RAW_INSTALLATIONS,
RAW_WEBSERVERS,
)
from homeassistant.components.diagnostics.util import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from .const import DOMAIN
from .coordinator import AirzoneUpdateCoordinator
TO_REDACT_API = [
API_CITY,
API_GROUP_ID,
API_LOCATION_ID,
API_OLD_ID,
API_PIN,
API_STAT_AP_MAC,
API_STAT_SSID,
API_USER_ID,
]
TO_REDACT_CONFIG = [
CONF_PASSWORD,
CONF_USERNAME,
]
TO_REDACT_COORD = [
AZD_WIFI_MAC,
]
def gather_ids(api_data: dict[str, Any]) -> dict[str, Any]:
"""Return dict with IDs."""
ids: dict[str, Any] = {}
dev_idx = 1
for dev_id in api_data[RAW_DEVICES_STATUS]:
if dev_id not in ids:
ids[dev_id] = f"device{dev_idx}"
dev_idx += 1
inst_idx = 1
for inst_id in api_data[RAW_INSTALLATIONS]:
if inst_id not in ids:
ids[inst_id] = f"installation{inst_idx}"
inst_idx += 1
ws_idx = 1
for ws_id in api_data[RAW_WEBSERVERS]:
if ws_id not in ids:
ids[ws_id] = f"webserver{ws_idx}"
ws_idx += 1
return ids
def redact_keys(data: Any, ids: dict[str, Any]) -> Any:
"""Redact sensitive keys in a dict."""
if not isinstance(data, (Mapping, list)):
return data
if isinstance(data, list):
return [redact_keys(val, ids) for val in data]
redacted = {**data}
keys = list(redacted)
for key in keys:
if key in ids:
redacted[ids[key]] = redacted.pop(key)
elif isinstance(redacted[key], Mapping):
redacted[key] = redact_keys(redacted[key], ids)
elif isinstance(redacted[key], list):
redacted[key] = [redact_keys(item, ids) for item in redacted[key]]
return redacted
def redact_values(data: Any, ids: dict[str, Any]) -> Any:
"""Redact sensitive values in a dict."""
if not isinstance(data, (Mapping, list)):
if data in ids:
return ids[data]
return data
if isinstance(data, list):
return [redact_values(val, ids) for val in data]
redacted = {**data}
for key, value in redacted.items():
if value is None:
continue
if isinstance(value, Mapping):
redacted[key] = redact_values(value, ids)
elif isinstance(value, list):
redacted[key] = [redact_values(item, ids) for item in value]
elif value in ids:
redacted[key] = ids[value]
return redacted
def redact_all(
data: dict[str, Any], ids: dict[str, Any], to_redact: list[str]
) -> dict[str, Any]:
"""Redact sensitive data."""
_data = redact_keys(data, ids)
_data = redact_values(_data, ids)
return async_redact_data(_data, to_redact)
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: ConfigEntry
) -> dict[str, Any]:
"""Return diagnostics for a config entry."""
coordinator: AirzoneUpdateCoordinator = hass.data[DOMAIN][config_entry.entry_id]
raw_data = coordinator.airzone.raw_data()
ids = gather_ids(raw_data)
return {
"api_data": redact_all(raw_data, ids, TO_REDACT_API),
"config_entry": redact_all(config_entry.as_dict(), ids, TO_REDACT_CONFIG),
"coord_data": redact_all(coordinator.data, ids, TO_REDACT_COORD),
}
@@ -0,0 +1,129 @@
"""Entity classes for the Airzone Cloud integration."""
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import Any
from aioairzone_cloud.const import (
AZD_AIDOOS,
AZD_AVAILABLE,
AZD_FIRMWARE,
AZD_NAME,
AZD_SYSTEM_ID,
AZD_WEBSERVER,
AZD_WEBSERVERS,
AZD_ZONES,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN, MANUFACTURER
from .coordinator import AirzoneUpdateCoordinator
class AirzoneEntity(CoordinatorEntity[AirzoneUpdateCoordinator], ABC):
"""Define an Airzone Cloud entity."""
@property
def available(self) -> bool:
"""Return Airzone Cloud entity availability."""
return super().available and self.get_airzone_value(AZD_AVAILABLE)
@abstractmethod
def get_airzone_value(self, key: str) -> Any:
"""Return Airzone Cloud entity value by key."""
class AirzoneAidooEntity(AirzoneEntity):
"""Define an Airzone Cloud Aidoo entity."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
entry: ConfigEntry,
aidoo_id: str,
aidoo_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator)
self.aidoo_id = aidoo_id
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, aidoo_id)},
manufacturer=MANUFACTURER,
name=aidoo_data[AZD_NAME],
via_device=(DOMAIN, aidoo_data[AZD_WEBSERVER]),
)
def get_airzone_value(self, key: str) -> Any:
"""Return Aidoo value by key."""
value = None
if aidoo := self.coordinator.data[AZD_AIDOOS].get(self.aidoo_id):
value = aidoo.get(key)
return value
class AirzoneWebServerEntity(AirzoneEntity):
"""Define an Airzone Cloud WebServer entity."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
entry: ConfigEntry,
ws_id: str,
ws_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator)
self.ws_id = ws_id
self._attr_device_info = DeviceInfo(
connections={(dr.CONNECTION_NETWORK_MAC, ws_id)},
identifiers={(DOMAIN, ws_id)},
manufacturer=MANUFACTURER,
name=f"WebServer {ws_id}",
sw_version=ws_data[AZD_FIRMWARE],
)
def get_airzone_value(self, key: str) -> Any:
"""Return WebServer value by key."""
value = None
if webserver := self.coordinator.data[AZD_WEBSERVERS].get(self.ws_id):
value = webserver.get(key)
return value
class AirzoneZoneEntity(AirzoneEntity):
"""Define an Airzone Cloud Zone entity."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
entry: ConfigEntry,
zone_id: str,
zone_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator)
self.system_id = zone_data[AZD_SYSTEM_ID]
self.zone_id = zone_id
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, zone_id)},
manufacturer=MANUFACTURER,
name=zone_data[AZD_NAME],
via_device=(DOMAIN, self.system_id),
)
def get_airzone_value(self, key: str) -> Any:
"""Return zone value by key."""
value = None
if zone := self.coordinator.data[AZD_ZONES].get(self.zone_id):
value = zone.get(key)
return value
@@ -0,0 +1,10 @@
{
"domain": "airzone_cloud",
"name": "Airzone Cloud",
"codeowners": ["@Noltari"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/airzone_cloud",
"iot_class": "cloud_polling",
"loggers": ["aioairzone_cloud"],
"requirements": ["aioairzone-cloud==0.1.7"]
}
@@ -0,0 +1,209 @@
"""Support for the Airzone Cloud sensors."""
from __future__ import annotations
from typing import Any, Final
from aioairzone_cloud.const import (
AZD_AIDOOS,
AZD_HUMIDITY,
AZD_NAME,
AZD_TEMP,
AZD_WEBSERVERS,
AZD_WIFI_RSSI,
AZD_ZONES,
)
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
PERCENTAGE,
SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
EntityCategory,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .coordinator import AirzoneUpdateCoordinator
from .entity import (
AirzoneAidooEntity,
AirzoneEntity,
AirzoneWebServerEntity,
AirzoneZoneEntity,
)
AIDOO_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
SensorEntityDescription(
device_class=SensorDeviceClass.TEMPERATURE,
key=AZD_TEMP,
name="Temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
),
)
WEBSERVER_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
SensorEntityDescription(
device_class=SensorDeviceClass.SIGNAL_STRENGTH,
entity_category=EntityCategory.DIAGNOSTIC,
entity_registry_enabled_default=False,
has_entity_name=True,
key=AZD_WIFI_RSSI,
name="RSSI",
native_unit_of_measurement=SIGNAL_STRENGTH_DECIBELS_MILLIWATT,
state_class=SensorStateClass.MEASUREMENT,
),
)
ZONE_SENSOR_TYPES: Final[tuple[SensorEntityDescription, ...]] = (
SensorEntityDescription(
device_class=SensorDeviceClass.TEMPERATURE,
key=AZD_TEMP,
name="Temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
),
SensorEntityDescription(
device_class=SensorDeviceClass.HUMIDITY,
key=AZD_HUMIDITY,
name="Humidity",
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
),
)
async def async_setup_entry(
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
) -> None:
"""Add Airzone Cloud sensors from a config_entry."""
coordinator: AirzoneUpdateCoordinator = hass.data[DOMAIN][entry.entry_id]
sensors: list[AirzoneSensor] = []
# Aidoos
for aidoo_id, aidoo_data in coordinator.data.get(AZD_AIDOOS, {}).items():
for description in AIDOO_SENSOR_TYPES:
if description.key in aidoo_data:
sensors.append(
AirzoneAidooSensor(
coordinator,
description,
entry,
aidoo_id,
aidoo_data,
)
)
# WebServers
for ws_id, ws_data in coordinator.data.get(AZD_WEBSERVERS, {}).items():
for description in WEBSERVER_SENSOR_TYPES:
if description.key in ws_data:
sensors.append(
AirzoneWebServerSensor(
coordinator,
description,
entry,
ws_id,
ws_data,
)
)
# Zones
for zone_id, zone_data in coordinator.data.get(AZD_ZONES, {}).items():
for description in ZONE_SENSOR_TYPES:
if description.key in zone_data:
sensors.append(
AirzoneZoneSensor(
coordinator,
description,
entry,
zone_id,
zone_data,
)
)
async_add_entities(sensors)
class AirzoneSensor(AirzoneEntity, SensorEntity):
"""Define an Airzone Cloud sensor."""
@callback
def _handle_coordinator_update(self) -> None:
"""Update attributes when the coordinator updates."""
self._async_update_attrs()
super()._handle_coordinator_update()
@callback
def _async_update_attrs(self) -> None:
"""Update sensor attributes."""
self._attr_native_value = self.get_airzone_value(self.entity_description.key)
class AirzoneAidooSensor(AirzoneAidooEntity, AirzoneSensor):
"""Define an Airzone Cloud Aidoo sensor."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
description: SensorEntityDescription,
entry: ConfigEntry,
aidoo_id: str,
aidoo_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator, entry, aidoo_id, aidoo_data)
self._attr_name = f"{aidoo_data[AZD_NAME]} {description.name}"
self._attr_unique_id = f"{aidoo_id}_{description.key}"
self.entity_description = description
self._async_update_attrs()
class AirzoneWebServerSensor(AirzoneWebServerEntity, AirzoneSensor):
"""Define an Airzone Cloud WebServer sensor."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
description: SensorEntityDescription,
entry: ConfigEntry,
ws_id: str,
ws_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator, entry, ws_id, ws_data)
self._attr_unique_id = f"{ws_id}_{description.key}"
self.entity_description = description
self._async_update_attrs()
class AirzoneZoneSensor(AirzoneZoneEntity, AirzoneSensor):
"""Define an Airzone Cloud Zone sensor."""
def __init__(
self,
coordinator: AirzoneUpdateCoordinator,
description: SensorEntityDescription,
entry: ConfigEntry,
zone_id: str,
zone_data: dict[str, Any],
) -> None:
"""Initialize."""
super().__init__(coordinator, entry, zone_id, zone_data)
self._attr_name = f"{zone_data[AZD_NAME]} {description.name}"
self._attr_unique_id = f"{zone_id}_{description.key}"
self.entity_description = description
self._async_update_attrs()
@@ -0,0 +1,19 @@
{
"config": {
"abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
},
"error": {
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]"
},
"step": {
"user": {
"data": {
"id": "Installation",
"username": "[%key:common::config_flow::data::username%]",
"password": "[%key:common::config_flow::data::password%]"
}
}
}
}
}
@@ -89,15 +89,9 @@ class AladdinDevice(CoverEntity):
await self._acc.get_doors(self._serial)
self._attr_available = True
except session_manager.ConnectionError:
except (session_manager.ConnectionError, session_manager.InvalidPasswordError):
self._attr_available = False
except session_manager.InvalidPasswordError:
self._attr_available = False
await self.hass.async_create_task(
self.hass.config_entries.async_reload(self._entry_id)
)
@property
def is_closed(self) -> bool | None:
"""Update is closed attribute."""
@@ -62,5 +62,11 @@
}
}
}
},
"issues": {
"platform_integration_no_support": {
"title": "[%key:common::issues::platform_integration_no_support_title%]",
"description": "[%key:common::issues::platform_integration_no_support_description%]"
}
}
}
+4 -4
View File
@@ -12,7 +12,7 @@ from homeassistant.const import CONF_CLIENT_ID, CONF_CLIENT_SECRET
from homeassistant.core import callback
from homeassistant.helpers import aiohttp_client
from homeassistant.helpers.storage import Store
from homeassistant.util import dt
from homeassistant.util import dt as dt_util
_LOGGER = logging.getLogger(__name__)
@@ -95,12 +95,12 @@ class Auth:
if not self._prefs[STORAGE_ACCESS_TOKEN]:
return False
expire_time = dt.parse_datetime(self._prefs[STORAGE_EXPIRE_TIME])
expire_time = dt_util.parse_datetime(self._prefs[STORAGE_EXPIRE_TIME])
preemptive_expire_time = expire_time - timedelta(
seconds=PREEMPTIVE_REFRESH_TTL_IN_SECONDS
)
return dt.utcnow() < preemptive_expire_time
return dt_util.utcnow() < preemptive_expire_time
async def _async_request_new_token(self, lwa_params):
try:
@@ -130,7 +130,7 @@ class Auth:
access_token = response_json["access_token"]
refresh_token = response_json["refresh_token"]
expires_in = response_json["expires_in"]
expire_time = dt.utcnow() + timedelta(seconds=expires_in)
expire_time = dt_util.utcnow() + timedelta(seconds=expires_in)
await self._async_update_preferences(
access_token, refresh_token, expire_time.isoformat()
+19 -18
View File
@@ -1,9 +1,11 @@
"""Config helpers for Alexa."""
from __future__ import annotations
from abc import ABC, abstractmethod
import asyncio
import logging
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.helpers.storage import Store
from .const import DOMAIN
@@ -17,14 +19,15 @@ _LOGGER = logging.getLogger(__name__)
class AbstractConfig(ABC):
"""Hold the configuration for Alexa."""
_unsub_proactive_report: asyncio.Task[CALLBACK_TYPE] | None = None
_store: AlexaConfigStore
_unsub_proactive_report: CALLBACK_TYPE | None = None
def __init__(self, hass):
def __init__(self, hass: HomeAssistant) -> None:
"""Initialize abstract config."""
self.hass = hass
self._store = None
self._enable_proactive_mode_lock = asyncio.Lock()
async def async_initialize(self):
async def async_initialize(self) -> None:
"""Perform async initialization of config."""
self._store = AlexaConfigStore(self.hass)
await self._store.async_load()
@@ -64,27 +67,25 @@ class AbstractConfig(ABC):
def user_identifier(self):
"""Return an identifier for the user that represents this config."""
async def async_enable_proactive_mode(self):
async def async_enable_proactive_mode(self) -> None:
"""Enable proactive mode."""
_LOGGER.debug("Enable proactive mode")
if self._unsub_proactive_report is None:
self._unsub_proactive_report = self.hass.async_create_task(
async_enable_proactive_mode(self.hass, self)
async with self._enable_proactive_mode_lock:
if self._unsub_proactive_report is not None:
return
self._unsub_proactive_report = await async_enable_proactive_mode(
self.hass, self
)
try:
await self._unsub_proactive_report
except Exception:
self._unsub_proactive_report = None
raise
async def async_disable_proactive_mode(self):
async def async_disable_proactive_mode(self) -> None:
"""Disable proactive mode."""
_LOGGER.debug("Disable proactive mode")
if unsub_func := await self._unsub_proactive_report:
if unsub_func := self._unsub_proactive_report:
unsub_func()
self._unsub_proactive_report = None
async def should_expose(self, entity_id):
@callback
def should_expose(self, entity_id):
"""If an entity should be exposed."""
return False
@@ -106,7 +107,7 @@ class AbstractConfig(ABC):
"""Return authorization status."""
return self._store.authorized
async def set_authorized(self, authorized):
async def set_authorized(self, authorized) -> None:
"""Set authorization status.
- Set when an incoming message is received from Alexa.
+1 -1
View File
@@ -103,7 +103,7 @@ async def async_api_discovery(
discovery_endpoints = [
alexa_entity.serialize_discovery()
for alexa_entity in async_get_entities(hass, config)
if await config.should_expose(alexa_entity.entity_id)
if config.should_expose(alexa_entity.entity_id)
]
return directive.response(
+21 -9
View File
@@ -1,6 +1,7 @@
"""Support for Alexa skill service end point."""
import enum
import logging
from typing import Any
from homeassistant.components import http
from homeassistant.core import callback
@@ -180,12 +181,15 @@ async def async_handle_intent(hass, message):
return alexa_response.as_dict()
def resolve_slot_synonyms(key, request):
def resolve_slot_data(key: str, request: dict[str, Any]) -> dict[str, str]:
"""Check slot request for synonym resolutions."""
# Default to the spoken slot value if more than one or none are found. For
# Default to the spoken slot value if more than one or none are found. Always
# passes the id and name of the nearest possible slot resolution. For
# reference to the request object structure, see the Alexa docs:
# https://tinyurl.com/ybvm7jhs
resolved_value = request["value"]
resolved_data = {}
resolved_data["value"] = request["value"]
resolved_data["id"] = ""
if (
"resolutions" in request
@@ -200,20 +204,26 @@ def resolve_slot_synonyms(key, request):
if entry["status"]["code"] != SYN_RESOLUTION_MATCH:
continue
possible_values.extend([item["value"]["name"] for item in entry["values"]])
possible_values.extend([item["value"] for item in entry["values"]])
# Always set id if available, otherwise an empty string is used as id
if len(possible_values) >= 1:
# Set ID if available
if "id" in possible_values[0]:
resolved_data["id"] = possible_values[0]["id"]
# If there is only one match use the resolved value, otherwise the
# resolution cannot be determined, so use the spoken slot value
# resolution cannot be determined, so use the spoken slot value and empty string as id
if len(possible_values) == 1:
resolved_value = possible_values[0]
resolved_data["value"] = possible_values[0]["name"]
else:
_LOGGER.debug(
"Found multiple synonym resolutions for slot value: {%s: %s}",
key,
resolved_value,
resolved_data["value"],
)
return resolved_value
return resolved_data
class AlexaResponse:
@@ -237,8 +247,10 @@ class AlexaResponse:
continue
_key = key.replace(".", "_")
_slot_data = resolve_slot_data(key, value)
self.variables[_key] = resolve_slot_synonyms(key, value)
self.variables[_key] = _slot_data["value"]
self.variables[_key + "_Id"] = _slot_data["id"]
def add_card(self, card_type, title, content):
"""Add a card to the response."""
+2 -2
View File
@@ -30,7 +30,7 @@ class AlexaDirective:
self.entity = self.entity_id = self.endpoint = self.instance = None
async def load_entity(self, hass, config):
def load_entity(self, hass, config):
"""Set attributes related to the entity for this request.
Sets these attributes when self.has_endpoint is True:
@@ -49,7 +49,7 @@ class AlexaDirective:
self.entity_id = _endpoint_id.replace("#", ".")
self.entity = hass.states.get(self.entity_id)
if not self.entity or not await config.should_expose(self.entity_id):
if not self.entity or not config.should_expose(self.entity_id):
raise AlexaInvalidEndpointError(_endpoint_id)
self.endpoint = ENTITY_ADAPTERS[self.entity.domain](hass, config, self.entity)
+1 -1
View File
@@ -34,7 +34,7 @@ async def async_handle_message(hass, config, request, context=None, enabled=True
await config.set_authorized(True)
if directive.has_endpoint:
await directive.load_entity(hass, config)
directive.load_entity(hass, config)
funct_ref = HANDLERS.get((directive.namespace, directive.name))
if funct_ref:
@@ -60,7 +60,8 @@ class AlexaConfig(AbstractConfig):
"""Return an identifier for the user that represents this config."""
return ""
async def should_expose(self, entity_id):
@core.callback
def should_expose(self, entity_id):
"""If an entity should be exposed."""
if not self._config[CONF_FILTER].empty_filter:
return self._config[CONF_FILTER](entity_id)
+11 -4
View File
@@ -5,7 +5,7 @@ import asyncio
from http import HTTPStatus
import json
import logging
from typing import cast
from typing import TYPE_CHECKING, cast
import aiohttp
import async_timeout
@@ -23,6 +23,9 @@ from .entities import ENTITY_ADAPTERS, AlexaEntity, generate_alexa_id
from .errors import NoTokenAvailable, RequireRelink
from .messages import AlexaResponse
if TYPE_CHECKING:
from .config import AbstractConfig
_LOGGER = logging.getLogger(__name__)
DEFAULT_TIMEOUT = 10
@@ -64,7 +67,7 @@ async def async_enable_proactive_mode(hass, smart_home_config):
if new_state.domain not in ENTITY_ADAPTERS:
return
if not await smart_home_config.should_expose(changed_entity):
if not smart_home_config.should_expose(changed_entity):
_LOGGER.debug("Not exposing %s because filtered by config", changed_entity)
return
@@ -188,7 +191,9 @@ async def async_send_changereport_message(
)
async def async_send_add_or_update_message(hass, config, entity_ids):
async def async_send_add_or_update_message(
hass: HomeAssistant, config: AbstractConfig, entity_ids: list[str]
) -> aiohttp.ClientResponse:
"""Send an AddOrUpdateReport message for entities.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#add-or-update-report
@@ -223,7 +228,9 @@ async def async_send_add_or_update_message(hass, config, entity_ids):
)
async def async_send_delete_message(hass, config, entity_ids):
async def async_send_delete_message(
hass: HomeAssistant, config: AbstractConfig, entity_ids: list[str]
) -> aiohttp.ClientResponse:
"""Send an DeleteReport message for entities.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#deletereport-event
+1 -4
View File
@@ -167,12 +167,9 @@ class AmazonPollyProvider(Provider):
self,
message: str,
language: str,
options: dict[str, Any] | None = None,
options: dict[str, Any],
) -> TtsAudioType:
"""Request TTS file from Polly."""
if options is None or language is None:
_LOGGER.debug("language and/or options were missing")
return None, None
voice_id = options.get(CONF_VOICE, self.default_voice)
voice_in_dict = self.all_voices[voice_id]
if language != voice_in_dict.get("LanguageCode"):
@@ -6,12 +6,15 @@ import voluptuous as vol
from homeassistant.components import websocket_api
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import Event, HassJob, HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.event import async_call_later, async_track_time_interval
from homeassistant.helpers.typing import ConfigType
from .analytics import Analytics
from .const import ATTR_ONBOARDED, ATTR_PREFERENCES, DOMAIN, INTERVAL, PREFERENCE_SCHEMA
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, _: ConfigType) -> bool:
"""Set up the analytics integration."""
@@ -1,6 +1,8 @@
"""The Android TV Remote integration."""
from __future__ import annotations
import logging
from androidtvremote2 import (
AndroidTVRemote,
CannotConnect,
@@ -9,20 +11,37 @@ from androidtvremote2 import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.const import CONF_HOST, CONF_NAME, EVENT_HOMEASSISTANT_STOP, Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from .const import DOMAIN
from .helpers import create_api
PLATFORMS: list[Platform] = [Platform.REMOTE]
_LOGGER = logging.getLogger(__name__)
PLATFORMS: list[Platform] = [Platform.MEDIA_PLAYER, Platform.REMOTE]
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Android TV Remote from a config entry."""
api = create_api(hass, entry.data[CONF_HOST])
@callback
def is_available_updated(is_available: bool) -> None:
if is_available:
_LOGGER.info(
"Reconnected to %s at %s", entry.data[CONF_NAME], entry.data[CONF_HOST]
)
else:
_LOGGER.warning(
"Disconnected from %s at %s",
entry.data[CONF_NAME],
entry.data[CONF_HOST],
)
api.add_is_available_updated_callback(is_available_updated)
try:
await api.async_connect()
except InvalidAuth as exc:
@@ -0,0 +1,84 @@
"""Base entity for Android TV Remote."""
from __future__ import annotations
from androidtvremote2 import AndroidTVRemote, ConnectionClosed
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_NAME
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import DeviceInfo, Entity
from .const import DOMAIN
class AndroidTVRemoteBaseEntity(Entity):
"""Android TV Remote Base Entity."""
_attr_has_entity_name = True
_attr_should_poll = False
def __init__(self, api: AndroidTVRemote, config_entry: ConfigEntry) -> None:
"""Initialize the entity."""
self._api = api
self._host = config_entry.data[CONF_HOST]
self._name = config_entry.data[CONF_NAME]
self._attr_unique_id = config_entry.unique_id
self._attr_is_on = api.is_on
device_info = api.device_info
assert config_entry.unique_id
assert device_info
self._attr_device_info = DeviceInfo(
connections={(CONNECTION_NETWORK_MAC, config_entry.data[CONF_MAC])},
identifiers={(DOMAIN, config_entry.unique_id)},
name=self._name,
manufacturer=device_info["manufacturer"],
model=device_info["model"],
)
@callback
def _is_available_updated(self, is_available: bool) -> None:
"""Update the state when the device is ready to receive commands or is unavailable."""
self._attr_available = is_available
self.async_write_ha_state()
@callback
def _is_on_updated(self, is_on: bool) -> None:
"""Update the state when device turns on or off."""
self._attr_is_on = is_on
self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
self._api.add_is_available_updated_callback(self._is_available_updated)
self._api.add_is_on_updated_callback(self._is_on_updated)
async def async_will_remove_from_hass(self) -> None:
"""Remove callbacks."""
self._api.remove_is_available_updated_callback(self._is_available_updated)
self._api.remove_is_on_updated_callback(self._is_on_updated)
def _send_key_command(self, key_code: str, direction: str = "SHORT") -> None:
"""Send a key press to Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
"""
try:
self._api.send_key_command(key_code, direction)
except ConnectionClosed as exc:
raise HomeAssistantError(
"Connection to Android TV device is closed"
) from exc
def _send_launch_app_command(self, app_link: str) -> None:
"""Launch an app on Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
"""
try:
self._api.send_launch_app_command(app_link)
except ConnectionClosed as exc:
raise HomeAssistantError(
"Connection to Android TV device is closed"
) from exc
@@ -1,13 +1,13 @@
{
"domain": "androidtv_remote",
"name": "Android TV Remote",
"codeowners": ["@tronikos"],
"codeowners": ["@tronikos", "@Drafteed"],
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/androidtv_remote",
"integration_type": "device",
"iot_class": "local_push",
"loggers": ["androidtvremote2"],
"quality_scale": "platinum",
"requirements": ["androidtvremote2==0.0.7"],
"requirements": ["androidtvremote2==0.0.9"],
"zeroconf": ["_androidtvremote2._tcp.local."]
}
@@ -0,0 +1,198 @@
"""Media player support for Android TV Remote."""
from __future__ import annotations
import asyncio
from typing import Any
from androidtvremote2 import AndroidTVRemote, ConnectionClosed
from homeassistant.components.media_player import (
MediaPlayerDeviceClass,
MediaPlayerEntity,
MediaPlayerEntityFeature,
MediaPlayerState,
MediaType,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .entity import AndroidTVRemoteBaseEntity
PARALLEL_UPDATES = 0
async def async_setup_entry(
hass: HomeAssistant,
config_entry: ConfigEntry,
async_add_entities: AddEntitiesCallback,
) -> None:
"""Set up the Android TV media player entity based on a config entry."""
api: AndroidTVRemote = hass.data[DOMAIN][config_entry.entry_id]
async_add_entities([AndroidTVRemoteMediaPlayerEntity(api, config_entry)])
class AndroidTVRemoteMediaPlayerEntity(AndroidTVRemoteBaseEntity, MediaPlayerEntity):
"""Android TV Remote Media Player Entity."""
_attr_assumed_state = True
_attr_device_class = MediaPlayerDeviceClass.TV
_attr_supported_features = (
MediaPlayerEntityFeature.PAUSE
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.PREVIOUS_TRACK
| MediaPlayerEntityFeature.NEXT_TRACK
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.PLAY
| MediaPlayerEntityFeature.STOP
| MediaPlayerEntityFeature.PLAY_MEDIA
)
def __init__(self, api: AndroidTVRemote, config_entry: ConfigEntry) -> None:
"""Initialize the entity."""
super().__init__(api, config_entry)
# This task is needed to create a job that sends a key press
# sequence that can be canceled if concurrency occurs
self._channel_set_task: asyncio.Task | None = None
def _update_current_app(self, current_app: str) -> None:
"""Update current app info."""
self._attr_app_id = current_app
self._attr_app_name = current_app
def _update_volume_info(self, volume_info: dict[str, str | bool]) -> None:
"""Update volume info."""
if volume_info.get("max"):
self._attr_volume_level = int(volume_info["level"]) / int(
volume_info["max"]
)
self._attr_is_volume_muted = bool(volume_info["muted"])
else:
self._attr_volume_level = None
self._attr_is_volume_muted = None
@callback
def _current_app_updated(self, current_app: str) -> None:
"""Update the state when the current app changes."""
self._update_current_app(current_app)
self.async_write_ha_state()
@callback
def _volume_info_updated(self, volume_info: dict[str, str | bool]) -> None:
"""Update the state when the volume info changes."""
self._update_volume_info(volume_info)
self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
await super().async_added_to_hass()
self._update_current_app(self._api.current_app)
self._update_volume_info(self._api.volume_info)
self._api.add_current_app_updated_callback(self._current_app_updated)
self._api.add_volume_info_updated_callback(self._volume_info_updated)
async def async_will_remove_from_hass(self) -> None:
"""Remove callbacks."""
await super().async_will_remove_from_hass()
self._api.remove_current_app_updated_callback(self._current_app_updated)
self._api.remove_volume_info_updated_callback(self._volume_info_updated)
@property
def state(self) -> MediaPlayerState:
"""Return the state of the device."""
if self._attr_is_on:
return MediaPlayerState.ON
return MediaPlayerState.OFF
async def async_turn_on(self) -> None:
"""Turn the Android TV on."""
if not self._attr_is_on:
self._send_key_command("POWER")
async def async_turn_off(self) -> None:
"""Turn the Android TV off."""
if self._attr_is_on:
self._send_key_command("POWER")
async def async_volume_up(self) -> None:
"""Turn volume up for media player."""
self._send_key_command("VOLUME_UP")
async def async_volume_down(self) -> None:
"""Turn volume down for media player."""
self._send_key_command("VOLUME_DOWN")
async def async_mute_volume(self, mute: bool) -> None:
"""Mute the volume."""
if mute != self.is_volume_muted:
self._send_key_command("VOLUME_MUTE")
async def async_media_play(self) -> None:
"""Send play command."""
self._send_key_command("MEDIA_PLAY")
async def async_media_pause(self) -> None:
"""Send pause command."""
self._send_key_command("MEDIA_PAUSE")
async def async_media_play_pause(self) -> None:
"""Send play/pause command."""
self._send_key_command("MEDIA_PLAY_PAUSE")
async def async_media_stop(self) -> None:
"""Send stop command."""
self._send_key_command("MEDIA_STOP")
async def async_media_previous_track(self) -> None:
"""Send previous track command."""
self._send_key_command("MEDIA_PREVIOUS")
async def async_media_next_track(self) -> None:
"""Send next track command."""
self._send_key_command("MEDIA_NEXT")
async def async_play_media(
self, media_type: MediaType | str, media_id: str, **kwargs: Any
) -> None:
"""Play a piece of media."""
if media_type == MediaType.CHANNEL:
if not media_id.isnumeric():
raise ValueError(f"Channel must be numeric: {media_id}")
if self._channel_set_task:
self._channel_set_task.cancel()
self._channel_set_task = asyncio.create_task(
self._send_key_commands(list(media_id))
)
await self._channel_set_task
return
if media_type == MediaType.URL:
self._send_launch_app_command(media_id)
return
raise ValueError(f"Invalid media type: {media_type}")
async def _send_key_commands(
self, key_codes: list[str], delay_secs: float = 0.1
) -> None:
"""Send a key press sequence to Android TV.
The delay is necessary because device may ignore
some commands if we send the sequence without delay.
"""
try:
for key_code in key_codes:
self._api.send_key_command(key_code)
await asyncio.sleep(delay_secs)
except ConnectionClosed as exc:
raise HomeAssistantError(
"Connection to Android TV device is closed"
) from exc
@@ -3,10 +3,9 @@ from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
from typing import Any
from androidtvremote2 import AndroidTVRemote, ConnectionClosed
from androidtvremote2 import AndroidTVRemote
from homeassistant.components.remote import (
ATTR_ACTIVITY,
@@ -20,17 +19,13 @@ from homeassistant.components.remote import (
RemoteEntityFeature,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_MAC, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import DOMAIN
from .entity import AndroidTVRemoteBaseEntity
PARALLEL_UPDATES = 0
_LOGGER = logging.getLogger(__name__)
async def async_setup_entry(
@@ -43,62 +38,29 @@ async def async_setup_entry(
async_add_entities([AndroidTVRemoteEntity(api, config_entry)])
class AndroidTVRemoteEntity(RemoteEntity):
"""Representation of an Android TV Remote."""
class AndroidTVRemoteEntity(AndroidTVRemoteBaseEntity, RemoteEntity):
"""Android TV Remote Entity."""
_attr_has_entity_name = True
_attr_should_poll = False
_attr_supported_features = RemoteEntityFeature.ACTIVITY
def __init__(self, api: AndroidTVRemote, config_entry: ConfigEntry) -> None:
"""Initialize device."""
self._api = api
self._host = config_entry.data[CONF_HOST]
self._name = config_entry.data[CONF_NAME]
self._attr_unique_id = config_entry.unique_id
self._attr_supported_features = RemoteEntityFeature.ACTIVITY
self._attr_is_on = api.is_on
self._attr_current_activity = api.current_app
device_info = api.device_info
assert config_entry.unique_id
assert device_info
self._attr_device_info = DeviceInfo(
connections={(CONNECTION_NETWORK_MAC, config_entry.data[CONF_MAC])},
identifiers={(DOMAIN, config_entry.unique_id)},
name=self._name,
manufacturer=device_info["manufacturer"],
model=device_info["model"],
)
@callback
def _current_app_updated(self, current_app: str) -> None:
"""Update the state when the current app changes."""
self._attr_current_activity = current_app
self.async_write_ha_state()
@callback
def is_on_updated(is_on: bool) -> None:
self._attr_is_on = is_on
self.async_write_ha_state()
async def async_added_to_hass(self) -> None:
"""Register callbacks."""
await super().async_added_to_hass()
@callback
def current_app_updated(current_app: str) -> None:
self._attr_current_activity = current_app
self.async_write_ha_state()
self._attr_current_activity = self._api.current_app
self._api.add_current_app_updated_callback(self._current_app_updated)
@callback
def is_available_updated(is_available: bool) -> None:
if is_available:
_LOGGER.info(
"Reconnected to %s at %s",
self._name,
self._host,
)
else:
_LOGGER.warning(
"Disconnected from %s at %s",
self._name,
self._host,
)
self._attr_available = is_available
self.async_write_ha_state()
async def async_will_remove_from_hass(self) -> None:
"""Remove callbacks."""
await super().async_will_remove_from_hass()
api.add_is_on_updated_callback(is_on_updated)
api.add_current_app_updated_callback(current_app_updated)
api.add_is_available_updated_callback(is_available_updated)
self._api.remove_current_app_updated_callback(self._current_app_updated)
async def async_turn_on(self, **kwargs: Any) -> None:
"""Turn the Android TV on."""
@@ -128,27 +90,3 @@ class AndroidTVRemoteEntity(RemoteEntity):
else:
self._send_key_command(single_command, "SHORT")
await asyncio.sleep(delay_secs)
def _send_key_command(self, key_code: str, direction: str = "SHORT") -> None:
"""Send a key press to Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
"""
try:
self._api.send_key_command(key_code, direction)
except ConnectionClosed as exc:
raise HomeAssistantError(
"Connection to Android TV device is closed"
) from exc
def _send_launch_app_command(self, app_link: str) -> None:
"""Launch an app on Android TV.
This does not block; it buffers the data and arranges for it to be sent out asynchronously.
"""
try:
self._api.send_launch_app_command(app_link)
except ConnectionClosed as exc:
raise HomeAssistantError(
"Connection to Android TV device is closed"
) from exc
+2 -10
View File
@@ -3,13 +3,7 @@ from __future__ import annotations
import logging
from anova_wifi import (
AnovaApi,
AnovaPrecisionCooker,
AnovaPrecisionCookerSensor,
InvalidLogin,
NoDevicesFound,
)
from anova_wifi import AnovaApi, AnovaPrecisionCooker, InvalidLogin, NoDevicesFound
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
@@ -67,9 +61,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
coordinators = [AnovaCoordinator(hass, device) for device in devices]
for coordinator in coordinators:
await coordinator.async_config_entry_first_refresh()
firmware_version = coordinator.data["sensors"][
AnovaPrecisionCookerSensor.FIRMWARE_VERSION
]
firmware_version = coordinator.data.sensor.firmware_version
coordinator.async_setup(str(firmware_version))
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = AnovaData(
api_jwt=api.jwt, precision_cookers=devices, coordinators=coordinators
@@ -2,7 +2,7 @@
from datetime import timedelta
import logging
from anova_wifi import AnovaOffline, AnovaPrecisionCooker
from anova_wifi import AnovaOffline, AnovaPrecisionCooker, APCUpdate
import async_timeout
from homeassistant.core import HomeAssistant, callback
@@ -14,11 +14,9 @@ from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
class AnovaCoordinator(DataUpdateCoordinator):
class AnovaCoordinator(DataUpdateCoordinator[APCUpdate]):
"""Anova custom coordinator."""
data: dict[str, dict[str, str | int | float]]
def __init__(
self,
hass: HomeAssistant,
@@ -47,7 +45,7 @@ class AnovaCoordinator(DataUpdateCoordinator):
sw_version=firmware_version,
)
async def _async_update_data(self) -> dict[str, dict[str, str | int | float]]:
async def _async_update_data(self) -> APCUpdate:
try:
async with async_timeout.timeout(5):
return await self.anova_device.update()
+1 -1
View File
@@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/anova",
"iot_class": "cloud_polling",
"loggers": ["anova_wifi"],
"requirements": ["anova-wifi==0.8.0"]
"requirements": ["anova-wifi==0.10.0"]
}
+46 -18
View File
@@ -1,7 +1,10 @@
"""Support for Anova Sensors."""
from __future__ import annotations
from anova_wifi import AnovaPrecisionCookerSensor
from collections.abc import Callable
from dataclasses import dataclass
from anova_wifi import APCUpdateSensor
from homeassistant import config_entries
from homeassistant.components.sensor import (
@@ -19,57 +22,80 @@ from .const import DOMAIN
from .entity import AnovaDescriptionEntity
from .models import AnovaData
@dataclass
class AnovaSensorEntityDescriptionMixin:
"""Describes the mixin variables for anova sensors."""
value_fn: Callable[[APCUpdateSensor], float | int | str]
@dataclass
class AnovaSensorEntityDescription(
SensorEntityDescription, AnovaSensorEntityDescriptionMixin
):
"""Describes a Anova sensor."""
SENSOR_DESCRIPTIONS: list[SensorEntityDescription] = [
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.COOK_TIME,
AnovaSensorEntityDescription(
key="cook_time",
state_class=SensorStateClass.TOTAL_INCREASING,
native_unit_of_measurement=UnitOfTime.SECONDS,
icon="mdi:clock-outline",
translation_key="cook_time",
device_class=SensorDeviceClass.DURATION,
value_fn=lambda data: data.cook_time,
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.STATE, translation_key="state"
AnovaSensorEntityDescription(
key="state", translation_key="state", value_fn=lambda data: data.state
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.MODE, translation_key="mode"
AnovaSensorEntityDescription(
key="mode", translation_key="mode", value_fn=lambda data: data.mode
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.TARGET_TEMPERATURE,
AnovaSensorEntityDescription(
key="target_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="target_temperature",
value_fn=lambda data: data.target_temperature,
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.COOK_TIME_REMAINING,
AnovaSensorEntityDescription(
key="cook_time_remaining",
native_unit_of_measurement=UnitOfTime.SECONDS,
icon="mdi:clock-outline",
translation_key="cook_time_remaining",
device_class=SensorDeviceClass.DURATION,
value_fn=lambda data: data.cook_time_remaining,
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.HEATER_TEMPERATURE,
AnovaSensorEntityDescription(
key="heater_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="heater_temperature",
value_fn=lambda data: data.heater_temperature,
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.TRIAC_TEMPERATURE,
AnovaSensorEntityDescription(
key="triac_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="triac_temperature",
value_fn=lambda data: data.triac_temperature,
),
SensorEntityDescription(
key=AnovaPrecisionCookerSensor.WATER_TEMPERATURE,
AnovaSensorEntityDescription(
key="water_temperature",
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
device_class=SensorDeviceClass.TEMPERATURE,
state_class=SensorStateClass.MEASUREMENT,
icon="mdi:thermometer",
translation_key="water_temperature",
value_fn=lambda data: data.water_temperature,
),
]
@@ -91,7 +117,9 @@ async def async_setup_entry(
class AnovaSensor(AnovaDescriptionEntity, SensorEntity):
"""A sensor using Anova coordinator."""
entity_description: AnovaSensorEntityDescription
@property
def native_value(self) -> StateType:
"""Return the state."""
return self.coordinator.data["sensors"][self.entity_description.key]
return self.entity_description.value_fn(self.coordinator.data.sensor)
+1 -1
View File
@@ -17,7 +17,7 @@
"error": {
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]",
"unknown": "[%key:common::config_flow::error::unknown%]",
"no_devices_found": "No devices were found. Make sure you have at least one Anova device online"
"no_devices_found": "No devices were found. Make sure you have at least one Anova device online."
}
},
"entity": {
+11 -7
View File
@@ -3,8 +3,6 @@ from __future__ import annotations
import logging
from apcaccess.status import ALL_UNITS
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
@@ -379,7 +377,6 @@ SENSORS: dict[str, SensorEntityDescription] = {
key="stesti",
name="UPS Self Test Interval",
icon="mdi:information-outline",
state_class=SensorStateClass.TOTAL_INCREASING,
),
"timeleft": SensorEntityDescription(
key="timeleft",
@@ -427,7 +424,6 @@ SENSORS: dict[str, SensorEntityDescription] = {
),
}
SPECIFIC_UNITS = {"ITEMP": UnitOfTemperature.CELSIUS}
INFERRED_UNITS = {
" Minutes": UnitOfTime.MINUTES,
" Seconds": UnitOfTime.SECONDS,
@@ -438,7 +434,14 @@ INFERRED_UNITS = {
" Watts": UnitOfPower.WATT,
" Hz": UnitOfFrequency.HERTZ,
" C": UnitOfTemperature.CELSIUS,
# APCUPSd reports data for "itemp" field (eventually represented by UPS Internal
# Temperature sensor in this integration) with a trailing "Internal", e.g.,
# "34.6 C Internal". Here we create a fake unit " C Internal" to handle this case.
" C Internal": UnitOfTemperature.CELSIUS,
" Percent Load Capacity": PERCENTAGE,
# "stesti" field (Self Test Interval) field could report a "days" unit, e.g.,
# "7 days", so here we add support for it.
" days": UnitOfTime.DAYS,
}
@@ -466,15 +469,16 @@ async def async_setup_entry(
def infer_unit(value: str) -> tuple[str, str | None]:
"""If the value ends with any of the units from ALL_UNITS.
"""If the value ends with any of the units from supported units.
Split the unit off the end of the value and return the value, unit tuple
pair. Else return the original value and None as the unit.
"""
for unit in ALL_UNITS:
for unit, ha_unit in INFERRED_UNITS.items():
if value.endswith(unit):
return value.removesuffix(unit), INFERRED_UNITS.get(unit, unit.strip())
return value.removesuffix(unit), ha_unit
return value, None
+3 -1
View File
@@ -28,7 +28,7 @@ from homeassistant.const import (
import homeassistant.core as ha
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import ServiceNotFound, TemplateError, Unauthorized
from homeassistant.helpers import template
from homeassistant.helpers import config_validation as cv, template
from homeassistant.helpers.json import json_dumps
from homeassistant.helpers.service import async_get_all_descriptions
from homeassistant.helpers.typing import ConfigType
@@ -49,6 +49,8 @@ DOMAIN = "api"
STREAM_PING_PAYLOAD = "ping"
STREAM_PING_INTERVAL = 50 # seconds
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Register the API with the HTTP interface."""
@@ -407,8 +407,9 @@ class AppleTVConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
# Protocol specific arguments
pair_args = {}
if self.protocol == Protocol.DMAP:
if self.protocol in {Protocol.AirPlay, Protocol.Companion, Protocol.DMAP}:
pair_args["name"] = "Home Assistant"
if self.protocol == Protocol.DMAP:
pair_args["zeroconf"] = await zeroconf.async_get_instance(self.hass)
# Initiate the pairing process
@@ -7,7 +7,7 @@
"documentation": "https://www.home-assistant.io/integrations/apple_tv",
"iot_class": "local_push",
"loggers": ["pyatv", "srptools"],
"requirements": ["pyatv==0.10.3"],
"requirements": ["pyatv==0.12.0"],
"zeroconf": [
"_mediaremotetv._tcp.local.",
"_companion-link._tcp.local.",
@@ -138,6 +138,9 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
# Listen to power updates
self.atv.power.listener = self
# Listen to volume updates
self.atv.audio.listener = self
if self.atv.features.in_state(FeatureState.Available, FeatureName.AppList):
self.hass.create_task(self._update_app_list())
@@ -203,6 +206,11 @@ class AppleTvMediaPlayer(AppleTVEntity, MediaPlayerEntity):
"""Update power state when it changes."""
self.async_write_ha_state()
@callback
def volume_update(self, old_level: float, new_level: float) -> None:
"""Update volume when it changes."""
self.async_write_ha_state()
@property
def app_id(self) -> str | None:
"""ID of the current running app."""
@@ -57,6 +57,8 @@ CREATE_FIELDS = {
}
UPDATE_FIELDS: dict = {} # Not supported
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
@dataclass
class ClientCredential:
@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/apprise",
"iot_class": "cloud_push",
"loggers": ["apprise"],
"requirements": ["apprise==1.3.0"]
"requirements": ["apprise==1.4.0"]
}
+11 -6
View File
@@ -161,16 +161,13 @@ class ArestSwitchFunction(ArestSwitchBase):
class ArestSwitchPin(ArestSwitchBase):
"""Representation of an aREST switch. Based on digital I/O."""
def __init__(self, resource, location, name, pin, invert):
def __init__(self, resource, location, name, pin, invert) -> None:
"""Initialize the switch."""
super().__init__(resource, location, name)
self._pin = pin
self.invert = invert
request = requests.get(f"{resource}/mode/{pin}/o", timeout=10)
if request.status_code != HTTPStatus.OK:
_LOGGER.error("Can't set mode")
self._attr_available = False
self.__set_pin_output()
def turn_on(self, **kwargs: Any) -> None:
"""Turn the device on."""
@@ -200,7 +197,15 @@ class ArestSwitchPin(ArestSwitchBase):
request = requests.get(f"{self._resource}/digital/{self._pin}", timeout=10)
status_value = int(self.invert)
self._attr_is_on = request.json()["return_value"] != status_value
self._attr_available = True
if self._attr_available is False:
self._attr_available = True
self.__set_pin_output()
except requests.exceptions.ConnectionError:
_LOGGER.warning("No route to device %s", self._resource)
self._attr_available = False
def __set_pin_output(self) -> None:
request = requests.get(f"{self._resource}/mode/{self._pin}/o", timeout=10)
if request.status_code != HTTPStatus.OK:
_LOGGER.error("Can't set mode")
self._attr_available = False
+5
View File
@@ -101,6 +101,11 @@ async def async_setup_platform(
) -> None:
"""Set up the ARWN platform."""
# Make sure MQTT integration is enabled and the client is available
if not await mqtt.async_wait_for_mqtt_client(hass):
_LOGGER.error("MQTT integration is not available")
return
@callback
def async_sensor_event_received(msg: mqtt.ReceiveMessage) -> None:
"""Process events as sensors.
@@ -5,6 +5,7 @@ from collections.abc import AsyncIterable
from homeassistant.components import stt
from homeassistant.core import Context, HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN
@@ -33,8 +34,11 @@ __all__ = (
"Pipeline",
"PipelineEvent",
"PipelineEventType",
"PipelineNotFound",
)
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Assist pipeline integration."""
@@ -54,13 +58,10 @@ async def async_pipeline_from_audio_stream(
conversation_id: str | None = None,
tts_audio_output: str | None = None,
) -> None:
"""Create an audio pipeline from an audio stream."""
pipeline = async_get_pipeline(hass, pipeline_id=pipeline_id)
if pipeline is None:
raise PipelineNotFound(
"pipeline_not_found", f"Pipeline {pipeline_id} not found"
)
"""Create an audio pipeline from an audio stream.
Raises PipelineNotFound if no pipeline is found.
"""
pipeline_input = PipelineInput(
conversation_id=conversation_id,
stt_metadata=stt_metadata,
@@ -68,13 +69,12 @@ async def async_pipeline_from_audio_stream(
run=PipelineRun(
hass,
context=context,
pipeline=pipeline,
pipeline=async_get_pipeline(hass, pipeline_id=pipeline_id),
start_stage=PipelineStage.STT,
end_stage=PipelineStage.TTS,
event_callback=event_callback,
tts_audio_output=tts_audio_output,
),
)
await pipeline_input.validate()
await pipeline_input.execute()
@@ -19,7 +19,7 @@ class PipelineNotFound(PipelineError):
class SpeechToTextError(PipelineError):
"""Error in speech to text portion of pipeline."""
"""Error in speech-to-text portion of pipeline."""
class IntentRecognitionError(PipelineError):
@@ -27,4 +27,4 @@ class IntentRecognitionError(PipelineError):
class TextToSpeechError(PipelineError):
"""Error in text to speech portion of pipeline."""
"""Error in text-to-speech portion of pipeline."""
@@ -5,7 +5,7 @@ import asyncio
from collections.abc import AsyncIterable, Callable, Iterable
from dataclasses import asdict, dataclass, field
import logging
from typing import Any
from typing import Any, cast
import voluptuous as vol
@@ -36,6 +36,7 @@ from .const import DOMAIN
from .error import (
IntentRecognitionError,
PipelineError,
PipelineNotFound,
SpeechToTextError,
TextToSpeechError,
)
@@ -125,7 +126,7 @@ async def _async_resolve_default_pipeline_settings(
stt_language = stt_languages[0]
else:
_LOGGER.debug(
"Speech to text engine '%s' does not support language '%s'",
"Speech-to-text engine '%s' does not support language '%s'",
stt_engine_id,
pipeline_language,
)
@@ -152,7 +153,7 @@ async def _async_resolve_default_pipeline_settings(
tts_voice = tts_voices[0].voice_id
else:
_LOGGER.debug(
"Text to speech engine '%s' does not support language '%s'",
"Text-to-speech engine '%s' does not support language '%s'",
tts_engine_id,
pipeline_language,
)
@@ -208,9 +209,7 @@ async def async_create_default_pipeline(
@callback
def async_get_pipeline(
hass: HomeAssistant, pipeline_id: str | None = None
) -> Pipeline | None:
def async_get_pipeline(hass: HomeAssistant, pipeline_id: str | None = None) -> Pipeline:
"""Get a pipeline by id or the preferred pipeline."""
pipeline_data: PipelineData = hass.data[DOMAIN]
@@ -218,7 +217,15 @@ def async_get_pipeline(
# A pipeline was not specified, use the preferred one
pipeline_id = pipeline_data.pipeline_store.async_get_preferred_item()
return pipeline_data.pipeline_store.data.get(pipeline_id)
pipeline = pipeline_data.pipeline_store.data.get(pipeline_id)
# If invalid pipeline ID was specified
if pipeline is None:
raise PipelineNotFound(
"pipeline_not_found", f"Pipeline {pipeline_id} not found"
)
return pipeline
@callback
@@ -332,12 +339,12 @@ class PipelineRun:
event_callback: PipelineEventCallback
language: str = None # type: ignore[assignment]
runner_data: Any | None = None
stt_provider: stt.SpeechToTextEntity | stt.Provider | None = None
intent_agent: str | None = None
tts_engine: str | None = None
tts_audio_output: str | None = None
id: str = field(default_factory=ulid_util.ulid)
stt_provider: stt.SpeechToTextEntity | stt.Provider = field(init=False)
tts_engine: str = field(init=False)
tts_options: dict | None = field(init=False, default=None)
def __post_init__(self) -> None:
@@ -387,9 +394,7 @@ class PipelineRun:
)
async def prepare_speech_to_text(self, metadata: stt.SpeechMetadata) -> None:
"""Prepare speech to text."""
stt_provider: stt.SpeechToTextEntity | stt.Provider | None = None
"""Prepare speech-to-text."""
# pipeline.stt_engine can't be None or this function is not called
stt_provider = stt.async_get_speech_to_text_engine(
self.hass,
@@ -400,7 +405,7 @@ class PipelineRun:
engine = self.pipeline.stt_engine
raise SpeechToTextError(
code="stt-provider-missing",
message=f"No speech to text provider for: {engine}",
message=f"No speech-to-text provider for: {engine}",
)
metadata.language = self.pipeline.stt_language or self.language
@@ -421,10 +426,7 @@ class PipelineRun:
metadata: stt.SpeechMetadata,
stream: AsyncIterable[bytes],
) -> str:
"""Run speech to text portion of pipeline. Returns the spoken text."""
if self.stt_provider is None:
raise RuntimeError("Speech to text was not prepared")
"""Run speech-to-text portion of pipeline. Returns the spoken text."""
if isinstance(self.stt_provider, stt.Provider):
engine = self.stt_provider.name
else:
@@ -446,10 +448,10 @@ class PipelineRun:
metadata, stream
)
except Exception as src_error:
_LOGGER.exception("Unexpected error during speech to text")
_LOGGER.exception("Unexpected error during speech-to-text")
raise SpeechToTextError(
code="stt-stream-failed",
message="Unexpected error during speech to text",
message="Unexpected error during speech-to-text",
) from src_error
_LOGGER.debug("speech-to-text result %s", result)
@@ -457,7 +459,7 @@ class PipelineRun:
if result.result != stt.SpeechResultState.SUCCESS:
raise SpeechToTextError(
code="stt-stream-failed",
message="Speech to text failed",
message="speech-to-text failed",
)
if not result.text:
@@ -546,8 +548,9 @@ class PipelineRun:
return speech
async def prepare_text_to_speech(self) -> None:
"""Prepare text to speech."""
engine = self.pipeline.tts_engine
"""Prepare text-to-speech."""
# pipeline.tts_engine can't be None or this function is not called
engine = cast(str, self.pipeline.tts_engine)
tts_options = {}
if self.pipeline.tts_voice is not None:
@@ -557,34 +560,31 @@ class PipelineRun:
tts_options[tts.ATTR_AUDIO_OUTPUT] = self.tts_audio_output
try:
# pipeline.tts_engine can't be None or this function is not called
if not await tts.async_support_options(
options_supported = await tts.async_support_options(
self.hass,
engine, # type: ignore[arg-type]
engine,
self.pipeline.tts_language,
tts_options,
):
raise TextToSpeechError(
code="tts-not-supported",
message=(
f"Text to speech engine {engine} "
f"does not support language {self.pipeline.tts_language} or options {tts_options}"
),
)
)
except HomeAssistantError as err:
raise TextToSpeechError(
code="tts-not-supported",
message=f"Text to speech engine '{engine}' not found",
message=f"Text-to-speech engine '{engine}' not found",
) from err
if not options_supported:
raise TextToSpeechError(
code="tts-not-supported",
message=(
f"Text-to-speech engine {engine} "
f"does not support language {self.pipeline.tts_language} or options {tts_options}"
),
)
self.tts_engine = engine
self.tts_options = tts_options
async def text_to_speech(self, tts_input: str) -> str:
"""Run text to speech portion of pipeline. Returns URL of TTS audio."""
if self.tts_engine is None:
raise RuntimeError("Text to speech was not prepared")
"""Run text-to-speech portion of pipeline. Returns URL of TTS audio."""
self.process_event(
PipelineEvent(
PipelineEventType.TTS_START,
@@ -612,10 +612,10 @@ class PipelineRun:
None,
)
except Exception as src_error:
_LOGGER.exception("Unexpected error during text to speech")
_LOGGER.exception("Unexpected error during text-to-speech")
raise TextToSpeechError(
code="tts-failed",
message="Unexpected error during text to speech",
message="Unexpected error during text-to-speech",
) from src_error
_LOGGER.debug("TTS result %s", tts_media)
@@ -651,7 +651,7 @@ class PipelineInput:
"""Input for conversation agent. Required when start_stage = intent."""
tts_input: str | None = None
"""Input for text to speech. Required when start_stage = tts."""
"""Input for text-to-speech. Required when start_stage = tts."""
conversation_id: str | None = None
@@ -661,7 +661,7 @@ class PipelineInput:
current_stage = self.run.start_stage
try:
# Speech to text
# speech-to-text
intent_input = self.intent_input
if current_stage == PipelineStage.STT:
assert self.stt_metadata is not None
@@ -703,15 +703,15 @@ class PipelineInput:
if self.run.start_stage == PipelineStage.STT:
if self.run.pipeline.stt_engine is None:
raise PipelineRunValidationError(
"the pipeline does not support speech to text"
"the pipeline does not support speech-to-text"
)
if self.stt_metadata is None:
raise PipelineRunValidationError(
"stt_metadata is required for speech to text"
"stt_metadata is required for speech-to-text"
)
if self.stt_stream is None:
raise PipelineRunValidationError(
"stt_stream is required for speech to text"
"stt_stream is required for speech-to-text"
)
elif self.run.start_stage == PipelineStage.INTENT:
if self.intent_input is None:
@@ -721,12 +721,12 @@ class PipelineInput:
elif self.run.start_stage == PipelineStage.TTS:
if self.tts_input is None:
raise PipelineRunValidationError(
"tts_input is required for text to speech"
"tts_input is required for text-to-speech"
)
if self.run.end_stage == PipelineStage.TTS:
if self.run.pipeline.tts_engine is None:
raise PipelineRunValidationError(
"the pipeline does not support text to speech"
"the pipeline does not support text-to-speech"
)
start_stage_index = PIPELINE_STAGE_ORDER.index(self.run.start_stage)
@@ -17,6 +17,7 @@ from homeassistant.helpers import config_validation as cv
from homeassistant.util import language as language_util
from .const import DOMAIN
from .error import PipelineNotFound
from .pipeline import (
PipelineData,
PipelineError,
@@ -85,8 +86,9 @@ async def websocket_run(
) -> None:
"""Run a pipeline."""
pipeline_id = msg.get("pipeline")
pipeline = async_get_pipeline(hass, pipeline_id=pipeline_id)
if pipeline is None:
try:
pipeline = async_get_pipeline(hass, pipeline_id=pipeline_id)
except PipelineNotFound:
connection.send_error(
msg["id"],
"pipeline-not-found",
@@ -151,7 +153,7 @@ async def websocket_run(
# Input to conversation agent
input_args["intent_input"] = msg["input"]["text"]
elif start_stage == PipelineStage.TTS:
# Input to text to speech system
# Input to text-to-speech system
input_args["tts_input"] = msg["input"]["text"]
input_args["run"] = PipelineRun(
+25 -10
View File
@@ -7,6 +7,7 @@ from itertools import chain
import logging
from aiohttp import ClientError, ClientResponseError
from yalexs.const import DEFAULT_BRAND
from yalexs.doorbell import Doorbell, DoorbellDetail
from yalexs.exceptions import AugustApiAIOHTTPError
from yalexs.lock import Lock, LockDetail
@@ -16,7 +17,7 @@ from yalexs_ble import YaleXSBLEDiscovery
from homeassistant.config_entries import SOURCE_INTEGRATION_DISCOVERY, ConfigEntry
from homeassistant.const import CONF_PASSWORD
from homeassistant.core import HomeAssistant, callback
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback
from homeassistant.exceptions import (
ConfigEntryAuthFailed,
ConfigEntryNotReady,
@@ -25,7 +26,7 @@ from homeassistant.exceptions import (
from homeassistant.helpers import device_registry as dr, discovery_flow
from .activity import ActivityStream
from .const import DOMAIN, MIN_TIME_BETWEEN_DETAIL_UPDATES, PLATFORMS
from .const import CONF_BRAND, DOMAIN, MIN_TIME_BETWEEN_DETAIL_UPDATES, PLATFORMS
from .exceptions import CannotConnect, InvalidAuth, RequireValidation
from .gateway import AugustGateway
from .subscriber import AugustSubscriberMixin
@@ -122,19 +123,29 @@ def _async_trigger_ble_lock_discovery(
class AugustData(AugustSubscriberMixin):
"""August data object."""
def __init__(self, hass, config_entry, august_gateway):
def __init__(
self,
hass: HomeAssistant,
config_entry: ConfigEntry,
august_gateway: AugustGateway,
) -> None:
"""Init August data object."""
super().__init__(hass, MIN_TIME_BETWEEN_DETAIL_UPDATES)
self._config_entry = config_entry
self._hass = hass
self._august_gateway = august_gateway
self.activity_stream = None
self.activity_stream: ActivityStream | None = None
self._api = august_gateway.api
self._device_detail_by_id = {}
self._doorbells_by_id = {}
self._locks_by_id = {}
self._house_ids = set()
self._pubnub_unsub = None
self._device_detail_by_id: dict[str, LockDetail | DoorbellDetail] = {}
self._doorbells_by_id: dict[str, Doorbell] = {}
self._locks_by_id: dict[str, Lock] = {}
self._house_ids: set[str] = set()
self._pubnub_unsub: CALLBACK_TYPE | None = None
@property
def brand(self) -> str:
"""Brand of the device."""
return self._config_entry.data.get(CONF_BRAND, DEFAULT_BRAND)
async def async_setup(self):
"""Async setup of august device data and activities."""
@@ -185,7 +196,11 @@ class AugustData(AugustSubscriberMixin):
)
await self.activity_stream.async_setup()
pubnub.subscribe(self.async_pubnub_message)
self._pubnub_unsub = async_create_pubnub(user_data["UserID"], pubnub)
self._pubnub_unsub = async_create_pubnub(
user_data["UserID"],
pubnub,
self.brand,
)
if self._locks_by_id:
# Do not prevent setup as the sync can timeout
@@ -50,6 +50,7 @@ def _retrieve_online_state(data: AugustData, detail: DoorbellDetail) -> bool:
def _retrieve_motion_state(data: AugustData, detail: DoorbellDetail) -> bool:
assert data.activity_stream is not None
latest = data.activity_stream.get_latest_device_activity(
detail.device_id, {ActivityType.DOORBELL_MOTION}
)
@@ -61,6 +62,7 @@ def _retrieve_motion_state(data: AugustData, detail: DoorbellDetail) -> bool:
def _retrieve_image_capture_state(data: AugustData, detail: DoorbellDetail) -> bool:
assert data.activity_stream is not None
latest = data.activity_stream.get_latest_device_activity(
detail.device_id, {ActivityType.DOORBELL_IMAGE_CAPTURE}
)
@@ -72,6 +74,7 @@ def _retrieve_image_capture_state(data: AugustData, detail: DoorbellDetail) -> b
def _retrieve_ding_state(data: AugustData, detail: DoorbellDetail) -> bool:
assert data.activity_stream is not None
latest = data.activity_stream.get_latest_device_activity(
detail.device_id, {ActivityType.DOORBELL_DING}
)
@@ -211,6 +214,7 @@ class AugustDoorBinarySensor(AugustEntityMixin, BinarySensorEntity):
@callback
def _update_from_data(self):
"""Get the latest state of the sensor and update activity."""
assert self._data.activity_stream is not None
door_activity = self._data.activity_stream.get_latest_device_activity(
self._device_id, {ActivityType.DOOR_OPERATION}
)
+106 -32
View File
@@ -1,33 +1,45 @@
"""Config flow for August integration."""
from collections.abc import Mapping
from dataclasses import dataclass
import logging
from typing import Any
import voluptuous as vol
from yalexs.authenticator import ValidationResult
from yalexs.const import BRANDS, DEFAULT_BRAND
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.data_entry_flow import FlowResult
from .const import CONF_LOGIN_METHOD, DOMAIN, LOGIN_METHODS, VERIFICATION_CODE_KEY
from .const import (
CONF_ACCESS_TOKEN_CACHE_FILE,
CONF_BRAND,
CONF_LOGIN_METHOD,
DEFAULT_LOGIN_METHOD,
DOMAIN,
LOGIN_METHODS,
VERIFICATION_CODE_KEY,
)
from .exceptions import CannotConnect, InvalidAuth, RequireValidation
from .gateway import AugustGateway
_LOGGER = logging.getLogger(__name__)
async def async_validate_input(data, august_gateway):
async def async_validate_input(
data: dict[str, Any], august_gateway: AugustGateway
) -> dict[str, Any]:
"""Validate the user input allows us to connect.
Data has the keys from DATA_SCHEMA with values provided by the user.
Request configuration steps from the user.
"""
assert august_gateway.authenticator is not None
authenticator = august_gateway.authenticator
if (code := data.get(VERIFICATION_CODE_KEY)) is not None:
result = await august_gateway.authenticator.async_validate_verification_code(
code
)
result = await authenticator.async_validate_verification_code(code)
_LOGGER.debug("Verification code validation: %s", result)
if result != ValidationResult.VALIDATED:
raise RequireValidation
@@ -50,6 +62,16 @@ async def async_validate_input(data, august_gateway):
}
@dataclass
class ValidateResult:
"""Result from validation."""
validation_required: bool
info: dict[str, Any]
errors: dict[str, str]
description_placeholders: dict[str, str]
class AugustConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for August."""
@@ -57,9 +79,9 @@ class AugustConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
def __init__(self):
"""Store an AugustGateway()."""
self._august_gateway = None
self._user_auth_details = {}
self._needs_reset = False
self._august_gateway: AugustGateway | None = None
self._user_auth_details: dict[str, Any] = {}
self._needs_reset = True
self._mode = None
super().__init__()
@@ -70,19 +92,30 @@ class AugustConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
async def async_step_user_validate(self, user_input=None):
"""Handle authentication."""
errors = {}
errors: dict[str, str] = {}
description_placeholders: dict[str, str] = {}
if user_input is not None:
result = await self._async_auth_or_validate(user_input, errors)
if result is not None:
return result
self._user_auth_details.update(user_input)
validate_result = await self._async_auth_or_validate()
description_placeholders = validate_result.description_placeholders
if validate_result.validation_required:
return await self.async_step_validation()
if not (errors := validate_result.errors):
return await self._async_update_or_create_entry(validate_result.info)
return self.async_show_form(
step_id="user_validate",
data_schema=vol.Schema(
{
vol.Required(
CONF_BRAND,
default=self._user_auth_details.get(CONF_BRAND, DEFAULT_BRAND),
): vol.In(BRANDS),
vol.Required(
CONF_LOGIN_METHOD,
default=self._user_auth_details.get(CONF_LOGIN_METHOD, "phone"),
default=self._user_auth_details.get(
CONF_LOGIN_METHOD, DEFAULT_LOGIN_METHOD
),
): vol.In(LOGIN_METHODS),
vol.Required(
CONF_USERNAME,
@@ -92,21 +125,27 @@ class AugustConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
}
),
errors=errors,
description_placeholders=description_placeholders,
)
async def async_step_validation(self, user_input=None):
async def async_step_validation(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle validation (2fa) step."""
if user_input:
if self._mode == "reauth":
return await self.async_step_reauth_validate(user_input)
return await self.async_step_user_validate(user_input)
previously_failed = VERIFICATION_CODE_KEY in self._user_auth_details
return self.async_show_form(
step_id="validation",
data_schema=vol.Schema(
{vol.Required(VERIFICATION_CODE_KEY): vol.All(str, vol.Strip)}
),
errors={"base": "invalid_verification_code"} if previously_failed else None,
description_placeholders={
CONF_BRAND: self._user_auth_details[CONF_BRAND],
CONF_USERNAME: self._user_auth_details[CONF_USERNAME],
CONF_LOGIN_METHOD: self._user_auth_details[CONF_LOGIN_METHOD],
},
@@ -122,49 +161,84 @@ class AugustConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
async def async_step_reauth_validate(self, user_input=None):
"""Handle reauth and validation."""
errors = {}
errors: dict[str, str] = {}
description_placeholders: dict[str, str] = {}
if user_input is not None:
result = await self._async_auth_or_validate(user_input, errors)
if result is not None:
return result
self._user_auth_details.update(user_input)
validate_result = await self._async_auth_or_validate()
description_placeholders = validate_result.description_placeholders
if validate_result.validation_required:
return await self.async_step_validation()
if not (errors := validate_result.errors):
return await self._async_update_or_create_entry(validate_result.info)
return self.async_show_form(
step_id="reauth_validate",
data_schema=vol.Schema(
{
vol.Required(
CONF_BRAND,
default=self._user_auth_details.get(CONF_BRAND, DEFAULT_BRAND),
): vol.In(BRANDS),
vol.Required(CONF_PASSWORD): str,
}
),
errors=errors,
description_placeholders={
description_placeholders=description_placeholders
| {
CONF_USERNAME: self._user_auth_details[CONF_USERNAME],
},
)
async def _async_auth_or_validate(self, user_input, errors):
self._user_auth_details.update(user_input)
await self._august_gateway.async_setup(self._user_auth_details)
async def _async_reset_access_token_cache_if_needed(
self, gateway: AugustGateway, username: str, access_token_cache_file: str | None
) -> None:
"""Reset the access token cache if needed."""
# We need to configure the access token cache file before we setup the gateway
# since we need to reset it if the brand changes BEFORE we setup the gateway
gateway.async_configure_access_token_cache_file(
username, access_token_cache_file
)
if self._needs_reset:
self._needs_reset = False
await self._august_gateway.async_reset_authentication()
await gateway.async_reset_authentication()
async def _async_auth_or_validate(self) -> ValidateResult:
"""Authenticate or validate."""
user_auth_details = self._user_auth_details
gateway = self._august_gateway
assert gateway is not None
await self._async_reset_access_token_cache_if_needed(
gateway,
user_auth_details[CONF_USERNAME],
user_auth_details.get(CONF_ACCESS_TOKEN_CACHE_FILE),
)
await gateway.async_setup(user_auth_details)
errors: dict[str, str] = {}
info: dict[str, Any] = {}
description_placeholders: dict[str, str] = {}
validation_required = False
try:
info = await async_validate_input(
self._user_auth_details,
self._august_gateway,
)
info = await async_validate_input(user_auth_details, gateway)
except CannotConnect:
errors["base"] = "cannot_connect"
except InvalidAuth:
errors["base"] = "invalid_auth"
except RequireValidation:
return await self.async_step_validation()
except Exception: # pylint: disable=broad-except
validation_required = True
except Exception as ex: # pylint: disable=broad-except
_LOGGER.exception("Unexpected exception")
errors["base"] = "unknown"
errors["base"] = "unhandled"
description_placeholders = {"error": str(ex)}
if errors:
return None
return ValidateResult(
validation_required, info, errors, description_placeholders
)
async def _async_update_or_create_entry(self, info: dict[str, Any]) -> FlowResult:
"""Update existing entry or create a new one."""
existing_entry = await self.async_set_unique_id(
self._user_auth_details[CONF_USERNAME]
)
+2
View File
@@ -7,6 +7,7 @@ from homeassistant.const import Platform
DEFAULT_TIMEOUT = 25
CONF_ACCESS_TOKEN_CACHE_FILE = "access_token_cache_file"
CONF_BRAND = "brand"
CONF_LOGIN_METHOD = "login_method"
CONF_INSTALL_ID = "install_id"
@@ -42,6 +43,7 @@ MIN_TIME_BETWEEN_DETAIL_UPDATES = timedelta(hours=1)
ACTIVITY_UPDATE_INTERVAL = timedelta(seconds=10)
LOGIN_METHODS = ["phone", "email"]
DEFAULT_LOGIN_METHOD = "email"
PLATFORMS = [
Platform.BUTTON,
@@ -3,12 +3,14 @@ from __future__ import annotations
from typing import Any
from yalexs.const import DEFAULT_BRAND
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from . import AugustData
from .const import DOMAIN
from .const import CONF_BRAND, DOMAIN
TO_REDACT = {
"HouseID",
@@ -44,4 +46,5 @@ async def async_get_config_entry_diagnostics(
)
for doorbell in data.doorbells
},
"brand": entry.data.get(CONF_BRAND, DEFAULT_BRAND),
}
+2 -1
View File
@@ -3,6 +3,7 @@ from abc import abstractmethod
from yalexs.doorbell import Doorbell
from yalexs.lock import Lock
from yalexs.util import get_configuration_url
from homeassistant.core import callback
from homeassistant.helpers.entity import DeviceInfo, Entity
@@ -30,7 +31,7 @@ class AugustEntityMixin(Entity):
name=device.device_name,
sw_version=self._detail.firmware_version,
suggested_area=_remove_device_types(device.device_name, DEVICE_TYPES),
configuration_url="https://account.august.com",
configuration_url=get_configuration_url(data.brand),
)
@property
+38 -17
View File
@@ -1,19 +1,26 @@
"""Handle August connection setup and authentication."""
import asyncio
from collections.abc import Mapping
from http import HTTPStatus
import logging
import os
from typing import Any
from aiohttp import ClientError, ClientResponseError
from yalexs.api_async import ApiAsync
from yalexs.authenticator_async import AuthenticationState, AuthenticatorAsync
from yalexs.authenticator_common import Authentication
from yalexs.const import DEFAULT_BRAND
from yalexs.exceptions import AugustApiAIOHTTPError
from homeassistant.const import CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import aiohttp_client
from .const import (
CONF_ACCESS_TOKEN_CACHE_FILE,
CONF_BRAND,
CONF_INSTALL_ID,
CONF_LOGIN_METHOD,
DEFAULT_AUGUST_CONFIG_FILE,
@@ -28,48 +35,59 @@ _LOGGER = logging.getLogger(__name__)
class AugustGateway:
"""Handle the connection to August."""
def __init__(self, hass):
def __init__(self, hass: HomeAssistant) -> None:
"""Init the connection."""
# Create an aiohttp session instead of using the default one since the
# default one is likely to trigger august's WAF if another integration
# is also using Cloudflare
self._aiohttp_session = aiohttp_client.async_create_clientsession(hass)
self._token_refresh_lock = asyncio.Lock()
self._access_token_cache_file = None
self._hass = hass
self._config = None
self.api = None
self.authenticator = None
self.authentication = None
self._access_token_cache_file: str | None = None
self._hass: HomeAssistant = hass
self._config: Mapping[str, Any] | None = None
self.api: ApiAsync | None = None
self.authenticator: AuthenticatorAsync | None = None
self.authentication: Authentication | None = None
@property
def access_token(self):
"""Access token for the api."""
return self.authentication.access_token
def config_entry(self):
def config_entry(self) -> dict[str, Any]:
"""Config entry."""
assert self._config is not None
return {
CONF_BRAND: self._config.get(CONF_BRAND, DEFAULT_BRAND),
CONF_LOGIN_METHOD: self._config[CONF_LOGIN_METHOD],
CONF_USERNAME: self._config[CONF_USERNAME],
CONF_INSTALL_ID: self._config.get(CONF_INSTALL_ID),
CONF_ACCESS_TOKEN_CACHE_FILE: self._access_token_cache_file,
}
async def async_setup(self, conf):
@callback
def async_configure_access_token_cache_file(
self, username: str, access_token_cache_file: str | None
) -> str:
"""Configure the access token cache file."""
file = access_token_cache_file or f".{username}{DEFAULT_AUGUST_CONFIG_FILE}"
self._access_token_cache_file = file
return self._hass.config.path(file)
async def async_setup(self, conf: Mapping[str, Any]) -> None:
"""Create the api and authenticator objects."""
if conf.get(VERIFICATION_CODE_KEY):
return
self._access_token_cache_file = conf.get(
CONF_ACCESS_TOKEN_CACHE_FILE,
f".{conf[CONF_USERNAME]}{DEFAULT_AUGUST_CONFIG_FILE}",
access_token_cache_file_path = self.async_configure_access_token_cache_file(
conf[CONF_USERNAME], conf.get(CONF_ACCESS_TOKEN_CACHE_FILE)
)
self._config = conf
self.api = ApiAsync(
self._aiohttp_session,
timeout=self._config.get(CONF_TIMEOUT, DEFAULT_TIMEOUT),
brand=self._config.get(CONF_BRAND, DEFAULT_BRAND),
)
self.authenticator = AuthenticatorAsync(
@@ -78,9 +96,7 @@ class AugustGateway:
self._config[CONF_USERNAME],
self._config.get(CONF_PASSWORD, ""),
install_id=self._config.get(CONF_INSTALL_ID),
access_token_cache_file=self._hass.config.path(
self._access_token_cache_file
),
access_token_cache_file=access_token_cache_file_path,
)
await self.authenticator.async_setup_authentication()
@@ -95,6 +111,10 @@ class AugustGateway:
# authenticated because we can be authenticated
# by have no access
await self.api.async_get_operable_locks(self.access_token)
except AugustApiAIOHTTPError as ex:
if ex.auth_failed:
raise InvalidAuth from ex
raise CannotConnect from ex
except ClientResponseError as ex:
if ex.status == HTTPStatus.UNAUTHORIZED:
raise InvalidAuth from ex
@@ -122,8 +142,9 @@ class AugustGateway:
def _reset_authentication(self):
"""Remove the cache file."""
if os.path.exists(self._access_token_cache_file):
os.unlink(self._access_token_cache_file)
path = self._hass.config.path(self._access_token_cache_file)
if os.path.exists(path):
os.unlink(path)
async def async_refresh_access_token_if_needed(self):
"""Refresh the august access token if needed."""
+2
View File
@@ -47,6 +47,7 @@ class AugustLock(AugustEntityMixin, RestoreEntity, LockEntity):
async def async_lock(self, **kwargs: Any) -> None:
"""Lock the device."""
assert self._data.activity_stream is not None
if self._data.activity_stream.pubnub.connected:
await self._data.async_lock_async(self._device_id, self._hyper_bridge)
return
@@ -54,6 +55,7 @@ class AugustLock(AugustEntityMixin, RestoreEntity, LockEntity):
async def async_unlock(self, **kwargs: Any) -> None:
"""Unlock the device."""
assert self._data.activity_stream is not None
if self._data.activity_stream.pubnub.connected:
await self._data.async_unlock_async(self._device_id, self._hyper_bridge)
return
@@ -28,5 +28,5 @@
"documentation": "https://www.home-assistant.io/integrations/august",
"iot_class": "cloud_push",
"loggers": ["pubnub", "yalexs"],
"requirements": ["yalexs==1.3.3", "yalexs-ble==2.1.16"]
"requirements": ["yalexs==1.5.1", "yalexs-ble==2.1.17"]
}
@@ -172,6 +172,7 @@ async def _async_migrate_old_unique_ids(hass, devices):
registry.async_update_entity(old_entity_id, new_unique_id=device.unique_id)
# pylint: disable-next=hass-invalid-inheritance # needs fixing
class AugustOperatorSensor(AugustEntityMixin, RestoreEntity, SensorEntity):
"""Representation of an August lock operation sensor."""
+9 -6
View File
@@ -1,7 +1,8 @@
{
"config": {
"error": {
"unknown": "[%key:common::config_flow::error::unknown%]",
"unhandled": "Unhandled error: {error}",
"invalid_verification_code": "Invalid verification code",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"invalid_auth": "[%key:common::config_flow::error::invalid_auth%]"
},
@@ -15,20 +16,22 @@
"data": {
"code": "Verification code"
},
"description": "Please check your {login_method} ({username}) and enter the verification code below"
"description": "Please check your {login_method} ({username}) and enter the verification code below. Codes may take a few minutes to arrive."
},
"user_validate": {
"description": "If the Login Method is 'email', Username is the email address. If the Login Method is 'phone', Username is the phone number in the format '+NNNNNNNNN'.",
"description": "It is recommended to use the 'email' login method as some brands may not work with the 'phone' method. If the Login Method is 'email', Username is the email address. If the Login Method is 'phone', Username is the phone number in the format '+NNNNNNNNN'. If you choose the wrong brand, you may be able to authenticate initially; however, you will not be able to operate devices. If you are unsure of the brand, create the integration again and try another brand.",
"data": {
"password": "[%key:common::config_flow::data::password%]",
"brand": "Brand",
"login_method": "Login Method",
"username": "[%key:common::config_flow::data::username%]",
"login_method": "Login Method"
"password": "[%key:common::config_flow::data::password%]"
},
"title": "Set up an August account"
},
"reauth_validate": {
"description": "Enter the password for {username}.",
"description": "Choose the correct brand for your device, and enter the password for {username}. If you choose the wrong brand, you may be able to authenticate initially; however, you will not be able to operate devices. If you are unsure of the brand, create the integration again and try another brand.",
"data": {
"brand": "[%key:component::august::config::step::user_validate::data::brand%]",
"password": "[%key:common::config_flow::data::password%]"
},
"title": "Reauthenticate an August account"
@@ -7,6 +7,8 @@
# Developer note:
# vscode devcontainer: use the following to access USB device:
# "runArgs": ["-e", "GIT_EDITOR=code --wait", "--device=/dev/ttyUSB0"],
# and add the following to the end of script/bootstrap:
# sudo chmod 777 /dev/ttyUSB0
import logging
@@ -149,6 +149,7 @@ from homeassistant.components.http.ban import log_invalid_auth
from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.config_entry_oauth2_flow import OAuth2AuthorizeCallbackView
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
@@ -161,6 +162,8 @@ DOMAIN = "auth"
StoreResultType = Callable[[str, Credentials], str]
RetrieveResultType = Callable[[str, str], Credentials | None]
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
@bind_hass
def create_auth_code(
@@ -228,6 +228,20 @@ def automations_with_blueprint(hass: HomeAssistant, blueprint_path: str) -> list
]
@callback
def blueprint_in_automation(hass: HomeAssistant, entity_id: str) -> str | None:
"""Return the blueprint the automation is based on or None."""
if DOMAIN not in hass.data:
return None
component: EntityComponent[AutomationEntity] = hass.data[DOMAIN]
if (automation_entity := component.get_entity(entity_id)) is None:
return None
return automation_entity.referenced_blueprint
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up all automations."""
hass.data[DOMAIN] = component = EntityComponent[AutomationEntity](
@@ -578,6 +592,14 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
await super().async_will_remove_from_hass()
await self.async_disable()
async def _async_enable_automation(self, event: Event) -> 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:
return
self._async_detach_triggers = await self._async_attach_triggers(True)
async def async_enable(self) -> None:
"""Enable this automation entity.
@@ -594,16 +616,8 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
self.async_write_ha_state()
return
async def async_enable_automation(event: Event) -> 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:
return
self._async_detach_triggers = await self._async_attach_triggers(True)
self.hass.bus.async_listen_once(
EVENT_HOMEASSISTANT_STARTED, async_enable_automation
EVENT_HOMEASSISTANT_STARTED, self._async_enable_automation
)
self.async_write_ha_state()
+1 -1
View File
@@ -218,7 +218,7 @@ class AxisNetworkDevice:
"""Stop stream."""
if self.api.stream.state != State.STOPPED:
self.api.stream.connection_status_callback.clear()
self.api.stream.stop()
self.api.stream.stop()
async def shutdown(self, event) -> None:
"""Stop the event stream."""
+1 -1
View File
@@ -26,7 +26,7 @@
"iot_class": "local_push",
"loggers": ["axis"],
"quality_scale": "platinum",
"requirements": ["axis==47"],
"requirements": ["axis==48"],
"ssdp": [
{
"manufacturer": "AXIS"
@@ -155,7 +155,6 @@ class AzureEventHub:
Suppress the INFO and below logging on the underlying packages,
they are very verbose, even at INFO.
"""
logging.getLogger("uamqp").setLevel(logging.WARNING)
logging.getLogger("azure.eventhub").setLevel(logging.WARNING)
self._listener_remover = self.hass.bus.async_listen(
MATCH_ALL, self.async_listen
@@ -5,5 +5,5 @@
"documentation": "https://www.home-assistant.io/integrations/azure_service_bus",
"iot_class": "cloud_push",
"loggers": ["azure"],
"requirements": ["azure-servicebus==7.8.0"]
"requirements": ["azure-servicebus==7.10.0"]
}
@@ -1,6 +1,7 @@
"""The Backup integration."""
from homeassistant.components.hassio import is_hassio
from homeassistant.core import HomeAssistant, ServiceCall
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType
from .const import DOMAIN, LOGGER
@@ -8,6 +9,8 @@ from .http import async_register_http_views
from .manager import BackupManager
from .websocket import async_register_websocket_handlers
CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Backup integration."""
+2 -2
View File
@@ -18,7 +18,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import integration_platform
from homeassistant.helpers.json import save_json
from homeassistant.util import dt
from homeassistant.util import dt as dt_util
from homeassistant.util.json import json_loads_object
from .const import DOMAIN, EXCLUDE_FROM_BACKUP, LOGGER
@@ -176,7 +176,7 @@ class BackupManager:
raise result
backup_name = f"Core {HAVERSION}"
date_str = dt.now().isoformat()
date_str = dt_util.now().isoformat()
slug = _generate_slug(date_str, backup_name)
backup_data = {
-2
View File
@@ -27,7 +27,6 @@ class BAFNumberDescriptionMixin:
"""Required values for BAF sensors."""
value_fn: Callable[[Device], int | None]
mode: NumberMode
@dataclass
@@ -147,7 +146,6 @@ class BAFNumber(BAFEntity, NumberEntity):
self.entity_description = description
super().__init__(device, f"{device.name} {description.name}")
self._attr_unique_id = f"{self._device.mac_address}-{description.key}"
self._attr_mode = description.mode
@callback
def _async_update_attrs(self) -> None:
+5 -8
View File
@@ -104,7 +104,7 @@ class BaiduTTSProvider(Provider):
"""Return a list of supported options."""
return SUPPORTED_OPTIONS
def get_tts_audio(self, message, language, options=None):
def get_tts_audio(self, message, language, options):
"""Load TTS from BaiduTTS."""
aip_speech = AipSpeech(
@@ -113,14 +113,11 @@ class BaiduTTSProvider(Provider):
self._app_data["secretkey"],
)
if options is None:
result = aip_speech.synthesis(message, language, 1, self._speech_conf_data)
else:
speech_data = self._speech_conf_data.copy()
for key, value in options.items():
speech_data[_OPTIONS[key]] = value
speech_data = self._speech_conf_data.copy()
for key, value in options.items():
speech_data[_OPTIONS[key]] = value
result = aip_speech.synthesis(message, language, 1, speech_data)
result = aip_speech.synthesis(message, language, 1, speech_data)
if isinstance(result, dict):
_LOGGER.error(
@@ -70,62 +70,6 @@ CONF_OPENED = "opened"
CONF_NOT_OPENED = "not_opened"
TURNED_ON = [
CONF_BAT_LOW,
CONF_CO,
CONF_COLD,
CONF_CONNECTED,
CONF_GAS,
CONF_HOT,
CONF_LIGHT,
CONF_NOT_LOCKED,
CONF_MOIST,
CONF_MOTION,
CONF_MOVING,
CONF_OCCUPIED,
CONF_OPENED,
CONF_PLUGGED_IN,
CONF_POWERED,
CONF_PRESENT,
CONF_PROBLEM,
CONF_RUNNING,
CONF_SMOKE,
CONF_SOUND,
CONF_UNSAFE,
CONF_UPDATE,
CONF_VIBRATION,
CONF_TAMPERED,
CONF_TURNED_ON,
]
TURNED_OFF = [
CONF_NOT_BAT_LOW,
CONF_NOT_COLD,
CONF_NOT_CONNECTED,
CONF_NOT_HOT,
CONF_LOCKED,
CONF_NOT_MOIST,
CONF_NOT_MOVING,
CONF_NOT_OCCUPIED,
CONF_NOT_OPENED,
CONF_NOT_PLUGGED_IN,
CONF_NOT_POWERED,
CONF_NOT_PRESENT,
CONF_NOT_TAMPERED,
CONF_NOT_UNSAFE,
CONF_NO_CO,
CONF_NO_GAS,
CONF_NO_LIGHT,
CONF_NO_MOTION,
CONF_NO_PROBLEM,
CONF_NOT_RUNNING,
CONF_NO_SMOKE,
CONF_NO_SOUND,
CONF_NO_VIBRATION,
CONF_TURNED_OFF,
]
ENTITY_TRIGGERS = {
BinarySensorDeviceClass.BATTERY: [
{CONF_TYPE: CONF_BAT_LOW},
@@ -245,6 +189,9 @@ ENTITY_TRIGGERS = {
],
}
TURNED_ON = [trigger[0][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]
TURNED_OFF = [trigger[1][CONF_TYPE] for trigger in ENTITY_TRIGGERS.values()]
TRIGGER_SCHEMA = DEVICE_TRIGGER_BASE_SCHEMA.extend(
{
@@ -4,6 +4,8 @@
"condition_type": {
"is_bat_low": "{entity_name} battery is low",
"is_not_bat_low": "{entity_name} battery is normal",
"is_charging": "{entity_name} is charging",
"is_not_charging": "{entity_name} is not charging",
"is_co": "{entity_name} is detecting carbon monoxide",
"is_no_co": "{entity_name} is not detecting carbon monoxide",
"is_cold": "{entity_name} is cold",
@@ -56,6 +58,8 @@
"trigger_type": {
"bat_low": "{entity_name} battery low",
"not_bat_low": "{entity_name} battery normal",
"charging": "{entity_name} charging",
"not_charging": "{entity_name} not charging",
"co": "{entity_name} started detecting carbon monoxide",
"no_co": "{entity_name} stopped detecting carbon monoxide",
"cold": "{entity_name} became cold",
@@ -310,5 +314,11 @@
"smoke": "smoke",
"sound": "sound",
"vibration": "vibration"
},
"issues": {
"platform_integration_no_support": {
"title": "[%key:common::issues::platform_integration_no_support_title%]",
"description": "[%key:common::issues::platform_integration_no_support_description%]"
}
}
}

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