Close the device.
327951
async def close(self) -> bool:
        """"""
        _LOGGER.debug('%s: Sending close command', self.name)
        if not await self._set_state(0):
            return False

        # Do not allow update of this device's state for 10 seconds.
        self.next_allowed_update = datetime.utcnow() + timedelta(seconds=10)

        # Ensure state is closed or closing.
        if self.state not in (STATE_CLOSED, STATE_CLOSING):
            # Set state to closing.
            self._update_state('5')
            self._device_json = self._device['device_info']

        _LOGGER.debug('%s: Close command send', self.name)
        return True
846724
def close(self):
    """"""
    self.emit(self.generate_epilog(self.settings), dest=ReporterDestination.ERR)
1011878
def close(self):
        """"""
        if not self.closed:
            # be sure to flush data to disk before closing the file
            self.flush()
            err = _snd.sf_close(self._file)
            self._file = None
            _error_check(err)
592699
function (successCallback, errorCallback, deviceHandle) {
		winble.logger.logApiEntry("close");
		winble.deviceManager.closeDevice(successCallback, errorCallback, deviceHandle);
		winble.logger.logApiExit("close");
	}
61240
def close(self):
        
        ep_list = self._ep_list
        while ep_list:
            ep_list.pop().close()
        self._closed = True
751789
def close(self):
        
        if self.device is not None:
            self.device.shutdown(socket.SHUT_RDWR)
            self.device.close()
883783
def close(self):
        
        if self._fd is None:
            return

        try:
            os.close(self._fd)
        except OSError as e:
            raise LEDError(e.errno, "Closing LED: " + e.strerror)

        self._fd = None
658119
def close(self):
        """"""
        if self._audio_stream:
            self.stop()
            self._audio_stream.close()
            self._audio_stream = None
167059
def close(self):
        
        if not self.closed:
            _vv and IOLOG.debug('%r.close()', self)
            self.closed = True
            os.close(self.fd)
265332
def close(self):
        """"""
        if self.connection:
            self.connection.close()
            self.connection = None
            logging.debug("Connection closed.")
501129
def close(self):
        
        try:
            # TODO: Find a way to speed up this shutdown.
            if self.ssl:
                self._device.shutdown()

            else:
                # Make sure that it closes immediately.
                self._device.shutdown(socket.SHUT_RDWR)

        except Exception:
            pass

        Device.close(self)
914406
@SuppressWarnings("WeakerAccess")
    public synchronized void stop() {
        if (isRunning()) {
            final Set<DeviceAnnouncement> lastDevices = getCurrentDevices();
            socket.get().close();
            socket.set(null);
            devices.clear();
            firstDeviceTime.set(0);
            // Report the loss of all our devices, on the proper thread, outside our lock
            SwingUtilities.invokeLater(new Runnable() {
                @Override
                public void run() {
                    for (DeviceAnnouncement announcement : lastDevices) {
                        deliverLostAnnouncement(announcement);
                    }
                }
            });
            deliverLifecycleAnnouncement(logger, false);
        }
    }
977303
def close(self):
        
        if self.connection is not None:
            self.connection.close()
        if self.connection_fd is not None:
            self.connection_fd.close()
745598
def terminate(self):
        """"""
        self.toggle_scan(False)
        self.keep_going = False
        self.join()
218140
def close(self):
        """"""
        if VERBOSE:
            _print_out('\nDummy_serial: Closing port\n')

        if not self._isOpen:
            raise IOError('Dummy_serial: The port is already closed')
            
        self._isOpen = False
        self.port = None
105158
def closeEvent(self, e):
        """"""
        self.emit('close_widget')
        super(DockWidget, self).closeEvent(e)
661854
def close(self):
        """"""
        logger.debug('closing dongle, {} active connections'.format(len(self.conn_handles)))
        if self.is_scanning():
            logger.debug('in scanning mode, calling end_scan')
            self.end_scan()
        self.reset()
        if self.api is not None:
            self.api.stop_daemon()
            self.api = None