Example #1
0
    def off(self, module, channel):
        """ Команда выключения канала на заданном модуле. """
        self.valid_module(module)
        self.valid_channel(channel)

        command = '#%s1%d00' % (int2hex(int(module)), int(channel))
        error, data  = self.ask(command)
        return False if error else True
Example #2
0
    def status(self, module=1):
        """ Возвращает статус устойства. """
        self.valid_module(module)

        error, data = self.ask('@%s' % int2hex(int(module)))
        if error:
            raise RuntimeError(self.error.encode('utf-8') or _('Unknown error'))
        else:
            data = channels_status(data)
        return data