@@ -27,117 +27,110 @@ class APIConfig(TypedDict):
2727 hot_water : dict [str , str ]
2828
2929
30- API_V1 : Final [APIConfig ] = {
31- "heating" : {
32- "700" : "hvac_mode" ,
33- "710" : "target_temperature" ,
34- "900" : "hvac_mode2" ,
35- "8000" : "hvac_action" ,
36- "8740" : "current_temperature" ,
37- "8749" : "room1_thermostat_mode" ,
38- },
39- "staticValues" : {
40- "714" : "min_temp" ,
41- "730" : "max_temp" ,
42- },
43- "device" : {
44- "6224" : "device_identification" ,
45- "6225" : "controller_family" ,
46- "6226" : "controller_variant" ,
47- },
48- "sensor" : {
49- "8700" : "outside_temperature" ,
50- "8740" : "current_temperature" ,
51- },
52- "hot_water" : {
53- "1600" : "operating_mode" ,
54- "1601" : "eco_mode_selection" ,
55- "1610" : "nominal_setpoint" ,
56- "1614" : "nominal_setpoint_max" ,
57- "1612" : "reduced_setpoint" ,
58- "1620" : "release" ,
59- "1630" : "dhw_charging_priority" ,
60- "1640" : "legionella_function" ,
61- "1645" : "legionella_setpoint" ,
62- "1641" : "legionella_periodicity" ,
63- "1642" : "legionella_function_day" ,
64- "1643" : "legionella_function_time" ,
65- "1646" : "legionella_dwelling_time" ,
66- "1647" : "legionella_circulation_pump" ,
67- "1648" : "legionella_circulation_temp_diff" ,
68- "1660" : "dhw_circulation_pump_release" ,
69- "1661" : "dhw_circulation_pump_cycling" ,
70- "1663" : "dhw_circulation_setpoint" ,
71- "1680" : "operating_mode_changeover" ,
72- "8830" : "dhw_actual_value_top_temperature" ,
73- "8820" : "state_dhw_pump" ,
74- "561" : "dhw_time_program_monday" ,
75- "562" : "dhw_time_program_tuesday" ,
76- "563" : "dhw_time_program_wednesday" ,
77- "564" : "dhw_time_program_thursday" ,
78- "565" : "dhw_time_program_friday" ,
79- "566" : "dhw_time_program_saturday" ,
80- "567" : "dhw_time_program_sunday" ,
81- "576" : "dhw_time_program_standard_values" ,
82- },
30+ # Base parameters that exist in all API versions
31+ BASE_HEATING_PARAMS : Final [dict [str , str ]] = {
32+ "700" : "hvac_mode" ,
33+ "710" : "target_temperature" ,
34+ "900" : "hvac_mode2" ,
35+ "8000" : "hvac_action" ,
36+ "8740" : "current_temperature" ,
37+ "8749" : "room1_thermostat_mode" ,
8338}
8439
85- API_V3 : Final [APIConfig ] = {
86- "heating" : {
87- "700" : "hvac_mode" ,
88- "710" : "target_temperature" ,
89- "900" : "hvac_mode2" ,
90- "8000" : "hvac_action" ,
91- "8740" : "current_temperature" ,
92- "8749" : "room1_thermostat_mode" ,
93- "770" : "room1_temp_setpoint_boost" ,
94- },
95- "staticValues" : {
96- "714" : "min_temp" ,
97- "716" : "max_temp" ,
98- },
99- "device" : {
100- "6224" : "device_identification" ,
101- "6225" : "controller_family" ,
102- "6226" : "controller_variant" ,
103- },
104- "sensor" : {
105- "8700" : "outside_temperature" ,
106- "8740" : "current_temperature" ,
107- },
108- "hot_water" : {
109- "1600" : "operating_mode" ,
110- "1601" : "eco_mode_selection" ,
111- "1610" : "nominal_setpoint" ,
112- "1614" : "nominal_setpoint_max" ,
113- "1612" : "reduced_setpoint" ,
114- "1620" : "release" ,
115- "1630" : "dhw_charging_priority" ,
116- "1640" : "legionella_function" ,
117- "1645" : "legionella_setpoint" ,
118- "1641" : "legionella_periodicity" ,
119- "1642" : "legionella_function_day" ,
120- "1644" : "legionella_function_time" ,
121- "1646" : "legionella_dwelling_time" ,
122- "1647" : "legionella_circulation_pump" ,
123- "1648" : "legionella_circulation_temp_diff" ,
124- "1660" : "dhw_circulation_pump_release" ,
125- "1661" : "dhw_circulation_pump_cycling" ,
126- "1663" : "dhw_circulation_setpoint" ,
127- "1680" : "operating_mode_changeover" ,
128- "8830" : "dhw_actual_value_top_temperature" ,
129- "8820" : "state_dhw_pump" ,
130- "561" : "dhw_time_program_monday" ,
131- "562" : "dhw_time_program_tuesday" ,
132- "563" : "dhw_time_program_wednesday" ,
133- "564" : "dhw_time_program_thursday" ,
134- "565" : "dhw_time_program_friday" ,
135- "566" : "dhw_time_program_saturday" ,
136- "567" : "dhw_time_program_sunday" ,
137- "576" : "dhw_time_program_standard_values" ,
138- },
40+ BASE_STATIC_VALUES_PARAMS : Final [dict [str , str ]] = {
41+ "714" : "min_temp" ,
13942}
14043
44+ BASE_DEVICE_PARAMS : Final [dict [str , str ]] = {
45+ "6224" : "device_identification" ,
46+ "6225" : "controller_family" ,
47+ "6226" : "controller_variant" ,
48+ }
49+
50+ BASE_SENSOR_PARAMS : Final [dict [str , str ]] = {
51+ "8700" : "outside_temperature" ,
52+ "8740" : "current_temperature" ,
53+ }
54+
55+ BASE_HOT_WATER_PARAMS : Final [dict [str , str ]] = {
56+ "1600" : "operating_mode" ,
57+ "1601" : "eco_mode_selection" ,
58+ "1610" : "nominal_setpoint" ,
59+ "1614" : "nominal_setpoint_max" ,
60+ "1612" : "reduced_setpoint" ,
61+ "1620" : "release" ,
62+ "1630" : "dhw_charging_priority" ,
63+ "1640" : "legionella_function" ,
64+ "1645" : "legionella_setpoint" ,
65+ "1641" : "legionella_periodicity" ,
66+ "1642" : "legionella_function_day" ,
67+ "1644" : "legionella_function_time" ,
68+ "1646" : "legionella_dwelling_time" ,
69+ "1647" : "legionella_circulation_pump" ,
70+ "1648" : "legionella_circulation_temp_diff" ,
71+ "1660" : "dhw_circulation_pump_release" ,
72+ "1661" : "dhw_circulation_pump_cycling" ,
73+ "1663" : "dhw_circulation_setpoint" ,
74+ "1680" : "operating_mode_changeover" ,
75+ "8830" : "dhw_actual_value_top_temperature" ,
76+ "8820" : "state_dhw_pump" ,
77+ "561" : "dhw_time_program_monday" ,
78+ "562" : "dhw_time_program_tuesday" ,
79+ "563" : "dhw_time_program_wednesday" ,
80+ "564" : "dhw_time_program_thursday" ,
81+ "565" : "dhw_time_program_friday" ,
82+ "566" : "dhw_time_program_saturday" ,
83+ "567" : "dhw_time_program_sunday" ,
84+ "576" : "dhw_time_program_standard_values" ,
85+ }
86+
87+ # V1-specific parameters
88+ V1_STATIC_VALUES_EXTENSIONS : Final [dict [str , str ]] = {
89+ "730" : "max_temp" , # V1 uses 730 for max_temp
90+ }
91+
92+ # V3-specific additional parameters
93+ V3_HEATING_EXTENSIONS : Final [dict [str , str ]] = {
94+ "770" : "room1_temp_setpoint_boost" ,
95+ # Future V3 extensions like 701, 701.1, 701.2 can be added here
96+ }
97+
98+ V3_STATIC_VALUES_EXTENSIONS : Final [dict [str , str ]] = {
99+ "716" : "max_temp" , # V3 uses 716 for max_temp
100+ }
101+
102+
103+ def build_api_config (version : str ) -> APIConfig :
104+ """Build API configuration dynamically based on version.
105+
106+ Args:
107+ version: The API version ("v1" or "v3")
108+
109+ Returns:
110+ APIConfig: The complete API configuration for the specified version
111+
112+ """
113+ config : APIConfig = {
114+ "heating" : BASE_HEATING_PARAMS .copy (),
115+ "staticValues" : BASE_STATIC_VALUES_PARAMS .copy (),
116+ "device" : BASE_DEVICE_PARAMS .copy (),
117+ "sensor" : BASE_SENSOR_PARAMS .copy (),
118+ "hot_water" : BASE_HOT_WATER_PARAMS .copy (),
119+ }
120+
121+ if version == "v1" :
122+ config ["staticValues" ].update (V1_STATIC_VALUES_EXTENSIONS )
123+ elif version == "v3" :
124+ config ["heating" ].update (V3_HEATING_EXTENSIONS )
125+ config ["staticValues" ].update (V3_STATIC_VALUES_EXTENSIONS )
126+
127+ return config
128+
129+
130+ # Pre-built API configurations
131+ API_V1 : Final [APIConfig ] = build_api_config ("v1" )
132+ API_V3 : Final [APIConfig ] = build_api_config ("v3" )
133+
141134API_VERSIONS : Final [dict [str , APIConfig ]] = {
142135 "v1" : API_V1 ,
143136 "v3" : API_V3 ,
@@ -189,3 +182,60 @@ class APIConfig(TypedDict):
189182
190183# Handle both ASCII and Unicode degree symbols
191184TEMPERATURE_UNITS = {"°C" , "°F" , "°C" , "°F" , "°C" , "°F" }
185+
186+ # Hot Water Parameter Groups
187+ # Essential parameters for frequent monitoring
188+ HOT_WATER_ESSENTIAL_PARAMS : Final [set [str ]] = {
189+ param_id
190+ for param_id , name in BASE_HOT_WATER_PARAMS .items ()
191+ if name
192+ in {
193+ "operating_mode" ,
194+ "nominal_setpoint" ,
195+ "reduced_setpoint" ,
196+ "release" ,
197+ "dhw_actual_value_top_temperature" ,
198+ "state_dhw_pump" ,
199+ }
200+ }
201+
202+ # Configuration parameters checked less frequently
203+ HOT_WATER_CONFIG_PARAMS : Final [set [str ]] = {
204+ param_id
205+ for param_id , name in BASE_HOT_WATER_PARAMS .items ()
206+ if name
207+ in {
208+ "eco_mode_selection" ,
209+ "nominal_setpoint_max" ,
210+ "dhw_charging_priority" ,
211+ "operating_mode_changeover" ,
212+ "legionella_function" ,
213+ "legionella_setpoint" ,
214+ "legionella_periodicity" ,
215+ "legionella_function_day" ,
216+ "legionella_function_time" ,
217+ "legionella_dwelling_time" ,
218+ "legionella_circulation_pump" ,
219+ "legionella_circulation_temp_diff" ,
220+ "dhw_circulation_pump_release" ,
221+ "dhw_circulation_pump_cycling" ,
222+ "dhw_circulation_setpoint" ,
223+ }
224+ }
225+
226+ # Schedule parameters (time programs)
227+ HOT_WATER_SCHEDULE_PARAMS : Final [set [str ]] = {
228+ param_id
229+ for param_id , name in BASE_HOT_WATER_PARAMS .items ()
230+ if name
231+ in {
232+ "dhw_time_program_monday" ,
233+ "dhw_time_program_tuesday" ,
234+ "dhw_time_program_wednesday" ,
235+ "dhw_time_program_thursday" ,
236+ "dhw_time_program_friday" ,
237+ "dhw_time_program_saturday" ,
238+ "dhw_time_program_sunday" ,
239+ "dhw_time_program_standard_values" ,
240+ }
241+ }
0 commit comments