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 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 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 Model8(EepromModel): """ Dummy model with multiple fields, including eext fields, without an id. """ name = EepromString(10, (1, 4)) link = EepromByte((1, 14)) room = EextByte()
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 Model6(EepromModel): """ Dummy model with a CompositeDataType. """ name = EepromString(10, (3, 4)) status = CompositeDataType([('link', EepromByte((3, 14))), ('out', EepromWord((3, 15)))])
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 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 Model3(EepromModel): """ Dummy model with multiple fields. """ name = EepromString(10, (3, 4)) link = EepromByte((3, 14)) out = EepromWord((3, 15))
class Model2(EepromModel): """ Dummy model without an id. """ name = EepromString(100, (3, 4))
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 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)))
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 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()