Turn off receiver via HTTP get command.
4733
def power_off(self):
        """"""
        try:
            if self.send_get_command(self._urls.command_power_standby):
                self._power = POWER_STANDBY
                self._state = STATE_OFF
                return True
            else:
                return False
        except requests.exceptions.RequestException:
            _LOGGER.error("Connection error: power off command not sent.")
            return False
192145
public function turnOff()
    {
        if ($this->isOn) {
            $this->disableLibraryHooks();
            $this->eject();
            $this->isOn = false;
        }
    }
261690
def stop_receive(self, stream):
        
        _vv and IOLOG.debug('%r.stop_receive(%r)', self, stream)
        self.defer(self.poller.stop_receive, stream.receive_side.fd)
1306163
def power_off(self):
        """"""
        try:
            self.send_command("POWER_OFF")
            self._power = POWER_OFF
            self._state = STATE_OFF
            return True
        except requests.exceptions.RequestException:
            _LOGGER.error("Connection error: power off command not sent.")
            return False
1352422
def stop(self):
        """"""
        self.ready = False
        
        sock = getattr(self, "socket", None)
        if sock:
            if not isinstance(self.bind_addr, basestring):
                # Touch our own socket to make accept() return immediately.
                try:
                    host, port = sock.getsockname()[:2]
                except socket.error, x:
                    if x.args[0] not in socket_errors_to_ignore:
                        # Changed to use error code and not message
                        # See http://www.cherrypy.org/ticket/860.
                        raise
                else:
                    # Note that we're explicitly NOT using AI_PASSIVE,
                    # here, because we want an actual IP to touch.
                    # localhost won't work if we've bound to a public IP,
                    # but it will if we bound to '0.0.0.0' (INADDR_ANY).
                    for res in socket.getaddrinfo(host, port, socket.AF_UNSPEC,
                                                  socket.SOCK_STREAM):
                        af, socktype, proto, canonname, sa = res
                        s = None
                        try:
                            s = socket.socket(af, socktype, proto)
                            # See http://groups.google.com/group/cherrypy-users/
                            #        browse_frm/thread/bbfe5eb39c904fe0
                            s.settimeout(1.0)
                            s.connect((host, port))
                            s.close()
                        except socket.error:
                            if s:
                                s.close()
            if hasattr(sock, "close"):
                sock.close()
            self.socket = None
        
        self.requests.stop(self.shutdown_timeout)
271632
def stop(self):
        
        self.listener.setsockopt(LINGER, 1)
        self.loop = False
        with nslock:
            self.listener.close()
7429
private void cancelStream(ChannelHandlerContext ctx, CancelClientStreamCommand cmd,
      ChannelPromise promise) {
    NettyClientStream.TransportState stream = cmd.stream();
    Status reason = cmd.reason();
    if (reason != null) {
      stream.transportReportStatus(reason, true, new Metadata());
    }
    if (!cmd.stream().isNonExistent()) {
      encoder().writeRstStream(ctx, stream.id(), Http2Error.CANCEL.code(), promise);
    } else {
      promise.setSuccess();
    }
  }
976344
def off(self):
        """"""
        msg = X10Send.unit_code_msg(self.address.x10_housecode,
                                    self.address.x10_unitcode)
        self._send_method(msg)

        msg = X10Send.command_msg(self.address.x10_housecode,
                                  X10_COMMAND_OFF)
        self._send_method(msg, False)
        self._update_subscribers(0x00)
714040
public synchronized void stop() {
        if (isRunning()) {
            try {
                setSendingStatus(false);
            } catch (Throwable t) {
                logger.error("Problem stopping sending status during shutdown", t);
            }
            DeviceFinder.getInstance().removeIgnoredAddress(socket.get().getLocalAddress());
            socket.get().close();
            socket.set(null);
            broadcastAddress.set(null);
            updates.clear();
            setTempoMaster(null);
            setDeviceNumber((byte)0);  // Set up for self-assignment if restarted.
            deliverLifecycleAnnouncement(logger, false);
        }
    }
158477
function turnOff(device) {
    return api.request('/device/turnOff?' + querystring.stringify({id: device.id || device}));
  }
659738
def send_get_command(self, command):
        """"""
        # Send commands via HTTP get
        res = requests.get("http://{host}:{port}{command}".format(
            host=self._host, port=self._receiver_port, command=command),
                           timeout=self.timeout)
        if res.status_code == 200:
            return True
        else:
            _LOGGER.error((
                "Host %s returned HTTP status code %s to GET command at "
                "end point %s"), self._host, res.status_code, command)
            return False
98035
def set_off(self):
        """"""
        try:
            request = requests.post(
                '{}/{}/{}/'.format(self.resource, URI, self._mac),
                data={'action': 'off'}, timeout=self.timeout)
            if request.status_code == 200:
                pass
        except requests.exceptions.ConnectionError:
            raise exceptions.MyStromConnectionError()
803754
def cancelMatchRequest(cfg):
    """"""
    payload = json.dumps([cfg.thePlayer])
    ladder = cfg.ladder
    return requests.post(
        url  = c.URL_BASE%(ladder.ipAddress, ladder.serverPort, "cancelmatch"),
        data = payload,
        #headers=headers,
    )
272498
def disable_ap():
    """"""
    wlan = network.WLAN(network.AP_IF)
    wlan.active(False)
    print("NETWORK: Access Point disabled.")
830270
def enable_disable_nat(self):
        
        if self.nat:
            self.data['nat'] = False
        else:
            self.data['nat'] = True
447827
def on_sigabrt(self, signal_unused, frame_unused):
        
        LOGGER.info('Stopping HTTP Server and IOLoop')
        self.http_server.stop()
        self.ioloop.stop()
892523
def disconnect(self, func):
        """"""
        if id(self) not in _alleged_receivers:
            return
        l = _alleged_receivers[id(self)]
        try:
            l.remove(func)
        except ValueError:
            return
        if not l:
            del _alleged_receivers[id(self)]