class OutputConfiguration(EepromModel): """ Models an output. The maximum number of inputs is 240 (30 modules), the actual number of outputs is 8 times the number of output modules (eeprom address 0, 2). """ id = EepromId(240, address=EepromAddress(0, 2, 1), multiplier=8) module_type = EepromString(1, lambda mid: (33 + mid / 8, 0), read_only=True, shared=True) name = EepromString(16, page_per_module(8, 33, 20, 16)) timer = EepromWord(page_per_module(8, 33, 4, 2)) floor = EepromByte(page_per_module(8, 33, 157, 1)) type = EepromByte(page_per_module(8, 33, 149, 1)) lock_bit_id = EepromByte(lambda mid: (231, mid)) can_led_1_id = EepromByte(gen_address(221, 32, 0)) can_led_1_function = EepromEnum(gen_address(221, 32, 1), get_led_functions()) can_led_2_id = EepromByte(gen_address(221, 32, 2)) can_led_2_function = EepromEnum(gen_address(221, 32, 3), get_led_functions()) can_led_3_id = EepromByte(gen_address(221, 32, 4)) can_led_3_function = EepromEnum(gen_address(221, 32, 5), get_led_functions()) can_led_4_id = EepromByte(gen_address(221, 32, 6)) can_led_4_function = EepromEnum(gen_address(221, 32, 7), get_led_functions())
class ScheduledActionConfiguration(EepromModel): """ Models the scheduled actions. The maximum number of scheduled actions is 102. """ id = EepromId(102) hour = EepromByte(lambda mid: (113 + (mid / 51), 5 * (mid % 51) + 0)) minute = EepromByte(lambda mid: (113 + (mid / 51), 5 * (mid % 51) + 1)) day = EepromByte(lambda mid: (113 + (mid / 51), 5 * (mid % 51) + 2)) # day's 8th byte -> one time or reschedule action = EepromActions(1, lambda mid: (113 + (mid / 51), 5 * (mid % 51) + 3))
class RTD10CoolingConfiguration(EepromModel): """ Configuration for RTD-10 when in cooling mode. """ id = EepromId(32) temp_setpoint_output = EepromByte(lambda mid: (217, 200 + mid)) ventilation_speed_output = EepromByte(lambda mid: (218, mid)) ventilation_speed_value = EepromByte(lambda mid: (218, 64 + mid)) mode_output = EepromByte(lambda mid: (219, mid)) mode_value = EepromByte(lambda mid: (219, 64 + mid)) on_off_output = EepromByte(lambda mid: (219, 100 + mid)) poke_angle_output = EepromByte(lambda mid: (220, mid)) poke_angle_value = EepromByte(lambda mid: (220, 64 + mid)) room = EextByte()
class RTD10HeatingConfiguration(EepromModel): """ Configuration for RTD-10 when in heating mode. """ id = EepromId(32) temp_setpoint_output = EepromByte(lambda mid: (213, 200 + mid)) ventilation_speed_output = EepromByte(lambda mid: (214, mid)) ventilation_speed_value = EepromByte(lambda mid: (214, 64 + mid)) mode_output = EepromByte(lambda mid: (215, mid)) mode_value = EepromByte(lambda mid: (215, 64 + mid)) on_off_output = EepromByte(lambda mid: (215, 100 + mid)) poke_angle_output = EepromByte(lambda mid: (216, mid)) poke_angle_value = EepromByte(lambda mid: (216, 64 + mid)) room = EextByte()
class ShutterConfiguration(EepromModel): """ Models a shutter. The maximum number of shutters is 120 (30 modules), the actual number of shutters is 4 times the number of shutter modules (eeprom address 0, 3). """ id = EepromId(120, address=EepromAddress(0, 3, 1), multiplier=4) timer_up = EepromByte(page_per_module(4, 33, 177, 2)) timer_down = EepromByte(page_per_module(4, 33, 178, 2)) up_down_config = EepromByte(page_per_module(4, 33, 185, 1)) name = EepromString(16, page_per_module(4, 33, 189, 16)) group_1 = EepromByte(lambda mid: (63, (mid * 2) + 0)) group_2 = EepromByte(lambda mid: (63, (mid * 2) + 1)) steps = EextWord()
class CanLedConfiguration(EepromModel): """ Models a CAN LED configuration. Each configuration defines the CAN LED that will be driven and the the function to drive the LED. The LED function will be activated when: the number of lights on is 0 (id = 0), the number of lights on is greater than 0 (id = 1), ..., the number of lights on is greater than 14 (id = 15), the number of outputs on is 0 (id = 16), ther number of outputs is greater than 0 (id = 17), the number of outputs on is greater than 14 (id = 31). """ id = EepromId(32) can_led_1_id = EepromByte(gen_address(229, 32, 0)) can_led_1_function = EepromEnum(gen_address(229, 32, 1), get_led_functions()) can_led_2_id = EepromByte(gen_address(229, 32, 2)) can_led_2_function = EepromEnum(gen_address(229, 32, 3), get_led_functions()) can_led_3_id = EepromByte(gen_address(229, 32, 4)) can_led_3_function = EepromEnum(gen_address(229, 32, 5), get_led_functions()) can_led_4_id = EepromByte(gen_address(229, 32, 6)) can_led_4_function = EepromEnum(gen_address(229, 32, 7), get_led_functions())
class InputConfiguration(EepromModel): """ Models an input. The maximum number of inputs is 240 (30 modules), the actual number of inputs is 8 times the number of input modules (eeprom address 0, 1). """ id = EepromId(240, address=EepromAddress(0, 1, 1), multiplier=8) module_type = EepromString(1, lambda mid: (2 + mid / 8, 0), read_only=True, shared=True) name = EepromString( 8, per_module( 8, lambda mid, iid: (115 + (mid / 4), 64 * (mid % 4) + 8 * iid))) action = EepromByte(page_per_module(8, 2, 4, 1)) basic_actions = EepromActions(15, page_per_module(8, 2, 12, 30)) invert = EepromByte(lambda mid: (32, mid)) can = EepromString(1, lambda mid: (2 + mid / 8, 252), read_only=True, shared=True)
class Model1(EepromModel): """ Dummy model with an id. """ id = EepromId(10) name = EepromString(100, lambda id: (1, 2 + id))
class RoModel(EepromModel): """ Dummy model. """ id = EepromId(10) name = EepromString(100, lambda id: (1, 2 + id)) other = EepromByte(lambda id: (2, 2 + id), read_only=True)
class PulseCounterConfiguration(EepromModel): """ Models a pulse counter. The maximum number of pulse counters is 24. """ id = EepromId(24) name = EepromString(16, lambda mid: (98 + (mid / 16), 16 * (mid % 16))) input = EepromByte(lambda mid: (0, 160 + mid))
class Model7(EepromModel): """ Dummy model with multiple fields, including eext fields and an id. """ id = EepromId(3) name = EepromString(10, lambda id: (id, 4)) link = EepromByte(lambda id: (id, 14)) room = EextByte()
class CoolingPumpGroupConfiguration(EepromModel): """ Models a pump group for cooling. The maximum number of pump groups is 8. """ id = EepromId(8) outputs = EepromCSV(32, lambda mid: (202, mid * 32)) output = EepromByte(lambda mid: (203, mid)) room = EextByte()
class CoolingConfiguration(EepromModel): """ Models a thermostat in cooling mode. The maximum number of thermostats is 32. """ id = EepromId(32) name = EepromString(16, lambda mid: (204 + (mid / 16), 16 * (mid % 16))) setp0 = EepromTemp(lambda mid: (201, 32 + mid)) setp1 = EepromTemp(lambda mid: (201, 64 + mid)) setp2 = EepromTemp(lambda mid: (201, 96 + mid)) setp3 = EepromTemp(lambda mid: (201, 128 + mid)) setp4 = EepromTemp(lambda mid: (201, 160 + mid)) setp5 = EepromTemp(lambda mid: (201, 192 + mid)) sensor = EepromByte(lambda mid: (203, 8 + mid)) output0 = EepromByte(lambda mid: (201, mid)) output1 = EepromByte(lambda mid: (201, 224 + mid)) pid_p = EepromByte(lambda mid: (200, 4 * mid)) pid_i = EepromByte(lambda mid: (200, (4 * mid) + 1)) pid_d = EepromByte(lambda mid: (200, (4 * mid) + 2)) pid_int = EepromByte(lambda mid: (200, (4 * mid) + 3)) permanent_manual = EepromIBool(lambda mid: (195, 64 + mid)) auto_mon = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 0))), ('start_d1', EepromTime(lambda mid: (206, (4 * mid) + 0))), ('stop_d1', EepromTime(lambda mid: (206, (4 * mid) + 1))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 0))), ('start_d2', EepromTime(lambda mid: (206, (4 * mid) + 2))), ('stop_d2', EepromTime(lambda mid: (206, (4 * mid) + 3))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 0))) ]) auto_tue = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 32))), ('start_d1', EepromTime(lambda mid: (206, (4 * mid) + 128))), ('stop_d1', EepromTime(lambda mid: (206, (4 * mid) + 129))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 32))), ('start_d2', EepromTime(lambda mid: (206, (4 * mid) + 130))), ('stop_d2', EepromTime(lambda mid: (206, (4 * mid) + 131))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 32))) ]) auto_wed = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 64))), ('start_d1', EepromTime(lambda mid: (207, (4 * mid) + 0))), ('stop_d1', EepromTime(lambda mid: (207, (4 * mid) + 1))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 64))), ('start_d2', EepromTime(lambda mid: (207, (4 * mid) + 2))), ('stop_d2', EepromTime(lambda mid: (207, (4 * mid) + 3))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 64))) ]) auto_thu = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 96))), ('start_d1', EepromTime(lambda mid: (207, (4 * mid) + 128))), ('stop_d1', EepromTime(lambda mid: (207, (4 * mid) + 129))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 96))), ('start_d2', EepromTime(lambda mid: (207, (4 * mid) + 130))), ('stop_d2', EepromTime(lambda mid: (207, (4 * mid) + 131))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 96))) ]) auto_fri = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 128))), ('start_d1', EepromTime(lambda mid: (208, (4 * mid) + 0))), ('stop_d1', EepromTime(lambda mid: (208, (4 * mid) + 1))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 128))), ('start_d2', EepromTime(lambda mid: (208, (4 * mid) + 2))), ('stop_d2', EepromTime(lambda mid: (208, (4 * mid) + 3))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 128))) ]) auto_sat = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 160))), ('start_d1', EepromTime(lambda mid: (208, (4 * mid) + 128))), ('stop_d1', EepromTime(lambda mid: (208, (4 * mid) + 129))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 160))), ('start_d2', EepromTime(lambda mid: (208, (4 * mid) + 130))), ('stop_d2', EepromTime(lambda mid: (208, (4 * mid) + 131))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 160))) ]) auto_sun = CompositeDataType([ ('temp_n', EepromTemp(lambda mid: (212, mid + 192))), ('start_d1', EepromTime(lambda mid: (209, (4 * mid) + 0))), ('stop_d1', EepromTime(lambda mid: (209, (4 * mid) + 1))), ('temp_d1', EepromTemp(lambda mid: (210, mid + 192))), ('start_d2', EepromTime(lambda mid: (209, (4 * mid) + 2))), ('stop_d2', EepromTime(lambda mid: (209, (4 * mid) + 3))), ('temp_d2', EepromTemp(lambda mid: (211, mid + 192))) ]) room = EextByte()
class ShutterGroupConfiguration(EepromModel): """ Models a group of shutters. """ id = EepromId(30) timer_up = EepromByte(lambda mid: (64, (mid * 2) + 0)) timer_down = EepromByte(lambda mid: (64, (mid * 2) + 1))
class Model4(EepromModel): """ Dummy model with a dynamic maximum id. """ id = EepromId(10, address=EepromAddress(0, 0, 1), multiplier=2) name = EepromString(10, lambda id: (1, 2 + id * 10))
class Model5(EepromModel): """ Dummy model with multiple fields and an id. """ id = EepromId(3) name = EepromString(10, lambda id: (3+id, 4)) link = EepromByte(lambda id: (3+id, 14)) out = EepromWord(lambda id: (3+id, 15))
class SensorConfiguration(EepromModel): """ Models a sensor. The maximum number of sensors is 32. """ id = EepromId(32) name = EepromString(16, lambda mid: (193 + (mid / 16), (mid % 16) * 16)) offset = EepromSignedTemp(lambda mid: (0, 60 + mid)) virtual = EepromIBool(lambda mid: (195, mid))
class Model9(EepromModel): """ Dummy model with multiple fields, including eext fields, without an id. """ id = EepromId(10) name = EextString() floor = EextByte()
class GroupActionConfiguration(EepromModel): """ Models a group action. The maximum number of inputs is 160. """ id = EepromId(160) name = EepromString(16, lambda mid: (158 + (mid / 16), 16 * (mid % 16))) actions = EepromActions(16, lambda mid: (67 + (mid / 8), 32 * (mid % 8)))