55from __future__ import annotations
66
77from plugwise .constants import ModelData
8- from plugwise .util import check_heater_central , check_model , get_vendor_name , safe
8+ from plugwise .util import check_heater_central , check_model , get_vendor_name , return_valid
99
1010from defusedxml import ElementTree as etree
1111from munch import Munch
@@ -32,7 +32,7 @@ def _appl_thermostat_info(self, appl: Munch, xml_1: etree, xml_2: etree = None)
3232 """Helper-function for _appliance_info_finder()."""
3333 locator = "./logs/point_log[type='thermostat']/thermostat"
3434 mod_type = "thermostat"
35- xml_2 = safe (xml_2 , self ._domain_objects )
35+ xml_2 = return_valid (xml_2 , self ._domain_objects )
3636 module_data = self ._get_module_data (xml_1 , locator , mod_type , xml_2 )
3737 appl .vendor_name = module_data ["vendor_name" ]
3838 appl .model = check_model (module_data ["vendor_model" ], appl .vendor_name )
@@ -56,7 +56,7 @@ def _appl_heater_central_info(
5656
5757 # Find the valid heater_central
5858 # xml_2 self._appliances for legacy, self._domain_objects for actual
59- xml_2 = safe (xml_2 , self ._domain_objects )
59+ xml_2 = return_valid (xml_2 , self ._domain_objects )
6060 self ._heater_id = check_heater_central (xml_2 )
6161
6262 # Info for On-Off device
@@ -73,7 +73,7 @@ def _appl_heater_central_info(
7373 mod_type = "boiler_state"
7474 # xml_1: appliance
7575 # xml_3: self._modules for legacy, self._domain_objects for actual
76- xml_3 = safe (xml_3 , self ._domain_objects )
76+ xml_3 = return_valid (xml_3 , self ._domain_objects )
7777 module_data = self ._get_module_data (xml_1 , locator_1 , mod_type , xml_3 )
7878 if not module_data ["contents" ]:
7979 module_data = self ._get_module_data (xml_1 , locator_2 , mod_type , xml_3 )
0 commit comments