@@ -45,8 +45,7 @@ def _update_zones(self) -> None:
4545 Collect data for each zone/location and add to self._zones.
4646 """
4747 for location_id , zone in self ._zones .items ():
48- data = self ._get_location_data (location_id )
49- zone .update (data )
48+ self ._get_location_data (location_id , zone )
5049
5150 def _update_gw_entities (self ) -> None :
5251 """Helper-function for _all_entities_data() and async_update().
@@ -155,33 +154,30 @@ def _update_for_cooling(self, entity: GwEntityData) -> None:
155154 3 # add 4 total, remove 1, count the conditional remove separately
156155 )
157156
158- def _get_location_data (self , loc_id : str ) -> GwEntityData :
157+ def _get_location_data (self , loc_id : str , zone : GwEntityData ) -> None :
159158 """Helper-function for _all_entity_data() and async_update().
160159
161160 Provide entity-data, based on Location ID (= loc_id).
162161 """
163- zone = self ._zones [loc_id ]
164- data = self ._get_zone_data (loc_id )
165- self ._regulation_control (data )
162+ self ._get_zone_data (loc_id , zone )
163+ self ._regulation_control (zone )
166164
167- data ["control_state" ] = "idle"
165+ zone ["control_state" ] = "idle"
168166 self ._count += 1
169- if (ctrl_state := self ._control_state (data )) and ctrl_state in (
167+ if (ctrl_state := self ._control_state (zone )) and ctrl_state in (
170168 "cooling" ,
171169 "heating" ,
172170 "preheating" ,
173171 ):
174- data ["control_state" ] = str (ctrl_state )
172+ zone ["control_state" ] = str (ctrl_state )
175173
176- if "setpoint" in data ["sensors" ]:
177- data ["sensors" ].pop ("setpoint" ) # remove, only used in _control_state()
174+ if "setpoint" in zone ["sensors" ]:
175+ zone ["sensors" ].pop ("setpoint" ) # remove, only used in _control_state()
178176 self ._count -= 1
179177
180178 # Thermostat data (presets, temperatures etc)
181179 self ._climate_data (loc_id , zone )
182180
183- return data
184-
185181 def _get_entity_data (self , entity_id : str , entity : GwEntityData ) -> None :
186182 """Helper-function for _update_gw_entities() and async_update().
187183
0 commit comments