mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Report update_percentage in esphome update entity (#129376)
This commit is contained in:
parent
3a59a862d5
commit
ecbb417736
@ -230,10 +230,8 @@ class ESPHomeUpdateEntity(EsphomeEntity[UpdateInfo, UpdateState], UpdateEntity):
|
||||
|
||||
@property
|
||||
@esphome_state_property
|
||||
def in_progress(self) -> bool | int | None:
|
||||
def in_progress(self) -> bool:
|
||||
"""Return if the update is in progress."""
|
||||
if self._state.has_progress:
|
||||
return int(self._state.progress)
|
||||
return self._state.in_progress
|
||||
|
||||
@property
|
||||
@ -260,6 +258,14 @@ class ESPHomeUpdateEntity(EsphomeEntity[UpdateInfo, UpdateState], UpdateEntity):
|
||||
"""Return the title of the update."""
|
||||
return self._state.title
|
||||
|
||||
@property
|
||||
@esphome_state_property
|
||||
def update_percentage(self) -> int | None:
|
||||
"""Return if the update is in progress."""
|
||||
if self._state.has_progress:
|
||||
return int(self._state.progress)
|
||||
return None
|
||||
|
||||
@convert_api_error_ha_error
|
||||
async def async_update(self) -> None:
|
||||
"""Command device to check for update."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user