Fix return type for entity update methods (#67184)

pull/67185/head
Marc Mueller 2022-02-24 18:25:38 +01:00 committed by GitHub
parent d495bded5c
commit 2af5b2c845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -93,11 +93,10 @@ class DuneHDPlayerEntity(MediaPlayerEntity):
self._state: dict[str, Any] = {}
self._unique_id = unique_id
def update(self) -> bool:
def update(self) -> None:
"""Update internal status of the entity."""
self._state = self._player.update_state()
self.__update_title()
return True
@property
def state(self) -> str | None:

View File

@ -136,16 +136,15 @@ class ResponseSwitch(SwitchEntity):
"""Handle updated incident data from the client."""
self.async_schedule_update_ha_state(True)
async def async_update(self) -> bool:
async def async_update(self) -> None:
"""Update FireServiceRota response data."""
data = await self._client.async_response_update()
if not data or "status" not in data:
return False
return
self._state = data["status"] == "acknowledged"
self._state_attributes = data
self._state_icon = data["status"]
_LOGGER.debug("Set state of entity 'Response Switch' to '%s'", self._state)
return True