Beispiel #1
0
    def send(self, payload, radio_config=None):
        #   payload is a pydict suitable for OpenThings
        #   radio_params is an overlay on top of radio tx defaults
        p = OpenThings.encode(payload)

        # Set radio defaults, if no override
        outer_times = self.tx_defaults.outer_times
        outer_delay = self.tx_defaults.outer_delay
        inner_times = self.tx_defaults.inner_times

        # Merge any wanted radio params, if provided
        if radio_config != None:
            try:
                outer_times = radio_config.outer_times
            except AttributeError:
                pass
            try:
                outer_delay = radio_config.outer_delay
            except AttributeError:
                pass
            try:
                inner_times = radio_config.inner_times
            except AttributeError:
                pass

        radio.transmitter(fsk=True)
        ##print("inner times %s" % inner_times)
        radio.transmit(p,
                       outer_times=outer_times,
                       inner_times=inner_times,
                       outer_delay=outer_delay)
Beispiel #2
0
    def send(self, payload, radio_config=None):
        #   payload is a pydict suitable for OpenThings
        #   radio_params is an overlay on top of radio tx defaults
        p = OpenThings.encode(payload)

        # Set radio defaults, if no override
        outer_times = self.tx_defaults.outer_times
        outer_delay = self.tx_defaults.outer_delay
        inner_times = self.tx_defaults.inner_times

        # Merge any wanted radio params, if provided
        if radio_config != None:
            try:
                outer_times = radio_config.outer_times
            except AttributeError: pass
            try:
                outer_delay = radio_config.outer_delay
            except AttributeError: pass
            try:
                inner_times = radio_config.inner_times
            except AttributeError: pass

        radio.transmitter(fsk=True)
        ##print("inner times %s" % inner_times)
        radio.transmit(p, outer_times=outer_times, inner_times=inner_times, outer_delay=outer_delay)