File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 8585MODULE_LOCATOR : Final = "./logs/point_log/*[@id]"
8686NONE : Final = "None"
8787OFF : Final = "off"
88+ PRIORITY_DEVICE_CLASSES = ("heater_central" , "gateway" )
8889
8990# XML data paths
9091APPLIANCES : Final = "/core/appliances"
Original file line number Diff line number Diff line change 2929 NONE ,
3030 OFF ,
3131 P1_MEASUREMENTS ,
32+ PRIORITY_DEVICE_CLASSES ,
3233 TEMP_CELSIUS ,
3334 THERMOSTAT_CLASSES ,
3435 TOGGLES ,
@@ -344,6 +345,8 @@ def _get_smartmeter_info(self) -> None:
344345 """For P1 collect the connected SmartMeter info from the Home/buildinglocation.
345346
346347 There is no appliance available for this device.
348+ Note: For P1 devices, we switch the gateway_id to the smartmeter device_id
349+ to maintain backward compatibility with existing implementations.
347350 """
348351 if self .smile_type == "power" :
349352 self ._p1_smartmeter_info_finder ()
@@ -356,7 +359,7 @@ def _get_smartmeter_info(self) -> None:
356359
357360 def _sort_gw_entities (self ) -> None :
358361 """Place the gateway and optional heater_central devices as 1st and 2nd."""
359- for dev_class in ( "heater_central" , "gateway" ) :
362+ for dev_class in PRIORITY_DEVICE_CLASSES :
360363 for entity_id , entity in dict (self .gw_entities ).items ():
361364 if entity ["dev_class" ] == dev_class :
362365 priority_entity = entity
You can’t perform that action at this time.
0 commit comments