def METHOD_NAME(self, device: Device):
    try:
        if device.connected:
            device.disconnect()
        del self.devices[device.get_name()]
    except KeyError:
        pass
    event.log_event("device_removed", self, device)