Compare commits

...

646 Commits

Author SHA1 Message Date
Erik
2f608d8650 Use numerical_value when compiling statistics 2023-02-01 14:03:33 +01:00
Erik
65324431a4 Add numerical_value state attribute to sensor 2023-02-01 13:58:43 +01:00
Franck Nijhof
4dba9c09fc Only report invalid numeric value for sensors once (#87010) 2023-01-31 12:44:18 +01:00
On Freund
35b82db8b0 Rympro integration code fixes (#86734)
* Address review comments

* Add coordinator.py to coveragerc

* Apply suggestions from code review

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

* Update homeassistant/components/rympro/coordinator.py

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

* Move SCAN_INTERVAL to coordinator.py

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2023-01-31 10:40:43 +01:00
Martin Mauch
a28e7e1541 Fix typo in EnOcean (#86868) 2023-01-31 09:49:37 +01:00
Bouwe Westerdijk
7f01d57965 Bump plugwise to v0.27.5 (#87001)
fixes undefined
2023-01-31 09:32:39 +01:00
epenet
0d018d53f1 Don't run tests if ruff fails (#87003) 2023-01-31 09:31:49 +01:00
Michael Davie
be25d17e02 Bump env_canada to 0.5.27 (#86996)
fixes undefined
2023-01-31 08:56:27 +01:00
epenet
7db166b515 Fix tests typing helper (#86956) 2023-01-31 08:48:35 +01:00
Jan Bouwhuis
33ede351f0 Cleanup code for parsing yaml MQTT config (#86944)
* Cleanup code for parsing yaml configs

* Add abstractmethod decorator to async_update

* Replace get() with default-list ensured by schema
2023-01-31 08:24:33 +01:00
Paulus Schoutsen
1c4ba61725 Bump ESPHome Dashboard API 1.2.3 (#86997) 2023-01-31 00:05:59 -05:00
Michael Hansen
f4654128db Add synesthesiam as a codeowner on intent (#86998) 2023-01-30 23:46:42 -05:00
Michael Hansen
be69c81db5 Prioritize entity names over area names in Assist matching (#86982)
* Refactor async_match_states

* Check entity name after state, before aliases

* Give entity name matches priority over area names

* Don't force result to have area

* Add area alias in tests

* Move name/area list creation back

* Clean up PR

* More clean up
2023-01-30 23:46:25 -05:00
Marcel van der Veldt
f8c6e4c20a Add support for Hue Smart Scenes (Natural Lights) (#85517)
* Bump aiohue to 4.6.0

* fix device name for lights

* fix name for groups too

* ignore smart scenes

* bump to 4.6.1 instead

* Add support for Smart Scenes (Natural lights) in Hue

* update base entity class

* fix test fixture

* update tests

* fix scene test

* fix typo

* use underlying scene controller

* use enum value

* update tests

* add current scene name within smart scene

* extra attributes are only valid if the scene is active

* Update v2_resources.json

* typo

* fix after merge
2023-01-30 23:32:37 -05:00
Paulus Schoutsen
d88849fb04 ESPHome handle remove password and no encryption (#86995)
* ESPHome handle remove password and no encryption

* Start reauth for invalid api password

---------

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2023-01-30 23:05:48 -05:00
PeteRager
e706696271 Nest - Climate shorten line to be less than 88 chars (#86989)
Lines to be less than 88
2023-01-30 19:14:24 -08:00
shbatm
53638ba138 Bump pyisy to 3.1.11 (#86981)
* Bump pyisy to 3.1.10

* Bump pyisy to 3.1.11
2023-01-30 21:36:51 -05:00
puddly
47453420c1 Bump ZHA dependencies (#86979)
Bump ZHA dependency bellows from 0.34.6 to 0.34.7
2023-01-30 21:35:27 -05:00
Bram Kragten
0c383e28c4 Update frontend to 20230130.0 (#86978) 2023-01-30 21:34:26 -05:00
Paulus Schoutsen
98b4a412f7 ESPHome discovered dashboard checks reauth flows (#86993) 2023-01-30 21:32:52 -05:00
GitHub Action
da35ac1942 [ci skip] Translation update 2023-01-31 00:25:29 +00:00
mkmer
365ce55d77 Honeywell auto mode invalid attribute (#86728)
fixes undefined
2023-01-31 00:04:00 +01:00
Michael Hansen
28affe91be Set synesthesiam as codeowner of conversation (#86958) 2023-01-30 23:02:25 +01:00
Paulus Schoutsen
2cdeb6f1cd Check dashboard when showing reauth form (#86980) 2023-01-30 22:46:42 +01:00
Steven Looman
7e206b5854 Fix error on empty location in ssdp messages (#86970) 2023-01-30 22:43:58 +01:00
Franck Nijhof
1edd00c51f Allow any state class when using the precipitation device class (#86977) 2023-01-30 22:43:23 +01:00
ollo69
772df02cce Catch AndroidTV exception on setup (#86819)
fixes undefined
2023-01-30 22:42:32 +01:00
puddly
8337d4613e ZHA config flow cleanup (#86742)
fixes undefined
2023-01-30 22:21:34 +01:00
Steven Looman
50373500c3 Ensure a proper scope_id is given for IPv6 addresses when initializing the SSDP component (#86975)
fixes undefined
2023-01-30 22:14:48 +01:00
Paul Bottein
a8b23d7139 Uses PolledSmartEnergySummation for ZLinky (#86960) 2023-01-30 22:10:55 +01:00
Raman Gupta
c715534821 Bump zwave-js-server-python to 0.45.0 (#86771) 2023-01-30 14:27:37 -05:00
Paulus Schoutsen
e0f8b5bbd1 Fix some mobile app sensor registration/update issues (#86965)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-30 20:08:19 +01:00
Michael Hansen
f7fdaadde0 Performance improvements for Assist (#86966)
* Move hassil recognize into executor

* Bump hassil to 0.2.6

* Disable template parsing in name/area lists

* Don't iterate over hass.config.components directly
2023-01-30 12:25:22 -06:00
Jan Bouwhuis
e57dad79fc Fix MQTT discovery failing after bad config update (#86935)
* Fix MQTT discovery failing after bad config update

* Update last discovery payload after update success

* Improve test, correct update assignment

* send_discovery_done to finally-catch vol.Error

* Just use try..finally

* Remove extra line

* use elif to avoid log confusion
2023-01-30 19:15:11 +01:00
J. Nick Koston
00118a6f96 Speed up live history setup if there is no pending data to commit (#86942) 2023-01-30 19:00:34 +01:00
J. Nick Koston
f874258e7e Silence spurious warnings about removing ix_states_entity_id with newer installs (#86961)
* Silence spurious warnings about removing ix_states_entity_id with newer installs

https://ptb.discord.com/channels/330944238910963714/427516175237382144/1069648035459641465

* Silence spurious warnings about removing ix_states_entity_id with newer installs

https://ptb.discord.com/channels/330944238910963714/427516175237382144/1069648035459641465
2023-01-30 12:38:33 -05:00
Erik Montnemery
53c5f02ca2 Remove some dead code from recorder (#86697) 2023-01-30 18:37:48 +01:00
Shay Levy
857df05308 Add Shelly Gen2 update entity for sleeping devices (#86837) 2023-01-30 19:05:13 +02:00
PeteRager
d22e670334 Avoid Nest climate set_temperature eating error (#86920)
* Update climate_sdm.py

* Update test case to detect KeyError

* Throw a defined exception if the condition in encoutered

Include keys from device_traits in error message

* Less diagnostic information in error message
2023-01-30 08:01:41 -08:00
Marc Mueller
2c12171e25 Update actions/cache to v3.2.4 (#86943) 2023-01-30 16:42:01 +01:00
Mick Vleeshouwer
98a79dd5a2 Fix ThreeWayHandle sensor in Overkiz integration (#86953)
Fix typo in sensor.py

Fixes https://github.com/home-assistant/core/issues/85913
2023-01-30 17:15:53 +02:00
Tom Puttemans
73cd03255f Ignore empty payloads from DSMR Reader (#86841)
* Ignore empty payloads from DSMR Reader

* Simplify empty payload handling

If the native value hasn't changed, requesting to store it won't have a performance impact.

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

---------

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-30 08:56:57 -05:00
Erik Montnemery
d4489faa68 Drop minus sign on negative zero (#86939)
* Drop minus sign on negative zero

* Add tests
2023-01-30 08:31:27 -05:00
Maciej Bieniek
5f57648578 Use more human-readable sensor names in Airly (#86893)
* Use more human-readable sensor names

* Use abbreviations for long names
2023-01-30 08:29:06 -05:00
Ben Dews
21d1c647c5 Add configuration options to OpenAI integration (#86768)
* Added multiple features to OpenAI integration

* Fixed failed test

* Removed features and improved tests

* initiated component before starting options flow
2023-01-30 08:24:11 -05:00
Robert Hillis
032a37b121 Address Google mail late review (#86847) 2023-01-30 14:18:56 +01:00
Franck Nijhof
3b5fd4bd06 Enable Ruff TRY004 (#86811) 2023-01-30 14:06:52 +01:00
mkmer
7368c86ecb Add Reauth config flow to honeywell (#86170) 2023-01-30 13:57:14 +01:00
epenet
7e7a27f8b9 Add type hints to http client fixtures (#86795) 2023-01-30 13:40:07 +01:00
Maciej Bieniek
cc36848a6d Use native_precision instead of round in Accuweather (#86869) 2023-01-30 12:36:24 +01:00
Nick Touran
d2e75e4f7a Add Autofocus, IR lamp, and Wiper switches in ONVIF (#84317)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-30 12:08:07 +01:00
Maciej Bieniek
d485630ce9 Use device class ENUM for Accuweather pressure tendency sensor (#86887)
* Use device class ENUM for pressure tendency sensor

* Format
2023-01-30 12:03:23 +01:00
Franck Nijhof
a4fa0925b7 Small improvement to Withings tests (#86937) 2023-01-30 11:03:42 +01:00
Franck Nijhof
c56832bb2c Enable Ruff SIM300 (#86793) 2023-01-30 11:03:23 +01:00
Franck Nijhof
9ac8f9aa37 Revert "Adjust D-Link entity naming" (#86936) 2023-01-30 10:56:56 +01:00
Robert Hillis
709d1cb8af Adjust D-Link entity naming (#86906) 2023-01-30 10:29:12 +01:00
Franck Nijhof
1958dd5550 Update ruff to v0.0.237 (#86932) 2023-01-30 10:15:24 +01:00
Malte Franken
92a833b192 Bump aio_geojson_generic_client to 0.3 (#86918) 2023-01-30 10:11:41 +01:00
J. Nick Koston
4e9bd09d39 Fix old indices not being removed in schema migration leading to slow MySQL queries (#86917)
fixes #83787
2023-01-29 21:33:23 -05:00
GitHub Action
b82ecfdd28 [ci skip] Translation update 2023-01-30 00:21:11 +00:00
J. Nick Koston
0f4b17755e Improve logging and handling when websocket gets behind (#86854)
fixes undefined
2023-01-29 10:49:27 -10:00
J. Nick Koston
c612a92cfb Use python defaults for comparing State, LazyState, and Event objects (#86856)
* Speed up comparing State and Event objects

Use default python implementation for State and Event __hash__ and __eq__

The default implementation compared based on the id() of the object
which is effectively what we want here anyways. These overrides are
left over from the days when these used to be attrs objects

By avoiding implementing these ourselves all of the equality checks
can happen in native code

* tweak

* adjust tests

* write out some more

* fix test to not compare objects

* more test fixes

* more test fixes

* correct stats tests

* fix more tests

* fix more tests

* update sensor recorder tests
2023-01-29 13:31:43 -05:00
Joakim Sørensen
80ffac48a3 Revert "Mark repo as safe directory to git config (#83755)" (#86888)
This reverts commit dc000d2289.
2023-01-29 13:07:50 -05:00
Allen Porter
4f965f0eca Bump pyrainbird to 2.0.0 (#86851) 2023-01-29 15:11:56 +01:00
Joakim Sørensen
569bf3bb76 Bump pytautulli from 21.11.0 to 23.1.1 (#86891) 2023-01-29 15:07:05 +01:00
Joakim Sørensen
f9e8247401 Bump isort from 5.11.4 to 5.12.0 (#86890) 2023-01-29 15:04:17 +01:00
Malte Franken
344a0c55a5 Add integration_type to geo_json_events (#86878)
define integration type
2023-01-29 15:02:13 +01:00
Thomas Schamm
11e125f2e8 Add Bosch SHC description and host form strings (#86897)
* Add description to setup SHC II. Add missing host info in reauth_confirm

* Remove template value in en.json
2023-01-29 15:00:36 +01:00
J. Nick Koston
691a234090 Cache the names and area lists in the default agent (#86874)
* Cache the names and area lists in the default agent

fixes #86803

* add coverage to make sure the entity cache busts

* add areas test

* cover the last line
2023-01-29 07:16:29 -05:00
Maciej Bieniek
eebc338c3b Support native_precision in Airly integration (#86843)
* Use native_precision

* Refactor extra_state_attributes
2023-01-29 11:44:23 +01:00
J. Nick Koston
58de7b8df0 Fix v32 schema migration when MySQL global.time_zone is configured with non-UTC timezone (#86867)
* Fix v32 schema migration when MySQL timezone is not UTC

* tweak
2023-01-28 22:06:07 -05:00
Martin Hjelmare
b1e939d1f1 Fix tradfri air quality device class (#86861) 2023-01-28 22:05:31 -05:00
J. Nick Koston
ec3475910f Improve websocket throughput of state changes (#86855)
After the start event we tend to get an event storm of state
changes which can get the websocket behind. #86854 will
help with that a bit, but we can reduce the overhead
to build a state diff when the attributes have not
changed
2023-01-28 22:05:06 -05:00
Robert Hillis
799edd90aa Fix D-Link attributes (#86842)
* Fix D-Link attributes

* fix blocking call
2023-01-28 22:03:58 -05:00
GitHub Action
0f6f63da64 [ci skip] Translation update 2023-01-29 00:26:29 +00:00
Paul Bottein
e93bfa6556 Update frontend to 20230128.0 (#86838) 2023-01-28 18:49:29 -05:00
Jan Bouwhuis
6a94a58325 Correct stale doc string for MQTT tag platform (#86862) 2023-01-29 00:23:22 +02:00
PeteRager
a7ddd592fb Nest improve error message on climate actions (#86853)
* Nest - Climate - Error Messages

1. Error messages were incorrect for some methods, for example async_set_temperature was reporting failure to set hvac_mode. This is corrected.
2. Error messages were incomplete and were not including the entity_id,and the operation being performed that failed.
3. Add unit tests to test the exception handling

* Move tests into exiisting error test

* Improve readability of error message
2023-01-28 12:58:28 -08:00
Allen Porter
733798f483 Fix nest climate set temperature error message string (#86852) 2023-01-28 11:02:46 -08:00
J. Nick Koston
af5fd74d6f Bump ismartgate to 5.0.0 (#86830)
python 3.11 support

changelog: https://github.com/bdraco/ismartgate/compare/v4.0.4...v5.0.0
2023-01-28 07:14:36 +01:00
Luca Angemi
efd2817221 Add state class to nest legacy sensors (#86810)
* Add state class to nest legacy sensors

Add state class (measurement) to humidity and temperature for the nest legacy sensors.

* Update

Update
2023-01-27 21:20:51 -08:00
J. Nick Koston
d97a061285 Chunk MariaDB and Postgresql data migration to avoid running out of buffer space (#86680)
* Chunk MariaDB data migration to avoid running out of buffer space

This will make the migration slower but since the innodb_buffer_pool_size
is using the defaul to 128M and not tuned to the db size there is a
risk of running out of buffer space for large databases

* Update homeassistant/components/recorder/migration.py

* hard code since bandit thinks its an injection

* Update homeassistant/components/recorder/migration.py

* guard against manually modified data/corrupt db

* adjust to 10k per chunk

* adjust to 50k per chunk

* memory still just fine at 250k

* but slower

* commit after each chunk to reduce lock pressure

* adjust

* set to 0 if null so we do not loop forever (this should only happen if the data is missing)

* set to 0 if null so we do not loop forever (this should only happen if the data is missing)

* tweak

* tweak

* limit cleanup

* lower limit to give some more buffer

* lower limit to give some more buffer

* where required for sqlite

* sqlite can wipe as many as needed with no limit

* limit on mysql only

* chunk postgres

* fix limit

* tweak

* fix reference

* fix

* tweak for ram

* postgres memory reduction

* defer cleanup

* fix

* same order
2023-01-27 22:39:45 -05:00
shbatm
e2edbc4259 Check for missing ISY994 Z-Wave Properties (#86829)
* Check for missing Z-Wave Properties

* Fix black from mobile
2023-01-27 22:16:28 -05:00
J. Nick Koston
d0c7f42559 Fix Bluetooth discoveries missing between restarts (#86808)
* Fix Bluetooth discoveries missing between restarts

* do not load other integrations

* coverage
2023-01-27 22:16:16 -05:00
Robert Hillis
b69576d6de Add D-link tests (#86825)
* Fix D-Link config flow auth

* Add tests to D-Link

* pyupgrade
2023-01-27 22:15:27 -05:00
Robert Hillis
adb0d85511 Fix D-Link config flow auth (#86824) 2023-01-27 21:38:25 -05:00
GitHub Action
072f228e4d [ci skip] Translation update 2023-01-28 00:23:36 +00:00
Shay Levy
803cd8d9a3 Handle state unknown if last state is missing in Shelly (#86813)
Shelly - handle state unknown if last state is missing
2023-01-27 23:34:56 +01:00
Ville Skyttä
50c2992f36 Drop py39 from black target-version (#86814) 2023-01-27 22:39:52 +02:00
dependabot[bot]
15492aead0 Bump tibdex/github-app-token from 1.7.0 to 1.8.0 (#86767)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-27 20:35:56 +01:00
Bouwe Westerdijk
661f7e1522 Bump plugwise to v0.27.4 (#86812)
fixes undefined
2023-01-27 20:00:44 +01:00
Franck Nijhof
e9543a7254 Enable Ruff PT021 (#86801) 2023-01-27 17:14:04 +01:00
Franck Nijhof
8f74bff354 Enable Ruff PLC0414 (#86799) 2023-01-27 16:32:04 +01:00
Shay Levy
f9f9741d2a Separate Shelly tests parameters in parametrize (#86778)
Shelly tests - separate parameters in parametrize
2023-01-27 14:28:35 +01:00
Franck Nijhof
ef800335fb Enable Ruff PT022 (#86792)
* Enable Ruff PT022

* Adjust found cases
2023-01-27 13:57:06 +01:00
Franck Nijhof
8c993116e1 Enable Ruff SIM401 (#86790)
* Enable Ruff SIM401

* Adjust found cases
2023-01-27 13:08:44 +01:00
Franck Nijhof
bfbf9b9751 Adjusts imports in tests to match our relative import rules (#86788) 2023-01-27 12:51:58 +01:00
Franck Nijhof
89c0b27b42 Migrates tests to use UnitOfPressure enum (#86785) 2023-01-27 12:13:27 +01:00
epenet
561fc2d771 Remove deprecated unit system properties (#86643)
* Remove deprecated unit system properties

* Fix tests
2023-01-27 12:09:26 +01:00
Franck Nijhof
3ff3834cae Re-enable Ruff UP024 (#86784) 2023-01-27 12:03:27 +01:00
Franck Nijhof
a79885ceaf Enable Ruff SIM117 (#86783) 2023-01-27 11:52:49 +01:00
Franck Nijhof
57cf11f067 Enable Ruff PT015 (#86775) 2023-01-27 11:10:29 +01:00
Franck Nijhof
49148421cb Migrates tests to use UnitOfSpeed enum (#86777) 2023-01-27 10:58:55 +01:00
Franck Nijhof
fca3382d37 Migrates tests to use MediaPlayerEntityFeature enum (#86779) 2023-01-27 10:56:40 +01:00
Franck Nijhof
42c4f2f7fa Add ability for pytest to run only on changed tests in codebase (#86776) 2023-01-27 10:35:18 +01:00
Shay Levy
ae6bc96002 Shelly code quality (#86733) 2023-01-27 10:47:05 +02:00
Franck Nijhof
e4a78420b8 Enable Ruff PT013 (#86757)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-27 09:09:46 +01:00
Malte Franken
bd9a8ba6f1 Bump aio_georss_gdacs to 0.8 (#86761)
bump aio_georss_gdacs to 0.8
2023-01-27 08:44:30 +01:00
Jesse Hills
78207121c0 Remove esphome password from config flow data if not needed (#86763)
* Remove esphome password if not needed

* Add test

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-26 21:45:51 -05:00
Paulus Schoutsen
687184138c ESPHome update: Store reference to runtime data, not one of its values (#86762)
Store reference to runtime data, not one of its values
2023-01-26 21:45:42 -05:00
Franck Nijhof
e738924780 Enable Ruff SIM105 (#86759)
* Enable Ruff SIM105

* Adjust existing cases
2023-01-26 21:06:22 -05:00
GitHub Action
71d7098530 [ci skip] Translation update 2023-01-27 00:25:12 +00:00
Aaron Bach
020d52c3e2 Fix state class issues in Ambient PWS (#86758)
fixes undefined
2023-01-27 00:14:46 +01:00
Marc Mueller
b84cf3a3d9 Improve bosch_shc config_flow typing (#86739) 2023-01-26 23:39:12 +01:00
Shay Levy
2c8cb13034 Bump aioshelly to 5.3.1 (#86751) 2023-01-27 00:34:31 +02:00
Paulus Schoutsen
9cd48b4999 OpenAI: Fix device without model (#86754) 2023-01-26 23:25:02 +01:00
tronikos
04bc522fa5 Google Assistant SDK: Test unload when enable_conversation_agent (#86707)
Test unload when enable_conversation_agent
2023-01-26 16:17:23 -05:00
Marc Mueller
caa1ba7e13 Improve nuki typing (#86736)
* Use NukiCoordinator

* Make NukiEntity generic

* Remove unnecessary ABC
2023-01-26 23:03:36 +02:00
mkmer
138a522d2e Bump AIOAladdinConnect to 0.1.54 (#86749) 2023-01-26 23:00:54 +02:00
Franck Nijhof
62dcbe5258 Enable Ruff PT001 (#86730) 2023-01-26 18:05:05 +01:00
Franck Nijhof
7ed9967245 Fix state classes for duration device class (#86727) 2023-01-26 17:26:52 +01:00
epenet
b3380261d7 Add hints to get_service in azure service bus (#86694) 2023-01-26 17:20:52 +01:00
Franck Nijhof
eb5d63237c Update ruff to v0.0.235 (#86719) 2023-01-26 17:17:13 +01:00
epenet
2bef69c6a7 Add hints to get_service in integrations (1/2) (#86692) 2023-01-26 16:56:57 +01:00
epenet
0d579f6ac3 Add hints to get_service in integrations (2/2) (#86693) 2023-01-26 16:55:57 +01:00
epenet
8a5a1b810a Add hints to get_service in netgear-lte (#86700) 2023-01-26 16:54:57 +01:00
epenet
95d0329d6c Add hints to get_service in tplink-lte (#86702) 2023-01-26 16:53:24 +01:00
Franck Nijhof
d4955a3d87 Replace assert False by raising an error (#86686) 2023-01-26 16:51:43 +01:00
Michael Hansen
adeaf746ec Use device area id in intent matching (#86678)
* Use device area id when matching

* Normalize whitespace in response

* Add extra test entity
2023-01-26 09:48:49 -06:00
Franck Nijhof
38203003d2 Remove gas device class from current sensor in dsmr_reader (#86725) 2023-01-26 16:44:52 +01:00
epenet
25c451832b Remove pragma: no cover when not raising (#86706) 2023-01-26 16:34:05 +01:00
StefanIacobLivisi
468457eff4 Bump aiolivisi to 0.0.15 (#86721) 2023-01-26 16:28:16 +01:00
epenet
7af86fe130 Improve notify type hints (#86685) 2023-01-26 16:23:03 +01:00
Marc Mueller
54fcf58449 Use mypy caching [ci] (#86715) 2023-01-26 15:59:37 +01:00
Martin Hjelmare
c727f403ff Bump python-matter-server to 2.0.2 (#86712) 2023-01-26 15:43:12 +01:00
Robert Svensson
4181a9baf0 Improve Axis config flow tests (#86644)
* Improve Axis config flow tests

* Don't use prepare_config_entry
2023-01-26 14:29:06 +01:00
David F. Mulcahey
6e285c87c3 Update Inovelli Blue Series switch support in ZHA (#86711) 2023-01-26 08:27:44 -05:00
Patrick ZAJDA
2e70de9dd9 Migrate Nuki to new entity naming style (#80021)
Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
2023-01-26 13:50:19 +01:00
mkmer
6ea234ed57 Add DeviceInfo to Honeywell (#86179)
* Add DeviceInfo
Add has_entity_name

* has_entity_name to class attribute

* Update homeassistant/components/honeywell/sensor.py

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

* Update homeassistant/components/honeywell/sensor.py

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

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-01-26 13:28:36 +01:00
MHFDoge
282d6af2a2 Add known webostv button to list (#86674)
Add known button to list.
2023-01-26 13:55:07 +02:00
Pascal Reeb
484e73beaa Add device registration to the Nuki component (#79806)
* Add device registration to the Nuki component

* Name is always given by the API

* implement pvizeli's suggestions

* switch device_registry to snake_case

* fix entity naming

* unify manufacturer names
2023-01-26 12:38:10 +01:00
Robert Svensson
9a6e620810 Fix missing interface key in deCONZ logbook (#86684)
fixes undefined
2023-01-26 11:44:01 +01:00
epenet
1139555448 Add hints to get_service in kodi (#86698) 2023-01-26 11:40:48 +01:00
epenet
cbcff6435f Add hints to get_service in joaoapps join (#86699) 2023-01-26 11:15:00 +01:00
Erik Montnemery
fea30c1ce9 Terminate strings at NUL when recording states and events (#86687) 2023-01-26 11:11:03 +01:00
epenet
b9ffc67a44 Add hints to get_service in syslog (#86701) 2023-01-26 11:10:50 +01:00
epenet
ca8cc284ed Add hints to get_service in rest (#86703) 2023-01-26 11:08:06 +01:00
Paulus Schoutsen
ff91fb7d74 Make openai conversation prompt template more readable + test case (#86676) 2023-01-26 11:04:15 +01:00
Franck Nijhof
021ac84405 Add recorder platform to required test category (#86704) 2023-01-26 11:03:56 +01:00
Franck Nijhof
17d3159e77 Remove unneeded use of keys() in ZHA (#86668)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-26 11:02:46 +01:00
Andrey Kupreychik
fa7ad20372 Update ndms2_client to 0.1.2 (#86624)
fix https://github.com/home-assistant/core/issues/86379
fixes undefined
2023-01-26 08:53:20 +01:00
Paulus Schoutsen
28a3b4a32c Add error handling for OpenAI (#86671)
* Add error handling for OpenAI

* Simplify area filtering

* better prompt
2023-01-25 22:17:19 -05:00
David F. Mulcahey
c395698ea2 Bump ZHA quirks lib (#86669) 2023-01-25 22:15:09 -05:00
Paulus Schoutsen
e06603bbbd Google Assistant: unset agent on unload (#86635) 2023-01-25 21:33:30 -05:00
J. Nick Koston
4cafd393c6 Correct units on mopeka battery voltage sensor (#86663) 2023-01-26 02:14:59 +01:00
Franck Nijhof
e50a531cd9 Code styling tweaks to the tests - Part 2 (#86662)
Co-authored-by: jjlawren <jjlawren@users.noreply.github.com>
2023-01-26 01:23:53 +01:00
GitHub Action
7ab88fa713 [ci skip] Translation update 2023-01-26 00:23:39 +00:00
Franck Nijhof
4955dd3e1b Code styling tweaks to Nexia tests (#86660) 2023-01-25 23:36:17 +01:00
J. Nick Koston
1d1d69ca02 Update scaffold scripts to use async_forward_entry_setups (#86647) 2023-01-25 21:26:31 +01:00
Robert Svensson
a56f6cb863 Assert Axis config entry state not hass.data (#86648) 2023-01-25 21:15:03 +01:00
Franck Nijhof
7d672b4a4d Bump version to 2023.3.0dev0 (#86632) 2023-01-25 20:50:44 +01:00
Paulus Schoutsen
df0fc30695 Fix oauth2 error (#86634) 2023-01-25 20:50:16 +01:00
Joakim Plate
1b97a51b5e Print expected device class units in error log (#86125) 2023-01-25 20:45:50 +01:00
Bram Kragten
74ae351ac0 Update frontend to 20230125.0 (#86628)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-25 18:37:23 +01:00
J. Nick Koston
03a8dcfdc1 Add Mopeka integration (#86500)
* Add Mopeka integration

Mopeka makes BLE propane tank monitors

* cover

* wip

* wip

* bump lib

* strip binary sensor

* all sensors

* all sensors

* update tests

* change quality

* change quality

* adjust

* integration_type, strict-typing
2023-01-25 12:28:13 -05:00
Duco Sebel
c5c7bb36cc Upgrade python-homewizard-energy to 1.8.0 (#86627) 2023-01-25 17:52:31 +01:00
Michael Hansen
c5c68cd429 Bump home-assistant-intents 2023.1.25 (#86626)
* Bump home-assistant-intents 2022.1.25

* Use correct year in home-assistant-intents package
2023-01-25 10:50:15 -06:00
Paulus Schoutsen
7d641e4d3e Add OpenAI integration (#86621)
* Add OpenAI integration

* Remove empty manifest fields

* More prompt tweaks

* Update manifest

* Update homeassistant/components/openai_conversation/config_flow.py

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

* Address comments

* Add full integration tests

* Cripple the integration

* Test single instance

Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-25 11:30:13 -05:00
tronikos
a85c4a1ddf Bump gassist-text to 0.0.10 (#85782)
* Bump gassist-text to 0.0.9

* Bump gassist-text to 0.0.10

* Clarify when it's empty response

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-25 11:01:33 -05:00
Martin Hjelmare
17f85165c8 Bump python-matter-server 2.0.1 (#86625) 2023-01-25 16:49:50 +01:00
Jon Caruana
bbed1099d5 Add diagnostics to LiteJet (#86600) 2023-01-25 16:41:59 +01:00
J. Nick Koston
7ddb467ba6 Increase async_setup_platforms deprecation logging to warning (#86582) 2023-01-25 14:38:26 +01:00
epenet
b2004e62b1 Remove ability to ignore coverage violations (#86597)
* Remove ability to ignore coverage violations

* Adjust codecov for required platforms

* Update codecov.yml
2023-01-25 14:27:16 +01:00
SgtBatten
0ccab19d2c Add Mega Joule as valid unit of energy (#86055)
* Add Mega joule

* Reorder valid energy types

Alphabetical

* Add Mega Joule

* Add Mega Joule as valid energy unit

* Add Mega Joule

* Add Mega Joule as a Unit of Measurement to Energy

* Update tests

* Update tests

* Update number docstring

Co-authored-by: Roving Ronin <108674933+Roving-Ronin@users.noreply.github.com>
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-25 14:13:42 +01:00
Jan Bouwhuis
f182e314e5 Add number platform support to Alexa (#86553)
Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2023-01-25 13:34:53 +01:00
Petter Ljungqvist
23c9580a4a Change pressure unit of measurement from mbar to hPa in Netatmo integration (#86210)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-25 13:18:47 +01:00
J. Nick Koston
a1ed2a57eb Migrate islamic_prayer_times to use async_forward_entry_setups (#86564)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-25 12:45:09 +01:00
Allen Porter
7ff1265b10 Add service to create calendar events (#85805) 2023-01-25 12:43:50 +01:00
Franck Nijhof
5f1edbccd1 Remove Almond integration (#86616) 2023-01-25 12:21:26 +01:00
TheJulianJES
665a2889ec Add group support for ZHA ExecuteIfOff lights (#86465)
Add group support for ZHA "execute if off" lights
2023-01-25 06:18:23 -05:00
TheJulianJES
0cf676d501 Remove unnecessary ZHA AnalogInput sensors for Xiaomi plugs (#86261)
* Remove unnecessary ZHA AnalogInput sensors for Xiaomi plugs

* Remove AnalogInput entities from test
2023-01-25 06:17:33 -05:00
David F. Mulcahey
65a44cad8f Bump zha-quirks to 0.0.91 (#86590)
Bump ZHA quirks lib
2023-01-25 11:58:31 +01:00
Vaarlion
3007e0259d Add a contains jinja filter and test (#86390) 2023-01-25 11:51:47 +01:00
Erik Montnemery
f327a247a0 Allow a temperature sensor to be in K (#86073) 2023-01-25 11:47:52 +01:00
Malte Franken
a2fb6fbaa8 Bump httpx to 0.23.3 (#86614)
fixes undefined
2023-01-25 11:40:46 +01:00
Kevin Worrel
0eabc27982 Include all light circuit functions (#86608)
fixes undefined
2023-01-25 00:36:15 -10:00
Kevin Worrel
82f006bc5c Bump screenlogicpy to v0.6.4 (#86603)
fixes undefined
2023-01-25 00:31:31 -10:00
Martin Hjelmare
890c2277ca Fix matter clusters BasicInformation (#86615) 2023-01-25 11:19:52 +01:00
J. Nick Koston
6270f33bee Migrate samsungtv to use async_forward_entry_setups (#86575)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 11:17:24 +01:00
Stefan Agner
f3cf760772 Drop IoTaWatt Accumulated sensors (#86611) 2023-01-25 11:08:43 +01:00
Jesse Hills
d0b67689e0 Add issue to ESPHome deprecating api password (#86606)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-25 11:07:57 +01:00
Marc Mueller
60b799aac9 Misc typing improvements (#86550) 2023-01-25 11:05:36 +01:00
Malte Franken
0e9b74986f Bump aio_geojson_usgs_earthquakes to 0.2 (#86598)
bump aio_geojson_usgs_earthquakes to 0.2
2023-01-25 10:53:57 +01:00
epenet
a8c952f82f Mock async_setup_entry in SamsungTV tests (#86601)
* Mock async_setup_entry in samsungtv tests

* Adjust test_import_legacy_without_name

* Adjust test_form_reauth_encrypted

* Add specific test

* 100% coverage
2023-01-25 10:48:15 +01:00
epenet
5a77a2801b Address late review in SFRBox (#86604) 2023-01-25 10:46:45 +01:00
Kevin Stillhammer
781a4267cf Calculate data using all sections for here_travel_time (#86576)
Calculate data using all sections
2023-01-25 10:33:43 +01:00
J. Nick Koston
7bd56ad7d6 Migrate totalconnect to use async_forward_entry_setups (#86580)
* Migrate totalconnect to use async_forward_entry_setups

Replaces deprecated async_setup_platforms with async_forward_entry_setups

* fix double update and tests
2023-01-25 10:26:49 +01:00
J. Nick Koston
540eb8de16 Migrate tomorrowio to use async_forward_entry_setups (#86579)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:21:06 +01:00
J. Nick Koston
33c777529e Migrate melnor to use async_forward_entry_setups (#86572)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:20:34 +01:00
J. Nick Koston
b253bb841e Migrate lg_soundbar to use async_forward_entry_setups (#86570)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:20:09 +01:00
J. Nick Koston
f548ccfb92 Migrate Landis+Gyr to use async_forward_entry_setups (#86569)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:19:51 +01:00
J. Nick Koston
1a2652e1bb Migrate konnected to use async_forward_entry_setups (#86565)
* Migrate konnected to use async_forward_entry_setups

Replaces deprecated async_setup_platforms with async_forward_entry_setups

* update tests
2023-01-25 10:19:23 +01:00
J. Nick Koston
5285d057d2 Migrate cast to use async_forward_entry_setups (#86558)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:12:58 +01:00
J. Nick Koston
3bfdba50d9 Migrate homematicip_cloud to use async_forward_entry_setups (#86563)
* Migrate homematicip_cloud to use async_forward_entry_setups

Replaces deprecated async_setup_platforms with async_forward_entry_setups

* adapt test, this test should be rewritten
2023-01-25 10:01:51 +01:00
J. Nick Koston
e427a70dc7 Migrate heos to use async_forward_entry_setups (#86562)
* Migrate heos to use async_forward_entry_setups

Replaces deprecated async_setup_platforms with async_forward_entry_setups

* fix order
2023-01-25 10:00:55 +01:00
J. Nick Koston
c1e3c1a27c Migrate escea to use async_forward_entry_setups (#86559)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-25 10:00:12 +01:00
Maciej Bieniek
dae7bcf387 Migrate Shelly to the new entity naming style (#86574)
* Use new entity naming style in Shelly

* Suggested change

* Use lower case for gen2 description
2023-01-25 09:55:52 +01:00
Ernst Klamer
b76c0c6f08 Bump bthome-ble to 2.5.1 (#86584)
Bump bthome
2023-01-25 09:25:09 +01:00
Erik Montnemery
086a6460ef Allow customizing sensor state precision (#86074)
* Allow customizing sensor precision

* Don't convert integer strings to floats

* Tweak converting sensor state to number

* Drop default rounding to 2 decimals

* Adjust test

* Tweak rounding, improve test coverage

* Don't convert to a number if not necessary

* Raise if native_precision is set and state is not numeric

* Address review comments

* Address comments, simplify

* Don't call  property twice

* Make exception more helpful
2023-01-25 08:55:46 +01:00
Allen Porter
ba63a9600e Bump google-nest-sdm to 2.2.4 (#86595) 2023-01-25 08:29:07 +01:00
Malte Franken
e832ef78f8 Bump aio_geojson_nsw_rfs_incidents to 0.6 (#86583)
bump aio_geojson_nsw_rfs_incidents to 0.6
2023-01-25 08:27:34 +01:00
Paulus Schoutsen
6c8efe3a3b Conversation cleanup (#86592)
* Require config entry when setting Conversation agent, add new unset agent method

* Remove onboarding from conversation agent

* Type attribution

* Wrap async_process params in ConversationInput object
2023-01-24 21:47:49 -06:00
J. Nick Koston
5c6656dcac Migrate legacy nest to use async_forward_entry_setups (#86573)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-24 18:32:55 -08:00
GitHub Action
9636fe4602 [ci skip] Translation update 2023-01-25 00:24:21 +00:00
J. Nick Koston
a851b20c97 Ensure platform setup is awaited in zwave_me (#86581)
* Ensure platform setup is awaited in zwave_me

There was a race during setup since platform setup
was not being awaited and was being done in a task

Also migrates to using async_forward_entry_setups
instead of manually writing out async_forward_entry_setup

* Ensure platform setup is awaited in zwave_me

There was a race during setup since platform setup
was not being awaited and was being done in a task

Also migrates to using async_forward_entry_setups
instead of manually writing out async_forward_entry_setup
2023-01-24 23:49:02 +02:00
J. Nick Koston
4b427ec02c Migrate soundtouch to use async_forward_entry_setups (#86577)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-24 23:30:56 +02:00
J. Nick Koston
b507fb1e06 Migrate steam_online to use async_forward_entry_setups (#86578)
* Migrate steam_online to use async_forward_entry_setups

Replaces deprecated async_setup_platforms with async_forward_entry_setups

* fix steam_online tests
2023-01-24 23:30:28 +02:00
J. Nick Koston
a4c52567a7 Migrate life360 to use async_forward_entry_setups (#86571) 2023-01-24 10:42:24 -10:00
On Freund
2c9e8ad475 ReadYourMeter Pro integration (#85986)
* ReadYourMeter Pro integration

* Add __init__.py to .coveragerc

* Address code review comments

* More code review comments
2023-01-24 22:41:33 +02:00
Maciej Bieniek
52afdb4a8b Migrate NextDNS to use async_forward_entry_setups (#86567) 2023-01-24 10:26:03 -10:00
J. Nick Koston
099b844dce Migrate shelly to use async_forward_entry_setups (#86554)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-24 22:23:34 +02:00
Allen Porter
09891ead8d Add rainbird rain delay number entity, deprecating the sensor and service (#86208)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-24 21:16:52 +01:00
J. Nick Koston
da390dbd9a Migrate google_assistant to use async_forward_entry_setups (#86561)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-24 21:16:22 +01:00
J. Nick Koston
dbab57ba87 Migrate fjaraskupan to use async_forward_entry_setups (#86560)
Replaces deprecated async_setup_platforms with async_forward_entry_setups
2023-01-24 21:15:30 +01:00
J. Nick Koston
b91a0d21d2 Migrate anthemav to async_forward_entry_setups (#86557) 2023-01-24 20:33:45 +01:00
J. Nick Koston
c599d1e1f8 Migrate ambient_station to use async_forward_entry_setups (#86555) 2023-01-24 20:33:17 +01:00
G Johansson
b3c5c6ae9c Add sensor to group (#83186) 2023-01-24 20:12:27 +01:00
Ernst Klamer
886d2fc3a1 Add events for xiaomi-ble (#85139)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-24 08:48:30 -10:00
Marc Mueller
90fc8dd860 Add rss_feed_template to strict-typing (#86528)
Add rss_feed_template to strict-typing
2023-01-24 19:06:24 +01:00
puddly
4b88a71d60 Re-enable multi-PAN (#86533)
Revert "Disable multi-pan (#83603)"

This reverts commit 9c7b80090a.
2023-01-24 19:05:17 +01:00
Martin Hjelmare
ff5c1ce2d3 Bump python-matter-server to 2.0.0 (#86470) 2023-01-24 19:00:04 +01:00
Maciej Bieniek
9a68f0abe8 Store Shelly climate last_target_temp value in restore extra data (#86482)
fixes undefined
2023-01-24 07:28:34 -10:00
Marc Mueller
b89a51c63d Improve google_assistant typing (#86537) 2023-01-24 18:18:05 +01:00
tronikos
949c88930f Google Assistant SDK: Allow multiple commands in the same conversation context (#85423)
* Allow multiple commands in the same conversation

* fix test

* Apply suggestions from code review

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

* Add missing cv import

* Update service description

* Fix test after merging dev

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-01-24 11:54:23 -05:00
Shay Levy
0d3bf0e911 Fix Shelly sleeping Gen2 - update data upon initialize (#86544) 2023-01-24 18:38:27 +02:00
epenet
c3c290b576 Remove files with coverage > 97% from ignore list (#86466)
* Test coverage - no-ignore

* Remove helpers/typing and scripts/auth

* Remove files with coverage > 99%

* Remove files with coverage > 98%

* Remove files with coverage > 97%

* Remove duplicates
2023-01-24 17:31:23 +01:00
tronikos
0daaa37e09 Google Assistant SDK: support audio response playback (#85989)
* Google Assistant SDK: support response playback

* Update PATHS_WITHOUT_AUTH

* gassist-text==0.0.8

* address review comments
2023-01-24 08:19:23 -08:00
Niklas Dörfler
80a8da26bc Add additional property media_channel to media_player in squeezebox component (#86402)
Add additional property media_channel to media_player
2023-01-24 17:16:51 +01:00
Marc Mueller
310d7718a0 Improve bosch_shc typing (#86535) 2023-01-24 17:06:00 +01:00
Pascal Vizeli
6cad0c7984 Bump aioecowitt 2023.01.0 (#86531) 2023-01-24 18:01:32 +02:00
Marc Mueller
b4ddff751a Improve cast typing (#86536) 2023-01-24 16:48:01 +01:00
Marc Mueller
d684aa4225 Improve rflink typing (#86538) 2023-01-24 16:47:34 +01:00
Marc Mueller
43f3b0f933 Remove unused integration constants (#86542) 2023-01-24 16:36:29 +01:00
Marc Mueller
58e8f53117 Improve ring typing (#86539) 2023-01-24 16:35:11 +01:00
Marc Mueller
d36d98937d Replace None constants [minecraft_server] (#86540) 2023-01-24 16:34:04 +01:00
Marc Mueller
f8c0e80ef7 Replace None constant [ps4] (#86541) 2023-01-24 16:33:15 +01:00
eineinhornmiau
0530f61373 Fix wrong notification sound name in LaMetric (#86483)
Fix wrong notification sound name

The wrongly named sound "static" is actually called "statistic"
https://lametric-documentation.readthedocs.io/en/latest/reference-docs/device-notifications.html
2023-01-24 14:44:53 +01:00
Artem Draft
02e973026d Add browse media and play media support in Bravia TV (#85288)
* Add media browsing and play media support in Bravia TV

* Add fix invalid Bravia Content-Type header for icons

* Avoid duplicates in source_list

* Small cleanup

* Edit comment

* Revert en.json
2023-01-24 14:31:09 +01:00
Marc Mueller
e717f56113 Add lacrosse to strict-typing (#86527)
Add lacrosse to strict-typing
2023-01-24 14:27:01 +01:00
Franck Nijhof
73c4ac53d2 Enable T20 (flake8-print) to ban use of print statements (#86525)
* Enable T20 (flake8-print) to ban use of print statements

* Make compatible with flake8 config
2023-01-24 14:24:21 +01:00
Jon Caruana
c9499f6574 Add available to LiteJet (#86506)
* Set available attribute as needed.

* Log disconnect reason.

* Change the exception that is raised.

* Bump version.
2023-01-24 14:22:16 +01:00
jan iversen
d703a83412 Bump pymodbus to v3.1.1 (#86513) 2023-01-24 14:14:49 +01:00
epenet
e96cea997e Add reboot button to SFRBox (#86514) 2023-01-24 14:13:49 +01:00
epenet
44beb350cd Add scrape to strict-typing (#86515) 2023-01-24 14:11:56 +01:00
Guido Schmitz
a9533c72fc Bump devolo_plc_api to 1.1.0 (#86516) 2023-01-24 14:11:17 +01:00
Aarni Koskela
65ad953497 Update Ruff to 0.0.231, enable D401 (#86520) 2023-01-24 13:57:08 +01:00
Jan Bouwhuis
8d678209db Add translation support for select selectors of derivative config and option flow (#86190)
* Add translation support for derivative config flow

* Revert translation support for SI units

* Undo test changes

* Remove redundant labels
2023-01-24 13:49:07 +01:00
Jan Bouwhuis
1b1f8a1d61 Add translation support for select selectors of integration integration config flow (#86212)
* Translation support method

* Translation support time unit

* Remove redundant labels
2023-01-24 13:22:33 +01:00
Jan Bouwhuis
1b4fda2321 Add translations for type select selector min_max config and option flow (#86213)
* Add translations for type select selector min_max

* Remove redundant labels
2023-01-24 13:11:11 +01:00
Franck Nijhof
14d3911bfd Update pre-commit to 3.0.0 (#86518) 2023-01-24 13:09:01 +01:00
Jan Bouwhuis
09ca8465a6 Add translation support for trafikverket_ferry weekday setting in option flow (#86219)
Add translation trafikverket_ferry weekday setting
2023-01-24 12:53:55 +01:00
Jan Bouwhuis
c97cf62b47 Add translation support for utility_meter type in config flow (#86220)
* Add translation support for utility_meter type

* Remove redundant labels
2023-01-24 12:52:26 +01:00
Todd Radel
63bddae01d Replace abodepy library with jaraco.abode to enable new Abode devices (#85474)
* replaced abodepy library with jaraco.abode

* updated jaraco.abode to version 3.2.1

* send capture event as dict
2023-01-24 12:44:38 +01:00
Jan Bouwhuis
66f12d7dab Add translations for shelly ble scanner options in option flow (#86218)
* Add translations for shelly ble scanner options

* Remove redundant labels

* isort
2023-01-24 12:25:35 +01:00
Aarni Koskela
bf41a971a2 Introduce ruff (eventually replacing autoflake, pyupgrade, flake8) (#86224) 2023-01-24 12:15:16 +01:00
epenet
df0c0297c8 Bump sfrbox-api to 0.0.5 (#86512) 2023-01-24 13:12:21 +02:00
Joakim Plate
9f5b1e58cb Support playback of channel preset in philips_js (#86491)
* Correct invalid browse check

* Support play_media of channel number

* Use ChannelStep instead of Next/Previous
2023-01-24 11:53:17 +01:00
Franck Nijhof
b7de185924 Fix CI, missing import in MQTT (#86517) 2023-01-24 11:40:40 +01:00
epenet
22dee1f92b Add reauth to SFR Box (#86511) 2023-01-24 11:00:22 +01:00
Franck Nijhof
e084fe4903 Update spotipy to 2.22.1 (#86510) 2023-01-24 10:11:14 +01:00
Franck Nijhof
b29425a9eb Update debugpy to 1.6.6 (#86509) 2023-01-24 10:10:42 +01:00
Jan Bouwhuis
42ca46d7b2 Remove redundant label for MQTT CA verification selector (#86236)
Remove redundant label for MQTT CA verification
2023-01-24 09:38:00 +01:00
wibbit
3f4c8a28ec Update geniushub-client to 0.7.0 (#85058)
* Bump geniushub-client version

Hit an issue with the latest versions of software running on GeniusHub,
that requires a bump in the geniushub-client version to resolve.

This addresses GH 78799

* Update dependancy in additional location

As per PR guid (glad I read that), I've also updated the global
requirements_all.txt file
2023-01-24 09:15:08 +01:00
Malte Franken
9fb4f6b643 Bump aio_geojson_geonetnz_volcano to 0.8 (#86507) 2023-01-24 08:39:39 +01:00
Malte Franken
8981e4820a Bump aio_geojson_geonetnz_quakes to 0.15 (#86505) 2023-01-24 08:35:28 +01:00
Ville Skyttä
5f0adfe6e4 Add missing config flow abort strings (#86180)
* Add missing `already_configured` and `already_in_progress` abort strings

* Note required strings.json entries in config_entries aborting functions
2023-01-24 08:59:32 +02:00
epenet
3ec7f0280e Add authentication to SFR Box (#85757)
* Add credentials to SFR Box

* Make username/password inclusive

* Add handler for ConnectTimeout

* Use menu

* Drop get
2023-01-24 07:22:14 +01:00
Erik Montnemery
2ab3d3ebf5 Enable strict typing for the otbr integration (#86473)
* Enable strict typing for the otbr integration

* Bump python-otbr-api to 1.0.2
2023-01-24 06:55:12 +01:00
Michael Hansen
ea95abcb30 Use intent responses from home-assistant-intents (#86484)
* Use intent responses from home_assistant_intents

* Use error responses from home_assistant_intents

* Remove speech checks for intent tests (set by conversation now)

* Bump hassil and home-assistant-intents versions

* Use Home Assistant JSON reader when loading intents

* Remove speech checks for light tests (done in agent)

* Add more tests for code coverage

* Add test for reloading on new component

* Add test for non-default response
2023-01-23 22:38:41 -05:00
Shay Levy
6d811d3fdb Bump aioshelly to 5.3.0 (#86493) 2023-01-23 15:35:05 -10:00
Dan Simpson
66e21d7701 Add Powerwall off grid switch (#86357)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-23 15:03:15 -10:00
Joakim Plate
60894c33a7 Set correct step on nibe number entity (#86492) 2023-01-24 01:33:27 +01:00
GitHub Action
613aa6f43a [ci skip] Translation update 2023-01-24 00:24:57 +00:00
IceBotYT
94c7f7bbb7 Add 3 new fields to LaCrosse View (#86356)
* Add BarometricPressure, FeelsLike, and WindChill

* Improve test coverage
2023-01-24 01:11:07 +01:00
J. Nick Koston
7d1dec8d31 Bump yalexs_ble to 1.12.8 (#86481) 2023-01-23 12:01:12 -10:00
J. Nick Koston
978aafdd09 Update esphome bluetooth client for python 3.11 (#86480) 2023-01-23 21:36:19 +01:00
Shay Levy
e15aaf2853 Fix Shelly RPC key instances handling (#86479)
Fix Shelly key instances handling
2023-01-23 22:12:29 +02:00
Franck Nijhof
c1332f68b3 Small adjustments to API docs config (#86474) 2023-01-23 19:58:39 +01:00
Shay Levy
e3b81ad170 Add Shelly Pro 3EM sensors (#86403)
* Add Shelly Pro 3EM sensors

* Fix Apparent Power sensor device class

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>

* Adapt entity naming to new style

Co-authored-by: Maciej Bieniek <bieniu@users.noreply.github.com>
2023-01-23 18:59:55 +02:00
Martin Hjelmare
51001ad1e1 Add matter diagnostics (#86091)
* Add matter diagnostics

* Complete test typing

* Rename redact attributes helper

* Adjust device lookup after identifier addition
2023-01-23 11:05:09 -05:00
930913
295308c39c Add gates to LD2410BLE (#86412)
* Add gates to LD2410BLE

Add max motion/static gates sensors, and all the motion/static energy
gate sensors.
Also a minor fix of a description.

* Make added LD2410 BLE entities diagnostic

* Apply suggestions from code review

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2023-01-23 11:01:44 -05:00
epenet
b4dd1b8cb2 Rename logbook constant (#86464) 2023-01-23 18:00:25 +02:00
epenet
15ab04f97d Prevent wilcard coverage ignore if tests exist (#86455) 2023-01-23 16:33:57 +01:00
Jan Bouwhuis
33fb27eb1a Rename fake kitchen_sink demo locks to more common name (#86452) 2023-01-23 16:31:02 +01:00
Erik Montnemery
9ef86b7b66 Add Thread integration (#86283)
* Add Thread integration

* Address review comments

* Address review comments
2023-01-23 10:27:24 -05:00
uvjustin
c15f4ad648 Update stream timestamp discontinuity check with audio (#86446) 2023-01-23 16:27:09 +01:00
Marc Mueller
7c8f6e9fad Drop unused dtype (#86459) 2023-01-23 16:24:02 +01:00
Jan Bouwhuis
8672be3829 Always add code to template vars MQTT lock command template (#86460)
Always add `code` to template vars lock cmd tpl
2023-01-23 16:08:25 +01:00
Erik Montnemery
052145fabd Fix grammar in some hassio docstrings (#86458) 2023-01-23 15:45:08 +01:00
Marc Mueller
6f94e47270 Update Union typing (6) [Py310] (#86454) 2023-01-23 15:01:07 +01:00
G Johansson
68dd2802a1 Add remove entity in group.set service (#79401)
* Group set remove entities

* simplify

* Add test

* Fix test
2023-01-23 15:00:40 +01:00
epenet
74a76c6fe7 Don't ignore diagnostics coverage (#86440) 2023-01-23 14:55:02 +01:00
Jan Bouwhuis
f719ecf086 Add command template and code_format support for MQTT lock (#85830)
* Add command template for MQTT lock

* Fix tests
2023-01-23 14:48:07 +01:00
Marc Mueller
00e5f23249 Update Union typing (zha) [Py310] (#86453) 2023-01-23 14:46:40 +01:00
TheJulianJES
6582ee3591 Use ExecuteIfOff on color cluster for supported bulbs with ZHA (#84874)
* Add options and execute_if_off_supported properties to Color channel

* Initialize "options" attribute on Color channel (allowing cache)

* Implement execute_if_off_supported for ZHA lights

* Make sure that color_channel exists, before checking execute_if_off_supported

* Replace "color_channel is not None" check with simplified "if color_channel"

* Make "test_number" test expect "options" for init attribute

* Add test_on_with_off_color test to test old and new behavior

* Experimental code to also support "execute_if_off" for groups if all members support it

* Remove support for groups for now

Group support will likely be added in a separate PR. For now, the old/standard behavior is used for groups.
2023-01-23 07:58:18 -05:00
mbo18
29e3d06a42 Add unit and device class to ZHA RSSI sensor (#85390)
* Add unit device class to ZHA RSSI sensor

* Remove unit and device class for LQI

* mypy

* isort

* mypy2

* Update sensor.py
2023-01-23 07:36:21 -05:00
Jan Bouwhuis
b03677db1c Add validation for lock component (#85842)
* Add validation for lock integration

* Add LockEntityFeature.OPEN for lock group

* Correct tests google_assistant for extra entity

* Validate feature when registering service

* Update tests

* Add LockFeature.OPEN with group
2023-01-23 13:08:00 +01:00
epenet
ea43effcc9 Fix hassfest coverage check (#86443)
* Fix hassfest coverage check

* A-Z
2023-01-23 12:23:38 +01:00
Yuval Aboulafia
a1a324a02e Adjust icons for iperf3 (#85809) 2023-01-23 10:52:02 +01:00
majuss
fb81b1791f Bump lupupy to 0.2.5 (#86439)
fix https://github.com/home-assistant/core/issues/86299
2023-01-23 10:47:56 +01:00
Franck Nijhof
2c9d0b7f18 Merge branch 'master' into dev 2023-01-23 10:33:16 +01:00
Marc Mueller
077ca97ef8 Fix local_partial_types errors (#86410)
Fix local_partial_types errors
2023-01-23 10:29:11 +01:00
J. Nick Koston
bfc19c8cc3 Give august its own aiohttp session (#86404)
fixes undefined
2023-01-23 10:14:29 +01:00
epenet
64535175b1 Add missing conversion tests in unit conversion (#86434) 2023-01-23 10:11:11 +01:00
uvjustin
d0153f5031 Detect timestamp discontinuity in stream (#86430)
fixes undefined
2023-01-23 10:09:46 +01:00
Marc Mueller
ab76b3ffb3 Update Union typing (3) [Py310] (#86426) 2023-01-23 10:05:56 +01:00
Marc Mueller
4f87c1f30f Update pre-commit-config [Py310] (#86415) 2023-01-23 09:59:44 +01:00
Marc Mueller
6397138589 Update Optional typing (1) [Py310] (#86417)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-23 09:56:10 +01:00
Marc Mueller
da35097803 Update Optional typing (2) [Py310] (#86419) 2023-01-23 09:10:05 +01:00
Marc Mueller
40be2324cc Update Union typing (5) [Py310] (#86428) 2023-01-23 09:06:26 +01:00
Marc Mueller
8abce25948 Update Union typing (4) [Py310] (#86427) 2023-01-23 09:04:40 +01:00
Aarni Koskela
b0ed0d5d41 Bump pre-commit-hooks to 4.4.0 (#82984) 2023-01-23 08:43:51 +01:00
Marc Mueller
f57c0ea725 Update Union typing (2) [Py310] (#86425) 2023-01-23 08:40:09 +01:00
Marc Mueller
1eec87214f Update Union typing (1) [Py310] (#86424) 2023-01-23 08:38:45 +01:00
Marc Mueller
d7dda6bee5 Update python version used for pylint [Py310] (#86414)
* Update python version used for pylint linting [Py310]

* Import Callable from collections.abc [Py310]

* Use builtin anext [Py310]
2023-01-23 07:56:15 +01:00
Marc Mueller
45b4b0e990 Import ParamSpec from typing [Py310] (#86413)
* Import ParamSpec from typing [Py310]

* Update additional imports
2023-01-23 07:28:43 +01:00
zebardy
af107d7853 Add support for additional fields to nut (#83265)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-22 19:24:30 -10:00
Dan Simpson
0c1abd5f10 Bump tesla_powerwall lib version to 0.3.19 (#86421) 2023-01-22 18:59:33 -10:00
Luke
8bc303a562 Change @conway20 to @Lash-L in OralB codeowners after github rename (#86416) 2023-01-22 16:04:52 -10:00
GitHub Action
4d215e573c [ci skip] Translation update 2023-01-23 00:23:13 +00:00
Daniele Ricci
70a9c8f8aa Upgrade caldav to 1.0.1 (#85536)
Upgrade caldav (fix #40127)

date_search was deprecated in favour of search which also implements client-side recurring events expansion
2023-01-22 16:00:19 -08:00
Jan Bouwhuis
66c3115b26 Improve MQTT transport select label (#86216) 2023-01-22 22:12:06 +01:00
Shay Levy
b1ae7d409b Cleanup Climacell translations (#86325) 2023-01-22 22:40:25 +02:00
Shay Levy
9e4be56939 Shelly - handle None in RPC power sensors (#86399)
Handle None in RPC power sensors
2023-01-22 22:18:47 +02:00
starkillerOG
32c1a01159 Add Reolink dhcp discovery (#85880)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-22 21:09:18 +01:00
Martin Hjelmare
9c76cd1b6a Add mysensors remote platform (#86376) 2023-01-22 21:04:42 +01:00
Franck Nijhof
5102d1a5f3 Drop Python 3.9 support (#85456) 2023-01-22 20:40:33 +01:00
J. Nick Koston
7661b222b4 Bump yalexs-ble to 1.12.7 (#86396)
fixes https://github.com/home-assistant/core/issues/86182
2023-01-22 19:51:10 +01:00
Robert Svensson
7729a5cf8a Bump aiounifi to v44 (#86381)
fixes undefined
2023-01-22 19:34:48 +01:00
Franck Nijhof
a22041c9be 2023.1.7 (#86389) 2023-01-22 19:16:56 +01:00
J. Nick Koston
52ea64d1d0 Fix repr for States and Events without a timestamp (#86391) 2023-01-22 08:11:42 -10:00
Willem-Jan van Rootselaar
711c92a87f Bump version python-bsblan to 0.5.9 (#86373)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-22 17:57:17 +01:00
Franck Nijhof
71c4588747 Bumped version to 2023.1.7 2023-01-22 17:48:00 +01:00
uvjustin
79a3d2e6f6 Pass frag_duration as integer (#86375)
fixes undefined
2023-01-22 17:47:21 +01:00
Daniel Hjelseth Høyer
974601cc2e Update pyTibber to 0.26.11 (#86316) 2023-01-22 17:47:17 +01:00
J. Nick Koston
71d54da673 Bump recommended esphome version for bluetooth proxies to 2022.12.4 (#86308)
This will fix an MTU issue reported with airthings and
other devices.

needs https://github.com/esphome/esphome/pull/4323
2023-01-22 17:47:14 +01:00
Shay Levy
9669b286c4 Fix Shelly sleeping Gen2 - do not refresh from zeroconf discovery (#86296) 2023-01-22 17:47:11 +01:00
Klaas Schoute
72dae914fc Bump odp-amsterdam to v5.0.1 (#86252)
Bump package version to v5.0.1
2023-01-22 17:47:07 +01:00
J. Nick Koston
0b0e977ce9 Remove history use_include_order configuration option (#86365) 2023-01-22 17:43:05 +01:00
Robert Svensson
332d3e0f19 Use fixtures to setup Axis integration in tests (#86034)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-22 17:33:40 +01:00
uvjustin
8e117ee499 Pass frag_duration as integer (#86375)
fixes undefined
2023-01-22 17:28:17 +01:00
epenet
30bf0634fe Add per-file-ignore to pylint (#86289) 2023-01-22 17:26:24 +01:00
mkmer
a0810053f1 Bump AIOSomecomfort to 0.0.3 (#86371)
fixes undefined
2023-01-22 17:25:27 +01:00
Michael
504a3d3028 Bump py-synologydsm-api to 2.0.2 (#86374) 2023-01-22 17:24:31 +01:00
Michael
e0d0dc05e4 Support password less PI-Hole installations (#86183) 2023-01-22 17:20:12 +01:00
Duco Sebel
bcec69fec1 Upgrade python-homewizard-energy to 1.7.0 (#86383) 2023-01-22 17:11:27 +01:00
epenet
e1fc494b54 Add missing ratio test cases in unit conversion (#86340)
* Add missing ratio test cases in unit conversion

* Improve ratio test to check inverse
2023-01-22 16:39:45 +01:00
G Johansson
b9a7b908f3 Bump pytrafikverket to 0.2.3 (#86341)
pytrafikverket 0.2.3

Co-authored-by: Shay Levy <levyshay1@gmail.com>
2023-01-22 13:02:49 +02:00
J. Nick Koston
5ff0479c16 Split history websocket API into its own file (#86364) 2023-01-21 18:45:00 -10:00
J. Nick Koston
4c84824ac8 Increase default recorder commit interval to 5 seconds (#86115) 2023-01-21 18:09:00 -10:00
Tom Harris
8cf6ebd363 Allow changing the Insteon USB device (#86290)
* Reconfig PLM device

* Test config change
2023-01-21 23:04:25 -05:00
J. Nick Koston
c842666bea Avoid creating logbook stream task if unsubscribed while waiting for executor (#86363) 2023-01-21 17:20:33 -10:00
J. Nick Koston
8227c84e05 Add support for streaming (push) history (#85892)
* Add support for streaming (push) history

Currently we poll for history data, like logbook we can stream
this data to avoid database overhead

* Update homeassistant/components/history/__init__.py

* merge filter

* expose new api

* expose new api

* expose new api

* expose new api

* coverage

* tests

* fixes

* tweak

* tweak

* tweak

* DRY

* leaky

* test for specific entities

* test for specific entities

* test for specific entities

* test for specific entities

* test for specific entities

* cover

* cover

* more cover

* tweak

* make sure it works before history starts

* fix test

* cover

* tweak

* make sure we unsub on overflow

* Update homeassistant/components/history/__init__.py

* Update homeassistant/components/history/__init__.py

* fix race in test

* fix db executor access

* relo above task creation
2023-01-21 22:03:41 -05:00
Shay Levy
0657c99efd Revert "Add SSHd and GH CLI to devcontainer to support gh net" (#86360)
Revert "Add SSHd and GH CLI to devcontainer to support `gh net` (#81623)"

This reverts commit 15db63bb3b.
2023-01-21 21:18:22 -05:00
GitHub Action
771e07c68b [ci skip] Translation update 2023-01-22 00:25:52 +00:00
Shay Levy
d5797d9f7d Cleanup Shelly imports (#86359)
* Cleanup Shelly imports

* Cleanup tests
2023-01-22 01:26:54 +02:00
Guido Schmitz
164fad112c React on IP changes in devolo Home Network (#86195) 2023-01-21 12:22:13 -10:00
J. Nick Koston
aac89a3493 Bump recommended esphome version for bluetooth proxies to 2022.12.4 (#86308)
This will fix an MTU issue reported with airthings and
other devices.

needs https://github.com/esphome/esphome/pull/4323
2023-01-22 00:05:06 +02:00
Joakim Plate
53b931e21a Don't interpret negative verbosity as debug (#86318)
* Don't interpret negative verbosity as debug

CI run with -qq which is a negative verbosity

* Make sure all caplog tests get debug level

* Update tests/conftest.py

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

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-22 00:03:57 +02:00
J. Nick Koston
ca4d7634a8 Switch an asyncio.wait_for in the template helper to async_timeout (#86349)
Switch an asyncio.wait_for in the template helper to async_timeout

Eliminates the extra task when calling async_render_will_timeout
2023-01-22 00:02:03 +02:00
J. Nick Koston
2dca826fa9 Bump flux_led to 0.28.35 (#86352)
changelog: https://github.com/Danielhiversen/flux_led/compare/0.28.34...0.28.35
2023-01-22 00:01:08 +02:00
J. Nick Koston
a49461a040 Restore flume scan interval to match app (#86354)
To stay under the API limit the device connection is now
only checked hourly and notifications are only checked every
5 minutes

fixes #82336
2023-01-22 00:00:12 +02:00
J. Nick Koston
a62b8a4f5b Add zeroconf discovery to Synology DSM (#86062) 2023-01-21 11:12:18 -10:00
Christopher Bailey
772a432c4d Fix edge cases for adding/enabling sensors for UniFi Protect (#86329)
Co-authored-by: J. Nick Koston <nick@koston.org>
fixes undefined
2023-01-21 09:38:59 -10:00
mkmer
5306883288 Fix Honeywell unavailable state on connection lost (#86312)
* Fix for Issue 62957

* Cleanup exception test

* rework connection error retry logic

* Refactor HoneywellData class

* move _atr_available to correct location

* await create_task
2023-01-21 20:28:05 +01:00
mkmer
402be4ebde Fix preset modes in Honeywell (#86293)
* Fix for issue #83841

* in instead of =

* Address None for entity maps

* Rework retry logic

* Committed to the wrong branch....
This reverts commit 40e19407a3 (Rework retry logic, 2023-01-21).

* Remove none, change log wording
2023-01-21 20:21:03 +01:00
Luke
f608e150fd Fix incorrect mock in whirlpool (#86331)
* Added async according to error logs

* changed Asyncmock to magicmock get_aircon_mock

* changed attr_callback to MagicMock for sensor_mock
2023-01-21 20:18:43 +01:00
epenet
91c502ae55 Bump bcrypt to 4.0.1 (#86338) 2023-01-21 11:16:28 -05:00
epenet
e8d19e7c62 Ensure all unit converters are tested (#86271)
* Ensure all unit converters are tested

* Adjust

* Simplify

* Simplify

* docstring
2023-01-21 13:11:13 +01:00
Michael Hansen
255611238b Conversation config (#86326)
* Restore conversation config

* Fall back to en for en_US, etc.

* Simplify config passing around

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2023-01-20 21:39:49 -05:00
GitHub Action
e1483ff746 [ci skip] Translation update 2023-01-21 00:24:12 +00:00
Erik Montnemery
1e2f00e186 Improve device automation validation (#86143) 2023-01-21 00:44:17 +01:00
shbatm
0c8b6c13fc Bump PyISY to 3.1.9 for performance improvements (#86297) 2023-01-20 13:09:00 -10:00
Daniel Hjelseth Høyer
50800d2590 Update pyTibber to 0.26.11 (#86316) 2023-01-21 00:01:17 +01:00
Nathan Spencer
be5fe29dc9 Correct pet_weight sensor state class in litterrobot (#86320) 2023-01-21 00:00:05 +01:00
Maciej Bieniek
58bfeb3110 Fix state_class for Accuweather precipitation sensor (#86088) 2023-01-20 23:36:25 +01:00
Jan Bouwhuis
80929c5f8c Update stale docstring on demo lock platform (#86306)
Update stale docstring
2023-01-20 23:01:32 +01:00
starkillerOG
7e51aeb916 Reolink add binary sensors (#85654)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-20 22:27:59 +01:00
mkmer
7f4a727e10 Address Honeywell late review (#86202) 2023-01-20 20:30:48 +01:00
Shay Levy
df77646c8a Fix Shelly sleeping Gen2 - do not refresh from zeroconf discovery (#86296) 2023-01-20 21:27:31 +02:00
Franck Nijhof
914704e459 Remove deprecated Uptime YAML configuration (#86292) 2023-01-20 18:50:32 +02:00
Franck Nijhof
7e8c081065 Refactor HomeWizard switch platform to use entity descriptions (#86011) 2023-01-20 08:49:04 -05:00
Franck Nijhof
a9728bd3a5 Update python-homewizard-energy to 1.6.1 (#86274)
* Update python-homewizard-energy to 1.6.1

* Adjust tests
2023-01-20 08:48:48 -05:00
Franck Nijhof
c14aa7bee4 Automatically set up HomeWizard during onboarding (#86024)
* Automatically set up HomeWizard during onboarding

* Add disabled API during onboarding test

* Mark onboarding complete half way in the test
2023-01-20 08:48:36 -05:00
Franck Nijhof
db6cacafcb Add battery device class to Glances battery sensor (#86278) 2023-01-20 08:47:38 -05:00
Erik Montnemery
ae39b95bb1 Rename otbr integration (#86284)
Rename otbr integration
2023-01-20 08:32:41 -05:00
Erik Montnemery
d94f007dbf Import recorder locally in test fixtures (#86286) 2023-01-20 14:22:48 +01:00
Franck Nijhof
24fdd588fd Code styling tweaks to the tests - Part 1 (#86192) 2023-01-20 13:52:46 +01:00
Franck Nijhof
79b52a2b41 Stricter pylint message control (#86154) 2023-01-20 13:47:55 +01:00
fwestenberg
29b2b6727e Add Stookwijzer (#84435)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-20 13:42:47 +01:00
Duco Sebel
658db7ff05 Add sensors for smart and gas meter identifiers (serial numbers) in HomeWizard (#86282) 2023-01-20 13:42:01 +01:00
Michael
e1512fd3e1 Support password less PI-Hole installations (#86184)
fixes undefined
2023-01-20 13:02:44 +01:00
Jan Bouwhuis
92742ae423 Add jammed state support for MQTT lock (#86010)
* Add jammed state support for MQTT lock

* Correct payload jammed key

* Add tests - rename solved to ok

* Rename jammed state and template topics to motor

* Use state topic for handling motor state

* Follow up comments

* Change default behaviour `state_unjammed`

* Skip `state_unjammed`
2023-01-20 12:19:26 +01:00
Marc Mueller
c8b9260f92 Add option to run only pylint or mypy tests [ci] (#86260) 2023-01-20 11:43:52 +01:00
Shay Levy
585c4acfee Shelly - use common coordinator base class (#86262)
* Shelly - use common coordinator base class

* rename entry to device_entry

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

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-20 09:43:01 +02:00
starkillerOG
3c4455c696 Bump reolink-aio to 0.3.0 (#86259)
* Bump reolink-aio to 0.3.0

* fix typo

* ReolinkException
2023-01-20 08:05:43 +01:00
Duco Sebel
4be7b62607 Bumb python-homewizard-energy to 1.6.0 (#86255) 2023-01-19 21:33:58 -05:00
Klaas Schoute
afb704f607 Bump odp-amsterdam to v5.0.1 (#86252)
Bump package version to v5.0.1
2023-01-19 21:26:51 -05:00
Aarni Koskela
656632f504 Fix docstring in helpers.template_entity (#86227) 2023-01-19 21:24:44 -05:00
Paulus Schoutsen
9a4329aa1d 2023.1.6 (#86251) 2023-01-19 20:06:01 -05:00
Marc Mueller
f00aadfc25 Improve ld2410_ble generic typing (#86258) 2023-01-20 01:50:58 +01:00
GitHub Action
59ad232ce5 [ci skip] Translation update 2023-01-20 00:25:31 +00:00
Michael Hansen
5aca996f22 HassTurnOn/Off intents to also handle cover entities (#86206)
* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Move entity/area resolution to async_match_states

* Special case for covers in HassTurnOn/Off

* Enable light color/brightness on areas

* Remove async_register from default agent

* Remove CONFIG_SCHEMA from conversation component

* Fix intent tests

* Fix light test

* Fix humidifier intent handlers

* Remove DATA_CONFIG for conversation

* Copy ServiceIntentHandler code to light

* Add proper errors to humidifier intent handlers
2023-01-19 17:15:01 -06:00
Paulus Schoutsen
8f10c22a23 Update ESPHome devices from HA (#86249)
* Update ESPHome devices from HA

* esphome-dashboard-api==1.2.2

* Limit to 1 parallel ESPHome update
2023-01-19 16:28:46 -05:00
Paulus Schoutsen
aa7e051538 Bumped version to 2023.1.6 2023-01-19 16:09:03 -05:00
Joris Pelgröm
82a13740b3 Update allowlisted OAuth redirect URIs for Wear OS in China (#86247) 2023-01-19 16:08:59 -05:00
Shay Levy
8dd0752bd0 Fix Shelly sleeping Gen2 device updates (#86198) 2023-01-19 16:08:58 -05:00
J. Nick Koston
58beab1b59 Fix live logbook stalling when there are no historical events with a high commit interval (#86110)
* Force live logbook to send an empty message to indicate no results

Since the sync task can take a while if the recorder is
busy, the logbook will appear to hang if we do not send
the first partial message even if its empty.

This work is in preparation for a higher database
commit interval where this issue is most obvious.

The historical only path did not have this issue because
it never had to wait for the db sync.

* update tests
2023-01-19 16:08:57 -05:00
Marcel van der Veldt
2c127c00d4 Adjust device registry for Matter devices (#86108)
* adjust device registry

* ignore test unique id

* update test

* ditch uniqueid + prefix serial

* adjust test

* add tests

* fix switch test

* prefix all identifiers

* Update homeassistant/components/matter/adapter.py

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

* no underscore in id

* fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-19 16:08:56 -05:00
J. Nick Koston
67f7a9ea78 Bump govee-ble to 0.21.1 (#86103)
fixes https://github.com/home-assistant/core/issues/85580
2023-01-19 16:08:34 -05:00
Franck Nijhof
15a35004dd Code styling tweaks to the Matter integration (#86096) 2023-01-19 16:07:48 -05:00
Marcel van der Veldt
d935f9400d Fix Matter unique_id generation (#86046)
* bae entity unique id on Operational Instance Name standard

* Update homeassistant/components/matter/entity.py

Co-authored-by: Stefan Agner <stefan@agner.ch>

* also adjust unique id for devices

* final adjustment

* remove assert on server_info

* move device info to init

* fabric_id_hex

* use DeviceInfo instead of dict

* fix test

Co-authored-by: Stefan Agner <stefan@agner.ch>
2023-01-19 16:07:47 -05:00
Joris Pelgröm
8aeb20db00 Update allowlisted OAuth redirect URIs for Wear OS in China (#86247) 2023-01-19 16:07:08 -05:00
Paulus Schoutsen
9631146745 Add conversation mobile app webhook (#86239)
* Add conversation mobile app webhook

* Re-instate removed unused import which was used as fixture
2023-01-19 13:59:02 -05:00
Aarni Koskela
c0d9dcdb3f Fix docstring in esphome.bluetooth.client (#86226) 2023-01-19 15:21:32 +01:00
Aarni Koskela
40d39a15c9 Fix stray string literal in bluetooth test wrapper (#86228) 2023-01-19 14:53:43 +01:00
GrahamJB1
200d3ae845 modbus slave unique ids (#86126)
modbus slave unique ids
2023-01-19 11:08:11 +01:00
epenet
6802f3db30 Add filter to strict-typing (#86215)
* Add filter to strict-typing

* Adjust comment
2023-01-19 11:07:42 +01:00
Patrick
3f348714e2 75142 Added QEMU_CPU ARG to the dockerfile (#86178)
at the moment when building for armhf its downloading the wrong packages since version 2022.7.6
Trying to start newer version with an armv6 raspberry leads to an infinite loop of exit code 256
2023-01-19 10:22:23 +01:00
GrahamJB1
bcd4c031c6 Support float in modbus register sensor (#86128)
register sensor should support float
2023-01-19 09:41:49 +01:00
Franck Nijhof
6f44bd43b0 Clean up HomeWizard diagnostic tests (#86211) 2023-01-19 09:35:12 +01:00
epenet
74096b87eb Add type hints to Filter (#86165) 2023-01-19 08:09:18 +01:00
epenet
4b6157cd9b Add type hints to Filter integration tests (#86169)
* Add type hints to filter tests

* Adjust

* Ensure strings are passed to State constructor

* Simplify Recorder import
2023-01-19 08:09:04 +01:00
Michael Hansen
2f98485ae7 Add conversation reload service (#86175)
* Add preload and reload service calls to conversation

* Add conversation preload/reload to websocket API

* Merge prepare into reload

* reload service and prepare websocket API

* Add preload and reload service calls to conversation

* Add conversation preload/reload to websocket API

* Merge prepare into reload

* reload service and prepare websocket API

* Add language lock for loading intents

* Add more tests for code coverage
2023-01-18 19:36:51 -06:00
Jack Boswell
ca885f3fab Add a switch to Starlink for stow/unstow (#85730)
Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-18 14:57:48 -10:00
GitHub Action
d1ecc418bb [ci skip] Translation update 2023-01-19 00:25:04 +00:00
Tom Harris
353638426e Cleanup Insteon code issues (#86173)
Clean up code issues
2023-01-19 01:27:59 +02:00
Shay Levy
0dabbcfca1 Fix Shelly sleeping Gen2 device updates (#86198) 2023-01-19 01:11:40 +02:00
Brandon Rothweiler
37c1052cce Rename Eufy integration to EufyHome (#86065) 2023-01-18 21:47:57 +01:00
Paulus Schoutsen
a83318f373 ESPHome dashboard tweaks (#86176) 2023-01-18 21:15:37 +01:00
930913
4f63398941 Add sensor platform to LD2410BLE (#85276)
* Add sensor platform to LD2410BLE

- Add platform
- Add moving target distance entity
- Add static target distance entity
- Add moving target energy entity
- Add static target energy entity

* Add detection distance entity

* Align bluetooth-data-tools version

* Generate sensors from description

Also add state_class and unfactor description lambdas.

* Optimise LD2410BLE collections

Co-authored-by: J. Nick Koston <nick@koston.org>
2023-01-18 14:56:06 -05:00
Paulus Schoutsen
29337bc6eb Reload ESPHome config entries when dashboard info received (#86174) 2023-01-18 17:59:55 +01:00
Shay Levy
c40c37e9ee Add reauth flow to webOS TV integration (#86168)
* Add reauth flow to webOS TV integration

* Remove unnecessary else
2023-01-18 18:48:38 +02:00
Paulus Schoutsen
f2b348dbdf Add OTBR WebSocket API (#86107)
* Add OTBR WebSocket API

* Not always active dataset

* Move logic to data class

* Remove retry until we need it

* Test all the things
2023-01-18 11:33:15 -05:00
Robert Svensson
e43802eb07 Use more _attrs_* in Axis entities (#85555)
* Use _attr_available

* Use _attr_is_on

* Use _attr_name

* Make some values private

* Update names of axis entity base classes

* Fix review comments
2023-01-18 17:27:13 +01:00
Marcel van der Veldt
4bebf00598 Adjust device registry for Matter devices (#86108)
* adjust device registry

* ignore test unique id

* update test

* ditch uniqueid + prefix serial

* adjust test

* add tests

* fix switch test

* prefix all identifiers

* Update homeassistant/components/matter/adapter.py

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

* no underscore in id

* fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-18 17:17:33 +01:00
mkmer
5e6ba594aa Change Honeywell somecomfort API to AIOSomecomfort API (#86102)
* Move to AIOSomecomfort

* Remove unused constant

* Improve test coverage to 100

* Update homeassistant/components/honeywell/__init__.py

remove "todo" from code

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

* Missing cannot_connect translation

* add asyncio errors
update devices per entity
rework retry login

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-18 16:03:13 +01:00
Marc Mueller
f0ba7a3795 Update pylint to 2.15.10 (#86167) 2023-01-18 15:01:24 +01:00
Erik Montnemery
fea5330cee Change 'Sky Connect' to 'SkyConnect' (#86166) 2023-01-18 08:43:38 -05:00
Marc Mueller
141acba40d Remove unnecessary try-else (3) (#86160) 2023-01-18 14:25:28 +01:00
Marc Mueller
bc115634d1 Remove unnecessary try-else (2) (#86159) 2023-01-18 14:25:09 +01:00
Marc Mueller
1cc8feabb7 Remove unnecessary try-else (1) (#86158) 2023-01-18 14:24:52 +01:00
Marc Mueller
6d336ec136 Remove unnecessary try-else (5) (#86164) 2023-01-18 14:10:13 +01:00
Marc Mueller
d26484d482 Remove unnecessary try-else (4) (#86161) 2023-01-18 13:17:08 +01:00
Marc Mueller
a44e44b7d0 Add missing raise for exceptions (#86155) 2023-01-18 12:48:30 +01:00
epenet
9cdf7a09ed Rename precision variable in Filter (#86090) 2023-01-18 12:40:04 +01:00
epenet
1cfcc9313b Fix incorrect type hint in Filter (#86141) 2023-01-18 12:39:00 +01:00
Artem Draft
a87a9790e9 Bump pybravia to 0.3.1 (#86153)
fixes undefined
2023-01-18 12:24:04 +01:00
Franck Nijhof
382e1ac679 Code styling tweaks to the ESPHome integration (#86146) 2023-01-18 11:10:16 +01:00
Erik Montnemery
f17a829bd8 Only wait for import flows to initialize at setup (#86106)
* Only wait for import flows to initialize at setup

* Update hassio tests

* Update hassio tests

* Apply suggestions from code review

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-18 10:44:18 +01:00
Shay Levy
767b43bb0e Remove WebOS TV script translation leftover (#86109)
Keep only english changes
2023-01-18 10:11:08 +01:00
GrahamJB1
9d9817328b Reset Modbus value on down (#86127)
* modbus: slave should reset value on sensor down as parent does that

* modbus: slave should reset value on sensor down as parent does that
2023-01-18 08:49:38 +01:00
mkmer
0b45fb6dc3 Bump AIOAladdinConnect to 0.1.53 (#86129) 2023-01-18 08:37:15 +01:00
Matthew Donoughe
33d0dec648 Update to pylutron_caseta to 0.18.0 (#86133) 2023-01-17 17:56:15 -10:00
J. Nick Koston
5279535046 Fix live logbook stalling when there are no historical events with a high commit interval (#86110)
* Force live logbook to send an empty message to indicate no results

Since the sync task can take a while if the recorder is
busy, the logbook will appear to hang if we do not send
the first partial message even if its empty.

This work is in preparation for a higher database
commit interval where this issue is most obvious.

The historical only path did not have this issue because
it never had to wait for the db sync.

* update tests
2023-01-17 21:06:37 -05:00
GitHub Action
87b2a73460 [ci skip] Translation update 2023-01-18 00:24:40 +00:00
Franck Nijhof
91aaca6471 Code styling tweaks to the Alexa integration (#86121) 2023-01-18 01:01:30 +02:00
J. Nick Koston
b722a7e05b Ensure flux_led does not try to reload while setup is in progress (#86122)
There was a discovery race in flux_led that could trigger
it to try to reload while in progress if the device data
changed
2023-01-17 22:51:04 +01:00
Daniel Gangl
cc74fcbda7 Remove deprecated zamg YAML config (#86113) 2023-01-17 21:58:20 +01:00
J. Nick Koston
1c2510bfb3 Bump govee-ble to 0.21.1 (#86103)
fixes https://github.com/home-assistant/core/issues/85580
2023-01-17 09:48:21 -10:00
Joakim Plate
829df7ddfd Adjust translations for zha buttons (#86095) 2023-01-17 21:36:11 +02:00
Erik Montnemery
f93bbd55ba Improve logging shutdown (#85812)
* Improve logging shutdown

* Update test
2023-01-17 20:06:25 +01:00
Erik Montnemery
f6cd399b9e Adjust kitchen_sink test (#86099) 2023-01-17 19:31:10 +01:00
Aaron Bach
27359dfc89 Subclass a DataUpdateCoordinator for Ridwell (#85644) 2023-01-17 19:31:00 +01:00
Erik Montnemery
b4abfb1697 Adjust Thread config flow (#86097)
* Adjust Thread config flow

* Improve tests

* Update homeassistant/components/otbr/config_flow.py

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

Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-17 13:27:33 -05:00
Franck Nijhof
bd1c476edf Code styling tweaks to the Matter integration (#86096) 2023-01-17 19:09:12 +01:00
Erik Montnemery
cf68d081ca Allow manually setting up the Thread integration (#86087) 2023-01-17 12:50:29 -05:00
Jon Caruana
65c4e63e30 Bump pylitejet to 0.4.6 (now with async!) (#85493) 2023-01-17 16:53:16 +01:00
Jan Bouwhuis
25392655e7 Allow translating select selector options (#85531)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2023-01-17 16:22:19 +01:00
Erik Montnemery
096ef5da47 Use Home Assistant swing modes in tado climate (#84278) 2023-01-17 16:13:49 +01:00
Franck Nijhof
c5fb3e7fab 2023.1.5 (#86058) 2023-01-17 09:40:32 +01:00
starkillerOG
669e6202ad bump reolink-aio to 0.2.1 (#85571) 2023-01-17 08:36:24 +01:00
Paulus Schoutsen
6a7e6ad0fd Bumped version to 2023.1.5 2023-01-16 21:47:10 -05:00
Daniel Hjelseth Høyer
5656129b60 Update pyTibber to 0.26.8 (#86044) 2023-01-16 21:47:01 -05:00
J. Nick Koston
96578f3f89 Handle ignored shelly entries when discovering via zeroconf (#86039)
fixes https://github.com/home-assistant/core/issues/85879
2023-01-16 21:47:00 -05:00
Shay Levy
4138e518ef Bump aiowebostv to 0.3.2 (#86031)
fixes undefined
2023-01-16 21:46:59 -05:00
Shay Levy
aa43acb443 Update webOS TV codeowners (#85959) 2023-01-16 21:46:58 -05:00
Shay Levy
b459261ef2 Fix webOS TV SSDP discovery missing friendly name (#85917) 2023-01-16 21:44:02 -05:00
Shay Levy
a318576c4f Bump aiowebostv to 0.3.1 to fix support for older devices (#85916)
Bump aiowebostv to 0.3.1
2023-01-16 21:44:01 -05:00
Allen Porter
9a6aaea9db Add a timeout during OAuth token exchange and additional debug logging (#85911) 2023-01-16 21:44:00 -05:00
Allen Porter
627ded42f5 Bump google-nest-sdm to 2.2.2 (#85899)
* Bump google-nest-sdm to 2.2.0

* Bump nest to 2.2.1

* Bump google-nest-sdm to 2.2.2
2023-01-16 21:43:59 -05:00
Allen Porter
fa09eba165 Bump google-nest-sdm to 2.1.2 (#84926) 2023-01-16 21:43:59 -05:00
Jan Stienstra
fcf53668c5 Skip over files without mime type in Jellyfin (#85874)
* Skip over files without mime type

* Skip over tracks without mime type
2023-01-16 21:40:30 -05:00
J. Nick Koston
d61b915286 Bump aiohomekit to 2.4.4 (#85853)
fixes https://github.com/home-assistant/core/issues/85400
fixes https://github.com/home-assistant/core/issues/84023
2023-01-16 21:40:29 -05:00
Shay Levy
b0153c7deb Fix WebOS TV image fetch SSL verify failure (#85841) 2023-01-16 21:40:28 -05:00
tronikos
2447e24677 Remove oauth2client dependency in Google Assistant SDK (#85785)
Remove import oauth2client, inline 2 constants
2023-01-16 21:40:27 -05:00
J. Nick Koston
502fea5f95 Bump pySwitchbot to 0.36.4 (#85777) 2023-01-16 21:40:26 -05:00
Yuval Aboulafia
caa8f9e49b Remove WAQI unsupported UOM (#85768)
fixes undefined
2023-01-16 21:40:25 -05:00
Erik Montnemery
8beb043d62 Remove sky connect config entry if USB stick is not plugged in (#85765)
* Remove sky connect config entry if USB stick is not plugged in

* Tweak cleanup

* Give some stuff more cromulent names

* Do the needful

* Add tests

* Tweak
2023-01-16 21:40:25 -05:00
starkillerOG
cb27cfe7dd Reolink check for admin (#85570)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
fixes undefined
2023-01-16 21:40:24 -05:00
Michael
1d5ecdd4ea Make API key mandatory for PI-Hole (#85885)
add reauth, so make api-key mandatory
2023-01-16 21:34:42 -05:00
Paulus Schoutsen
3bb9be2382 2023.1.4 (#85764) 2023-01-12 15:00:21 -05:00
Paulus Schoutsen
6581bad7ce Bumped version to 2023.1.4 2023-01-12 13:20:23 -05:00
Shay Levy
197634503f Bump aiowebostv to 0.3.0 (#85756) 2023-01-12 13:20:17 -05:00
Franck Nijhof
32fc0e03a5 Use jemalloc in Docker builds (#85738) 2023-01-12 13:20:16 -05:00
Nathan Spencer
2e9ea0c934 Fix Litter-Robot 4 firmware versions reported while updating (#85710) 2023-01-12 13:20:15 -05:00
Nathan Spencer
856f68252b Use built in polling for litterrobot update entity (#84678)
* Use built in polling

* Define scan interval
2023-01-12 13:19:55 -05:00
Nathan Spencer
2789747b0f Bump pylitterbot to 2023.1.0 (#85484) 2023-01-12 13:18:37 -05:00
Daniel Hjelseth Høyer
45d14739c5 Update pyTibber to 0.26.8 (#85702)
* Tibber, update pyTibber

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

* Tibber, update pyTibber

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>

Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
2023-01-12 13:17:40 -05:00
Ville Skyttä
d0f95d84b4 Upgrade huawei-lte-api to 1.6.11 (#85669) 2023-01-12 13:17:38 -05:00
Robert Hillis
1e852e761c Remove oauth2client dependency in Google Sheets (#85637)
Remove oauth2client dependency
2023-01-12 13:17:37 -05:00
Ville Skyttä
c3859f9170 Improve Huawei LTE SSDP inclusion (#85572)
* Probe Huawei LTE API for device support on SSDP match

More or less as expected, the loosening of SSDP/UPnP data matches done
in #81643 started to yield false positives, as in #85402.

Coming up with robust matches solely based on the SSDP/UPnP data still
does not seem possible, so keep the matches as loose as they were made,
but additionally invoke a probe request on the API to determine if the
device looks like a supported one.

* Probe only after unique id checks

Prevents throwaway probes for discoveries already in progress.

* Fix SSDP result URL test, add missing assert on it
2023-01-12 13:17:36 -05:00
Milan Meulemans
6df4fc6708 Upgrade aionanoleaf to 0.2.1 (#83669) 2023-01-12 13:17:34 -05:00
Paulus Schoutsen
b297b78086 2023.1.3 (#85645) 2023-01-10 15:58:26 -05:00
Paulus Schoutsen
4bdf87d383 Bumped version to 2023.1.3 2023-01-10 14:52:06 -05:00
Paul Bottein
e47364f34d Update frontend to 20230110.0 (#85640) 2023-01-10 14:52:01 -05:00
Erik Montnemery
fe7d32dc5d Bump hatasmota to 0.6.3 (#85633) 2023-01-10 14:52:00 -05:00
Allen Porter
62a003a053 Bump gcal-sync to 4.1.2 (#85631) 2023-01-10 14:51:59 -05:00
Shay Levy
b5d1421dfd Bump aioshelly to 5.2.1 to fix Task exception was never retrieved (#85575)
Bump aioshelly to 5.2.1
2023-01-10 14:51:58 -05:00
Aaron Bach
ebab2bd0f9 Remove no-longer-needed invalid API key monitor for OpenUV (#85573)
* Remove no-longer-needed invalid API key monitor for OpenUV

* Handle re-auth cancellation

* Use automatic API status check
2023-01-10 14:51:57 -05:00
J. Nick Koston
e7babb4266 Do not check ble scanner state for sleepy shelly devices (#85566)
fixes #85563
2023-01-10 14:51:56 -05:00
Christopher Bailey
1a042c2dad Bump pyunifiprotect to 4.6.1 (#85547) 2023-01-10 14:51:55 -05:00
Keilin Bickar
731ca046f6 Bump sense_energy to 0.11.1 (#85533)
fixes undefined
2023-01-10 14:51:54 -05:00
epenet
c844276e95 Remove invalid state class in Subaru sensor (#85520) 2023-01-10 14:51:53 -05:00
starkillerOG
9f9cdb62eb Restore Netgear signal strength icon (#85512) 2023-01-10 14:51:52 -05:00
Franck Nijhof
c73830439f Remove invalid Signal Strength device class from NETGEAR (#85510) 2023-01-10 14:51:51 -05:00
Christopher Bailey
940b5d62b4 Bump pyunifiprotect to 4.6.0 (#85483) 2023-01-10 14:51:50 -05:00
Paulus Schoutsen
b3454bfd9c 2023.1.2 (#85481) 2023-01-08 21:44:13 -05:00
Paulus Schoutsen
834847988d Bumped version to 2023.1.2 2023-01-08 20:24:25 -05:00
Allen Porter
caf15534bb Bump gcal_sync to 4.1.1 (#85453) 2023-01-08 20:24:19 -05:00
Allen Porter
10cb2e31c4 Bump ical to 4.2.9 (#85401) 2023-01-08 20:24:18 -05:00
Lutz Lengemann
85c9f9facf Increase Hydrawise default scan interval (#85398)
Increasing default scan interval

Fixes #83540
2023-01-08 20:24:17 -05:00
J. Nick Koston
5ff7b3bb1a Bump pySwitchbot to 0.36.3 (#85360) 2023-01-08 20:24:16 -05:00
J. Nick Koston
e5ba423d6d Add note to SwitchBot locks that usernames are case sensitive (#85359) 2023-01-08 20:24:15 -05:00
puddly
b30d4ef7cf Bump ZHA dependencies (#85355)
* Bump ZHA dependencies

* Deprecated `foundation.Command` -> `foundation.GeneralCommand`
2023-01-08 20:24:15 -05:00
Joakim Plate
00e563f1b8 Switch play pause method in philips js (#85343)
fixes undefined
2023-01-08 20:24:14 -05:00
Phil Bruckner
cf06f3b81d Bump life360 package to 5.5.0 (#85322)
Improve debug output & redact sensitive info from log.
Fix bug that was masking some HTTP errors.
Retry HTTP errors 502, 503 & 504, which have been observed to happen every once
in a while, resulting in fewer unnecessary unavailable states.
2023-01-08 20:24:13 -05:00
starkillerOG
a781fcca86 Bump reolink-aio to 0.1.3 (#85309)
bump reolink-aio to 0.1.3
2023-01-08 20:24:12 -05:00
Tom Puttemans
764550f2e1 Fix dsmr_reader peak hour consumption unit of measurement (#85301) 2023-01-08 20:24:11 -05:00
puddly
7396bcc585 Retry ZHA config entry setup when ENETUNREACH is caught (#84615)
* The config entry is not ready on `ENETUNREACH`

* Use new `TransientConnectionError` from zigpy
2023-01-08 20:20:26 -05:00
epenet
7e6b087773 Allow SensorDeviceClass.POWER_FACTOR unit None (#85287)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2023-01-06 09:27:02 +01:00
Paulus Schoutsen
71ce7373a3 2023.1.1 (#85277) 2023-01-05 23:18:21 -05:00
Paulus Schoutsen
33bb9c230b Bumped version to 2023.1.1 2023-01-05 22:24:17 -05:00
Charles Garwood
f0f2c12d91 Fix Fully Kiosk service call config entry handling (#85275)
* Make sure we're getting the fully_kiosk config entry

* Make sure we're getting the fully_kiosk config entry
2023-01-05 22:23:52 -05:00
J. Nick Koston
2840821594 Reject the WiFI AP when considering to update a shelly config entry from zeroconf (#85265)
Reject the WiFI AP IP when considering to update a shelly config entry from zeroconf

fixes #85180
2023-01-05 22:23:51 -05:00
rikroe
edfd83c3a7 Bump bimmer_connected to 0.12.0 (#85255)
* Bump bimmer_connected to 0.12.0

* Fix mypy

* Remove not needed code

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
2023-01-05 22:23:51 -05:00
starkillerOG
ee88f34a91 bump reolink-aio to 0.1.2 (#85247) 2023-01-05 22:22:35 -05:00
J. Nick Koston
fa4c250001 Improve error reporting when switchbot auth fails (#85244)
* Improve error reporting when switchbot auth fails

related issue #85243

* bump

* coverage
2023-01-05 22:21:55 -05:00
Franck Nijhof
59d6f827c3 Fix device class for DSMR gas sensors providing energy readings (#85202) 2023-01-05 22:18:30 -05:00
epenet
26ea02aa8f Remove invalid device class for RSSI sensors (#85191)
* Remove invalid device class for RRSI sensors

* Restore state class
2023-01-05 22:18:29 -05:00
epenet
d73b86132b Adjust valid energy units (#85190) 2023-01-05 22:18:28 -05:00
Franck Nijhof
8034faadca Remove invalid AQI unit from Environment Canada (#85183) 2023-01-05 22:18:27 -05:00
Erik Montnemery
3c2b7c0d69 Bump hatasmota to 0.6.2 (#85182) 2023-01-05 22:18:26 -05:00
Ernst Klamer
563ad02c65 Bump bthome-ble to 2.4.1 (#85153)
fix https://github.com/home-assistant/core/issues/85142
fixes undefined
2023-01-05 22:15:13 -05:00
Michal Čihař
fe89b663e7 Fix lacrosse_view fetching of latest data (#85117)
lacrosse_view: fixed fetching of latest data

When using datetime.utcnow(), it only replaces timezone information with
UTC making the actual time offset by the timezone. When you are in UTC-
timezones, it makes no issue as the offset is in the future, but when in
UTC+, the last hour(s) of data are missing.

This commits swtiches to time.time() as UTC timestamp is actually what
the API expects.

It also reduces the window to one hour what noticeably improves the API
performance.
2023-01-05 22:15:12 -05:00
William Scanlon
dcd07d3135 Bump pyeconet to 0.1.18 to fix energy usage (#85094) 2023-01-05 22:15:11 -05:00
Robert Svensson
8bf2299407 Only subscribe to relevant IDs for state updates (#85252)
Make sure to only subscribe to the relevant ID
2023-01-05 21:49:22 -05:00
Robert Svensson
9c689d757c Limit calls in UniFi to write state (#85248)
Limit calls to write state to when relevant
2023-01-05 15:38:24 -05:00
Franck Nijhof
4e4fc1767f 2023.1.0 (#85120) 2023-01-04 20:47:22 +01:00
Martin Hjelmare
cc3c5772c5 Fix Z-Wave JS sensor units and device classes (#85129)
fixes undefined
2023-01-04 19:47:59 +01:00
J. Nick Koston
6ba6991ecd Bump home-assistant-bluetooth to 1.9.2 (#85123) 2023-01-04 18:36:15 +01:00
Franck Nijhof
d52d068469 Merge branch 'master' into rc 2023-01-04 17:09:15 +01:00
Franck Nijhof
09b3611a63 Bumped version to 2023.1.0 2023-01-04 17:05:21 +01:00
Joakim Sørensen
ab2f05d3e9 Handle zone exception when setting up Cloudflare (#85110) 2023-01-04 17:04:43 +01:00
Guido Schmitz
90ac0c870f Remove illuminance device class for sensors in devolo Home Control (#85108) 2023-01-04 17:04:40 +01:00
Bram Kragten
0fd113db59 Update frontend to 20230104.0 (#85107) 2023-01-04 17:04:35 +01:00
Jan Bouwhuis
1b43323f5e Allow MQTT device_class or state_class to be set as None (#85106)
* Allow MQTT device_class to be set as `None`

* Add test

* Also allow sensor state_class to be `None`
2023-01-04 17:04:30 +01:00
Jan Bouwhuis
6108e581b1 Do not reset current selection on reconfig or MQTT select (#85099)
* Do not reset current selection on reconfig

* Add a test
2023-01-04 11:54:27 +01:00
Aaron Bach
c8c68f05ec Remove workaround for reloading PurpleAir upon device removal (#85086) 2023-01-04 11:53:06 +01:00
Franck Nijhof
b80467dc58 Update adguard to 0.6.1 (#85052)
* Update adguard to 0.6.0

* Update adguard to 0.6.1
2023-01-04 11:49:16 +01:00
Andre Lengwenus
6e9f0eca03 Fix integer only LCN variable values (#85035) 2023-01-04 11:49:10 +01:00
Paulus Schoutsen
cc6a2f0338 2022.12.9 (#85030) 2023-01-02 22:06:36 -05:00
J. Nick Koston
6ebf2ec9ec Fix failing HomeKit Controller diagnostics tests (#84936) 2023-01-02 22:05:25 -05:00
Paulus Schoutsen
9ecee11af6 Bumped version to 2023.1.0b5 2023-01-02 21:30:16 -05:00
J. Nick Koston
9a1669103b Fix bluetooth not being loaded with esphome proxies when removed from default_config (#85032)
* Fix bluetooth not being loaded with esphome proxies when removed from default_config

fixes #84960

* actually commit the conftest change
2023-01-02 21:30:02 -05:00
Paulus Schoutsen
368ea0586d Bump slixmpp to 1.8.3 (#85031) 2023-01-02 21:30:01 -05:00
J. Nick Koston
4a7db6ee71 Bump httpx to 0.23.2 (#85023)
changelogs:
https://github.com/encode/httpcore/compare/0.16.2...0.16.3
https://github.com/encode/httpx/compare/0.23.1...0.23.2
2023-01-02 21:30:00 -05:00
Tobias Sauerwein
a10b9572c7 Bump pyatmo to v7.5.0 (#85016) 2023-01-02 21:29:59 -05:00
starkillerOG
0b47bf1f0b Switch to reolink-aio (#85014)
* switch to reolink-aio

* fix imports
2023-01-02 21:29:58 -05:00
Bram Kragten
5f4d286556 Update frontend to 20230102.0 (#85010)
Co-authored-by: Franck Nijhof <git@frenck.dev>
2023-01-02 21:29:57 -05:00
Daniel Hjelseth Høyer
b23ab3c65a Update Tibber lib to 0.26.7. Improve error handling of realtime data (#85008) 2023-01-02 21:29:56 -05:00
J. Nick Koston
7c199b36f8 Bump home-assistant-bluetooth to 1.9.1 (#85005)
fixes #83722
2023-01-02 21:29:55 -05:00
David F. Mulcahey
d4e55ee030 Bump ZHA quirks (#85004) 2023-01-02 21:29:55 -05:00
starkillerOG
f3ec82543e Bump motionblinds to 0.6.15 (#84994) 2023-01-02 21:29:54 -05:00
Erik Montnemery
4013d4c48d Revert "Add aliases to device registry items" (#84976) 2023-01-02 21:29:53 -05:00
Martin Hjelmare
93ac908776 Handle not available add-on in hassio add-on manager (#84943)
* Handle not available add-on in hassio add-on manager

* Fix zwave_js tests

* Fix sky connect tests

* Fix matter tests

* Fix yellow tests

* Update hardware tests
2023-01-02 21:29:52 -05:00
starkillerOG
2ad1a53038 Consider 95% as closed for Motion blinds venetian blinds (#84872) 2023-01-02 21:29:51 -05:00
Paulus Schoutsen
3ba59fbebe Bumped version to 2022.12.9 2023-01-02 20:30:09 -05:00
Martin Hjelmare
f3fab5c1f5 Handle not available add-on in hassio add-on manager (#84943)
* Handle not available add-on in hassio add-on manager

* Fix zwave_js tests

* Fix sky connect tests

* Fix matter tests

* Fix yellow tests

* Update hardware tests
2023-01-02 20:30:03 -05:00
Paulus Schoutsen
2d120cb6ba Bumped version to 2023.1.0b4 2023-01-01 20:25:29 -05:00
Allen Porter
ad782166c7 Fix caldav calendars with custom timezones (#84955)
* Fix caldav calendars with custom timezones

* Revert whitespace change
2023-01-01 20:23:33 -05:00
J. Nick Koston
bc9202cf02 Bump pySwitchbot to 0.36.1 (#84937)
changelog: https://github.com/Danielhiversen/pySwitchbot/compare/0.36.0...0.36.1

small fix for the battery not updating with passive scanning
after lock operation
2023-01-01 20:23:32 -05:00
J. Nick Koston
0d385d3b67 Fix failing HomeKit Controller diagnostics tests (#84936) 2023-01-01 20:23:31 -05:00
Allen Porter
76fa24aba1 Fix Climate device HVAC mode trigger UI (#84930)
* Fix Climate device HVAC mode trigger UI

* Use updated order of test case results
2023-01-01 20:23:30 -05:00
ChopperRob
95ae37cd87 Fix haveibeenpwned user-agent string (#84919)
* Fixed user-agent string not being accepted as an valid header

* Update homeassistant/components/haveibeenpwned/sensor.py

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

* Removed the aiohttp import

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-01 20:22:56 -05:00
Robert Svensson
bc1d22f4ec Bump pydeconz to v106 (#84914)
fixes undefined
2023-01-01 20:20:15 -05:00
Allen Porter
67e1872ab6 Fix free/busy google calendars (#84907)
fixes undefined
2023-01-01 20:20:14 -05:00
tronikos
516c2b0cdb Google Assistant SDK: Log command and response (#84904)
Log command and response
2023-01-01 20:20:13 -05:00
Aaron Bach
60f067b68f Use serial number for AirVisal Pro config entry unique ID (#84902)
* Use serial number for AirVisal Pro config entry unique ID

* Code review
2023-01-01 20:20:13 -05:00
Aaron Bach
ff76567061 Fix issues with PurpleAir sensor device class and unit (#84896) 2023-01-01 20:20:12 -05:00
Aaron Bach
93488cfa0f Don't include distance in PurpleAir sensor selector (#84893) 2023-01-01 20:20:11 -05:00
J. Nick Koston
9655619667 Small fixes for SwitchBot Locks (#84888)
Co-authored-by: Aaron Bach <bachya1208@gmail.com>
2023-01-01 20:20:10 -05:00
starkillerOG
32736b3336 Process late feedback for Reolink (#84884)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-01 20:20:09 -05:00
starkillerOG
c77b78928e Bump motionblinds to 0.6.14 (#84873) 2023-01-01 20:20:08 -05:00
William Scanlon
a7ba242f1f Bump pyeconet to 0.1.17 (#84868) 2023-01-01 20:20:08 -05:00
Greg Dowling
043d58d697 Bump pyroon library to 0.1.2. (#84865) 2023-01-01 20:20:07 -05:00
Robert Svensson
6408890543 Bump aiounifi to v43 (#84864) 2023-01-01 20:20:06 -05:00
Franck Nijhof
c5f7d7ae85 Only reflect unavailable state in DSMR when disconnected (#84862)
* Only reflect unavailable state in DSMR when disonnected

* Addressreview comment
2023-01-01 20:20:05 -05:00
Franck Nijhof
7ab27cd9bf Do not validate device classes when entity state is unknown (#84860) 2023-01-01 20:20:04 -05:00
Artem Draft
9932c0cb91 Bump pybravia to 0.2.5 (#84835) 2023-01-01 20:20:03 -05:00
Aaron Bach
565d4f85c1 Ensure AirVisual Pro migration includes device and entity customizations (#84798)
* Ensure AirVisual Pro migration includes device and entity customizations

* Update homeassistant/components/airvisual/__init__.py

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

* Code review

* Fix tests

* Fix tests FOR REAL

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2023-01-01 20:20:02 -05:00
Franck Nijhof
7be60d4569 Bumped version to 2023.1.0b3 2022-12-30 16:50:35 +01:00
Franck Nijhof
a50622cbfd Add availability property to DSMR sensors (#84848) 2022-12-30 16:49:35 +01:00
Bram Kragten
fb41b024c0 Update frontend to 20221230.0 (#84842) 2022-12-30 16:49:31 +01:00
Artem Draft
80ac4c0269 Redesign and refactor Bravia TV config_flow (#84832)
fixes undefined
2022-12-30 16:49:27 +01:00
Damian Sypniewski
0e0677b690 Add option to retrieve SwitchBot Lock encryption key through config flow (#84830)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-12-30 16:48:39 +01:00
SukramJ
50d9e3efe6 Add mA to SensorDeviceClass.CURRENT units (#84492)
fixes undefined
2022-12-30 16:45:39 +01:00
Jan Bouwhuis
ca28006d76 Add mV as a unit for voltage and enable conversions (#84805)
fixes undefined
2022-12-30 16:41:51 +01:00
Phil Cole
ac3711e6ab Use pycarwings2 2.14 (#84792)
fixes undefined
2022-12-30 16:40:22 +01:00
epenet
5901964bf6 Enable unit conversion for DATA_SIZE (#84699) 2022-12-30 16:40:19 +01:00
epenet
b24c40f2df Enable unit conversion for DATA_RATE (#84698) 2022-12-30 16:40:16 +01:00
Chris Straffon
2cb7a80f98 Fix growatt identification issue (#84628)
Fixes https://github.com/home-assistant/core/issues/84600
fixes undefined
2022-12-30 16:40:11 +01:00
Steven Looman
f05de2b28c Actually try port when finding next available port for ssdp server (#84206)
fixes undefined
2022-12-30 16:29:17 +01:00
Paulus Schoutsen
d9aff9d7b0 Bumped version to 2023.1.0b2 2022-12-29 20:55:27 -05:00
shbatm
46e11c2fa8 ISY994: Bump PyISY to 3.0.10 (#84821) 2022-12-29 20:54:48 -05:00
J. Nick Koston
522477d5a4 Fix thermobeacon WS08 models that identify with manufacturer_id 27 (#84812)
fixes #84706
2022-12-29 20:54:47 -05:00
Joakim Plate
cc2b592221 Correct missing alarm reset button on nibe (#84809)
fixes undefined
2022-12-29 20:54:46 -05:00
Aaron Bach
bd86111dd8 Fix AirVisual Pro sensors with incorrect units for their device classes (#84800) 2022-12-29 20:54:45 -05:00
Michael
f0514008fa Deprecate YAML config in PI-Hole (#84797)
create an issue about deprecated yaml config
2022-12-29 20:54:44 -05:00
Aaron Bach
3c8a66abbe Don't attempt setup on migrated AirVisual Pro in the airvisual domain (#84796)
fixes undefined
2022-12-29 20:54:44 -05:00
Aaron Bach
f1d509be03 Remove ozone device class from OpenUV sensor (#84791)
fixes undefined
2022-12-29 20:54:43 -05:00
Robert Svensson
fbdc7d44bc Only subscribe to specific UniFi object ID (#84787) 2022-12-29 20:54:42 -05:00
Hans Oischinger
cae386465e Catch vicare errors when deactivating preset fails (#84778)
vicare: catch errors when deactivating preset fails
2022-12-29 20:54:41 -05:00
Allen Porter
31847e3a69 Check google calendar API scope to determine if write access is enabled (#84749)
* Check google calendar API scope to determine if write access is enabled

* Add API scope for calendar service for creating events
2022-12-29 20:54:40 -05:00
Jc2k
5787e1506c Fix UUID normalisation for vendor extensions in homekit_controller thread transport (#84746) 2022-12-29 20:54:39 -05:00
starkillerOG
9a29f64128 Bump pynetgear to 0.10.9 (#84733) 2022-12-29 20:54:38 -05:00
Tomas Kislan
6c0e4a9e8f Fix and upgrade minio integration (#84545)
closes https://github.com/home-assistant/core/issues/79842
2022-12-29 20:54:37 -05:00
Franck Nijhof
9ce64f8990 Bumped version to 2023.1.0b1 2022-12-28 22:18:06 +01:00
Aaron Bach
6ef4086683 Fix incorrect values for AirVisual Pro sensors (#84725) 2022-12-28 22:16:22 +01:00
Aaron Bach
b146f52317 Remove incorrect unit for AirVisual AQI sensor (#84723)
fixes undefined
2022-12-28 22:16:19 +01:00
Hans Oischinger
001bd78bcb water_heater: Add unsupported states (#84720) 2022-12-28 22:16:16 +01:00
Allen Porter
ba4ec8f8c1 Gracefully handle caldav event with missing summary (#84719)
fixes undefined
2022-12-28 22:16:12 +01:00
Michael
8aa3a6cc15 Remove deprecated tankerkoenig YAML config (#84711)
remove yaml import
2022-12-28 22:16:09 +01:00
Hmmbob
ed43e1d3a4 Update apprise to 1.2.1 (#84705) 2022-12-28 22:16:06 +01:00
Marcel van der Veldt
b7654c0fce Bump python matter server to 1.0.8 (#84692)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-12-28 22:16:02 +01:00
Franck Nijhof
99f3cfdf8a Bumped version to 2023.1.0b0 2022-12-28 16:51:38 +01:00
2992 changed files with 51580 additions and 15767 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -45,13 +45,5 @@
"!include_dir_merge_list scalar",
"!include_dir_merge_named scalar"
]
},
"features": {
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "latest"
}
}
}

View File

@@ -10,7 +10,7 @@ on:
env:
BUILD_TYPE: core
DEFAULT_PYTHON: 3.9
DEFAULT_PYTHON: "3.10"
jobs:
init:

View File

@@ -18,13 +18,22 @@ on:
description: "Skip pytest"
default: false
type: boolean
pylint-only:
description: "Only run pylint"
default: false
type: boolean
mypy-only:
description: "Only run mypy"
default: false
type: boolean
env:
CACHE_VERSION: 3
PIP_CACHE_VERSION: 3
HA_SHORT_VERSION: 2023.2
DEFAULT_PYTHON: 3.9
ALL_PYTHON_VERSIONS: "['3.9', '3.10']"
MYPY_CACHE_VERSION: 3
HA_SHORT_VERSION: 2023.3
DEFAULT_PYTHON: "3.10"
ALL_PYTHON_VERSIONS: "['3.10']"
PRE_COMMIT_CACHE: ~/.cache/pre-commit
PIP_CACHE: /tmp/pip-cache
SQLALCHEMY_WARN_20: 1
@@ -163,6 +172,9 @@ jobs:
pre-commit:
name: Prepare pre-commit base
runs-on: ubuntu-20.04
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
needs:
- info
steps:
@@ -176,7 +188,7 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v3.2.3
uses: actions/cache@v3.2.4
with:
path: venv
key: >-
@@ -191,7 +203,7 @@ jobs:
pip install "$(cat requirements_test.txt | grep pre-commit)"
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache@v3.2.3
uses: actions/cache@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
key: >-
@@ -220,30 +232,22 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if pre-commit cache restore failed
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
echo "Failed to restore pre-commit environment from cache"
exit 1
- name: Run black (fully)
if: needs.info.outputs.test_full_suite == 'true'
run: |
@@ -274,30 +278,22 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if pre-commit cache restore failed
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
echo "Failed to restore pre-commit environment from cache"
exit 1
- name: Register flake8 problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/flake8.json"
@@ -314,6 +310,55 @@ jobs:
shopt -s globstar
pre-commit run --hook-stage manual flake8 --files {homeassistant,tests}/components/${{ needs.info.outputs.integrations_glob }}/{*,**/*}
lint-ruff:
name: Check ruff
runs-on: ubuntu-latest
needs:
- info
- pre-commit
steps:
- name: Check out code from GitHub
uses: actions/checkout@v3.3.0
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
uses: actions/setup-python@v4.5.0
id: python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Register ruff problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/ruff.json"
- name: Run ruff (fully)
if: needs.info.outputs.test_full_suite == 'true'
run: |
. venv/bin/activate
pre-commit run --hook-stage manual ruff --all-files
- name: Run ruff (partially)
if: needs.info.outputs.test_full_suite == 'false'
shell: bash
run: |
. venv/bin/activate
shopt -s globstar
pre-commit run --hook-stage manual ruff --files {homeassistant,tests}/components/${{ needs.info.outputs.integrations_glob }}/{*,**/*}
lint-isort:
name: Check isort
runs-on: ubuntu-20.04
@@ -331,30 +376,22 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if pre-commit cache restore failed
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
echo "Failed to restore pre-commit environment from cache"
exit 1
- name: Run isort
run: |
. venv/bin/activate
@@ -377,30 +414,22 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-venv-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore pre-commit environment from cache
id: cache-precommit
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: ${{ env.PRE_COMMIT_CACHE }}
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.pre-commit_cache_key }}
- name: Fail job if pre-commit cache restore failed
if: steps.cache-precommit.outputs.cache-hit != 'true'
run: |
echo "Failed to restore pre-commit environment from cache"
exit 1
- name: Run pyupgrade (fully)
if: needs.info.outputs.test_full_suite == 'true'
@@ -509,7 +538,7 @@ jobs:
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache@v3.2.3
uses: actions/cache@v3.2.4
with:
path: venv
key: >-
@@ -517,7 +546,7 @@ jobs:
needs.info.outputs.python_cache_key }}
- name: Restore pip wheel cache
if: steps.cache-venv.outputs.cache-hit != 'true'
uses: actions/cache@v3.2.3
uses: actions/cache@v3.2.4
with:
path: ${{ env.PIP_CACHE }}
key: >-
@@ -554,6 +583,9 @@ jobs:
hassfest:
name: Check hassfest
runs-on: ubuntu-20.04
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
needs:
- info
- base
@@ -568,17 +600,13 @@ jobs:
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run hassfest
run: |
. venv/bin/activate
@@ -587,6 +615,9 @@ jobs:
gen-requirements-all:
name: Check all requirements
runs-on: ubuntu-20.04
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
needs:
- info
- base
@@ -601,17 +632,13 @@ jobs:
check-latest: true
- name: Restore base Python virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run gen_requirements_all.py
run: |
. venv/bin/activate
@@ -621,6 +648,9 @@ jobs:
name: Check pylint
runs-on: ubuntu-20.04
timeout-minutes: 20
if: |
github.event.inputs.mypy-only != 'true'
|| github.event.inputs.pylint-only == 'true'
needs:
- info
- base
@@ -635,17 +665,13 @@ jobs:
check-latest: true
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register pylint problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
@@ -666,6 +692,9 @@ jobs:
mypy:
name: Check mypy
runs-on: ubuntu-20.04
if: |
github.event.inputs.pylint-only != 'true'
|| github.event.inputs.mypy-only == 'true'
needs:
- info
- base
@@ -678,19 +707,33 @@ jobs:
with:
python-version: ${{ env.DEFAULT_PYTHON }}
check-latest: true
- name: Generate partial mypy restore key
id: generate-mypy-key
run: |
mypy_version=$(cat requirements_test.txt | grep mypy | cut -d '=' -f 3)
echo "version=$mypy_version" >> $GITHUB_OUTPUT
echo "key=mypy-${{ env.MYPY_CACHE_VERSION }}-$mypy_version-${{
env.HA_SHORT_VERSION }}-$(date -u '+%Y-%m-%dT%H:%M:%s')" >> $GITHUB_OUTPUT
- name: Restore full Python ${{ env.DEFAULT_PYTHON }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Restore mypy cache
uses: actions/cache@v3.2.4
with:
path: .mypy_cache
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
steps.generate-mypy-key.outputs.key }}
restore-keys: |
${{ runner.os }}-${{ steps.python.outputs.python-version }}-mypy-${{
env.MYPY_CACHE_VERSION }}-${{ steps.generate-mypy-key.outputs.version }}-${{
env.HA_SHORT_VERSION }}-
- name: Register mypy problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
@@ -710,6 +753,9 @@ jobs:
pip-check:
runs-on: ubuntu-20.04
if: |
github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
needs:
- info
- base
@@ -729,17 +775,13 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: >-
${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Run pip check
run: |
. venv/bin/activate
@@ -750,6 +792,8 @@ jobs:
if: |
(github.event_name != 'push' || github.event.repository.full_name == 'home-assistant/core')
&& github.event.inputs.lint-only != 'true'
&& github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
&& (needs.info.outputs.test_full_suite == 'true' || needs.info.outputs.tests_glob)
needs:
- info
@@ -757,8 +801,9 @@ jobs:
- gen-requirements-all
- hassfest
- lint-black
- lint-other
- lint-isort
- lint-other
- lint-ruff
- mypy
strategy:
fail-fast: false
@@ -784,16 +829,12 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register Python problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
@@ -873,6 +914,8 @@ jobs:
if: |
(github.event_name != 'push' || github.event.repository.full_name == 'home-assistant/core')
&& github.event.inputs.lint-only != 'true'
&& github.event.inputs.pylint-only != 'true'
&& github.event.inputs.mypy-only != 'true'
&& needs.info.outputs.test_full_suite == 'true'
needs:
- info
@@ -880,8 +923,9 @@ jobs:
- gen-requirements-all
- hassfest
- lint-black
- lint-other
- lint-isort
- lint-other
- lint-ruff
- mypy
strategy:
fail-fast: false
@@ -907,16 +951,12 @@ jobs:
check-latest: true
- name: Restore full Python ${{ matrix.python-version }} virtual environment
id: cache-venv
uses: actions/cache/restore@v3.2.3
uses: actions/cache/restore@v3.2.4
with:
path: venv
fail-on-cache-miss: true
key: ${{ runner.os }}-${{ steps.python.outputs.python-version }}-${{
needs.info.outputs.python_cache_key }}
- name: Fail job if Python cache restore failed
if: steps.cache-venv.outputs.cache-hit != 'true'
run: |
echo "Failed to restore Python virtual environment from cache"
exit 1
- name: Register Python problem matcher
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"

30
.github/workflows/matchers/ruff.json vendored Normal file
View File

@@ -0,0 +1,30 @@
{
"problemMatcher": [
{
"owner": "ruff-error",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([EF]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
},
{
"owner": "ruff-warning",
"severity": "warning",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s([CDNW]\\d{3}\\s.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
]
}
]
}

View File

@@ -42,7 +42,7 @@ jobs:
id: token
# Pinned to a specific version of the action for security reasons
# v1.7.0
uses: tibdex/github-app-token@021a2405c7f990db57f5eae5397423dcc554159c
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.ISSUE_TRIAGE_APP_ID }}
private_key: ${{ secrets.ISSUE_TRIAGE_APP_PEM }}

View File

@@ -12,7 +12,7 @@ on:
- "**strings.json"
env:
DEFAULT_PYTHON: 3.9
DEFAULT_PYTHON: "3.10"
jobs:
upload:

View File

@@ -1,9 +1,16 @@
repos:
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.237
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py39-plus]
args: [--py310-plus]
stages: [manual]
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
hooks:
@@ -11,6 +18,7 @@ repos:
args:
- --in-place
- --remove-all-unused-imports
stages: [manual]
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
@@ -41,6 +49,7 @@ repos:
- flake8-noqa==1.3.0
- mccabe==0.7.0
exclude: docs/source/conf.py
stages: [manual]
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
@@ -51,11 +60,11 @@ repos:
- --configfile=tests/bandit.yaml
files: ^(homeassistant|script|tests)/.+\.py$
- repo: https://github.com/PyCQA/isort
rev: 5.11.4
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.4.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
@@ -84,7 +93,7 @@ repos:
- id: python-typing-update
stages: [manual]
args:
- --py39-plus
- --py310-plus
- --force
- --keep-updates
files: ^(homeassistant|tests|script)/.+\.py$

View File

@@ -112,6 +112,7 @@ homeassistant.components.fastdotcom.*
homeassistant.components.feedreader.*
homeassistant.components.file_upload.*
homeassistant.components.filesize.*
homeassistant.components.filter.*
homeassistant.components.fitbit.*
homeassistant.components.flux_led.*
homeassistant.components.forecast_solar.*
@@ -174,6 +175,7 @@ homeassistant.components.jewish_calendar.*
homeassistant.components.kaleidescape.*
homeassistant.components.knx.*
homeassistant.components.kraken.*
homeassistant.components.lacrosse.*
homeassistant.components.lacrosse_view.*
homeassistant.components.lametric.*
homeassistant.components.laundrify.*
@@ -201,6 +203,7 @@ homeassistant.components.mjpeg.*
homeassistant.components.modbus.*
homeassistant.components.modem_callerid.*
homeassistant.components.moon.*
homeassistant.components.mopeka.*
homeassistant.components.mqtt.*
homeassistant.components.mysensors.*
homeassistant.components.nam.*
@@ -222,6 +225,7 @@ homeassistant.components.onewire.*
homeassistant.components.open_meteo.*
homeassistant.components.openexchangerates.*
homeassistant.components.openuv.*
homeassistant.components.otbr.*
homeassistant.components.overkiz.*
homeassistant.components.peco.*
homeassistant.components.persistent_notification.*
@@ -248,12 +252,14 @@ homeassistant.components.ridwell.*
homeassistant.components.rituals_perfume_genie.*
homeassistant.components.roku.*
homeassistant.components.rpi_power.*
homeassistant.components.rss_feed_template.*
homeassistant.components.rtsp_to_webrtc.*
homeassistant.components.ruuvi_gateway.*
homeassistant.components.ruuvitag_ble.*
homeassistant.components.samsungtv.*
homeassistant.components.scene.*
homeassistant.components.schedule.*
homeassistant.components.scrape.*
homeassistant.components.select.*
homeassistant.components.senseme.*
homeassistant.components.sensibo.*

28
.vscode/tasks.json vendored
View File

@@ -27,6 +27,20 @@
},
"problemMatcher": []
},
{
"label": "Pytest (changed tests only)",
"type": "shell",
"command": "pytest --timeout=10 --picked",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Flake8",
"type": "shell",
@@ -41,6 +55,20 @@
},
"problemMatcher": []
},
{
"label": "Ruff",
"type": "shell",
"command": "pre-commit run ruff --all-files",
"group": {
"kind": "test",
"isDefault": true
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"problemMatcher": []
},
{
"label": "Pylint",
"type": "shell",

View File

@@ -67,8 +67,6 @@ build.json @home-assistant/supervisor
/tests/components/alert/ @home-assistant/core @frenck
/homeassistant/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh
/tests/components/alexa/ @home-assistant/cloud @ochlocracy @jbouwh
/homeassistant/components/almond/ @gcampax @balloob
/tests/components/almond/ @gcampax @balloob
/homeassistant/components/amberelectric/ @madpilot
/tests/components/amberelectric/ @madpilot
/homeassistant/components/ambiclimate/ @danielhiversen
@@ -213,8 +211,8 @@ build.json @home-assistant/supervisor
/tests/components/configurator/ @home-assistant/core
/homeassistant/components/control4/ @lawtancool
/tests/components/control4/ @lawtancool
/homeassistant/components/conversation/ @home-assistant/core
/tests/components/conversation/ @home-assistant/core
/homeassistant/components/conversation/ @home-assistant/core @synesthesiam
/tests/components/conversation/ @home-assistant/core @synesthesiam
/homeassistant/components/coolmaster/ @OnFreund
/tests/components/coolmaster/ @OnFreund
/homeassistant/components/coronavirus/ @home-assistant/core
@@ -509,8 +507,8 @@ build.json @home-assistant/supervisor
/tests/components/homematic/ @pvizeli @danielperna84
/homeassistant/components/homewizard/ @DCSBL
/tests/components/homewizard/ @DCSBL
/homeassistant/components/honeywell/ @rdfurman
/tests/components/honeywell/ @rdfurman
/homeassistant/components/honeywell/ @rdfurman @mkmer
/tests/components/honeywell/ @rdfurman @mkmer
/homeassistant/components/http/ @home-assistant/core
/tests/components/http/ @home-assistant/core
/homeassistant/components/huawei_lte/ @scop @fphammerle
@@ -568,8 +566,8 @@ build.json @home-assistant/supervisor
/tests/components/integration/ @dgomes
/homeassistant/components/intellifire/ @jeeftor
/tests/components/intellifire/ @jeeftor
/homeassistant/components/intent/ @home-assistant/core
/tests/components/intent/ @home-assistant/core
/homeassistant/components/intent/ @home-assistant/core @synesthesiam
/tests/components/intent/ @home-assistant/core @synesthesiam
/homeassistant/components/intesishome/ @jnimmo
/homeassistant/components/ios/ @robbiet480
/tests/components/ios/ @robbiet480
@@ -740,6 +738,8 @@ build.json @home-assistant/supervisor
/tests/components/monoprice/ @etsinko @OnFreund
/homeassistant/components/moon/ @fabaff @frenck
/tests/components/moon/ @fabaff @frenck
/homeassistant/components/mopeka/ @bdraco
/tests/components/mopeka/ @bdraco
/homeassistant/components/motion_blinds/ @starkillerOG
/tests/components/motion_blinds/ @starkillerOG
/homeassistant/components/motioneye/ @dermotduffy
@@ -840,6 +840,8 @@ build.json @home-assistant/supervisor
/tests/components/onvif/ @hunterjm
/homeassistant/components/open_meteo/ @frenck
/tests/components/open_meteo/ @frenck
/homeassistant/components/openai_conversation/ @balloob
/tests/components/openai_conversation/ @balloob
/homeassistant/components/openerz/ @misialq
/tests/components/openerz/ @misialq
/homeassistant/components/openexchangerates/ @MartinHjelmare
@@ -855,8 +857,8 @@ build.json @home-assistant/supervisor
/tests/components/openweathermap/ @fabaff @freekode @nzapponi
/homeassistant/components/opnsense/ @mtreinish
/tests/components/opnsense/ @mtreinish
/homeassistant/components/oralb/ @bdraco @conway20
/tests/components/oralb/ @bdraco @conway20
/homeassistant/components/oralb/ @bdraco @Lash-L
/tests/components/oralb/ @bdraco @Lash-L
/homeassistant/components/oru/ @bvlaicu
/homeassistant/components/otbr/ @home-assistant/core
/tests/components/otbr/ @home-assistant/core
@@ -894,8 +896,8 @@ build.json @home-assistant/supervisor
/tests/components/point/ @fredrike
/homeassistant/components/poolsense/ @haemishkyd
/tests/components/poolsense/ @haemishkyd
/homeassistant/components/powerwall/ @bdraco @jrester
/tests/components/powerwall/ @bdraco @jrester
/homeassistant/components/powerwall/ @bdraco @jrester @daniel-simpson
/tests/components/powerwall/ @bdraco @jrester @daniel-simpson
/homeassistant/components/profiler/ @bdraco
/tests/components/profiler/ @bdraco
/homeassistant/components/progettihwsw/ @ardaseremet
@@ -1001,6 +1003,8 @@ build.json @home-assistant/supervisor
/tests/components/ruuvi_gateway/ @akx
/homeassistant/components/ruuvitag_ble/ @akx
/tests/components/ruuvitag_ble/ @akx
/homeassistant/components/rympro/ @OnFreund @elad-bar @maorcc
/tests/components/rympro/ @OnFreund @elad-bar @maorcc
/homeassistant/components/sabnzbd/ @shaiu
/tests/components/sabnzbd/ @shaiu
/homeassistant/components/safe_mode/ @home-assistant/core
@@ -1139,6 +1143,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/stiebel_eltron/ @fucm
/homeassistant/components/stookalert/ @fwestenberg @frenck
/tests/components/stookalert/ @fwestenberg @frenck
/homeassistant/components/stookwijzer/ @fwestenberg
/tests/components/stookwijzer/ @fwestenberg
/homeassistant/components/stream/ @hunterjm @uvjustin @allenporter
/tests/components/stream/ @hunterjm @uvjustin @allenporter
/homeassistant/components/stt/ @pvizeli
@@ -1200,6 +1206,8 @@ build.json @home-assistant/supervisor
/homeassistant/components/thermopro/ @bdraco
/tests/components/thermopro/ @bdraco
/homeassistant/components/thethingsnetwork/ @fabaff
/homeassistant/components/thread/ @home-assistant/core
/tests/components/thread/ @home-assistant/core
/homeassistant/components/threshold/ @fabaff
/tests/components/threshold/ @fabaff
/homeassistant/components/tibber/ @danielhiversen

View File

@@ -5,6 +5,8 @@ FROM ${BUILD_FROM}
ENV \
S6_SERVICES_GRACETIME=220000
ARG QEMU_CPU
WORKDIR /usr/src
## Setup Home Assistant Core dependencies

View File

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

View File

@@ -6,19 +6,39 @@ coverage:
default:
target: 90
threshold: 0.09
config-flows:
required:
target: auto
threshold: 1
paths:
- homeassistant/components/*/config_flow.py
- homeassistant/components/*/device_action.py
- homeassistant/components/*/device_condition.py
- homeassistant/components/*/device_trigger.py
- homeassistant/components/*/diagnostics.py
- homeassistant/components/*/group.py
- homeassistant/components/*/intent.py
- homeassistant/components/*/logbook.py
- homeassistant/components/*/media_source.py
- homeassistant/components/*/recorder.py
- homeassistant/components/*/scene.py
patch:
default:
target: auto
config-flows:
required:
target: 100
threshold: 0
paths:
- homeassistant/components/*/config_flow.py
- homeassistant/components/*/device_action.py
- homeassistant/components/*/device_condition.py
- homeassistant/components/*/device_trigger.py
- homeassistant/components/*/diagnostics.py
- homeassistant/components/*/group.py
- homeassistant/components/*/intent.py
- homeassistant/components/*/logbook.py
- homeassistant/components/*/media_source.py
- homeassistant/components/*/recorder.py
- homeassistant/components/*/scene.py
comment: false
# To make partial tests possible,

View File

@@ -1,21 +1,20 @@
#!/usr/bin/env python3
#
# Home-Assistant documentation build configuration file, created by
# sphinx-quickstart on Sun Aug 28 13:13:10 2016.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
"""Home Assistant documentation build configuration file.
This file is execfile()d with the current directory set to its
containing dir.
Note that not all possible configuration values are present in this
autogenerated file.
All configuration values have a default; values that are commented out
serve to show the default.
If extensions (or modules to document with autodoc) are in another directory,
add these directories to sys.path here. If the directory is relative to the
documentation root, use os.path.abspath to make it absolute, like shown here.
"""
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import inspect
import os
import sys
@@ -110,17 +109,17 @@ def linkcode_resolve(domain, info):
for part in fullname.split("."):
try:
obj = getattr(obj, part)
except:
except Exception: # pylint: disable=broad-except
return None
try:
fn = inspect.getsourcefile(obj)
except:
except Exception: # pylint: disable=broad-except
fn = None
if not fn:
return None
try:
source, lineno = inspect.findsource(obj)
except:
except Exception: # pylint: disable=broad-except
lineno = None
if lineno:
linespec = "#L%d" % (lineno + 1)

View File

@@ -35,7 +35,7 @@ def validate_python() -> None:
def ensure_config_path(config_dir: str) -> None:
"""Validate the configuration directory."""
# pylint: disable=import-outside-toplevel
# pylint: disable-next=import-outside-toplevel
from . import config as config_util
lib_dir = os.path.join(config_dir, "deps")
@@ -77,7 +77,7 @@ def ensure_config_path(config_dir: str) -> None:
def get_arguments() -> argparse.Namespace:
"""Get parsed passed in arguments."""
# pylint: disable=import-outside-toplevel
# pylint: disable-next=import-outside-toplevel
from . import config as config_util
parser = argparse.ArgumentParser(
@@ -184,7 +184,7 @@ def main() -> int:
validate_os()
if args.script is not None:
# pylint: disable=import-outside-toplevel
# pylint: disable-next=import-outside-toplevel
from . import scripts
return scripts.run(args.script)
@@ -192,7 +192,7 @@ def main() -> int:
config_dir = os.path.abspath(os.path.join(os.getcwd(), args.config))
ensure_config_path(config_dir)
# pylint: disable=import-outside-toplevel
# pylint: disable-next=import-outside-toplevel
from . import runner
runtime_conf = runner.RuntimeConfig(

View File

@@ -5,7 +5,7 @@ import asyncio
from collections import OrderedDict
from collections.abc import Mapping
from datetime import timedelta
from typing import Any, Optional, cast
from typing import Any, cast
import jwt
@@ -24,7 +24,7 @@ EVENT_USER_UPDATED = "user_updated"
EVENT_USER_REMOVED = "user_removed"
_MfaModuleDict = dict[str, MultiFactorAuthModule]
_ProviderKey = tuple[str, Optional[str]]
_ProviderKey = tuple[str, str | None]
_ProviderDict = dict[_ProviderKey, AuthProvider]

View File

@@ -1,29 +1,28 @@
"""Common code for permissions."""
from collections.abc import Mapping
from typing import Union
# MyPy doesn't support recursion yet. So writing it out as far as we need.
ValueType = Union[
ValueType = (
# Example: entities.all = { read: true, control: true }
Mapping[str, bool],
bool,
None,
]
Mapping[str, bool]
| bool
| None
)
# Example: entities.domains = { light: … }
SubCategoryDict = Mapping[str, ValueType]
SubCategoryType = Union[SubCategoryDict, bool, None]
SubCategoryType = SubCategoryDict | bool | None
CategoryType = Union[
CategoryType = (
# Example: entities.domains
Mapping[str, SubCategoryType],
Mapping[str, SubCategoryType]
# Example: entities.all
Mapping[str, ValueType],
bool,
None,
]
| Mapping[str, ValueType]
| bool
| None
)
# Example: { entities: … }
PolicyType = Mapping[str, CategoryType]

View File

@@ -3,13 +3,13 @@ from __future__ import annotations
from collections.abc import Callable
from functools import wraps
from typing import Optional, cast
from typing import cast
from .const import SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str], Optional[ValueType]]
LookupFunc = Callable[[PermissionLookup, SubCategoryDict, str], ValueType | None]
SubCatLookupType = dict[str, LookupFunc]

View File

@@ -14,7 +14,7 @@ from ipaddress import (
ip_address,
ip_network,
)
from typing import Any, Union, cast
from typing import Any, cast
import voluptuous as vol
@@ -27,8 +27,8 @@ from . import AUTH_PROVIDER_SCHEMA, AUTH_PROVIDERS, AuthProvider, LoginFlow
from .. import InvalidAuthError
from ..models import Credentials, RefreshToken, UserMeta
IPAddress = Union[IPv4Address, IPv6Address]
IPNetwork = Union[IPv4Network, IPv6Network]
IPAddress = IPv4Address | IPv6Address
IPNetwork = IPv4Network | IPv6Network
CONF_TRUSTED_NETWORKS = "trusted_networks"
CONF_TRUSTED_USERS = "trusted_users"

View File

@@ -346,7 +346,7 @@ def async_enable_logging(
if not log_no_color:
try:
# pylint: disable=import-outside-toplevel
# pylint: disable-next=import-outside-toplevel
from colorlog import ColoredFormatter
# basicConfig must be called after importing colorlog in order to

View File

@@ -3,10 +3,14 @@ from __future__ import annotations
from functools import partial
from abodepy import Abode, AbodeAutomation as AbodeAuto
from abodepy.devices import AbodeDevice as AbodeDev
from abodepy.exceptions import AbodeAuthenticationException, AbodeException
import abodepy.helpers.timeline as TIMELINE
from jaraco.abode.automation import Automation as AbodeAuto
from jaraco.abode.client import Client as Abode
from jaraco.abode.devices.base import Device as AbodeDev
from jaraco.abode.exceptions import (
AuthenticationException as AbodeAuthenticationException,
Exception as AbodeException,
)
from jaraco.abode.helpers.timeline import Groups as GROUPS
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
@@ -26,7 +30,7 @@ from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
from homeassistant.helpers import config_validation as cv, entity
from homeassistant.helpers.dispatcher import dispatcher_send
from .const import ATTRIBUTION, CONF_POLLING, DEFAULT_CACHEDB, DOMAIN, LOGGER
from .const import ATTRIBUTION, CONF_POLLING, DOMAIN, LOGGER
SERVICE_SETTINGS = "change_setting"
SERVICE_CAPTURE_IMAGE = "capture_image"
@@ -82,7 +86,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
username = entry.data[CONF_USERNAME]
password = entry.data[CONF_PASSWORD]
polling = entry.data[CONF_POLLING]
cache = hass.config.path(DEFAULT_CACHEDB)
# For previous config entries where unique_id is None
if entry.unique_id is None:
@@ -92,7 +95,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
try:
abode = await hass.async_add_executor_job(
Abode, username, password, True, True, True, cache
Abode, username, password, True, True, True
)
except AbodeAuthenticationException as ex:
@@ -225,17 +228,17 @@ def setup_abode_events(hass: HomeAssistant) -> None:
hass.bus.fire(event, data)
events = [
TIMELINE.ALARM_GROUP,
TIMELINE.ALARM_END_GROUP,
TIMELINE.PANEL_FAULT_GROUP,
TIMELINE.PANEL_RESTORE_GROUP,
TIMELINE.AUTOMATION_GROUP,
TIMELINE.DISARM_GROUP,
TIMELINE.ARM_GROUP,
TIMELINE.ARM_FAULT_GROUP,
TIMELINE.TEST_GROUP,
TIMELINE.CAPTURE_GROUP,
TIMELINE.DEVICE_GROUP,
GROUPS.ALARM,
GROUPS.ALARM_END,
GROUPS.PANEL_FAULT,
GROUPS.PANEL_RESTORE,
GROUPS.AUTOMATION,
GROUPS.DISARM,
GROUPS.ARM,
GROUPS.ARM_FAULT,
GROUPS.TEST,
GROUPS.CAPTURE,
GROUPS.DEVICE,
]
for event in events:

View File

@@ -1,7 +1,7 @@
"""Support for Abode Security System alarm control panels."""
from __future__ import annotations
from abodepy.devices.alarm import AbodeAlarm as AbodeAl
from jaraco.abode.devices.alarm import Alarm as AbodeAl
import homeassistant.components.alarm_control_panel as alarm
from homeassistant.components.alarm_control_panel import AlarmControlPanelEntityFeature

View File

@@ -4,8 +4,8 @@ from __future__ import annotations
from contextlib import suppress
from typing import cast
from abodepy.devices.binary_sensor import AbodeBinarySensor as ABBinarySensor
import abodepy.helpers.constants as CONST
from jaraco.abode.devices.sensor import BinarySensor as ABBinarySensor
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,

View File

@@ -4,9 +4,9 @@ from __future__ import annotations
from datetime import timedelta
from typing import Any, cast
from abodepy.devices import CONST, AbodeDevice as AbodeDev
from abodepy.devices.camera import AbodeCamera as AbodeCam
import abodepy.helpers.timeline as TIMELINE
from jaraco.abode.devices.base import Device as AbodeDev
from jaraco.abode.devices.camera import Camera as AbodeCam
from jaraco.abode.helpers import constants as CONST, timeline as TIMELINE
import requests
from requests.models import Response
@@ -30,7 +30,7 @@ async def async_setup_entry(
data: AbodeSystem = hass.data[DOMAIN]
async_add_entities(
AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE)
AbodeCamera(data, device, TIMELINE.CAPTURE_IMAGE) # pylint: disable=no-member
for device in data.abode.get_devices(generic_type=CONST.TYPE_CAMERA)
)

View File

@@ -5,9 +5,12 @@ from collections.abc import Mapping
from http import HTTPStatus
from typing import Any, cast
from abodepy import Abode
from abodepy.exceptions import AbodeAuthenticationException, AbodeException
from abodepy.helpers.errors import MFA_CODE_REQUIRED
from jaraco.abode.client import Client as Abode
from jaraco.abode.exceptions import (
AuthenticationException as AbodeAuthenticationException,
Exception as AbodeException,
)
from jaraco.abode.helpers.errors import MFA_CODE_REQUIRED
from requests.exceptions import ConnectTimeout, HTTPError
import voluptuous as vol
@@ -15,7 +18,7 @@ from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.data_entry_flow import FlowResult
from .const import CONF_POLLING, DEFAULT_CACHEDB, DOMAIN, LOGGER
from .const import CONF_POLLING, DOMAIN, LOGGER
CONF_MFA = "mfa_code"
@@ -35,7 +38,6 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
vol.Required(CONF_MFA): str,
}
self._cache: str | None = None
self._mfa_code: str | None = None
self._password: str | None = None
self._polling: bool = False
@@ -43,12 +45,11 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
async def _async_abode_login(self, step_id: str) -> FlowResult:
"""Handle login with Abode."""
self._cache = self.hass.config.path(DEFAULT_CACHEDB)
errors = {}
try:
await self.hass.async_add_executor_job(
Abode, self._username, self._password, True, False, False, self._cache
Abode, self._username, self._password, True, False, False
)
except AbodeException as ex:
@@ -77,12 +78,7 @@ class AbodeFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle multi-factor authentication (MFA) login with Abode."""
try:
# Create instance to access login method for passing MFA code
abode = Abode(
auto_login=False,
get_devices=False,
get_automations=False,
cache_path=self._cache,
)
abode = Abode(auto_login=False, get_devices=False, get_automations=False)
await self.hass.async_add_executor_job(
abode.login, self._username, self._password, self._mfa_code
)

View File

@@ -6,5 +6,4 @@ LOGGER = logging.getLogger(__package__)
DOMAIN = "abode"
ATTRIBUTION = "Data provided by goabode.com"
DEFAULT_CACHEDB = "abodepy_cache.pickle"
CONF_POLLING = "polling"

View File

@@ -1,8 +1,8 @@
"""Support for Abode Security System covers."""
from typing import Any
from abodepy.devices.cover import AbodeCover as AbodeCV
import abodepy.helpers.constants as CONST
from jaraco.abode.devices.cover import Cover as AbodeCV
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.cover import CoverEntity
from homeassistant.config_entries import ConfigEntry

View File

@@ -4,8 +4,8 @@ from __future__ import annotations
from math import ceil
from typing import Any
from abodepy.devices.light import AbodeLight as AbodeLT
import abodepy.helpers.constants as CONST
from jaraco.abode.devices.light import Light as AbodeLT
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.light import (
ATTR_BRIGHTNESS,

View File

@@ -1,8 +1,8 @@
"""Support for the Abode Security System locks."""
from typing import Any
from abodepy.devices.lock import AbodeLock as AbodeLK
import abodepy.helpers.constants as CONST
from jaraco.abode.devices.lock import Lock as AbodeLK
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.lock import LockEntity
from homeassistant.config_entries import ConfigEntry

View File

@@ -3,11 +3,11 @@
"name": "Abode",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/abode",
"requirements": ["abodepy==1.2.0"],
"requirements": ["jaraco.abode==3.2.1"],
"codeowners": ["@shred86"],
"homekit": {
"models": ["Abode", "Iota"]
},
"iot_class": "cloud_push",
"loggers": ["abodepy", "lomond"]
"loggers": ["jaraco.abode", "lomond"]
}

View File

@@ -3,7 +3,8 @@ from __future__ import annotations
from typing import cast
from abodepy.devices.sensor import CONST, AbodeSensor as AbodeSense
from jaraco.abode.devices.sensor import Sensor as AbodeSense
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.sensor import (
SensorDeviceClass,

View File

@@ -3,7 +3,8 @@ from __future__ import annotations
from typing import Any, cast
from abodepy.devices.switch import CONST, AbodeSwitch as AbodeSW
from jaraco.abode.devices.switch import Switch as AbodeSW
from jaraco.abode.helpers import constants as CONST
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry

View File

@@ -2,7 +2,7 @@
"config": {
"abort": {
"reauth_successful": "\u041f\u043e\u0432\u0442\u043e\u0440\u043d\u0430\u0442\u0430 \u0430\u0432\u0442\u0435\u043d\u0442\u0438\u043a\u0430\u0446\u0438\u044f \u0431\u0435\u0448\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u0430",
"single_instance_allowed": "\u0420\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u043d\u0430 Abode."
"single_instance_allowed": "\u0412\u0435\u0447\u0435 \u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d\u043e. \u0412\u044a\u0437\u043c\u043e\u0436\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f."
},
"error": {
"cannot_connect": "\u041d\u0435\u0443\u0441\u043f\u0435\u0445 \u043f\u0440\u0438 \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435"

View File

@@ -17,10 +17,10 @@ from homeassistant.const import (
PERCENTAGE,
UV_INDEX,
UnitOfLength,
UnitOfPrecipitationDepth,
UnitOfSpeed,
UnitOfTemperature,
UnitOfTime,
UnitOfVolumetricFlux,
)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -248,7 +248,8 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
state_class=SensorStateClass.MEASUREMENT,
metric_unit=UnitOfLength.METERS,
us_customary_unit=UnitOfLength.FEET,
value_fn=lambda data, unit: round(cast(float, data[unit][ATTR_VALUE])),
value_fn=lambda data, unit: cast(float, data[unit][ATTR_VALUE]),
native_precision=0,
),
AccuWeatherSensorDescription(
key="CloudCover",
@@ -290,18 +291,20 @@ SENSOR_TYPES: tuple[AccuWeatherSensorDescription, ...] = (
),
AccuWeatherSensorDescription(
key="Precipitation",
device_class=SensorDeviceClass.PRECIPITATION,
device_class=SensorDeviceClass.PRECIPITATION_INTENSITY,
name="Precipitation",
state_class=SensorStateClass.MEASUREMENT,
metric_unit=UnitOfPrecipitationDepth.MILLIMETERS,
us_customary_unit=UnitOfPrecipitationDepth.INCHES,
metric_unit=UnitOfVolumetricFlux.MILLIMETERS_PER_HOUR,
us_customary_unit=UnitOfVolumetricFlux.INCHES_PER_HOUR,
value_fn=lambda data, unit: cast(float, data[unit][ATTR_VALUE]),
attr_fn=lambda data: {"type": data["PrecipitationType"]},
),
AccuWeatherSensorDescription(
key="PressureTendency",
device_class=SensorDeviceClass.ENUM,
icon="mdi:gauge",
name="Pressure tendency",
options=["falling", "rising", "steady"],
translation_key="pressure_tendency",
value_fn=lambda data, _: cast(str, data["LocalizedText"]).lower(),
),
@@ -452,7 +455,7 @@ def _get_sensor_data(
return sensors[ATTR_FORECAST][forecast_day][kind]
if kind == "Precipitation":
return sensors["PrecipitationSummary"][kind]
return sensors["PrecipitationSummary"]["PastHour"]
return sensors[kind]

View File

@@ -1,5 +1,8 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
},
"step": {
"cloud": {
"data": {

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -1,4 +1,6 @@
"""Config flow to configure Agent devices."""
from contextlib import suppress
from agent import AgentConnectionError, AgentError
from agent.a import Agent
import voluptuous as vol
@@ -31,10 +33,8 @@ class AgentFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
server_origin = generate_url(host, port)
agent_client = Agent(server_origin, async_get_clientsession(self.hass))
try:
with suppress(AgentConnectionError, AgentError):
await agent_client.update()
except (AgentConnectionError, AgentError):
pass
await agent_client.close()

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -3,7 +3,7 @@ from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any, cast
from typing import Any
from homeassistant.components.sensor import (
SensorDeviceClass,
@@ -19,11 +19,10 @@ from homeassistant.const import (
UnitOfPressure,
UnitOfTemperature,
)
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import AirlyDataUpdateCoordinator
@@ -62,7 +61,7 @@ PARALLEL_UPDATES = 1
class AirlySensorEntityDescription(SensorEntityDescription):
"""Class describing Airly sensor entities."""
value: Callable = round
attrs: Callable[[dict[str, Any]], dict[str, Any]] = lambda data: {}
SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
@@ -70,12 +69,19 @@ SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
key=ATTR_API_CAQI,
icon="mdi:air-filter",
name=ATTR_API_CAQI,
native_precision=0,
native_unit_of_measurement="CAQI",
attrs=lambda data: {
ATTR_LEVEL: data[ATTR_API_CAQI_LEVEL],
ATTR_ADVICE: data[ATTR_API_ADVICE],
ATTR_DESCRIPTION: data[ATTR_API_CAQI_DESCRIPTION],
},
),
AirlySensorEntityDescription(
key=ATTR_API_PM1,
device_class=SensorDeviceClass.PM1,
name=ATTR_API_PM1,
name="PM1.0",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
),
@@ -83,28 +89,39 @@ SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
key=ATTR_API_PM25,
device_class=SensorDeviceClass.PM25,
name="PM2.5",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_PM25}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_PM25}_{SUFFIX_PERCENT}"]),
},
),
AirlySensorEntityDescription(
key=ATTR_API_PM10,
device_class=SensorDeviceClass.PM10,
name=ATTR_API_PM10,
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_PM10}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_PM10}_{SUFFIX_PERCENT}"]),
},
),
AirlySensorEntityDescription(
key=ATTR_API_HUMIDITY,
device_class=SensorDeviceClass.HUMIDITY,
name=ATTR_API_HUMIDITY.capitalize(),
native_precision=1,
native_unit_of_measurement=PERCENTAGE,
state_class=SensorStateClass.MEASUREMENT,
value=lambda value: round(value, 1),
),
AirlySensorEntityDescription(
key=ATTR_API_PRESSURE,
device_class=SensorDeviceClass.PRESSURE,
name=ATTR_API_PRESSURE.capitalize(),
native_precision=0,
native_unit_of_measurement=UnitOfPressure.HPA,
state_class=SensorStateClass.MEASUREMENT,
),
@@ -112,36 +129,56 @@ SENSOR_TYPES: tuple[AirlySensorEntityDescription, ...] = (
key=ATTR_API_TEMPERATURE,
device_class=SensorDeviceClass.TEMPERATURE,
name=ATTR_API_TEMPERATURE.capitalize(),
native_precision=1,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
state_class=SensorStateClass.MEASUREMENT,
value=lambda value: round(value, 1),
),
AirlySensorEntityDescription(
key=ATTR_API_CO,
name=ATTR_API_CO,
name="Carbon monoxide",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_CO}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_CO}_{SUFFIX_PERCENT}"]),
},
),
AirlySensorEntityDescription(
key=ATTR_API_NO2,
device_class=SensorDeviceClass.NITROGEN_DIOXIDE,
name=ATTR_API_NO2,
name="Nitrogen dioxide",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_NO2}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_NO2}_{SUFFIX_PERCENT}"]),
},
),
AirlySensorEntityDescription(
key=ATTR_API_SO2,
device_class=SensorDeviceClass.SULPHUR_DIOXIDE,
name=ATTR_API_SO2,
name="Sulphur dioxide",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_SO2}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_SO2}_{SUFFIX_PERCENT}"]),
},
),
AirlySensorEntityDescription(
key=ATTR_API_O3,
device_class=SensorDeviceClass.OZONE,
name=ATTR_API_O3,
name="Ozone",
native_precision=0,
native_unit_of_measurement=CONCENTRATION_MICROGRAMS_PER_CUBIC_METER,
state_class=SensorStateClass.MEASUREMENT,
attrs=lambda data: {
ATTR_LIMIT: data[f"{ATTR_API_O3}_{SUFFIX_LIMIT}"],
ATTR_PERCENT: round(data[f"{ATTR_API_O3}_{SUFFIX_PERCENT}"]),
},
),
)
@@ -190,64 +227,15 @@ class AirlySensor(CoordinatorEntity[AirlyDataUpdateCoordinator], SensorEntity):
self._attr_unique_id = (
f"{coordinator.latitude}-{coordinator.longitude}-{description.key}".lower()
)
self._attrs: dict[str, Any] = {}
self._attr_native_value = coordinator.data[description.key]
self._attr_extra_state_attributes = description.attrs(coordinator.data)
self.entity_description = description
@property
def native_value(self) -> StateType:
"""Return the state."""
state = self.coordinator.data[self.entity_description.key]
return cast(StateType, self.entity_description.value(state))
@property
def extra_state_attributes(self) -> dict[str, Any]:
"""Return the state attributes."""
if self.entity_description.key == ATTR_API_CAQI:
self._attrs[ATTR_LEVEL] = self.coordinator.data[ATTR_API_CAQI_LEVEL]
self._attrs[ATTR_ADVICE] = self.coordinator.data[ATTR_API_ADVICE]
self._attrs[ATTR_DESCRIPTION] = self.coordinator.data[
ATTR_API_CAQI_DESCRIPTION
]
if self.entity_description.key == ATTR_API_PM25:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_PM25}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_PM25}_{SUFFIX_PERCENT}"]
)
if self.entity_description.key == ATTR_API_PM10:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_PM10}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_PM10}_{SUFFIX_PERCENT}"]
)
if self.entity_description.key == ATTR_API_CO:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_CO}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_CO}_{SUFFIX_PERCENT}"]
)
if self.entity_description.key == ATTR_API_NO2:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_NO2}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_NO2}_{SUFFIX_PERCENT}"]
)
if self.entity_description.key == ATTR_API_SO2:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_SO2}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_SO2}_{SUFFIX_PERCENT}"]
)
if self.entity_description.key == ATTR_API_O3:
self._attrs[ATTR_LIMIT] = self.coordinator.data[
f"{ATTR_API_O3}_{SUFFIX_LIMIT}"
]
self._attrs[ATTR_PERCENT] = round(
self.coordinator.data[f"{ATTR_API_O3}_{SUFFIX_PERCENT}"]
)
return self._attrs
@callback
def _handle_coordinator_update(self) -> None:
"""Handle updated data from the coordinator."""
self._attr_native_value = self.coordinator.data[self.entity_description.key]
self._attr_extra_state_attributes = self.entity_description.attrs(
self.coordinator.data
)
self.async_write_ha_state()

View File

@@ -12,8 +12,8 @@
"data": {
"api_key": "API \u043a\u043b\u044e\u0447 \u0437\u0430 Airly",
"latitude": "\u0428\u0438\u0440\u0438\u043d\u0430",
"longitude": "\u0414\u044a\u043b\u0436\u0438\u043d\u0430",
"name": "\u0418\u043c\u0435 \u043d\u0430 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f\u0442\u0430"
"longitude": "\u0413\u0435\u043e\u0433\u0440\u0430\u0444\u0441\u043a\u0430 \u0434\u044a\u043b\u0436\u0438\u043d\u0430",
"name": "\u0418\u043c\u0435"
},
"description": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0430\u043d\u0435 \u043d\u0430 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u043e\u0442\u043e \u043d\u0430 \u0432\u044a\u0437\u0434\u0443\u0445\u0430 Airly \u0417\u0430 \u0434\u0430 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0430\u0442\u0435 \u043a\u043b\u044e\u0447 \u0437\u0430 API, \u043e\u0442\u0438\u0434\u0435\u0442\u0435 \u043d\u0430 https://developer.airly.eu/register"
}

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -0,0 +1,12 @@
{
"config": {
"step": {
"user": {
"data": {
"ip_address": "IP-adress",
"password": "L\u00f6senord"
}
}
}
}
}

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -266,8 +266,12 @@ async def async_migrate_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": source},
data={CONF_API_KEY: entry.data[CONF_API_KEY], **geography},
context={"source": SOURCE_IMPORT},
data={
"import_source": source,
CONF_API_KEY: entry.data[CONF_API_KEY],
**geography,
},
)
)

View File

@@ -171,6 +171,13 @@ class AirVisualFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Define the config flow to handle options."""
return SchemaOptionsFlowHandler(config_entry, OPTIONS_FLOW)
async def async_step_import(self, import_data: dict[str, str]) -> FlowResult:
"""Handle import of config entry version 1 data."""
import_source = import_data.pop("import_source")
if import_source == "geography_by_coords":
return await self.async_step_geography_by_coords(import_data)
return await self.async_step_geography_by_name(import_data)
async def async_step_geography_by_coords(
self, user_input: dict[str, str] | None = None
) -> FlowResult:

View File

@@ -22,12 +22,6 @@
"country": "\u0421\u0442\u0440\u0430\u043d\u0430"
}
},
"node_pro": {
"data": {
"ip_address": "\u0425\u043e\u0441\u0442",
"password": "\u041f\u0430\u0440\u043e\u043b\u0430"
}
},
"reauth_confirm": {
"data": {
"api_key": "API \u043a\u043b\u044e\u0447"

View File

@@ -30,14 +30,6 @@
"description": "Utilitza l'API d'AirVisual per monitoritzar un/a ciutat/estat/pa\u00eds",
"title": "Configura una ubicaci\u00f3 geogr\u00e0fica"
},
"node_pro": {
"data": {
"ip_address": "Amfitri\u00f3",
"password": "Contrasenya"
},
"description": "Monitoritza una unitat personal d'AirVisual. Pots obtenir la contrasenya des de la interf\u00edcie d'usuari (UI) de la unitat.",
"title": "Configuraci\u00f3 d'AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Clau API"

View File

@@ -24,13 +24,6 @@
"country": "Zem\u011b"
}
},
"node_pro": {
"data": {
"ip_address": "Hostitel",
"password": "Heslo"
},
"title": "Nastaven\u00ed AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Kl\u00ed\u010d API"

View File

@@ -30,14 +30,6 @@
"description": "Verwende die AirVisual Cloud API, um ein(e) Stadt/Bundesland/Land zu \u00fcberwachen.",
"title": "Konfiguriere einen Standort"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Passwort"
},
"description": "\u00dcberwache eine pers\u00f6nliche AirVisual-Einheit. Das Passwort kann von der Benutzeroberfl\u00e4che des Ger\u00e4ts abgerufen werden.",
"title": "Konfiguriere einen AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API-Schl\u00fcssel"

View File

@@ -30,14 +30,6 @@
"description": "\u03a7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03ae\u03c3\u03c4\u03b5 \u03c4\u03bf AirVisual cloud API \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03c0\u03b1\u03c1\u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03b5\u03af\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03c0\u03cc\u03bb\u03b7/\u03c0\u03bf\u03bb\u03b9\u03c4\u03b5\u03af\u03b1/\u03c7\u03ce\u03c1\u03b1.",
"title": "\u0394\u03b9\u03b1\u03bc\u03cc\u03c1\u03c6\u03c9\u03c3\u03b7 \u03b3\u03b5\u03c9\u03b3\u03c1\u03b1\u03c6\u03af\u03b1\u03c2"
},
"node_pro": {
"data": {
"ip_address": "\u039a\u03b5\u03bd\u03c4\u03c1\u03b9\u03ba\u03cc\u03c2 \u03c5\u03c0\u03bf\u03bb\u03bf\u03b3\u03b9\u03c3\u03c4\u03ae\u03c2",
"password": "\u039a\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2"
},
"description": "\u03a0\u03b1\u03c1\u03b1\u03ba\u03bf\u03bb\u03bf\u03c5\u03b8\u03ae\u03c3\u03c4\u03b5 \u03bc\u03b9\u03b1 \u03c0\u03c1\u03bf\u03c3\u03c9\u03c0\u03b9\u03ba\u03ae \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1 AirVisual. \u039f \u03ba\u03c9\u03b4\u03b9\u03ba\u03cc\u03c2 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7\u03c2 \u03bc\u03c0\u03bf\u03c1\u03b5\u03af \u03bd\u03b1 \u03b1\u03bd\u03b1\u03ba\u03c4\u03b7\u03b8\u03b5\u03af \u03b1\u03c0\u03cc \u03c4\u03bf UI \u03c4\u03b7\u03c2 \u03bc\u03bf\u03bd\u03ac\u03b4\u03b1\u03c2.",
"title": "\u0394\u03b9\u03b1\u03bc\u03cc\u03c1\u03c6\u03c9\u03c3\u03b7 \u03b5\u03bd\u03cc\u03c2 \u03ba\u03cc\u03bc\u03b2\u03bf\u03c5 AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "\u039a\u03bb\u03b5\u03b9\u03b4\u03af API"

View File

@@ -30,14 +30,6 @@
"description": "Use the AirVisual cloud API to monitor a city/state/country.",
"title": "Configure a Geography"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Password"
},
"description": "Monitor a personal AirVisual unit. The password can be retrieved from the unit's UI.",
"title": "Configure an AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API Key"

View File

@@ -22,14 +22,6 @@
"description": "Utilice la API en la nube de AirVisual para monitorear una ciudad/estado/pa\u00eds.",
"title": "Configurar una geograf\u00eda"
},
"node_pro": {
"data": {
"ip_address": "Direcci\u00f3n IP/nombre de host de la unidad",
"password": "Contrase\u00f1a de la unidad"
},
"description": "Monitoree una unidad AirVisual personal. La contrase\u00f1a se puede recuperar de la interfaz de usuario de la unidad.",
"title": "Configurar un AirVisual Node/Pro"
},
"reauth_confirm": {
"title": "Vuelva a autenticar AirVisual"
},

View File

@@ -30,14 +30,6 @@
"description": "Usar la API de la nube de AirVisual para supervisar una ciudad/estado/pa\u00eds.",
"title": "Configurar una geograf\u00eda"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Contrase\u00f1a"
},
"description": "Supervisar una unidad AirVisual personal. La contrase\u00f1a se puede recuperar desde la IU de la unidad.",
"title": "Configurar un AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Clave API"

View File

@@ -30,14 +30,6 @@
"description": "Kasuta AirVisual pilve API-t linna/osariigi/riigi j\u00e4lgimiseks.",
"title": "Seadista Geography sidumine"
},
"node_pro": {
"data": {
"ip_address": "\u00dcksuse IP-aadress / hostinimi",
"password": "Salas\u00f5na"
},
"description": "J\u00e4lgige isiklikku AirVisual-seadet. Parooli saab hankida seadme kasutajaliidese kaudu.",
"title": "Seadistage AirVisual Node / Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API v\u00f5ti"

View File

@@ -2,13 +2,6 @@
"config": {
"error": {
"general_error": "Tapahtui tuntematon virhe."
},
"step": {
"node_pro": {
"data": {
"password": "Salasana"
}
}
}
}
}

View File

@@ -30,14 +30,6 @@
"description": "Utilisez l'API cloud AirVisual pour surveiller une ville / un \u00e9tat / un pays.",
"title": "Configurer un lieu g\u00e9ographique"
},
"node_pro": {
"data": {
"ip_address": "H\u00f4te",
"password": "Mot de passe"
},
"description": "Surveillez une unit\u00e9 personnelle AirVisual. Le mot de passe peut \u00eatre r\u00e9cup\u00e9r\u00e9 dans l'interface utilisateur de l'unit\u00e9.",
"title": "Configurer un noeud AirVisual Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Cl\u00e9 d'API"

View File

@@ -22,13 +22,6 @@
"api_key": "\u05de\u05e4\u05ea\u05d7 API"
}
},
"node_pro": {
"data": {
"ip_address": "\u05de\u05d0\u05e8\u05d7",
"password": "\u05e1\u05d9\u05e1\u05de\u05d4"
},
"description": "\u05e2\u05e7\u05d5\u05d1 \u05d0\u05d7\u05e8 \u05d9\u05d7\u05d9\u05d3\u05ea AirVisual \u05d0\u05d9\u05e9\u05d9\u05ea. \u05e0\u05d9\u05ea\u05df \u05dc\u05d0\u05d7\u05d6\u05e8 \u05d0\u05ea \u05d4\u05e1\u05d9\u05e1\u05de\u05d4 \u05de\u05de\u05e9\u05e7 \u05d4\u05de\u05e9\u05ea\u05de\u05e9 \u05e9\u05dc \u05d4\u05d9\u05d7\u05d9\u05d3\u05d4."
},
"reauth_confirm": {
"data": {
"api_key": "\u05de\u05e4\u05ea\u05d7 API"

View File

@@ -2,16 +2,6 @@
"config": {
"error": {
"general_error": "\u0915\u094b\u0908 \u0905\u091c\u094d\u091e\u093e\u0924 \u0924\u094d\u0930\u0941\u091f\u093f \u0925\u0940\u0964"
},
"step": {
"node_pro": {
"data": {
"ip_address": "\u0907\u0915\u093e\u0908 \u0915\u0947 \u0906\u0908\u092a\u0940 \u092a\u0924\u0947/\u0939\u094b\u0938\u094d\u091f\u0928\u093e\u092e",
"password": "\u0907\u0915\u093e\u0908 \u092a\u093e\u0938\u0935\u0930\u094d\u0921"
},
"description": "\u090f\u0915 \u0935\u094d\u092f\u0915\u094d\u0924\u093f\u0917\u0924 \u090f\u092f\u0930\u0935\u093f\u091c\u0941\u0905\u0932 \u0907\u0915\u093e\u0908 \u0915\u0940 \u0928\u093f\u0917\u0930\u093e\u0928\u0940 \u0915\u0930\u0947\u0902\u0964 \u092a\u093e\u0938\u0935\u0930\u094d\u0921 \u092f\u0942\u0928\u093f\u091f \u0915\u0947 \u092f\u0942\u0906\u0908 \u0938\u0947 \u092a\u094d\u0930\u093e\u092a\u094d\u0924 \u0915\u093f\u092f\u093e \u091c\u093e \u0938\u0915\u0924\u093e \u0939\u0948\u0964",
"title": "\u090f\u092f\u0930\u0935\u093f\u091c\u0941\u0905\u0932 \u0928\u094b\u0921 \u092a\u094d\u0930\u094b"
}
}
}
}

View File

@@ -30,14 +30,6 @@
"description": "Haszn\u00e1lja az AirVisual felh\u0151 API-t egy v\u00e1ros / \u00e1llam / orsz\u00e1g figyel\u00e9s\u00e9hez.",
"title": "Konfigur\u00e1lja a geogr\u00e1fi\u00e1t"
},
"node_pro": {
"data": {
"ip_address": "C\u00edm",
"password": "Jelsz\u00f3"
},
"description": "Szem\u00e9lyes AirVisual egys\u00e9g figyel\u00e9se. A jelsz\u00f3 lek\u00e9rhet\u0151 a k\u00e9sz\u00fcl\u00e9k felhaszn\u00e1l\u00f3i fel\u00fclet\u00e9r\u0151l.",
"title": "AirVisual Node/Pro konfigur\u00e1l\u00e1sa"
},
"reauth_confirm": {
"data": {
"api_key": "API kulcs"

View File

@@ -30,14 +30,6 @@
"description": "Gunakan API cloud AirVisual untuk memantau kota/negara bagian/negara.",
"title": "Konfigurasikan Lokasi Geografi"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Kata Sandi"
},
"description": "Pantau unit AirVisual pribadi. Kata sandi dapat diambil dari antarmuka unit.",
"title": "Konfigurasikan AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Kunci API"

View File

@@ -30,14 +30,6 @@
"description": "Usa l'API cloud di AirVisual per monitorare una citt\u00e0/stato/paese.",
"title": "Configura un'area geografica"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Password"
},
"description": "Monitora un'unit\u00e0 AirVisual personale. La password pu\u00f2 essere recuperata dall'interfaccia utente dell'unit\u00e0.",
"title": "Configura un AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Chiave API"

View File

@@ -30,14 +30,6 @@
"description": "AirVisual cloud API\u3092\u4f7f\u7528\u3057\u3066\u3001\u90fd\u5e02/\u5dde/\u56fd\u3092\u76e3\u8996\u3057\u307e\u3059\u3002",
"title": "Geography\u306e\u8a2d\u5b9a"
},
"node_pro": {
"data": {
"ip_address": "\u30db\u30b9\u30c8",
"password": "\u30d1\u30b9\u30ef\u30fc\u30c9"
},
"description": "\u500b\u4eba\u306eAirVisual\u30e6\u30cb\u30c3\u30c8\u3092\u76e3\u8996\u3057\u307e\u3059\u3002\u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u3001\u672c\u4f53\u306eUI\u304b\u3089\u53d6\u5f97\u3067\u304d\u307e\u3059\u3002",
"title": "AirVisual Node/Pro\u306e\u8a2d\u5b9a"
},
"reauth_confirm": {
"data": {
"api_key": "API\u30ad\u30fc"

View File

@@ -30,14 +30,6 @@
"description": "AirVisual \ud074\ub77c\uc6b0\ub4dc API\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub3c4\uc2dc/\uc8fc/\uad6d\uac00\ub97c \ubaa8\ub2c8\ud130\ub9c1\ud569\ub2c8\ub2e4.",
"title": "\uc9c0\ub9ac\uc801 \uc704\uce58 \uad6c\uc131\ud558\uae30"
},
"node_pro": {
"data": {
"ip_address": "\ud638\uc2a4\ud2b8",
"password": "\ube44\ubc00\ubc88\ud638"
},
"description": "\uc0ac\uc6a9\uc790\uc758 AirVisual \uae30\uae30\ub97c \ubaa8\ub2c8\ud130\ub9c1\ud569\ub2c8\ub2e4. \uae30\uae30\uc758 UI \uc5d0\uc11c \ube44\ubc00\ubc88\ud638\ub97c \ucc3e\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.",
"title": "AirVisual Node/Pro \uad6c\uc131\ud558\uae30"
},
"reauth_confirm": {
"data": {
"api_key": "API \ud0a4"

View File

@@ -18,14 +18,6 @@
"state": "Kanton"
}
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Passwuert"
},
"description": "Pers\u00e9inlech Airvisual Unit\u00e9it iwwerwaachen. Passwuert kann vum UI vum Apparat ausgelies ginn.",
"title": "Airvisual Node/Pro ariichten"
},
"reauth_confirm": {
"data": {
"api_key": "API Schl\u00ebssel"

View File

@@ -30,14 +30,6 @@
"description": "Gebruik de AirVisual-cloud-API om een stad/staat/land te bewaken.",
"title": "Configureer een geografie"
},
"node_pro": {
"data": {
"ip_address": "Host",
"password": "Wachtwoord"
},
"description": "Monitor een persoonlijke AirVisual-eenheid. Het wachtwoord kan worden opgehaald uit de gebruikersinterface van het apparaat.",
"title": "Configureer een AirVisual Node / Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API-sleutel"

View File

@@ -30,14 +30,6 @@
"description": "Bruk AirVisual cloud API til \u00e5 overv\u00e5ke en by/stat/land.",
"title": "Konfigurer en Geography"
},
"node_pro": {
"data": {
"ip_address": "Vert",
"password": "Passord"
},
"description": "Overv\u00e5ke en personlig AirVisual-enhet. Passordet kan hentes fra enhetens brukergrensesnitt.",
"title": "Konfigurer en AirVisual Node / Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API-n\u00f8kkel"

View File

@@ -30,14 +30,6 @@
"description": "U\u017cyj API chmury AirVisual do monitorowania miasta/stanu/kraju.",
"title": "Konfiguracja Geography"
},
"node_pro": {
"data": {
"ip_address": "Nazwa hosta lub adres IP",
"password": "Has\u0142o"
},
"description": "Monitoruj jednostk\u0119 AirVisual. Has\u0142o mo\u017cna odzyska\u0107 z interfejsu u\u017cytkownika urz\u0105dzenia.",
"title": "Konfiguracja AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "Klucz API"

View File

@@ -30,14 +30,6 @@
"description": "Use a API de nuvem AirVisual para monitorar uma cidade/estado/pa\u00eds.",
"title": "Configurar uma geografia"
},
"node_pro": {
"data": {
"ip_address": "Nome do host",
"password": "Senha"
},
"description": "Monitore uma unidade AirVisual pessoal. A senha pode ser recuperada da interface do usu\u00e1rio da unidade.",
"title": "Configurar um n\u00f3/pro AirVisual"
},
"reauth_confirm": {
"data": {
"api_key": "Chave da API"

View File

@@ -15,12 +15,6 @@
"latitude": "Latitude"
}
},
"node_pro": {
"data": {
"ip_address": "Endere\u00e7o",
"password": "Palavra-passe"
}
},
"reauth_confirm": {
"data": {
"api_key": "Chave da API"

View File

@@ -30,14 +30,6 @@
"description": "\u0414\u043b\u044f \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433\u0430 \u0433\u043e\u0440\u043e\u0434\u0430/\u0448\u0442\u0430\u0442\u0430/\u0441\u0442\u0440\u0430\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043e\u0431\u043b\u0430\u0447\u043d\u044b\u0439 API AirVisual.",
"title": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u043c\u0435\u0441\u0442\u043e\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f"
},
"node_pro": {
"data": {
"ip_address": "\u0425\u043e\u0441\u0442",
"password": "\u041f\u0430\u0440\u043e\u043b\u044c"
},
"description": "\u041c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430 AirVisual. \u041f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432.",
"title": "\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 AirVisual Node / Pro"
},
"reauth_confirm": {
"data": {
"api_key": "\u041a\u043b\u044e\u0447 API"

View File

@@ -30,14 +30,6 @@
"description": "Pou\u017eite cloudov\u00e9 API AirVisual na monitorovanie mesta/\u0161t\u00e1tu/krajiny.",
"title": "Konfigur\u00e1cia geografie"
},
"node_pro": {
"data": {
"ip_address": "Hostite\u013e",
"password": "Heslo"
},
"description": "Monitorujte osobn\u00fa jednotku AirVisual. Heslo je mo\u017en\u00e9 z\u00edska\u0165 z pou\u017e\u00edvate\u013esk\u00e9ho rozhrania jednotky.",
"title": "Nastavenie AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API k\u013e\u00fa\u010d"

View File

@@ -8,14 +8,6 @@
"invalid_api_key": "Vpisan neveljaven API klju\u010d"
},
"step": {
"node_pro": {
"data": {
"ip_address": "IP naslov/ime gostitelja enote",
"password": "Geslo enote"
},
"description": "Spremljajte osebno napravo AirVisual. Geslo je mogo\u010de pridobiti iz uporabni\u0161kega vmesnika enote.",
"title": "Konfigurirajte AirVisual Node/Pro"
},
"user": {
"description": "Spremljajte kakovost zraka na zemljepisni lokaciji.",
"title": "Nastavite AirVisual"

View File

@@ -30,14 +30,6 @@
"description": "Anv\u00e4nd AirVisuals moln-API f\u00f6r att \u00f6vervaka en stad/stat/land.",
"title": "Konfigurera en geografi"
},
"node_pro": {
"data": {
"ip_address": "Enhets IP-adress / v\u00e4rdnamn",
"password": "Enhetsl\u00f6senord"
},
"description": "\u00d6vervaka en personlig AirVisual-enhet. L\u00f6senordet kan h\u00e4mtas fr\u00e5n enhetens anv\u00e4ndargr\u00e4nssnitt.",
"title": "Konfigurera en AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API-nyckel"

View File

@@ -30,14 +30,6 @@
"description": "Bir \u015fehri/eyalet/\u00fclkeyi izlemek i\u00e7in AirVisual bulut API'sini kullan\u0131n.",
"title": "Bir Co\u011frafyay\u0131 Yap\u0131land\u0131rma"
},
"node_pro": {
"data": {
"ip_address": "Sunucu",
"password": "Parola"
},
"description": "Ki\u015fisel bir AirVisual \u00fcnitesini izleyin. Parola, \u00fcnitenin kullan\u0131c\u0131 aray\u00fcz\u00fcnden al\u0131nabilir.",
"title": "Bir AirVisual Node/Pro'yu yap\u0131land\u0131r\u0131n"
},
"reauth_confirm": {
"data": {
"api_key": "API Anahtar\u0131"

View File

@@ -10,14 +10,6 @@
"invalid_api_key": "\u0425\u0438\u0431\u043d\u0438\u0439 \u043a\u043b\u044e\u0447 API"
},
"step": {
"node_pro": {
"data": {
"ip_address": "\u0425\u043e\u0441\u0442",
"password": "\u041f\u0430\u0440\u043e\u043b\u044c"
},
"description": "\u041c\u043e\u043d\u0456\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u0438\u0441\u0442\u0440\u043e\u044e AirVisual. \u041f\u0430\u0440\u043e\u043b\u044c \u043c\u043e\u0436\u043d\u0430 \u043e\u0442\u0440\u0438\u043c\u0430\u0442\u0438 \u0432 \u0456\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0456 \u043f\u0440\u0438\u0441\u0442\u0440\u043e\u0457\u0432.",
"title": "\u041d\u0430\u043b\u0430\u0448\u0442\u0443\u0432\u0430\u043d\u043d\u044f AirVisual Node / Pro"
},
"reauth_confirm": {
"data": {
"api_key": "\u041a\u043b\u044e\u0447 API"

View File

@@ -30,14 +30,6 @@
"description": "\u4f7f\u7528 AirVisual \u96f2\u7aef API \u4ee5\u76e3\u63a7\u57ce\u5e02/\u5dde/\u570b\u5bb6\u3002",
"title": "\u8a2d\u5b9a\u5730\u7406\u5ea7\u6a19"
},
"node_pro": {
"data": {
"ip_address": "\u4e3b\u6a5f\u7aef",
"password": "\u5bc6\u78bc"
},
"description": "\u76e3\u63a7\u500b\u4eba AirVisual \u88dd\u7f6e\uff0c\u5bc6\u78bc\u53ef\u4ee5\u900f\u904e\u88dd\u7f6e UI \u7372\u5f97\u3002",
"title": "\u8a2d\u5b9a AirVisual Node/Pro"
},
"reauth_confirm": {
"data": {
"api_key": "API \u91d1\u9470"

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -152,5 +152,5 @@ class AirzoneZoneEntity(AirzoneEntity):
raise HomeAssistantError(
f"Failed to set zone {self.name}: {error}"
) from error
else:
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())
self.coordinator.async_set_updated_data(self.coordinator.airzone.data())

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -2,7 +2,7 @@
"domain": "aladdin_connect",
"name": "Aladdin Connect",
"documentation": "https://www.home-assistant.io/integrations/aladdin_connect",
"requirements": ["AIOAladdinConnect==0.1.52"],
"requirements": ["AIOAladdinConnect==0.1.54"],
"codeowners": ["@mkmer"],
"iot_class": "cloud_polling",
"loggers": ["aladdin_connect"],

View File

@@ -0,0 +1,7 @@
{
"config": {
"abort": {
"already_configured": "Ier\u012bce jau pievienota Home Assistant."
}
}
}

View File

@@ -3,6 +3,9 @@
"abort": {
"already_configured": "\u0423\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e\u0442\u043e \u0432\u0435\u0447\u0435 \u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d\u043e"
},
"create_entry": {
"default": "\u0423\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0430\u043d \u0441 AlarmDecoder."
},
"error": {
"cannot_connect": "\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435"
},
@@ -19,5 +22,30 @@
}
}
}
},
"options": {
"step": {
"arm_settings": {
"data": {
"code_arm_required": "\u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0435 \u043a\u043e\u0434 \u0437\u0430 \u043f\u043e\u0435\u043c\u0430\u043d\u0435 \u043f\u043e\u0434 \u043e\u0445\u0440\u0430\u043d\u0430"
}
},
"init": {
"data": {
"edit_select": "\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0430\u043d\u0435"
}
},
"zone_details": {
"data": {
"zone_name": "\u0418\u043c\u0435 \u043d\u0430 \u0437\u043e\u043d\u0430",
"zone_type": "\u0422\u0438\u043f \u0437\u043e\u043d\u0430"
}
},
"zone_select": {
"data": {
"zone_number": "\u041d\u043e\u043c\u0435\u0440 \u043d\u0430 \u0437\u043e\u043d\u0430"
}
}
}
}
}

View File

@@ -14,6 +14,7 @@ from homeassistant.components import (
input_number,
light,
media_player,
number,
timer,
vacuum,
)
@@ -26,6 +27,7 @@ from homeassistant.const import (
ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE,
ATTR_UNIT_OF_MEASUREMENT,
PERCENTAGE,
STATE_ALARM_ARMED_AWAY,
STATE_ALARM_ARMED_CUSTOM_BYPASS,
STATE_ALARM_ARMED_HOME,
@@ -41,6 +43,10 @@ from homeassistant.const import (
STATE_UNKNOWN,
STATE_UNLOCKED,
STATE_UNLOCKING,
UnitOfLength,
UnitOfMass,
UnitOfTemperature,
UnitOfVolume,
)
from homeassistant.core import State
import homeassistant.util.color as color_util
@@ -65,6 +71,34 @@ from .resources import (
_LOGGER = logging.getLogger(__name__)
UNIT_TO_CATALOG_TAG = {
UnitOfTemperature.CELSIUS: AlexaGlobalCatalog.UNIT_TEMPERATURE_CELSIUS,
UnitOfTemperature.FAHRENHEIT: AlexaGlobalCatalog.UNIT_TEMPERATURE_FAHRENHEIT,
UnitOfTemperature.KELVIN: AlexaGlobalCatalog.UNIT_TEMPERATURE_KELVIN,
UnitOfLength.METERS: AlexaGlobalCatalog.UNIT_DISTANCE_METERS,
UnitOfLength.KILOMETERS: AlexaGlobalCatalog.UNIT_DISTANCE_KILOMETERS,
UnitOfLength.INCHES: AlexaGlobalCatalog.UNIT_DISTANCE_INCHES,
UnitOfLength.FEET: AlexaGlobalCatalog.UNIT_DISTANCE_FEET,
UnitOfLength.YARDS: AlexaGlobalCatalog.UNIT_DISTANCE_YARDS,
UnitOfLength.MILES: AlexaGlobalCatalog.UNIT_DISTANCE_MILES,
UnitOfMass.GRAMS: AlexaGlobalCatalog.UNIT_MASS_GRAMS,
UnitOfMass.KILOGRAMS: AlexaGlobalCatalog.UNIT_MASS_KILOGRAMS,
UnitOfMass.POUNDS: AlexaGlobalCatalog.UNIT_WEIGHT_POUNDS,
UnitOfMass.OUNCES: AlexaGlobalCatalog.UNIT_WEIGHT_OUNCES,
UnitOfVolume.LITERS: AlexaGlobalCatalog.UNIT_VOLUME_LITERS,
UnitOfVolume.CUBIC_FEET: AlexaGlobalCatalog.UNIT_VOLUME_CUBIC_FEET,
UnitOfVolume.CUBIC_METERS: AlexaGlobalCatalog.UNIT_VOLUME_CUBIC_METERS,
UnitOfVolume.GALLONS: AlexaGlobalCatalog.UNIT_VOLUME_GALLONS,
PERCENTAGE: AlexaGlobalCatalog.UNIT_PERCENT,
"preset": AlexaGlobalCatalog.SETTING_PRESET,
}
def get_resource_by_unit_of_measurement(entity: State) -> str:
"""Translate the unit of measurement to an Alexa Global Catalog keyword."""
unit: str = entity.attributes.get("unit_of_measurement", "preset")
return UNIT_TO_CATALOG_TAG.get(unit, AlexaGlobalCatalog.SETTING_PRESET)
class AlexaCapability:
"""Base class for Alexa capability interfaces.
@@ -78,10 +112,16 @@ class AlexaCapability:
supported_locales = {"en-US"}
def __init__(self, entity: State, instance: str | None = None) -> None:
def __init__(
self,
entity: State,
instance: str | None = None,
non_controllable_properties: bool | None = None,
) -> None:
"""Initialize an Alexa capability."""
self.entity = entity
self.instance = instance
self._non_controllable_properties = non_controllable_properties
def name(self) -> str:
"""Return the Alexa API name of this interface."""
@@ -101,7 +141,7 @@ class AlexaCapability:
def properties_non_controllable(self) -> bool | None:
"""Return True if non controllable."""
return None
return self._non_controllable_properties
def get_property(self, name):
"""Read and return a property.
@@ -135,16 +175,16 @@ class AlexaCapability:
def configuration(self):
"""Return the configuration object.
Applicable to the ThermostatController, SecurityControlPanel, ModeController, RangeController,
and EventDetectionSensor.
Applicable to the ThermostatController, SecurityControlPanel, ModeController,
RangeController, and EventDetectionSensor.
"""
return []
def configurations(self):
"""Return the configurations object.
The plural configurations object is different that the singular configuration object.
Applicable to EqualizerController interface.
The plural configurations object is different that the singular configuration
object. Applicable to EqualizerController interface.
"""
return []
@@ -196,7 +236,8 @@ class AlexaCapability:
if configuration := self.configuration():
result["configuration"] = configuration
# The plural configurations object is different than the singular configuration object above.
# The plural configurations object is different than the singular
# configuration object above.
if configurations := self.configurations():
result["configurations"] = configurations
@@ -757,7 +798,8 @@ class AlexaPlaybackController(AlexaCapability):
def supported_operations(self):
"""Return the supportedOperations object.
Supported Operations: FastForward, Next, Pause, Play, Previous, Rewind, StartOver, Stop
Supported Operations: FastForward, Next, Pause, Play, Previous, Rewind,
StartOver, Stop
"""
supported_features = self.entity.attributes.get(ATTR_SUPPORTED_FEATURES, 0)
@@ -1117,7 +1159,9 @@ class AlexaThermostatController(AlexaCapability):
def configuration(self):
"""Return configuration object.
Translates climate HVAC_MODES and PRESETS to supported Alexa ThermostatMode Values.
Translates climate HVAC_MODES and PRESETS to supported Alexa
ThermostatMode Values.
ThermostatMode Value must be AUTO, COOL, HEAT, ECO, OFF, or CUSTOM.
"""
supported_modes = []
@@ -1133,7 +1177,8 @@ class AlexaThermostatController(AlexaCapability):
if thermostat_mode:
supported_modes.append(thermostat_mode)
# Return False for supportsScheduling until supported with event listener in handler.
# Return False for supportsScheduling until supported with event
# listener in handler.
configuration = {"supportsScheduling": False}
if supported_modes:
@@ -1270,12 +1315,15 @@ class AlexaSecurityPanelController(AlexaCapability):
class AlexaModeController(AlexaCapability):
"""Implements Alexa.ModeController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must be unique across ModeController, RangeController,
ToggleController within the same device.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
The instance property should be a concatenated string of device domain period
and single word. e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property
strings within the same device. e.g. Instance property cover.position &
cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
@@ -1302,10 +1350,9 @@ class AlexaModeController(AlexaCapability):
def __init__(self, entity, instance, non_controllable=False):
"""Initialize the entity."""
super().__init__(entity, instance)
AlexaCapability.__init__(self, entity, instance, non_controllable)
self._resource = None
self._semantics = None
self.properties_non_controllable = lambda: non_controllable
def name(self):
"""Return the Alexa API name of this interface."""
@@ -1408,8 +1455,8 @@ class AlexaModeController(AlexaCapability):
modes = self.entity.attributes.get(humidifier.ATTR_AVAILABLE_MODES, [])
for mode in modes:
self._resource.add_mode(f"{humidifier.ATTR_MODE}.{mode}", [mode])
# Humidifiers or Fans with a single mode completely break Alexa discovery, add a
# fake preset (see issue #53832).
# Humidifiers or Fans with a single mode completely break Alexa discovery,
# add a fake preset (see issue #53832).
if len(modes) == 1:
self._resource.add_mode(
f"{humidifier.ATTR_MODE}.{PRESET_MODE_NA}", [PRESET_MODE_NA]
@@ -1479,12 +1526,15 @@ class AlexaModeController(AlexaCapability):
class AlexaRangeController(AlexaCapability):
"""Implements Alexa.RangeController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must be unique across ModeController, RangeController,
ToggleController within the same device.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
The instance property should be a concatenated string of device domain period
and single word. e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property
strings within the same device. e.g. Instance property cover.position &
cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
@@ -1509,12 +1559,13 @@ class AlexaRangeController(AlexaCapability):
"pt-BR",
}
def __init__(self, entity, instance, non_controllable=False):
def __init__(
self, entity: State, instance: str | None, non_controllable: bool = False
) -> None:
"""Initialize the entity."""
super().__init__(entity, instance)
AlexaCapability.__init__(self, entity, instance, non_controllable)
self._resource = None
self._semantics = None
self.properties_non_controllable = lambda: non_controllable
def name(self):
"""Return the Alexa API name of this interface."""
@@ -1538,7 +1589,8 @@ class AlexaRangeController(AlexaCapability):
raise UnsupportedProperty(name)
# Return None for unavailable and unknown states.
# Allows the Alexa.EndpointHealth Interface to handle the unavailable state in a stateReport.
# Allows the Alexa.EndpointHealth Interface to handle the unavailable
# state in a stateReport.
if self.entity.state in (STATE_UNAVAILABLE, STATE_UNKNOWN, None):
return None
@@ -1567,6 +1619,10 @@ class AlexaRangeController(AlexaCapability):
if self.instance == f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}":
return float(self.entity.state)
# Number Value
if self.instance == f"{number.DOMAIN}.{number.ATTR_VALUE}":
return float(self.entity.state)
# Vacuum Fan Speed
if self.instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
speed_list = self.entity.attributes.get(vacuum.ATTR_FAN_SPEED_LIST)
@@ -1644,7 +1700,29 @@ class AlexaRangeController(AlexaCapability):
unit = self.entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
self._resource = AlexaPresetResource(
["Value", AlexaGlobalCatalog.SETTING_PRESET],
["Value", get_resource_by_unit_of_measurement(self.entity)],
min_value=min_value,
max_value=max_value,
precision=precision,
unit=unit,
)
self._resource.add_preset(
value=min_value, labels=[AlexaGlobalCatalog.VALUE_MINIMUM]
)
self._resource.add_preset(
value=max_value, labels=[AlexaGlobalCatalog.VALUE_MAXIMUM]
)
return self._resource.serialize_capability_resources()
# Number Value
if self.instance == f"{number.DOMAIN}.{number.ATTR_VALUE}":
min_value = float(self.entity.attributes[number.ATTR_MIN])
max_value = float(self.entity.attributes[number.ATTR_MAX])
precision = float(self.entity.attributes.get(number.ATTR_STEP, 1))
unit = self.entity.attributes.get(ATTR_UNIT_OF_MEASUREMENT)
self._resource = AlexaPresetResource(
["Value", get_resource_by_unit_of_measurement(self.entity)],
min_value=min_value,
max_value=max_value,
precision=precision,
@@ -1760,12 +1838,15 @@ class AlexaRangeController(AlexaCapability):
class AlexaToggleController(AlexaCapability):
"""Implements Alexa.ToggleController.
The instance property must be unique across ModeController, RangeController, ToggleController within the same device.
The instance property should be a concatenated string of device domain period and single word.
e.g. fan.speed & fan.direction.
The instance property must be unique across ModeController, RangeController,
ToggleController within the same device.
The instance property must not contain words from other instance property strings within the same device.
e.g. Instance property cover.position & cover.tilt_position will cause the Alexa.Discovery directive to fail.
The instance property should be a concatenated string of device domain period
and single word. e.g. fan.speed & fan.direction.
The instance property must not contain words from other instance property
strings within the same device. e.g. Instance property cover.position
& cover.tilt_position will cause the Alexa.Discovery directive to fail.
An instance property string value may be reused for different devices.
@@ -1792,10 +1873,9 @@ class AlexaToggleController(AlexaCapability):
def __init__(self, entity, instance, non_controllable=False):
"""Initialize the entity."""
super().__init__(entity, instance)
AlexaCapability.__init__(self, entity, instance, non_controllable)
self._resource = None
self._semantics = None
self.properties_non_controllable = lambda: non_controllable
def name(self):
"""Return the Alexa API name of this interface."""
@@ -2021,7 +2101,8 @@ class AlexaEventDetectionSensor(AlexaCapability):
state = self.entity.state
# Return None for unavailable and unknown states.
# Allows the Alexa.EndpointHealth Interface to handle the unavailable state in a stateReport.
# Allows the Alexa.EndpointHealth Interface to handle the unavailable
# state in a stateReport.
if state in (STATE_UNAVAILABLE, STATE_UNKNOWN, None):
return None
@@ -2089,7 +2170,8 @@ class AlexaEqualizerController(AlexaCapability):
def properties_supported(self):
"""Return what properties this entity supports.
Either bands, mode or both can be specified. Only mode is supported at this time.
Either bands, mode or both can be specified. Only mode is supported
at this time.
"""
return [{"name": "mode"}]

View File

@@ -1,8 +1,9 @@
"""Config helpers for Alexa."""
from abc import ABC, abstractmethod
import asyncio
import logging
from homeassistant.core import callback
from homeassistant.core import CALLBACK_TYPE, callback
from homeassistant.helpers.storage import Store
from .const import DOMAIN
@@ -16,7 +17,7 @@ _LOGGER = logging.getLogger(__name__)
class AbstractConfig(ABC):
"""Hold the configuration for Alexa."""
_unsub_proactive_report = None
_unsub_proactive_report: asyncio.Task[CALLBACK_TYPE] | None = None
def __init__(self, hass):
"""Initialize abstract config."""

View File

@@ -23,6 +23,7 @@ from homeassistant.components import (
light,
lock,
media_player,
number,
scene,
script,
sensor,
@@ -103,7 +104,8 @@ class DisplayCategory:
# Indicates a device that cools the air in interior spaces.
AIR_CONDITIONER = "AIR_CONDITIONER"
# Indicates a device that emits pleasant odors and masks unpleasant odors in interior spaces.
# Indicates a device that emits pleasant odors and masks unpleasant
# odors in interior spaces.
AIR_FRESHENER = "AIR_FRESHENER"
# Indicates a device that improves the quality of air in interior spaces.
@@ -143,7 +145,8 @@ class DisplayCategory:
GAME_CONSOLE = "GAME_CONSOLE"
# Indicates a garage door.
# Garage doors must implement the ModeController interface to open and close the door.
# Garage doors must implement the ModeController interface to
# open and close the door.
GARAGE_DOOR = "GARAGE_DOOR"
# Indicates a wearable device that transmits audio directly into the ear.
@@ -206,8 +209,8 @@ class DisplayCategory:
# Indicates a security system.
SECURITY_SYSTEM = "SECURITY_SYSTEM"
# Indicates an electric cooking device that sits on a countertop, cooks at low temperatures,
# and is often shaped like a cooking pot.
# Indicates an electric cooking device that sits on a countertop,
# cooks at low temperatures, and is often shaped like a cooking pot.
SLOW_COOKER = "SLOW_COOKER"
# Indicates an endpoint that locks.
@@ -243,7 +246,8 @@ class DisplayCategory:
# Indicates a vacuum cleaner.
VACUUM_CLEANER = "VACUUM_CLEANER"
# Indicates a network-connected wearable device, such as an Apple Watch, Fitbit, or Samsung Gear.
# Indicates a network-connected wearable device, such as an Apple Watch,
# Fitbit, or Samsung Gear.
WEARABLE = "WEARABLE"
@@ -574,9 +578,10 @@ class FanCapabilities(AlexaEntity):
force_range_controller = False
# AlexaRangeController controls the Fan Speed Percentage.
# For fans which only support on/off, no controller is added. This makes the
# fan impossible to turn on or off through Alexa, most likely due to a bug in Alexa.
# As a workaround, we add a range controller which can only be set to 0% or 100%.
# For fans which only support on/off, no controller is added. This makes
# the fan impossible to turn on or off through Alexa, most likely due
# to a bug in Alexa. As a workaround, we add a range controller which
# can only be set to 0% or 100%.
if force_range_controller or supported & fan.FanEntityFeature.SET_SPEED:
yield AlexaRangeController(
self.entity, instance=f"{fan.DOMAIN}.{fan.ATTR_PERCENTAGE}"
@@ -849,8 +854,9 @@ class ImageProcessingCapabilities(AlexaEntity):
@ENTITY_ADAPTERS.register(input_number.DOMAIN)
@ENTITY_ADAPTERS.register(number.DOMAIN)
class InputNumberCapabilities(AlexaEntity):
"""Class to represent input_number capabilities."""
"""Class to represent number and input_number capabilities."""
def default_display_categories(self):
"""Return the display categories for this entity."""
@@ -858,10 +864,8 @@ class InputNumberCapabilities(AlexaEntity):
def interfaces(self):
"""Yield the supported interfaces."""
yield AlexaRangeController(
self.entity, instance=f"{input_number.DOMAIN}.{input_number.ATTR_VALUE}"
)
domain = self.entity.domain
yield AlexaRangeController(self.entity, instance=f"{domain}.value")
yield AlexaEndpointHealth(self.hass, self.entity)
yield Alexa(self.hass)

View File

@@ -19,6 +19,7 @@ from homeassistant.components import (
input_number,
light,
media_player,
number,
timer,
vacuum,
)
@@ -613,9 +614,10 @@ async def async_api_adjust_volume_step(
"""Process an adjust volume step request."""
# media_player volume up/down service does not support specifying steps
# each component handles it differently e.g. via config.
# This workaround will simply call the volume up/Volume down the amount of steps asked for
# When no steps are called in the request, Alexa sends a default of 10 steps which for most
# purposes is too high. The default is set 1 in this case.
# This workaround will simply call the volume up/Volume down the amount of
# steps asked for. When no steps are called in the request, Alexa sends
# a default of 10 steps which for most purposes is too high. The default
# is set 1 in this case.
entity = directive.entity
volume_int = int(directive.payload["volumeSteps"])
is_default = bool(directive.payload["volumeStepsDefault"])
@@ -1020,8 +1022,9 @@ async def async_api_disarm(
data = {ATTR_ENTITY_ID: entity.entity_id}
response = directive.response()
# Per Alexa Documentation: If you receive a Disarm directive, and the system is already disarmed,
# respond with a success response, not an error response.
# Per Alexa Documentation: If you receive a Disarm directive, and the
# system is already disarmed, respond with a success response,
# not an error response.
if entity.state == STATE_ALARM_DISARMED:
return response
@@ -1136,7 +1139,8 @@ async def async_api_adjust_mode(
Only supportedModes with ordered=True support the adjustMode directive.
"""
# Currently no supportedModes are configured with ordered=True to support this request.
# Currently no supportedModes are configured with ordered=True
# to support this request.
raise AlexaInvalidDirectiveError(DIRECTIVE_NOT_SUPPORTED)
@@ -1282,6 +1286,14 @@ async def async_api_set_range(
max_value = float(entity.attributes[input_number.ATTR_MAX])
data[input_number.ATTR_VALUE] = min(max_value, max(min_value, range_value))
# Input Number Value
elif instance == f"{number.DOMAIN}.{number.ATTR_VALUE}":
range_value = float(range_value)
service = number.SERVICE_SET_VALUE
min_value = float(entity.attributes[number.ATTR_MIN])
max_value = float(entity.attributes[number.ATTR_MAX])
data[number.ATTR_VALUE] = min(max_value, max(min_value, range_value))
# Vacuum Fan Speed
elif instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
service = vacuum.SERVICE_SET_FAN_SPEED
@@ -1413,6 +1425,17 @@ async def async_api_adjust_range(
max_value, max(min_value, range_delta + current)
)
# Number Value
elif instance == f"{number.DOMAIN}.{number.ATTR_VALUE}":
range_delta = float(range_delta)
service = number.SERVICE_SET_VALUE
min_value = float(entity.attributes[number.ATTR_MIN])
max_value = float(entity.attributes[number.ATTR_MAX])
current = float(entity.state)
data[number.ATTR_VALUE] = response_value = min(
max_value, max(min_value, range_delta + current)
)
# Vacuum Fan Speed
elif instance == f"{vacuum.DOMAIN}.{vacuum.ATTR_FAN_SPEED}":
range_delta = int(range_delta)
@@ -1483,7 +1506,9 @@ async def async_api_changechannel(
data = {
ATTR_ENTITY_ID: entity.entity_id,
media_player.const.ATTR_MEDIA_CONTENT_ID: channel,
media_player.const.ATTR_MEDIA_CONTENT_TYPE: media_player.const.MEDIA_TYPE_CHANNEL,
media_player.const.ATTR_MEDIA_CONTENT_TYPE: (
media_player.const.MEDIA_TYPE_CHANNEL
),
}
await hass.services.async_call(

View File

@@ -6,12 +6,15 @@ class AlexaGlobalCatalog:
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#global-alexa-catalog
You can use the global Alexa catalog for pre-defined names of devices, settings, values, and units.
This catalog is localized into all the languages that Alexa supports.
You can use the global Alexa catalog for pre-defined names of devices, settings,
values, and units.
This catalog is localized into all the languages that Alexa supports.
You can reference the following catalog of pre-defined friendly names.
Each item in the following list is an asset identifier followed by its supported friendly names.
The first friendly name for each identifier is the one displayed in the Alexa mobile app.
Each item in the following list is an asset identifier followed by its
supported friendly names. The first friendly name for each identifier is
the one displayed in the Alexa mobile app.
"""
# Air Purifier, Air Cleaner,Clean Air Machine
@@ -23,7 +26,8 @@ class AlexaGlobalCatalog:
# Router, Internet Router, Network Router, Wifi Router, Net Router
DEVICE_NAME_ROUTER = "Alexa.DeviceName.Router"
# Shade, Blind, Curtain, Roller, Shutter, Drape, Awning, Window shade, Interior blind
# Shade, Blind, Curtain, Roller, Shutter, Drape, Awning,
# Window shade, Interior blind
DEVICE_NAME_SHADE = "Alexa.DeviceName.Shade"
# Shower
@@ -190,10 +194,13 @@ class AlexaGlobalCatalog:
class AlexaCapabilityResource:
"""Base class for Alexa capabilityResources, modeResources, and presetResources objects.
"""Base class for Alexa capabilityResources, modeResources, and presetResources.
Resources objects labels must be unique across all modeResources and
presetResources within the same device. To provide support for all
supported locales, include one label from the AlexaGlobalCatalog in the
labels array.
Resources objects labels must be unique across all modeResources and presetResources within the same device.
To provide support for all supported locales, include one label from the AlexaGlobalCatalog in the labels array.
You cannot use any words from the following list as friendly names:
https://developer.amazon.com/docs/alexa/device-apis/resources-and-assets.html#names-you-cannot-use
@@ -211,11 +218,17 @@ class AlexaCapabilityResource:
return self.serialize_labels(self._resource_labels)
def serialize_configuration(self):
"""Return ModeResources, PresetResources friendlyNames serialized for an API response."""
"""Return serialized configuration for an API response.
Return ModeResources, PresetResources friendlyNames serialized.
"""
return []
def serialize_labels(self, resources):
"""Return resource label objects for friendlyNames serialized for an API response."""
"""Return serialized labels for an API response.
Returns resource label objects for friendlyNames serialized.
"""
labels = []
for label in resources:
if label in AlexaGlobalCatalog.__dict__.values():
@@ -245,7 +258,10 @@ class AlexaModeResource(AlexaCapabilityResource):
self._supported_modes.append({"value": value, "labels": labels})
def serialize_configuration(self):
"""Return configuration for ModeResources friendlyNames serialized for an API response."""
"""Return serialized configuration for an API response.
Returns configuration for ModeResources friendlyNames serialized.
"""
mode_resources = []
for mode in self._supported_modes:
result = {
@@ -260,7 +276,8 @@ class AlexaModeResource(AlexaCapabilityResource):
class AlexaPresetResource(AlexaCapabilityResource):
"""Implements Alexa PresetResources.
Use presetResources with RangeController to provide a set of friendlyNames for each RangeController preset.
Use presetResources with RangeController to provide a set of
friendlyNamesfor each RangeController preset.
https://developer.amazon.com/docs/device-apis/resources-and-assets.html#presetresources
"""
@@ -281,7 +298,10 @@ class AlexaPresetResource(AlexaCapabilityResource):
self._presets.append({"value": value, "labels": labels})
def serialize_configuration(self):
"""Return configuration for PresetResources friendlyNames serialized for an API response."""
"""Return serialized configuration for an API response.
Returns configuration for PresetResources friendlyNames serialized.
"""
configuration = {
"supportedRange": {
"minimumValue": self._minimum_value,
@@ -309,18 +329,23 @@ class AlexaPresetResource(AlexaCapabilityResource):
class AlexaSemantics:
"""Class for Alexa Semantics Object.
You can optionally enable additional utterances by using semantics. When you use semantics,
you manually map the phrases "open", "close", "raise", and "lower" to directives.
You can optionally enable additional utterances by using semantics. When
you use semantics, you manually map the phrases "open", "close", "raise",
and "lower" to directives.
Semantics is supported for the following interfaces only: ModeController, RangeController, and ToggleController.
Semantics is supported for the following interfaces only: ModeController,
RangeController, and ToggleController.
Semantics stateMappings are only supported for one interface of the same type on the same device. If a device has
multiple RangeControllers only one interface may use stateMappings otherwise discovery will fail.
Semantics stateMappings are only supported for one interface of the same
type on the same device. If a device has multiple RangeControllers only
one interface may use stateMappings otherwise discovery will fail.
You can support semantics actionMappings on different controllers for the same device, however each controller must
support different phrases. For example, you can support "raise" on a RangeController, and "open" on a ModeController,
but you can't support "open" on both RangeController and ModeController. Semantics stateMappings are only supported
for one interface on the same device.
You can support semantics actionMappings on different controllers for the
same device, however each controller must support different phrases.
For example, you can support "raise" on a RangeController, and "open"
on a ModeController, but you can't support "open" on both RangeController
and ModeController. Semantics stateMappings are only supported for one
interface on the same device.
https://developer.amazon.com/docs/device-apis/alexa-discovery.html#semantics-object
"""

View File

@@ -1,325 +0,0 @@
"""Support for Almond."""
from __future__ import annotations
import asyncio
from datetime import timedelta
import logging
import time
from typing import Any
from aiohttp import ClientError, ClientSession
import async_timeout
from pyalmond import AbstractAlmondWebAuth, AlmondLocalAuth, WebAlmondAPI
import voluptuous as vol
from homeassistant.auth.const import GROUP_ID_ADMIN
from homeassistant.components import conversation
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_HOST,
CONF_TYPE,
EVENT_HOMEASSISTANT_START,
)
from homeassistant.core import Context, CoreState, HomeAssistant
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers import (
aiohttp_client,
config_entry_oauth2_flow,
config_validation as cv,
event,
intent,
network,
storage,
)
from homeassistant.helpers.typing import ConfigType
from . import config_flow
from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
STORAGE_VERSION = 1
STORAGE_KEY = DOMAIN
ALMOND_SETUP_DELAY = 30
DEFAULT_OAUTH2_HOST = "https://almond.stanford.edu"
DEFAULT_LOCAL_HOST = "http://localhost:3000"
CONFIG_SCHEMA = vol.Schema(
{
DOMAIN: vol.Any(
vol.Schema(
{
vol.Required(CONF_TYPE): TYPE_OAUTH2,
vol.Required(CONF_CLIENT_ID): cv.string,
vol.Required(CONF_CLIENT_SECRET): cv.string,
vol.Optional(CONF_HOST, default=DEFAULT_OAUTH2_HOST): cv.url,
}
),
vol.Schema(
{vol.Required(CONF_TYPE): TYPE_LOCAL, vol.Required(CONF_HOST): cv.url}
),
)
},
extra=vol.ALLOW_EXTRA,
)
_LOGGER = logging.getLogger(__name__)
async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Almond component."""
hass.data[DOMAIN] = {}
if DOMAIN not in config:
return True
conf = config[DOMAIN]
host = conf[CONF_HOST]
if conf[CONF_TYPE] == TYPE_OAUTH2:
config_flow.AlmondFlowHandler.async_register_implementation(
hass,
config_entry_oauth2_flow.LocalOAuth2Implementation(
hass,
DOMAIN,
conf[CONF_CLIENT_ID],
conf[CONF_CLIENT_SECRET],
f"{host}/me/api/oauth2/authorize",
f"{host}/me/api/oauth2/token",
),
)
return True
if not hass.config_entries.async_entries(DOMAIN):
hass.async_create_task(
hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_IMPORT},
data={"type": TYPE_LOCAL, "host": conf[CONF_HOST]},
)
)
return True
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Almond config entry."""
websession = aiohttp_client.async_get_clientsession(hass)
if entry.data["type"] == TYPE_LOCAL:
auth = AlmondLocalAuth(entry.data["host"], websession)
else:
# OAuth2
implementation = (
await config_entry_oauth2_flow.async_get_config_entry_implementation(
hass, entry
)
)
oauth_session = config_entry_oauth2_flow.OAuth2Session(
hass, entry, implementation
)
auth = AlmondOAuth(entry.data["host"], websession, oauth_session)
api = WebAlmondAPI(auth)
agent = AlmondAgent(hass, api, entry)
# Hass.io does its own configuration.
if not entry.data.get("is_hassio"):
# If we're not starting or local, set up Almond right away
if hass.state != CoreState.not_running or entry.data["type"] == TYPE_LOCAL:
await _configure_almond_for_ha(hass, entry, api)
else:
# OAuth2 implementations can potentially rely on the HA Cloud url.
# This url is not be available until 30 seconds after boot.
async def configure_almond(_now):
try:
await _configure_almond_for_ha(hass, entry, api)
except ConfigEntryNotReady:
_LOGGER.warning(
"Unable to configure Almond to connect to Home Assistant"
)
async def almond_hass_start(_event):
event.async_call_later(hass, ALMOND_SETUP_DELAY, configure_almond)
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_START, almond_hass_start)
conversation.async_set_agent(hass, agent)
return True
async def _configure_almond_for_ha(
hass: HomeAssistant, entry: ConfigEntry, api: WebAlmondAPI
):
"""Configure Almond to connect to HA."""
try:
if entry.data["type"] == TYPE_OAUTH2:
# If we're connecting over OAuth2, we will only set up connection
# with Home Assistant if we're remotely accessible.
hass_url = network.get_url(hass, allow_internal=False, prefer_cloud=True)
else:
hass_url = network.get_url(hass)
except network.NoURLAvailableError:
# If no URL is available, we're not going to configure Almond to connect to HA.
return
_LOGGER.debug("Configuring Almond to connect to Home Assistant at %s", hass_url)
store = storage.Store[dict[str, Any]](hass, STORAGE_VERSION, STORAGE_KEY)
data = await store.async_load()
if data is None:
data = {}
user = None
if "almond_user" in data:
user = await hass.auth.async_get_user(data["almond_user"])
if user is None:
user = await hass.auth.async_create_system_user(
"Almond", group_ids=[GROUP_ID_ADMIN]
)
data["almond_user"] = user.id
await store.async_save(data)
refresh_token = await hass.auth.async_create_refresh_token(
user,
# Almond will be fine as long as we restart once every 5 years
access_token_expiration=timedelta(days=365 * 5),
)
# Create long lived access token
access_token = hass.auth.async_create_access_token(refresh_token)
# Store token in Almond
try:
async with async_timeout.timeout(30):
await api.async_create_device(
{
"kind": "io.home-assistant",
"hassUrl": hass_url,
"accessToken": access_token,
"refreshToken": "",
# 5 years from now in ms.
"accessTokenExpires": (time.time() + 60 * 60 * 24 * 365 * 5) * 1000,
}
)
except (asyncio.TimeoutError, ClientError) as err:
if isinstance(err, asyncio.TimeoutError):
msg: str | ClientError = "Request timeout"
else:
msg = err
_LOGGER.warning("Unable to configure Almond: %s", msg)
await hass.auth.async_remove_refresh_token(refresh_token)
raise ConfigEntryNotReady from err
# Clear all other refresh tokens
for token in list(user.refresh_tokens.values()):
if token.id != refresh_token.id:
await hass.auth.async_remove_refresh_token(token)
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload Almond."""
conversation.async_set_agent(hass, None)
return True
class AlmondOAuth(AbstractAlmondWebAuth):
"""Almond Authentication using OAuth2."""
def __init__(
self,
host: str,
websession: ClientSession,
oauth_session: config_entry_oauth2_flow.OAuth2Session,
) -> None:
"""Initialize Almond auth."""
super().__init__(host, websession)
self._oauth_session = oauth_session
async def async_get_access_token(self):
"""Return a valid access token."""
if not self._oauth_session.valid_token:
await self._oauth_session.async_ensure_token_valid()
return self._oauth_session.token["access_token"]
class AlmondAgent(conversation.AbstractConversationAgent):
"""Almond conversation agent."""
def __init__(
self, hass: HomeAssistant, api: WebAlmondAPI, entry: ConfigEntry
) -> None:
"""Initialize the agent."""
self.hass = hass
self.api = api
self.entry = entry
@property
def attribution(self):
"""Return the attribution."""
return {"name": "Powered by Almond", "url": "https://almond.stanford.edu/"}
async def async_get_onboarding(self):
"""Get onboard url if not onboarded."""
if self.entry.data.get("onboarded"):
return None
host = self.entry.data["host"]
if self.entry.data.get("is_hassio"):
host = "/core_almond"
return {
"text": (
"Would you like to opt-in to share your anonymized commands with"
" Stanford to improve Almond's responses?"
),
"url": f"{host}/conversation",
}
async def async_set_onboarding(self, shown):
"""Set onboarding status."""
self.hass.config_entries.async_update_entry(
self.entry, data={**self.entry.data, "onboarded": shown}
)
return True
async def async_process(
self,
text: str,
context: Context,
conversation_id: str | None = None,
language: str | None = None,
) -> conversation.ConversationResult | None:
"""Process a sentence."""
response = await self.api.async_converse_text(text, conversation_id)
language = language or self.hass.config.language
first_choice = True
buffer = ""
for message in response["messages"]:
if message["type"] == "text":
buffer += f"\n{message['text']}"
elif message["type"] == "picture":
buffer += f"\n Picture: {message['url']}"
elif message["type"] == "rdl":
buffer += (
f"\n Link: {message['rdl']['displayTitle']} "
f"{message['rdl']['webCallback']}"
)
elif message["type"] == "choice":
if first_choice:
first_choice = False
else:
buffer += ","
buffer += f" {message['title']}"
intent_response = intent.IntentResponse(language=language)
intent_response.async_set_speech(buffer.strip())
return conversation.ConversationResult(
response=intent_response, conversation_id=conversation_id
)

View File

@@ -1,124 +0,0 @@
"""Config flow to connect with Home Assistant."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
from aiohttp import ClientError
import async_timeout
from pyalmond import AlmondLocalAuth, WebAlmondAPI
from yarl import URL
from homeassistant import core, data_entry_flow
from homeassistant.components.hassio import HassioServiceInfo
from homeassistant.data_entry_flow import FlowResult
from homeassistant.helpers import aiohttp_client, config_entry_oauth2_flow
from .const import DOMAIN, TYPE_LOCAL, TYPE_OAUTH2
async def async_verify_local_connection(hass: core.HomeAssistant, host: str):
"""Verify that a local connection works."""
websession = aiohttp_client.async_get_clientsession(hass)
api = WebAlmondAPI(AlmondLocalAuth(host, websession))
try:
async with async_timeout.timeout(10):
await api.async_list_apps()
return True
except (asyncio.TimeoutError, ClientError):
return False
class AlmondFlowHandler(
config_entry_oauth2_flow.AbstractOAuth2FlowHandler, domain=DOMAIN
):
"""Implementation of the Almond OAuth2 config flow."""
DOMAIN = DOMAIN
host = None
hassio_discovery = None
@property
def logger(self) -> logging.Logger:
"""Return logger."""
return logging.getLogger(__name__)
@property
def extra_authorize_data(self) -> dict:
"""Extra data that needs to be appended to the authorize url."""
return {"scope": "profile user-read user-read-results user-exec-command"}
async def async_step_user(self, user_input=None):
"""Handle a flow start."""
# Only allow 1 instance.
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
return await super().async_step_user(user_input)
async def async_step_auth(self, user_input=None):
"""Handle authorize step."""
result = await super().async_step_auth(user_input)
if result["type"] == data_entry_flow.FlowResultType.EXTERNAL_STEP:
self.host = str(URL(result["url"]).with_path("me"))
return result
async def async_oauth_create_entry(self, data: dict) -> FlowResult:
"""Create an entry for the flow.
Ok to override if you want to fetch extra info or even add another step.
"""
data["type"] = TYPE_OAUTH2
data["host"] = self.host
return self.async_create_entry(title=self.flow_impl.name, data=data)
async def async_step_import(self, user_input: dict[str, Any]) -> FlowResult:
"""Import data."""
# Only allow 1 instance.
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
if not await async_verify_local_connection(self.hass, user_input["host"]):
self.logger.warning(
"Aborting import of Almond because we're unable to connect"
)
return self.async_abort(reason="cannot_connect")
return self.async_create_entry(
title="Configuration.yaml",
data={"type": TYPE_LOCAL, "host": user_input["host"]},
)
async def async_step_hassio(self, discovery_info: HassioServiceInfo) -> FlowResult:
"""Receive a Hass.io discovery."""
if self._async_current_entries():
return self.async_abort(reason="single_instance_allowed")
self.hassio_discovery = discovery_info.config
return await self.async_step_hassio_confirm()
async def async_step_hassio_confirm(self, user_input=None):
"""Confirm a Hass.io discovery."""
data = self.hassio_discovery
if user_input is not None:
return self.async_create_entry(
title=data["addon"],
data={
"is_hassio": True,
"type": TYPE_LOCAL,
"host": f"http://{data['host']}:{data['port']}",
},
)
return self.async_show_form(
step_id="hassio_confirm",
description_placeholders={"addon": data["addon"]},
)

View File

@@ -1,4 +0,0 @@
"""Constants for the Almond integration."""
DOMAIN = "almond"
TYPE_OAUTH2 = "oauth2"
TYPE_LOCAL = "local"

View File

@@ -1,11 +0,0 @@
{
"domain": "almond",
"name": "Almond",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/almond",
"dependencies": ["auth", "conversation"],
"codeowners": ["@gcampax", "@balloob"],
"requirements": ["pyalmond==0.0.2"],
"iot_class": "local_polling",
"loggers": ["pyalmond"]
}

View File

@@ -1,19 +0,0 @@
{
"config": {
"step": {
"pick_implementation": {
"title": "[%key:common::config_flow::title::oauth2_pick_implementation%]"
},
"hassio_confirm": {
"title": "Almond via Home Assistant add-on",
"description": "Do you want to configure Home Assistant to connect to Almond provided by the add-on: {addon}?"
}
},
"abort": {
"single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"missing_configuration": "[%key:common::config_flow::abort::oauth2_missing_configuration%]",
"no_url_available": "[%key:common::config_flow::abort::oauth2_no_url_available%]"
}
}
}

View File

@@ -1,14 +0,0 @@
{
"config": {
"abort": {
"cannot_connect": "\u041d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u0432\u044a\u0440\u0437\u0432\u0430\u043d\u0435 \u0441 Almond \u0441\u044a\u0440\u0432\u044a\u0440\u0430.",
"missing_configuration": "\u041c\u043e\u043b\u044f, \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u0442\u0435 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f\u0442\u0430 \u043a\u0430\u043a \u0434\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u0435 Almond.",
"single_instance_allowed": "\u0412\u0435\u0447\u0435 \u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u0430\u043d\u043e. \u0412\u044a\u0437\u043c\u043e\u0436\u043d\u0430 \u0435 \u0441\u0430\u043c\u043e \u0435\u0434\u043d\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f."
},
"step": {
"pick_implementation": {
"title": "\u0418\u0437\u0431\u043e\u0440 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434 \u0437\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u043a\u0430\u0446\u0438\u044f"
}
}
}
}

View File

@@ -1,19 +0,0 @@
{
"config": {
"abort": {
"cannot_connect": "Ha fallat la connexi\u00f3",
"missing_configuration": "El component no est\u00e0 configurat. Mira'n la documentaci\u00f3.",
"no_url_available": "No hi ha cap URL disponible. Per a m\u00e9s informaci\u00f3 sobre aquest error, [consulta la secci\u00f3 d'ajuda]({docs_url})",
"single_instance_allowed": "Ja configurat. Nom\u00e9s \u00e9s possible una sola configuraci\u00f3."
},
"step": {
"hassio_confirm": {
"description": "Vols configurar Home Assistant perqu\u00e8 es connecti amb Almond proporcionat pel complement: {addon}?",
"title": "Almond via complement de Home Assistant"
},
"pick_implementation": {
"title": "Selecciona el m\u00e8tode d'autenticaci\u00f3"
}
}
}
}

View File

@@ -1,19 +0,0 @@
{
"config": {
"abort": {
"cannot_connect": "Nepoda\u0159ilo se p\u0159ipojit",
"missing_configuration": "Komponenta nen\u00ed nastavena. Postupujte podle dokumentace.",
"no_url_available": "Nen\u00ed k dispozici \u017e\u00e1dn\u00e1 adresa URL. Informace o t\u00e9to chyb\u011b naleznete [v sekci n\u00e1pov\u011bdy]({docs_url})",
"single_instance_allowed": "Ji\u017e nastaveno. Je mo\u017en\u00e1 pouze jedin\u00e1 konfigurace."
},
"step": {
"hassio_confirm": {
"description": "Chcete nakonfigurovat slu\u017ebu Home Assistant pro p\u0159ipojen\u00ed k Almond pomoc\u00ed Supervisor {addon}?",
"title": "Almond prost\u0159ednictv\u00edm dopl\u0148ku Supervisor"
},
"pick_implementation": {
"title": "Vyberte metodu ov\u011b\u0159en\u00ed"
}
}
}
}

View File

@@ -1,17 +0,0 @@
{
"config": {
"abort": {
"cannot_connect": "Kan ikke oprette forbindelse til Almond-serveren.",
"missing_configuration": "Tjek venligst dokumentationen om, hvordan man indstiller Almond."
},
"step": {
"hassio_confirm": {
"description": "Vil du konfigurere Home Assistant til at oprette forbindelse til Almond leveret af Supervisor-tilf\u00f8jelsen: {addon}?",
"title": "Almond via Supervisor-tilf\u00f8jelse"
},
"pick_implementation": {
"title": "V\u00e6lg godkendelsesmetode"
}
}
}
}

View File

@@ -1,19 +0,0 @@
{
"config": {
"abort": {
"cannot_connect": "Verbindung fehlgeschlagen",
"missing_configuration": "Die Komponente ist nicht konfiguriert. Bitte der Dokumentation folgen.",
"no_url_available": "Keine URL verf\u00fcgbar. Informationen zu diesem Fehler findest du [im Hilfebereich]({docs_url}).",
"single_instance_allowed": "Bereits konfiguriert. Nur eine einzige Konfiguration m\u00f6glich."
},
"step": {
"hassio_confirm": {
"description": "M\u00f6chtest du Home Assistant so konfigurieren, dass eine Verbindung mit Almond als Supervisor-Add-On hergestellt wird: {addon}?",
"title": "Almond \u00fcber das Supervisor Add-on"
},
"pick_implementation": {
"title": "W\u00e4hle die Authentifizierungsmethode"
}
}
}
}

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