예제 #1
0
def write_timer():
    """ Writes a timer setting to an Output, and immediately activates the timer value (even when an Output is already on). """
    return MasterCommandSpec(
        "WT", [Field.byte("id"),
               Field.int("timer"),
               Field.padding(10)], [
                   Field.byte("id"),
                   Field.int("timer"),
                   Field.padding(10),
                   Field.lit("\r\n")
               ], "RT")
예제 #2
0
def modules_update_firmware_block():
    """ Upload 1 block of 64 bytes to the module. """
    return MasterCommandSpec("FD",
                             [Field.str('addr', 4), Field.int("block"), Field.str("bytes", 64),
                              Field.lit('C'), Field.byte('crc0'), Field.byte('crc1')],
                             [Field.str('addr', 4), Field.byte("error_code"), Field.lit('C'), Field.byte('crc0'),
                              Field.byte('crc1'), Field.lit("\r\n")])
예제 #3
0
def read_output():
    """ Read the information about an output """
    return MasterCommandSpec("ro",
                             [Field.byte("id"), Field.padding(12)],
                             [Field.byte('id'), Field.str('type', 1), Field.byte('light'), Field.int('timer'),
                              Field.int('ctimer'), Field.byte('status'), Field.dimmer('dimmer'),
                              Field.byte('controller_out'), Field.byte('max_power'), Field.byte('floor_level'),
                              Field.bytes('menu_position', 3), Field.str('name', 16), Field.crc(),
                              Field.lit('\r\n')])
예제 #4
0
def write_timer():
    """ Writes a timer setting to an Output, and immediately activates the timer value (even when an Output is already on). """
    return MasterCommandSpec("WT",
                             [Field.byte("id"), Field.int("timer"), Field.padding(10)],
                             [Field.byte("id"), Field.int("timer"), Field.padding(10), Field.lit("\r\n")],
                             "RT")
예제 #5
0
def pulse_list():
    """ List the pulse counter values. """
    return MasterCommandSpec("PL",
                             [Field.padding(13)],
                             [Field.int('pv0'), Field.int('pv1'), Field.int('pv2'), Field.int('pv3'),
                              Field.int('pv4'), Field.int('pv5'), Field.int('pv6'), Field.int('pv7'),
                              Field.int('pv8'), Field.int('pv9'), Field.int('pv10'), Field.int('pv11'),
                              Field.int('pv12'), Field.int('pv13'), Field.int('pv14'), Field.int('pv15'),
                              Field.int('pv16'), Field.int('pv17'), Field.int('pv18'), Field.int('pv19'),
                              Field.int('pv20'), Field.int('pv21'), Field.int('pv22'), Field.int('pv23'),
                              Field.crc(), Field.lit('\r\n')])