Commit Graph

36 Commits

Author SHA1 Message Date
epenet c3ade400fb Use Platform constant in tests (#145801)
* Use Platform constant in tests

* spelling

* Fix platform
2025-05-28 15:51:37 +02:00
Erik Montnemery 428cc1a951 Update signature of platforms' async_setup_entry in tests (#138271) 2025-02-11 13:17:39 +01:00
epenet 6cf10cd0b2 Remove deprecated supported features warning in Update (#132667) 2024-12-09 11:25:18 +01:00
Erik Montnemery 45fb21e32d Suppress update entity's update_percentage when update not in progress (#129397) 2024-10-29 17:56:09 +01:00
Erik Montnemery bd55fe868d Allow update entities to report progress as a float (#128930)
* Allow update entities to report progress as a float

* Add test

* Update snapshots

* Update recorder test

* Use _attr_* in MockUpdateEntity
2024-10-24 21:20:18 +02:00
Erik Montnemery e861cab727 Add update_percentage state attribute to update entity (#128877)
* Add update_percentage state attribute to update entity

* Update tests

* Update tests
2024-10-21 15:31:48 +02:00
Simone Chemelli c94bb6c1db Add new method version_is_newer to Update platform (#124797)
* Allow string comparing in update platform

* new approach after architecture discussion

* cleanup

* Update homeassistant/components/update/__init__.py

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

* Update homeassistant/components/update/__init__.py

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

* add tests

* Update tests/components/update/test_init.py

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

* Update tests/components/update/test_init.py

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

* Update tests/components/update/test_init.py

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

* update docstrings

* one more docstring

---------

Co-authored-by: Erik Montnemery <erik@montnemery.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2024-09-19 11:00:22 +02:00
Marc Mueller f11b316dac Import Generator from collections.abc (4) (#120917) 2024-07-01 11:54:42 +02:00
epenet ca8d3e0c83 Ignore unnecessary-lambda warnings in tests (#119564) 2024-06-13 16:58:41 +02:00
Marc Mueller 59e178df3b Import Generator from typing_extensions (5) (#118993) 2024-06-06 17:33:27 +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
Jan-Philipp Benecke dce3bde0ab Use setup_test_component_platform helper for update entity component tests instead of hass.components (#114203)
* Use `setup_test_component_platform` helper for update entity component tests instead of `hass.components`

* Run ruff format
2024-03-26 20:20:08 +01: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
J. Nick Koston a50883d975 Run service call tasks eagerly (#112791) 2024-03-08 20:37:21 -10:00
Marc Mueller 87165c0d6e Add empty line after module docstring [tests t-z] (#112712) 2024-03-08 14:44:56 +01:00
Joakim Sørensen 6da82cf07e Use supported_features_compat in update.install service (#107224) 2024-01-05 10:38:54 +01:00
J. Nick Koston 4b6aaf6254 Update platform back-compat for custom components without UpdateEntityFeature (#106528) 2023-12-28 14:10:26 -10:00
J. Nick Koston 5156a93b9e Add support for attribute caching to the update platform (#106261) 2023-12-23 10:29:55 +01:00
Erik Montnemery d1afcd773f Revert "Cache entity properties that are never expected to change in the base class" (#100422)
Revert "Cache entity properties that are never expected to change in the base class (#95315)"

This reverts commit 042776ebb8.
2023-09-15 11:25:24 +02:00
J. Nick Koston 042776ebb8 Cache entity properties that are never expected to change in the base class (#95315) 2023-09-14 17:48:48 -05:00
Robert Resch 790523126e Name unnamed update entities by their device class (#98579) 2023-08-18 13:40:35 +02:00
Erik Montnemery 4085c4f6d8 Tweak typing of Entity.platform (#88321)
* Tweak typing of Entity.platform

* Fix mypy errors

* Fix update test

* Improve comments
2023-06-09 10:56:04 +02:00
epenet 71dc98a39c Improve hass_ws_client type hint in tests (#89703) 2023-03-14 16:31:40 +01:00
G Johansson 8c00f435a6 Change name to entity_id update platform error messages (#87960) 2023-02-12 22:18:09 +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
Franck Nijhof d65e12ab6e Add clear_skipped service to update entity (#70116) 2022-04-19 16:11:16 +02:00
Franck Nijhof b644e7ed0f Set brand icon as entity picture on update entities (#69200)
Co-authored-by: Joakim Sørensen <ludeeus@ludeeus.dev>
2022-04-03 20:38:05 +02:00
Franck Nijhof c31e788439 Rename current_version to installed_version in Update platform (#69093) 2022-04-01 20:11:17 +02:00
Joakim Sørensen a81194cdd7 Add auto_update property to UpdateEntity (#69054) 2022-04-01 12:56:58 +02:00
Joakim Sørensen 6d168d2672 Do not mark downgrades as updates (#68893) 2022-03-30 09:34:29 -07:00
Joakim Sørensen 9a150c2234 Add release_notes method to update entities (#68842) 2022-03-29 17:38:56 -07:00
Franck Nijhof 44d3a7e459 Adjust backup type of Update entity (#68553) 2022-03-23 11:20:04 +01:00
Franck Nijhof 2424564d2c Change update default entity category based on features (#68455) 2022-03-21 14:35:40 +01:00
Franck Nijhof 073fb40b79 Add update entity platform (#68248)
Co-authored-by: Glenn Waters <glenn@watrs.ca>
2022-03-21 11:02:48 +01:00
Joakim Sørensen 6b3b21bcfd Revert "Add update integration (#66552)" (#67641) 2022-03-07 15:52:15 -08:00
Joakim Sørensen 1a78e18eeb Add update integration (#66552)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2022-03-03 08:27:09 -08:00