def _subscribe(self):
        """ Subscribe to the device.

        A subscription serves two purposes:
        - Returns state (on/off).
        - Enables state changes on the device
          for a short period of time.
        """
        cmd = MAGIC + SUBSCRIBE + self._mac \
            + PADDING_1 + self._mac_reversed + PADDING_1
        status = self._udp_transact(cmd, self._subscribe_resp)
        if status is not None:
            self.last_subscribed = time.time()
            return status == ON
        else:
            raise S20Exception(
                "No status could be found for {}".format(self.host))
def _subscribe ( self ) : cmd = MAGIC + SUBSCRIBE + self . _mac + PADDING_1 + self . _mac_reversed + PADDING_1 status = self . _udp_transact ( cmd , self . _subscribe_resp ) if status is not None : self . last_subscribed = time . time ( ) return status == ON else : raise S20Exception ( "No status could be found for {}" . format ( self . host ) )
Subscribe to the device.

        A subscription serves two purposes:
        - Returns state (on/off).
        - Enables state changes on the device
          for a short period of time.