def turn_on(self, **kwargs): """Instruct the switch to turn on.""" import velbus message = velbus.SwitchRelayOnMessage() message.set_defaults(self._module) message.relay_channels = [self._channel] self._velbus.send(message)
def turn_on(self, channel, callback=None): """ Turn on switch. :return: None """ if callback is None: def callb(): """No-op""" pass callback = callb message = velbus.SwitchRelayOnMessage(self._address) message.relay_channels = [channel] self._controller.send(message, callback)
def _relay_on(self, channel): import velbus message = velbus.SwitchRelayOnMessage() message.set_defaults(self._module) message.relay_channels = [channel] self._velbus.send(message)