@@ -380,18 +380,14 @@ def appliance_info_finder(self, appliance, appl):
380380
381381 def appliance_types_finder (self , appliance , appl ):
382382 """Determine type(s) per appliance."""
383- # For legacy Anna gateway and heater_central is the same device
384- if self ._smile_legacy and self .smile_type == "thermostat" :
385- self .gateway_id = self .heater_id
386-
387- # Preset all types applicable to home
388- appl .types = self ._loc_data [self ._home_location ]["types" ]
389-
390383 # Appliance with location (i.e. a device)
391384 if appliance .find ("location" ) is not None :
392385 appl .location = appliance .find ("location" ).attrib ["id" ]
393386 for appl_type in types_finder (appliance ):
394387 appl .types .add (appl_type )
388+ else :
389+ # Preset all types applicable to home
390+ appl .types = self ._loc_data [self ._home_location ]["types" ]
395391
396392 # Determine appliance_type from functionality
397393 relay_func = appliance .find (".//actuator_functionalities/relay_functionality" )
@@ -476,6 +472,10 @@ def all_appliances(self):
476472 "vendor" : appl .v_name ,
477473 }
478474
475+ # For legacy Anna gateway and heater_central is the same device
476+ if self ._smile_legacy and self .smile_type == "thermostat" :
477+ self .gateway_id = self .heater_id
478+
479479 def match_locations (self ):
480480 """Update locations with present appliance-types."""
481481 matched_locations = {}
0 commit comments