async def async_update_ha_state(self, force_refresh: bool=False) -> None:
    'Update Home Assistant with current state of entity.\n\n        If force_refresh == True will update entity before setting state.\n\n        This method must be run in the event loop.\n        '
    if (self.hass is None):
        raise RuntimeError(f'Attribute hass is None for {self}')
    if (self.entity_id is None):
        raise NoEntitySpecifiedError(f'No entity id specified for entity {self.name}')
    if force_refresh:
        try:
            (await self.async_device_update())
        except Exception:
            _LOGGER.exception('Update for %s fails', self.entity_id)
            return
    self._async_write_ha_state()
Update Home Assistant with current state of entity.

If force_refresh == True will update entity before setting state.

This method must be run in the event loop.
async def async_update_ha_state(self, force_refresh: bool=False) -> None:
    'Update Home Assistant with current state of entity.\n\n        If force_refresh == True will update entity before setting state.\n\n        This method must be run in the event loop.\n        '
    if (self.hass is None):
        raise RuntimeError(f'Attribute hass is None for {self}')
    if (self.entity_id is None):
        raise NoEntitySpecifiedError(f'No entity id specified for entity {self.name}')
    if force_refresh:
        try:
            (await self.async_device_update())
        except Exception:
            _LOGGER.exception('Update for %s fails', self.entity_id)
            return
    self._async_write_ha_state()