def disconnect(self, api):
        with self._lock:
            key = (api.host, api.port)

            did_remove = self._targets.pop(key, None) is None

            if len(self._targets) == 0:
                # Remove event listener if no forwarding targets present
                self.hass.bus.remove_listener(ha.MATCH_ALL,
                                              self._event_listener)

            return did_remove
Remove target from being forwarded to.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/remote.py/EventForwarder.disconnect