async def async_remove(self, *, force_remove: bool=False) -> None:
    "Remove entity from Home Assistant.\n\n        If the entity has a non disabled entry in the entity registry,\n        the entity's state will be set to unavailable, in the same way\n        as when the entity registry is loaded.\n\n        If the entity doesn't have a non disabled entry in the entity registry,\n        or if force_remove=True, its state will be removed.\n        "
    if (self.platform and (not self._added)):
        raise HomeAssistantError(f'Entity {self.entity_id} async_remove called twice')
    self._added = False
    if (self._on_remove is not None):
        while self._on_remove:
            self._on_remove.pop()()
    (await self.async_internal_will_remove_from_hass())
    (await self.async_will_remove_from_hass())
    if ((not force_remove) and self.registry_entry and (not self.registry_entry.disabled)):
        self.registry_entry.write_unavailable_state(self.hass)
    else:
        self.hass.states.async_remove(self.entity_id, context=self._context)
Remove entity from Home Assistant.

If the entity has a non disabled entry in the entity registry,
the entity's state will be set to unavailable, in the same way
as when the entity registry is loaded.

If the entity doesn't have a non disabled entry in the entity registry,
or if force_remove=True, its state will be removed.
async def async_remove(self, *, force_remove: bool=False) -> None:
    "Remove entity from Home Assistant.\n\n        If the entity has a non disabled entry in the entity registry,\n        the entity's state will be set to unavailable, in the same way\n        as when the entity registry is loaded.\n\n        If the entity doesn't have a non disabled entry in the entity registry,\n        or if force_remove=True, its state will be removed.\n        "
    if (self.platform and (not self._added)):
        raise HomeAssistantError(f'Entity {self.entity_id} async_remove called twice')
    self._added = False
    if (self._on_remove is not None):
        while self._on_remove:
            self._on_remove.pop()()
    (await self.async_internal_will_remove_from_hass())
    (await self.async_will_remove_from_hass())
    if ((not force_remove) and self.registry_entry and (not self.registry_entry.disabled)):
        self.registry_entry.write_unavailable_state(self.hass)
    else:
        self.hass.states.async_remove(self.entity_id, context=self._context)