Commit Graph

21 Commits (7e11fec761dcdc108cd8e355c4f19d1a79d50270)

Author SHA1 Message Date
Joost Lekkerkerker b9281327c4
Use FlowResultType enum in config flow tests A-M (#114681) 2024-04-03 09:21:17 +02:00
Joost Lekkerkerker 9b41e3d124
Use is in enum comparison in config flow tests A-E (#114669) 2024-04-02 11:22:05 -10:00
J. Nick Koston 9a79320861
Mark executor jobs as background unless created from a tracked task (#114450)
* Mark executor jobs as background unless created from a tracked task

If the current task is not tracked the executor job should not
be a background task to avoid delaying startup and shutdown.

Currently any executor job created in a untracked task or
background task would end up being tracked and delaying
startup/shutdown

* import exec has the same issue

* Avoid tracking import executor jobs

There is no reason to track these jobs as they are always awaited
and we do not want to support fire and forget import executor jobs

* fix xiaomi_miio

* lots of fire time changed without background await

* revert changes moved to other PR

* more

* more

* more

* m

* m

* p

* fix fire and forget tests

* scrape

* sonos

* system

* more

* capture callback before block

* coverage

* more

* more races

* more races

* more

* missed some

* more fixes

* missed some more

* fix

* remove unneeded

* one more race

* two
2024-03-30 00:16:53 -04:00
Joost Lekkerkerker 6bb4e7d62c
Bump ruff to 0.3.4 (#112690)
Co-authored-by: Sid <27780930+autinerd@users.noreply.github.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-03-26 00:02:16 +01:00
Dave T 579084a21e
Add more sensors to aurora_abb_powerone (part 2) (#114097) 2024-03-24 11:04:12 +00:00
Dave T c82c295eed
Add more sensors to aurora_abb_powerone (#114074) 2024-03-23 21:52:22 +00:00
Dave T 318b6e3a8b
Allow retries on communication exceptions for Aurora ABB Powerone solar inverter (#104492)
* Allow retries on SerialException, AuroraError

* Add test to verify that retry is occuring

* Fix tests and indents

* Only log to info level for normal on/offline

* Review comment: don't log warning, debug and raise UpdateFailed

* Fix tests
2024-03-19 12:21:32 +01:00
Marc Mueller 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Jan Bouwhuis 1a4d1907c9
Make ATTR_SERIAL_NUMBER a generic homeassistant constant (#108106) 2024-01-15 20:33:15 +01:00
Dave T b48ad268b5
Add alarm sensor to Aurora ABB (#104503)
* Add new sensors

* Add strings

* Fix tests

* Only add alarm sensor, & refactor

* Address review comments

* Address review comments.

* Fix ruff
2023-12-02 23:04:37 +01:00
Dave T 7a727dc3ad
Migrate Aurora_ABB_Powerone to DataUpdateCoordinator (#72363)
* Refactor to DataUpdateCoordinator

* Fix tests for sunset/sunrise

* Correct time offsets in tests

* Fix time intervals (attempt 2)

* Merge dev

* Fix tests after rebase

* Fix isort

* Address review comments: const and increase cov

* Fix merge problems

* Refactor, removing unnecessary file

* Perform blocking serial IO in the executor

* Replace deprecated  async_setup_platforms

* Update based on review comments

* Fix tests

* Update based on review comments.

* Update homeassistant/components/aurora_abb_powerone/sensor.py

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

* Use freezer for time deltas.

* Address review comments

---------

Co-authored-by: Dave T <davet2001@users.noreply.github.com>
Co-authored-by: Joost Lekkerkerker <joostlek@outlook.com>
2023-11-22 19:04:49 +01:00
Joost Lekkerkerker 73bc5a4e8f
Add entity translations to Aurora ABB PowerOne (#95132) 2023-06-27 08:42:09 +02:00
epenet 2545694d41
Add type hints to integration tests (a) (#87684)
* Add type hints to accuweather tests

* Adjust a** components

* Adjust aiohttp_client

* ClientSessionGenerator/WebSocketGenerator
2023-02-08 12:16:23 +01:00
Franck Nijhof 5e81d28116
Update black to 23.1.0 (#87188) 2023-02-02 18:35:24 +01:00
Franck Nijhof 7cd68381f1
Search/replace RESULT_TYPE_* by FlowResultType enum (#74642) 2022-07-07 19:57:36 +03:00
Dave T b261f0fb41
Use more specific exception and simplify aurora_abb_powerone (#73338)
* Use more specific exception for comms timeout

* Remove defered uniqueid assigner now yaml has gone

Co-authored-by: Dave T <davet2001@users.noreply.github.com>
2022-06-13 09:36:46 +02:00
Robert Hillis b869b680fb
Remove deprecated yaml config from aurora abb (#62317) 2021-12-19 18:00:49 +01:00
Dave T 6419950283
Aurora abb improvements (#58504)
* Add type hints.

* Refactor AuroraDevice to AuroraDeviceEntity

* Refactor AuroraDevice to AuroraDeviceEntity

* Connection class is defined in manifest.

* Separate words with underscore in variable names

* Remove duplicated code.

* Remove unused "unknown" string

* Test import yaml when integration already setup

* Remove test already done in config_flow test

* Convert variable names to snake case

* Shorten AuroraDeviceEntity to AuroraEntity

* Add typing

* Remove unnecessary integration setup in test.

* Refactor "already_setup" to "already_configured"

* Use common string

* Reduce the amount of code in the try block.

* Fix merge

* Allow yaml setup to be deferred if no comms

* Properly setup all sensors for defered yaml setup.

* Apply suggestions from code review

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

* Add type hints.

* Refactor AuroraDevice to AuroraDeviceEntity

* Refactor AuroraDevice to AuroraDeviceEntity

* Connection class is defined in manifest.

* Separate words with underscore in variable names

* Remove duplicated code.

* Remove unused "unknown" string

* Test import yaml when integration already setup

* Remove test already done in config_flow test

* Convert variable names to snake case

* Shorten AuroraDeviceEntity to AuroraEntity

* Add typing

* Remove unnecessary integration setup in test.

* Refactor "already_setup" to "already_configured"

* Use common string

* Reduce the amount of code in the try block.

* Allow yaml setup to be deferred if no comms

* Properly setup all sensors for defered yaml setup.

* Code review: move line out of try block.

* Improve test coverage

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-11-04 04:38:47 +01:00
Dave T 51be7d53d6
Aurora abb defer unique_id assignment during yaml import (#58887)
* Defer unique_id assignment during yaml import if dark

* Back out variable name change to simplify.

* Allow config flow yaml setup deferral.

* Fix deferred yaml import

* Code review: only wrap necessary lines in try blk

* Code review: catch possible duplicate unique_id

* Simplify assignment.

* Code review: use timedelta to retry yaml import

* Code review: if a different error occurs, raise it

* Remove current config entry if duplicate unique_id

* Code review: remove unnecessary line.

* Code review: revert change, leave to other PR.

* Code review: remove unnecessary patch & min->sec

* Remove unnecessary else after raise.

* Increase test coverage.

* Check the number of config entries at each stage

* Raise ConfigEntryNotReady when connection fails.

* Log & return false for error on yaml import
2021-11-03 01:30:29 +01:00
Dave T 37930aeeb6
Aurora abb energy metering (#58454)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-10-28 16:47:49 -05:00
Dave T e22aaea5b2
Aurora abb (solar) configflow (#36300)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-10-25 20:04:42 -05:00