Commit graph

21300 commits

Author SHA1 Message Date
J. Nick Koston
7871e9279b
Adjust thread safety check messages to point to developer docs (#117392) 2024-05-14 15:20:31 +02:00
epenet
77de1b2331
Move abode service registration (#117418) 2024-05-14 15:18:45 +02:00
epenet
2e155f4de5
Move esphome coordinator to separate module (#117427) 2024-05-14 15:16:47 +02:00
Joost Lekkerkerker
92bb76ed24
Use snapshot platform helper in Flexit bacnet (#117428) 2024-05-14 15:10:21 +02:00
Matthias Alphart
bca277a027
Add knx.telegram integration specific trigger; update KNX Interface device trigger (#107592)
* Add `knx.telegram` integration specific trigger

* Move implementation to trigger.py, use it from device_trigger

* test device_trigger

* test trigger.py

* Add "incoming" and "outgoing" and handle legacy device triggers

* work with mixed group address styles

* improve coverage

* Add no-op option

* apply changed linting rules

* Don't distinguish legacy device triggers from new ones

that's now supported since frontend has fixed default values of extra_fields

* review suggestion: reuse trigger schema for device trigger extra fields

* cleanup for readability

* Remove no-op option
2024-05-14 14:45:49 +02:00
Matthias Alphart
ba48da7678
Allow templates for enabling automation triggers (#114458)
* Allow templates for enabling automation triggers

* Test exception for non-limited template

* Use `cv.template` instead of `cv.template_complex`

* skip trigger with invalid enable template

instead of returning and thus not evaluating other triggers
2024-05-14 14:44:21 +02:00
Nick Hehr
55bf0b6647
Add Viam image processing integration (#101786)
* feat: scaffold integration, configure client

* feat: register services, allow API key auth flow

* feat: register detection, classification services

* test(viam): add test coverage

* chore(viam): update viam-sdk version

* fix(viam): add service schemas and translation keys

* test(viam): update config flow to use new selector values

* chore(viam): update viam-sdk to 0.11.0

* feat: add exceptions translation stings

* refactor(viam): use constant keys, defer filesystem IO execution

* fix(viam): add missing constants, resolve correct image for services

* fix(viam): use lokalize string refs, resolve more constant strings

* fix(viam): move service registration to async_setup

* refactor: abstract services into separate module outside of manager

* refactor(viam): extend common vol schemas

* refactor(viam): consolidate common service values

* refactor(viam): replace FlowResult with ConfigFlowResult

* chore(viam): add icons.json for services

* refactor(viam): use org API key to connect to robot

* fix(viam): close app client if user abort config flow

* refactor(viam): run ruff formatter

* test(viam): confirm 100% coverage of config_flow

* refactor(viam): simplify manager, clean up config flow methods

* refactor(viam): split auth step into auth_api & auth_location

* refactor(viam): remove use of SelectOptionDict for auth choice, update strings

* fix(viam): use sentence case for translation strings

* test(viam): create mock_viam_client fixture for reusable mock
2024-05-14 13:35:56 +02:00
epenet
438db92d86
Use ConfigEntry runtime_data in agent_dvr (#117412) 2024-05-14 11:10:40 +02:00
epenet
010ed8da9c
Use ConfigEntry runtime_data in aemet (#117411) 2024-05-14 10:59:55 +02:00
Allen Porter
b84829f70f
Import and cache supported feature enum flags only when needed (#117270)
* Import and cache supported feature enum flags only when needed

* Add comment aboud being loaded from executor.

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-13 21:07:39 -07:00
J. Nick Koston
9381462877
Migrate restore_state to use the singleton helper (#117385) 2024-05-14 09:13:44 +09:00
Thomas55555
b2996844be
Add reauth for missing token scope in Husqvarna Automower (#117098)
* Add repair for wrong token scope to Husqvarna Automower

* avoid new installations with missing scope

* tweaks

* just reauth

* texts

* Add link to correct account

* Update homeassistant/components/husqvarna_automower/strings.json

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

* Update homeassistant/components/husqvarna_automower/strings.json

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

* Update homeassistant/components/husqvarna_automower/strings.json

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

* Add comment

* directly assert mock_missing_scope_config_entry.state is loaded

* assert that a flow is started

* pass complete url to strings and simplify texts

* shorten long line

* address review

* simplify tests

* grammar

* remove obsolete fixture

* fix test

* Update tests/components/husqvarna_automower/test_init.py

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

* test if reauth flow has started

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2024-05-13 23:00:51 +02:00
Maciej Bieniek
0d09226661
Support reconfigure flow in Nettigo Air Monitor integration (#117318)
* Add reconfigure flow

* Fix input

* Add tests

---------

Co-authored-by: Maciej Bieniek <478555+bieniu@users.noreply.github.com>
2024-05-13 19:17:14 +02:00
Jan Bouwhuis
548eb35b79
Migrate File notify entity platform (#117215)
* Migrate File notify entity platform

* Do not load legacy notify service for new  config entries

* Follow up comment

* mypy

* Correct typing

* Only use the name when importing notify services

* Make sure a name is set on new entires
2024-05-13 11:22:13 +02:00
Bouwe Westerdijk
84cc650bb3
Implement runtime data for Plugwise (#117172) 2024-05-13 09:38:06 +02:00
Brett Adams
af0dd189d9
Improve error handling in Teslemetry (#117336)
* Improvement command handle

* Add test for ignored reasons
2024-05-12 19:37:59 -07:00
Raman Gupta
61b906e29f
Bump zwave-js-server-python to 0.56.0 (#117288)
* Bump zwave-js-server-python to 0.56.0

* Fix deprecation warning

* Fix tests

---------

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 22:19:47 -04:00
J. Nick Koston
11f49280c9
Enable open protection in the event loop (#117289) 2024-05-13 08:50:31 +09:00
J. Nick Koston
d06932bbc2
Refactor asyncio loop protection to improve performance (#117295) 2024-05-13 07:01:55 +09:00
Joost Lekkerkerker
aae39759d9
Clean up aurora (#117315)
* Clean up aurora

* Fix

* Fix

* Fix
2024-05-12 21:54:32 +02:00
Robert Hillis
0a8feae49a
Add test for radarr update failure (#116882) 2024-05-12 20:23:53 +02:00
Marc Mueller
3434fb70fb
Remove ConfigEntry runtime_data on unload (#117312) 2024-05-12 13:53:22 -04:00
Jan Bouwhuis
a1bc929421
Migrate Tibber notify service (#116893)
* Migrate tibber notify service

* Tests and repair flow

* Use notify repair flow helper

* Cleanup strings after using helper, use HomeAssistantError

* Add entry state assertions to unload test

* Update comment

* Update comment
2024-05-12 19:52:08 +02:00
Jan Bouwhuis
07061b14d0
Fix typo in mqtt test name (#117305) 2024-05-12 16:44:39 +02:00
Jan Bouwhuis
606a2848db
Fix import on File config entry and other improvements (#117210)
* Address comments

* Remove Name option for File based sensor

* Make sure platform schema is applied
2024-05-12 15:09:54 +02:00
Brett Adams
7509ccff40
Use entry runtime data in Teslemetry (#117283)
* runtime_data

* runtime_data

* Remove some code

* format

* Fix missing entry.runtime_data
2024-05-12 08:25:09 -04:00
Jan Bouwhuis
65a4e5a1af
Spelling of controlling in mqtt valve tests (#117301) 2024-05-12 14:06:21 +02:00
Jan Bouwhuis
92254772ca
Increase MQTT broker socket buffer size (#117267)
* Increase MQTT broker socket buffer size

* Revert unrelated change

* Try to increase buffer size

* Set INITIAL_SUBSCRIBE_COOLDOWN back to 0.5 sec

* Sinplify and add test

* comments

* comments

---------

Co-authored-by: J. Nick Koston <nick@koston.org>
2024-05-12 13:13:41 +02:00
J. Nick Koston
f4e8d46ec2
Small speed ups to bootstrap tests (#117285) 2024-05-12 20:05:02 +09:00
Erik Montnemery
0acf392a50
Use MockConfigEntry in hue tests (#117237)
Use MockConfigEntry in hue tests
2024-05-11 23:36:54 -04:00
J. Nick Koston
b061e7d1aa
Small speed up to setting up integrations and config entries (#117278)
* Small speed up to setting up integration and config entries

When profiling tests, I noticed many calls to get_running_loop. In the places
where we are already in a coro, pass the existing loop so it does not have to
be looked up. I did not do this for places were we are not in a coro since there
is risk that an integration could be doing a non-thread-safe call and its better
that the code raises when trying to fetch the running loop vs the performance
improvement for these cases.

* fix merge

* missed some
2024-05-11 22:39:20 -04:00
J. Nick Koston
481de8cdc9
Ensure config entry operations are always holding the lock (#117214)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2024-05-12 08:20:08 +09:00
Erik Montnemery
f55fcca0bb
Tweak config_entries tests (#117242) 2024-05-11 21:45:03 +02:00
Joost Lekkerkerker
9f53c807c6
Refactor V2C tests (#117264)
* Refactor V2C tests

* Refactor V2C tests

* Refactor V2C tests

* Refactor V2C tests

* Update tests/components/v2c/conftest.py

* Refactor V2C tests
2024-05-11 21:28:37 +02:00
Jan Bouwhuis
7eb8f265fe
Add shared notify service migration repair helper (#117213)
* Add shared notifiy service migration repair helper

* Delete ecobee repairs.py

* Update dependency

* Fix file test

* Fix homematic tests

* Improve tests for file  and homematic
2024-05-11 21:13:44 +02:00
Erik Montnemery
d1525b1edf
Sort parameters to MockConfigEntry (#117239) 2024-05-11 14:16:29 -04:00
Erik Montnemery
35900cd579
Use mock_config_flow helper in bootstrap tests (#117240) 2024-05-11 14:11:42 -04:00
Erik Montnemery
021b057a87
Use mock_config_flow helper in config_entries tests (#117241) 2024-05-11 14:11:18 -04:00
Erik Montnemery
5c1f6aeb60
Use mock_config_flow helper in config tests (#117245) 2024-05-11 14:09:00 -04:00
hahn-th
8e71fca511
Bump homematicip to 1.1.1 (#117175) 2024-05-11 18:24:56 +02:00
Raman Gupta
9655db3d55
Fix zwave_js discovery logic for node device class (#117232)
* Fix zwave_js discovery logic for node device class

* simplify check
2024-05-11 17:41:03 +02:00
Erik Montnemery
3bea124d84
Sort asserts in config config_entries tests (#117244) 2024-05-11 17:38:07 +02:00
Erik Montnemery
813f97dedc
Rename some MQTT tests (#117246) 2024-05-11 16:57:46 +02:00
Erik Montnemery
745c4aef30
Rename some rflink tests (#117247) 2024-05-11 14:18:41 +01:00
Erik Montnemery
acc78b26f7
Rename some translation helper tests (#117248) 2024-05-11 14:17:53 +01:00
Erik Montnemery
6f50c60e60
Rename some runner tests (#117249) 2024-05-11 14:16:41 +01:00
Erik Montnemery
90a50c162d
Use MockConfigEntry in unifi tests (#117238) 2024-05-11 11:11:53 +02:00
J. Nick Koston
daef625985
Speed up init and finish flow (#117226)
Since every flow now has to check for single config entry, change
the check to see if a config entry exists first before calling
the _support_single_config_entry_only since _support_single_config_entry_only
has to load the integration which adds up quite a bit in test runs
2024-05-11 09:47:17 +02:00
J. Nick Koston
d7aa24fa50
Only load translations for an integration once per test session (#117118) 2024-05-11 12:00:02 +09:00
J. Nick Koston
9e107a02db
Fix flakey advantage_air test (#117224) 2024-05-10 21:39:01 -05:00