Commit Graph

70 Commits (6e322c310b79be29f169a7435669c0d70d9167d6)

Author SHA1 Message Date
Sid 721b2c2ca8
Enable Ruff PT012 (#113957) 2024-06-08 17:59:08 +02:00
epenet bfff3c0524
Add type hint to mock_async_zeroconf in test fixtures (#119057) 2024-06-07 12:09:18 +02:00
J. Nick Koston ed0568c655
Ensure config entries are not unloaded while their platforms are setting up (#118767)
* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* Report non-awaited/non-locked config entry platform forwards

Its currently possible for config entries to be reloaded while their platforms
are being forwarded if platform forwards are not awaited or done after the
config entry is setup since the lock will not be held in this case.

In https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards
we advised to await platform forwards to ensure this does not happen, however
for sleeping devices and late discovered devices, platform forwards may happen
later.

If config platform forwards are happening during setup, they should be awaited

If config entry platform forwards are not happening during setup, instead
async_late_forward_entry_setups should be used which will hold the lock to
prevent the config entry from being unloaded while its platforms are being
setup

* run with error on to find them

* cert_exp, hold lock

* cert_exp, hold lock

* shelly async_late_forward_entry_setups

* compact

* compact

* found another

* patch up mobileapp

* patch up hue tests

* patch up smartthings

* fix mqtt

* fix esphome

* zwave_js

* mqtt

* rework

* fixes

* fix mocking

* fix mocking

* do not call async_forward_entry_setup directly

* docstrings

* docstrings

* docstrings

* add comments

* doc strings

* fixed all in core, turn off strict

* coverage

* coverage

* missing

* coverage
2024-06-04 21:34:39 -04:00
Guido Schmitz 63c9aef71d
Correct spelling of "Wi-Fi" in devolo_home_network (#106167)
* Use Wi-Fi in devolo_home_network

* Recreate snapshots

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
2024-04-16 16:28:25 +02:00
epenet 0b01326f9f
Use is in ConfigEntryState enum comparison in tests (A-M) (#114925) 2024-04-05 17:16:55 +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
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
Erik Montnemery 426f73b1f4
Add State.last_reported (#113511)
* Add State.last_reported

* Update tests

* Update test snapshots

* Call state_reported listeners when firing state_changed event

* Add tests
2024-03-20 21:05:07 +01:00
Sid 00ec7f11f0
Enable Ruff rule PT007 (#113764)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2024-03-19 09:01:07 +01:00
Marc Mueller aa16a9d707
Add empty line after module docstring (3) (#112750) 2024-03-08 20:38:34 +01:00
Marc Mueller 38adfbf1a3
Add empty line after module docstring [tests a-e] (#112708) 2024-03-08 08:50:25 -05:00
Joost Lekkerkerker 38ba966d74
Add icon translations to Devolo home network (#111367) 2024-02-28 11:21:19 +01:00
Franck Nijhof e0a9dcd996
Add label registry (#110821) 2024-02-19 11:59:08 +01:00
Guido Schmitz b35afccdb7
Add PLC PHY rates as sensor to devolo Home Network (#87039)
* Add plc phyrate sensors

* Fix mypy

* Add tests

* Use suggested_display_precision

* Adapt to recent development

* Remove accidentally added constant

* Fix tests

* Fix pylint

* Use PHY rate instead of phyrate

* Adapt tests

* Hopefully fix mypy

* Hopefully fix mypy

* Use LogicalNetwork

* Apply mypy fixes
2023-12-18 21:11:06 +01:00
Erik Montnemery 6908497c3d
Add minor version to config entries (#105479) 2023-12-12 08:44:35 +01:00
Guido Schmitz f5cc4dcf3e
Add MAC adress to devolo Home Network DeviceInfo (#103290)
Add MAC adress to devolo Home Network devices
2023-11-03 08:34:49 +01:00
Guido Schmitz 04c0bca487
Remove name from device info in devolo Home Network (#102585) 2023-10-23 14:00:47 +02:00
J. Nick Koston 433c022687
Save previous unique id in entity registry when it changes (#102093) 2023-10-16 21:26:19 -10:00
Guido Schmitz 3cd4d26eb9
React on changed firmware version in devolo_home_network (#101513) 2023-10-06 13:37:48 +02:00
Guido Schmitz 285ad10624
Use snapshot in devolo_home_network update tests (#101442) 2023-10-05 20:09:52 +02:00
Guido Schmitz d14e5dc56a
Increase update interval of update platform in devolo_home_network (#101366)
Increase update interval of firmware platform
2023-10-04 09:19:57 +02:00
Guido Schmitz 598a8890e9
Use freezer.tick in devolo_home_network image tests (#101208)
Use freezer.tick
2023-10-01 18:22:19 +02:00
J. Nick Koston 0eca433004
Update zeroconf discovery to use IPAddress objects to avoid conversions (#100567) 2023-09-19 18:58:46 +02:00
Guido Schmitz 660167cb1b
Add image platform to devolo_home_network (#98036) 2023-08-28 14:55:49 +02:00
Erik Montnemery 943db9e0d5
Use freezegun in devolo_home_network tests (#99029) 2023-08-25 08:59:52 -05:00
Guido Schmitz 365dc47740
Add update platform to devolo Home Network (#86003)
* Add update platform

* Take care of progress

* Adapt to recent development

* Only add platform if supported

* Avoid unneeded line change

* Fix ruff in tests

* Handle update failures like in button platform

* Apply suggestions

* Fix tests

* Remove unused logger
2023-08-21 20:59:58 +02:00
Franck Nijhof 868a5f377f
Ruff: isort don't split imports based on trailing comma (#98162) 2023-08-10 14:27:03 +02:00
Meow a4b2ded503
Refactor deprecated RESULT_TYPE_* (#97367) 2023-07-30 19:27:30 +02:00
Guido Schmitz 6717e40114
Use snapshots in devolo Home Network button tests (#95141)
Use snapshots
2023-07-25 00:20:09 +02:00
J. Nick Koston 3a06659120
Speed up single entity/response service calls (#96729)
* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* Significantly speed up single entity/response service calls

Since the majority of service calls are single entity, we can
avoid creating tasks in this case. Since the multi-entity
service calls always check the result and raise, we can switch
the asyncio.wait to asyncio.gather

* revert

* cannot be inside pytest.raises

* one more

* Update homeassistant/helpers/service.py
2023-07-17 09:33:13 +02:00
Guido Schmitz a3681774d6
Use snapshots in devolo Home Network sensor tests (#95104)
Use snapshots

Co-authored-by: G Johansson <goran.johansson@shiftit.se>
2023-07-10 15:49:08 +02:00
Guido Schmitz d804d3fca3
Use snapshot for devolo Home Network diagnostics test (#94966) 2023-06-22 23:56:09 +02:00
Guido Schmitz 933ae5198e
Refactor devolo_home_network tests (#88706)
* Refactor devolo_home_network tests

* Reduce to snapshot introduction

* Simplify

* Update snapshots

* Simplify further
2023-06-21 10:21:36 +02:00
Ville Skyttä ced67e5800
Import `util.dt` as `dt_util` in `components/[a-d]*` (#93756) 2023-05-30 00:02:06 +03:00
Guido Schmitz 3abcffe3a0
Raise on reauth in devolo Home Network switch platform (#92850) 2023-05-18 11:28:17 -05:00
Guido Schmitz f165a41b7a
Add button platform to devolo Home Network (#85834)
* Add Start WPS button

* Add remaining buttons

* Set correct entity categories

* Inherit from DevoloEntity

* Fix mypy

* Apply feedback

* Raise on DevicePasswordProtected

* Fix ruff

* Really fix ruff

* Adapt to recent development

* Change error message
2023-05-07 14:53:46 +02:00
Matthias Alphart 1af1f4db0c
Fix devolo home lint errors from ruff (#92649) 2023-05-05 17:11:05 -05:00
Guido Schmitz b195d5d1db
Assemble platforms upfront in devolo Home Network (#80126)
* Assemble platforms upfront in devolo Home Network

* Add tests

* Optimize mocks

* Use async_forward_entry_setups

* Adapt tests to newly added switch platform
2023-05-05 23:01:57 +02:00
epenet 853bd52a22
Adjust entity registry access in tests (1) (#88950) 2023-03-01 09:11:14 +01:00
Guido Schmitz 1279868bf5
Bump devolo_plc_api to 1.2.0 (#88348) 2023-02-18 13:34:26 +01:00
Franck Nijhof ed79265843
Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
epenet 728f62b1ec
Add type hints to integration tests (part 5) (#87850) 2023-02-12 19:39:48 +01:00
Erik Montnemery cc564026fa
Move EntityCategory to homeassistant.const (#87792)
* Move EntityCategory to homeassistant.const

* Fix more imports
2023-02-09 20:15:37 +01:00
epenet a79be493e5
Adjust hass_client type hint in integration tests (#86954)
* Adjust hass_client type hint in integration tests

* Adjust hass_client_no_auth

* Fix rebase
2023-02-02 16:29:57 -05:00
Franck Nijhof 62dcbe5258
Enable Ruff PT001 (#86730) 2023-01-26 18:05:05 +01:00
Guido Schmitz 164fad112c
React on IP changes in devolo Home Network (#86195) 2023-01-21 12:22:13 -10:00
Guido Schmitz cb36905ce5
Add diagnostics to devolo Home Network (#86022) 2023-01-17 12:59:02 +01:00
Guido Schmitz c191daedc3
Remove dead code path in devolo Home Network (#85790)
Remove dead code path
2023-01-13 21:15:50 +01:00
Guido Schmitz d40a4aa970
Add switch platform to devolo_home_network (#72494) 2023-01-10 10:05:59 +01:00
Guido Schmitz 21fbe07218
Bump devolo_plc_api to 1.0.0 (#85235)
* Bump devolo_plc_api to 1.0.0

* Fix pylint
2023-01-06 01:49:59 +02:00