async def async_will_remove_from_hass(self):
        """Run when entity will be removed from hass.
        To be extended by integrations.
        """
        await super().async_will_remove_from_hass()
        if unsub := self._vars.pop('homekit_remote_unsub', None):
            unsub()
Run when entity will be removed from hass.
        To be extended by integrations.
        
custom_components/xiaomi_miot/media_player.py