File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -159,8 +159,8 @@ def _all_appliances(self) -> None:
159159 def _get_p1_smartmeter_info (self ) -> None :
160160 """For P1 collect the connected SmartMeter info from the Home/building location.
161161
162- Note: For P1, the entity_id for the gateway and smartmeter are
163- switched to maintain backward compatibility with existing implementations .
162+ Note: For P1, the entity_id for the gateway and smartmeter are switched to maintain
163+ backward compatibility. For Anna P1, the smartmeter uses the home location_id directly .
164164 """
165165 appl = Munch ()
166166 locator = MODULE_LOCATOR
@@ -327,9 +327,10 @@ def _get_measurement_data(self, entity_id: str) -> GwEntityData:
327327 data : GwEntityData = {"binary_sensors" : {}, "sensors" : {}, "switches" : {}}
328328 # Get P1 smartmeter data from LOCATIONS
329329 entity = self .gw_entities [entity_id ]
330- dev_class = entity .get ("dev_class" )
331330 smile_is_power = self .smile .type == "power"
332- if (smile_is_power or self .smile .anna_p1 ) and dev_class == "smartmeter" :
331+ if (smile_is_power or self .smile .anna_p1 ) and entity .get (
332+ "dev_class"
333+ ) == "smartmeter" :
333334 data .update (self ._power_data_from_location ())
334335
335336 if smile_is_power and not self .smile .anna_p1 :
You can’t perform that action at this time.
0 commit comments