@@ -279,7 +279,13 @@ def __init__(self) -> None:
279279 SmileCommon .__init__ (self )
280280
281281 def _all_appliances (self ) -> None :
282- """Collect all appliances with relevant info."""
282+ """Collect all appliances with relevant info.
283+
284+ Also, collect the P1 smartmeter info from a location
285+ as this one is not available as an appliance.
286+ Note: For P1 devices, the entity_id for the gateway and smartmeter are
287+ switched to maintain backward compatibility with existing implementations.
288+ """
283289 self ._count = 0
284290 self ._all_locations ()
285291
@@ -338,16 +344,14 @@ def _all_appliances(self) -> None:
338344
339345 self ._create_gw_entities (appl )
340346
347+ # Collect P1 Smartmeter info
341348 self ._get_smartmeter_info ()
349+
350+ # Sort the gw_entities
342351 self ._sort_gw_entities ()
343352
344353 def _get_smartmeter_info (self ) -> None :
345- """For P1 collect the connected SmartMeter info from the Home/buildinglocation.
346-
347- 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.
350- """
354+ """For P1 collect the connected SmartMeter info from the Home/building location."""
351355 if self .smile_type == "power" :
352356 self ._p1_smartmeter_info_finder ()
353357 # P1: for gateway and smartmeter switch entity_id - part 2
0 commit comments