def get_module_version(): """ Get the version of the module. """ return MasterCommandSpec("FV", [Field.str('addr', 4), Field.crc(), Field.padding(6)], [Field.str('addr', 4), Field.byte("error_code"), Field.byte("hw_version"), Field.byte("f1"), Field.byte("f2"), Field.byte("f3"), Field.byte("status"), Field.crc(), Field.lit("\r\n")])
def error_list(): """ Get the number of errors for each input and output module. """ return MasterCommandSpec("el", [Field.padding(13)], [ Field("errors", ErrorListFieldType()), Field.crc(), Field.lit("\r\n") ])
def read_setpoint(): """ Read the programmed setpoint of a thermostat """ return MasterCommandSpec("rs", [Field.byte('thermostat'), Field.padding(12)], [Field.byte('thermostat'), Field.svt('act'), Field.svt('csetp'), Field.svt('psetp0'), Field.svt('psetp1'), Field.svt('psetp2'), Field.svt('psetp3'), Field.svt('psetp4'), Field.svt('psetp5'), Field.byte('sensor_nr'), Field.byte('output0_nr'), Field.byte('output1_nr'), Field.byte('output0'), Field.byte('output1'), Field.svt('outside'), Field.byte('mode'), Field.str('name', 16), Field.byte('pid_p'), Field.byte('pid_i'), Field.byte('pid_d'), Field.byte('pid_ithresh'), Field.svt('threshold_temp'), Field.byte('days'), Field.byte('hours'), Field.byte('minutes'), Field.svt('mon_start_d1'), Field.svt('mon_stop_d1'), Field.svt('mon_start_d2'), Field.svt('mon_stop_d2'), Field.svt('tue_start_d1'), Field.svt('tue_stop_d1'), Field.svt('tue_start_d2'), Field.svt('tue_stop_d2'), Field.svt('wed_start_d1'), Field.svt('wed_stop_d1'), Field.svt('wed_start_d2'), Field.svt('wed_stop_d2'), Field.svt('thu_start_d1'), Field.svt('thu_stop_d1'), Field.svt('thu_start_d2'), Field.svt('thu_stop_d2'), Field.svt('fri_start_d1'), Field.svt('fri_stop_d1'), Field.svt('fri_start_d2'), Field.svt('fri_stop_d2'), Field.svt('sat_start_d1'), Field.svt('sat_stop_d1'), Field.svt('sat_start_d2'), Field.svt('sat_stop_d2'), Field.svt('sun_start_d1'), Field.svt('sun_stop_d1'), Field.svt('sun_start_d2'), Field.svt('sun_stop_d2'), Field.lit('T'), Field.svt('mon_temp_d1'), Field.svt('tue_temp_d1'), Field.svt('wed_temp_d1'), Field.svt('thu_temp_d1'), Field.svt('fri_temp_d1'), Field.svt('sat_temp_d1'), Field.svt('sun_temp_d1'), Field.svt('mon_temp_d2'), Field.svt('tue_temp_d2'), Field.svt('wed_temp_d2'), Field.svt('thu_temp_d2'), Field.svt('fri_temp_d2'), Field.svt('sat_temp_d2'), Field.svt('sun_temp_d2'), Field.svt('mon_temp_n'), Field.svt('tue_temp_n'), Field.svt('wed_temp_n'), Field.svt('thu_temp_n'), Field.svt('fri_temp_n'), Field.svt('sat_temp_n'), Field.svt('sun_temp_n'), Field.crc(), Field.lit('\r\n')])
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') ])
def read_input_module(master_version): """ Read the status about all inputs of an input module """ if master_version < (3, 143, 88): raise NotImplementedError("read_input_module() not supported on master version {}".format(master_version)) return MasterCommandSpec("RI", [Field.byte("input_module_nr"), Field.padding(12)], [Field.byte('input_module_nr'), Field.byte('input_status'), Field.padding(8), Field.crc(), Field.lit('\r\n')])
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')])
def read_input(): """ Read the information about an input """ return MasterCommandSpec( "ri", [Field.byte("input_nr"), Field.padding(12)], [ Field.byte('input_nr'), Field.byte('output_action'), Field.bytes('output_list', 30), Field.str('input_name', 8), Field.crc(), Field.lit('\r\n') ])
def thermostat_mode_list(): """ Read the thermostat mode for each thermostat. """ return MasterCommandSpec("ml", [Field.padding(13)], [Field.byte('mode0'), Field.byte('mode1'), Field.byte('mode2'), Field.byte('mode3'), Field.byte('mode4'), Field.byte('mode5'), Field.byte('mode6'), Field.byte('mode7'), Field.byte('mode8'), Field.byte('mode9'), Field.byte('mode10'), Field.byte('mode11'), Field.byte('mode12'), Field.byte('mode13'), Field.byte('mode14'), Field.byte('mode15'), Field.byte('mode16'), Field.byte('mode17'), Field.byte('mode18'), Field.byte('mode19'), Field.byte('mode20'), Field.byte('mode21'), Field.byte('mode22'), Field.byte('mode23'), Field.byte('mode24'), Field.byte('mode25'), Field.byte('mode26'), Field.byte('mode27'), Field.byte('mode28'), Field.byte('mode29'), Field.byte('mode30'), Field.byte('mode31'), Field.crc(), Field.lit('\r\n')])
def sensor_temperature_list(): """ Reads the list temperature values of the 32 (0-31) sensors. """ return MasterCommandSpec("cl", [Field.padding(13)], [Field.svt('tmp0'), Field.svt('tmp1'), Field.svt('tmp2'), Field.svt('tmp3'), Field.svt('tmp4'), Field.svt('tmp5'), Field.svt('tmp6'), Field.svt('tmp7'), Field.svt('tmp8'), Field.svt('tmp9'), Field.svt('tmp10'), Field.svt('tmp11'), Field.svt('tmp12'), Field.svt('tmp13'), Field.svt('tmp14'), Field.svt('tmp15'), Field.svt('tmp16'), Field.svt('tmp17'), Field.svt('tmp18'), Field.svt('tmp19'), Field.svt('tmp20'), Field.svt('tmp21'), Field.svt('tmp22'), Field.svt('tmp23'), Field.svt('tmp24'), Field.svt('tmp25'), Field.svt('tmp26'), Field.svt('tmp27'), Field.svt('tmp28'), Field.svt('tmp29'), Field.svt('tmp30'), Field.svt('tmp31'), Field.crc(), Field.lit('\r\n')])
def sensor_brightness_list(): """ Reads the list brightness values of the 32 (0-31) sensors. """ return MasterCommandSpec("bl", [Field.padding(13)], [Field.svt('bri0'), Field.svt('bri1'), Field.svt('bri2'), Field.svt('bri3'), Field.svt('bri4'), Field.svt('bri5'), Field.svt('bri6'), Field.svt('bri7'), Field.svt('bri8'), Field.svt('bri9'), Field.svt('bri10'), Field.svt('bri11'), Field.svt('bri12'), Field.svt('bri13'), Field.svt('bri14'), Field.svt('bri15'), Field.svt('bri16'), Field.svt('bri17'), Field.svt('bri18'), Field.svt('bri19'), Field.svt('bri20'), Field.svt('bri21'), Field.svt('bri22'), Field.svt('bri23'), Field.svt('bri24'), Field.svt('bri25'), Field.svt('bri26'), Field.svt('bri27'), Field.svt('bri28'), Field.svt('bri29'), Field.svt('bri30'), Field.svt('bri31'), Field.crc(), Field.lit('\r\n')])
def virtual_sensor_list(): """ Read the list with virtual settings of the 32 (0-31) sensors. """ return MasterCommandSpec("VL", [Field.padding(13)], [Field.byte('vir0'), Field.byte('vir1'), Field.byte('vir2'), Field.byte('vir3'), Field.byte('vir4'), Field.byte('vir5'), Field.byte('vir6'), Field.byte('vir7'), Field.byte('vir8'), Field.byte('vir9'), Field.byte('vir10'), Field.byte('vir11'), Field.byte('vir12'), Field.byte('vir13'), Field.byte('vir14'), Field.byte('vir15'), Field.byte('vir16'), Field.byte('vir17'), Field.byte('vir18'), Field.byte('vir19'), Field.byte('vir20'), Field.byte('vir21'), Field.byte('vir22'), Field.byte('vir23'), Field.byte('vir24'), Field.byte('vir25'), Field.byte('vir26'), Field.byte('vir27'), Field.byte('vir28'), Field.byte('vir29'), Field.byte('vir30'), Field.byte('vir31'), Field.crc(), Field.lit('\r\n')])
def sensor_humidity_list(): """ Reads the list humidity values of the 32 (0-31) sensors. """ return MasterCommandSpec("hl", [Field.padding(13)], [Field.svt('hum0'), Field.svt('hum1'), Field.svt('hum2'), Field.svt('hum3'), Field.svt('hum4'), Field.svt('hum5'), Field.svt('hum6'), Field.svt('hum7'), Field.svt('hum8'), Field.svt('hum9'), Field.svt('hum10'), Field.svt('hum11'), Field.svt('hum12'), Field.svt('hum13'), Field.svt('hum14'), Field.svt('hum15'), Field.svt('hum16'), Field.svt('hum17'), Field.svt('hum18'), Field.svt('hum19'), Field.svt('hum20'), Field.svt('hum21'), Field.svt('hum22'), Field.svt('hum23'), Field.svt('hum24'), Field.svt('hum25'), Field.svt('hum26'), Field.svt('hum27'), Field.svt('hum28'), Field.svt('hum29'), Field.svt('hum30'), Field.svt('hum31'), Field.crc(), Field.lit('\r\n')])
def permanent_manual_thermostat_list(): """ Read the permanent manual bytes, 1 per thermostat. """ return MasterCommandSpec("pL", [Field.padding(13)], [Field.byte('tm'), Field.byte('pmt0'), Field.byte('pmt1'), Field.byte('pmt2'), Field.byte('pmt3'), Field.byte('pmt4'), Field.byte('pmt5'), Field.byte('pmt6'), Field.byte('pmt7'), Field.byte('pmt8'), Field.byte('pmt9'), Field.byte('pmt10'), Field.byte('pmt11'), Field.byte('pmt12'), Field.byte('pmt13'), Field.byte('pmt14'), Field.byte('pmt15'), Field.byte('pmt16'), Field.byte('pmt17'), Field.byte('pmt18'), Field.byte('pmt19'), Field.byte('pmt20'), Field.byte('pmt21'), Field.byte('pmt22'), Field.byte('pmt23'), Field.byte('pmt24'), Field.byte('pmt25'), Field.byte('pmt26'), Field.byte('pmt27'), Field.byte('pmt28'), Field.byte('pmt29'), Field.byte('pmt30'), Field.byte('pmt31'), Field.crc(), Field.lit('\r\n')])
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') ])
def thermostat_list(): """ Read the thermostat mode, the outside temperature, the temperature of each thermostat, as well as the setpoint. """ return MasterCommandSpec("tl", [Field.padding(13)], [Field.byte('mode'), Field.svt('outside'), Field.svt('tmp0'), Field.svt('tmp1'), Field.svt('tmp2'), Field.svt('tmp3'), Field.svt('tmp4'), Field.svt('tmp5'), Field.svt('tmp6'), Field.svt('tmp7'), Field.svt('tmp8'), Field.svt('tmp9'), Field.svt('tmp10'), Field.svt('tmp11'), Field.svt('tmp12'), Field.svt('tmp13'), Field.svt('tmp14'), Field.svt('tmp15'), Field.svt('tmp16'), Field.svt('tmp17'), Field.svt('tmp18'), Field.svt('tmp19'), Field.svt('tmp20'), Field.svt('tmp21'), Field.svt('tmp22'), Field.svt('tmp23'), Field.svt('tmp24'), Field.svt('tmp25'), Field.svt('tmp26'), Field.svt('tmp27'), Field.svt('tmp28'), Field.svt('tmp29'), Field.svt('tmp30'), Field.svt('tmp31'), Field.svt('setp0'), Field.svt('setp1'), Field.svt('setp2'), Field.svt('setp3'), Field.svt('setp4'), Field.svt('setp5'), Field.svt('setp6'), Field.svt('setp7'), Field.svt('setp8'), Field.svt('setp9'), Field.svt('setp10'), Field.svt('setp11'), Field.svt('setp12'), Field.svt('setp13'), Field.svt('setp14'), Field.svt('setp15'), Field.svt('setp16'), Field.svt('setp17'), Field.svt('setp18'), Field.svt('setp19'), Field.svt('setp20'), Field.svt('setp21'), Field.svt('setp22'), Field.svt('setp23'), Field.svt('setp24'), Field.svt('setp25'), Field.svt('setp26'), Field.svt('setp27'), Field.svt('setp28'), Field.svt('setp29'), Field.svt('setp30'), Field.svt('setp31'), Field.crc(), Field.lit('\r\n')])
def error_list(): """ Get the number of errors for each input and output module. """ return MasterCommandSpec("el", [Field.padding(13)], [Field("errors", ErrorListFieldType()), Field.crc(), Field.lit("\r\n")])
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')])
def read_input(): """ Read the information about an input """ return MasterCommandSpec("ri", [Field.byte("input_nr"), Field.padding(12)], [Field.byte('input_nr'), Field.byte('output_action'), Field.bytes('output_list', 30), Field.str('input_name', 8), Field.crc(), Field.lit('\r\n')])