code: def _on_disconnect(_loop, adapter, _adapter_id, conn_id):
      
  
      conn_string = adapter._get_property(conn_id, 'connection_string')
      if conn_string is None:
          adapter._logger.debug("Dropping disconnect notification with unknown conn_id=%s", conn_id)
          return
  
      adapter._teardown_connection(conn_id, force=True)
      event = dict(reason='no reason passed from legacy adapter', expected=False)
      adapter.notify_event_nowait(conn_string, 'disconnection', event)
docs: Callback when a device disconnects unexpectedly.