Skip to content

Commit 7b44775

Browse files
committed
Extend internal-use selfs
1 parent ad65d13 commit 7b44775

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

plugwise/data.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _all_entity_data(self) -> None:
3636
self._update_gw_entities()
3737
if self.smile(ADAM):
3838
self._update_zones()
39-
self.gw_entities.update(self.zones)
39+
self.gw_entities.update(self._zones)
4040

4141
self.gw_data.update(
4242
{
@@ -55,9 +55,9 @@ def _all_entity_data(self) -> None:
5555
def _update_zones(self) -> None:
5656
"""Helper-function for _all_entity_data() and async_update().
5757
58-
Collect data for each zone/location and add to self.zones.
58+
Collect data for each zone/location and add to self._zones.
5959
"""
60-
for location_id, zone in self.zones.items():
60+
for location_id, zone in self._zones.items():
6161
data = self._get_location_data(location_id)
6262
zone.update(data)
6363

@@ -158,7 +158,7 @@ def _get_location_data(self, loc_id: str) -> GwEntityData:
158158
159159
Provide entity-data, based on Location ID (= loc_id).
160160
"""
161-
zone = self.zones[loc_id]
161+
zone = self._zones[loc_id]
162162
data = self._get_zone_data(loc_id)
163163
if ctrl_state := self._control_state(loc_id):
164164
data["control_state"] = ctrl_state

plugwise/helper.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def __init__(self) -> None:
224224
self._is_thermostat: bool
225225
self._last_active: dict[str, str | None]
226226
self._last_modified: dict[str, str] = {}
227+
self._loc_data: dict[str, ThermoLoc]
227228
self._notifications: dict[str, dict[str, str]] = {}
228229
self._on_off_device: bool
229230
self._opentherm_device: bool
@@ -251,7 +252,6 @@ def __init__(self) -> None:
251252
self.gateway_id: str
252253
self.gw_data: GatewayData = {}
253254
self.gw_entities: dict[str, GwEntityData] = {}
254-
self.loc_data: dict[str, ThermoLoc]
255255
self.smile_fw_version: Version | None
256256
self.smile_hw_version: str | None
257257
self.smile_mac_address: str | None
@@ -261,7 +261,7 @@ def __init__(self) -> None:
261261
self.smile_type: str
262262
self.smile_zigbee_mac_address: str | None
263263
self.therms_with_offset_func: list[str] = []
264-
self.zones: dict[str, GwEntityData] = {}
264+
self._zones: dict[str, GwEntityData] = {}
265265
SmileCommon.__init__(self)
266266

267267
def _all_appliances(self) -> None:
@@ -354,11 +354,11 @@ def _all_locations(self) -> None:
354354
if loc.name == "Home":
355355
self._home_location = loc.loc_id
356356

357-
self.loc_data[loc.loc_id] = {"name": loc.name}
357+
self._loc_data[loc.loc_id] = {"name": loc.name}
358358

359359
def _p1_smartmeter_info_finder(self, appl: Munch) -> None:
360360
"""Collect P1 DSMR SmartMeter info."""
361-
loc_id = next(iter(self.loc_data.keys()))
361+
loc_id = next(iter(self._loc_data.keys()))
362362
location = self._domain_objects.find(f'./location[@id="{loc_id}"]')
363363
locator = MODULE_LOCATOR
364364
module_data = self._get_module_data(location, locator)
@@ -488,7 +488,7 @@ def _get_zone_data(self, loc_id: str) -> GwEntityData:
488488
Collect the location-data based on location id.
489489
"""
490490
data: GwEntityData = {"sensors": {}}
491-
zone = self.zones[loc_id]
491+
zone = self._zones[loc_id]
492492
measurements = ZONE_MEASUREMENTS
493493
if (
494494
location := self._domain_objects.find(f'./location[@id="{loc_id}"]')
@@ -861,7 +861,7 @@ def _scan_thermostats(self) -> None:
861861

862862
for loc_id, loc_data in list(self._thermo_locs.items()):
863863
if loc_data["primary_prio"] != 0:
864-
self.zones[loc_id] = {
864+
self._zones[loc_id] = {
865865
"dev_class": "climate",
866866
"name": loc_data["name"],
867867
"thermostats": {"primary": loc_data["primary"], "secondary": loc_data["secondary"]}
@@ -874,7 +874,7 @@ def _match_locations(self) -> dict[str, ThermoLoc]:
874874
Match appliances with locations.
875875
"""
876876
matched_locations: dict[str, ThermoLoc] = {}
877-
for location_id, location_details in self.loc_data.items():
877+
for location_id, location_details in self._loc_data.items():
878878
for appliance_details in self.gw_entities.values():
879879
if appliance_details["location"] == location_id:
880880
location_details.update(

plugwise/smile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ async def async_update(self) -> PlugwiseData:
126126
"""Perform an incremental update for updating the various device states."""
127127
self.gw_data: GatewayData = {}
128128
self.gw_entities: dict[str, GwEntityData] = {}
129-
self.zones: dict[str, GwEntityData] = {}
129+
self._zones: dict[str, GwEntityData] = {}
130130
try:
131131
await self.full_xml_update()
132132
self.get_all_gateway_entities()

0 commit comments

Comments
 (0)