@callback
def async_schedule_update_ha_state(self, force_refresh: bool=False) -> None:
    'Schedule an update ha state change task.\n\n        This method must be run in the event loop.\n        Scheduling the update avoids executor deadlocks.\n\n        Entity state and attributes are read when the update ha state change\n        task is executed.\n        If state is changed more than once before the ha state change task has\n        been executed, the intermediate state transitions will be missed.\n        '
    if force_refresh:
        self.hass.async_create_task(self.async_update_ha_state(force_refresh))
    else:
        self.async_write_ha_state()
Schedule an update ha state change task.

This method must be run in the event loop.
Scheduling the update avoids executor deadlocks.

Entity state and attributes are read when the update ha state change
task is executed.
If state is changed more than once before the ha state change task has
been executed, the intermediate state transitions will be missed.
@callback
def async_schedule_update_ha_state(self, force_refresh: bool=False) -> None:
    'Schedule an update ha state change task.\n\n        This method must be run in the event loop.\n        Scheduling the update avoids executor deadlocks.\n\n        Entity state and attributes are read when the update ha state change\n        task is executed.\n        If state is changed more than once before the ha state change task has\n        been executed, the intermediate state transitions will be missed.\n        '
    if force_refresh:
        self.hass.async_create_task(self.async_update_ha_state(force_refresh))
    else:
        self.async_write_ha_state()