Skip to content

Commit 90430e0

Browse files
committed
Improve _all_device_data()
1 parent 66c6f91 commit 90430e0

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

plugwise/smile.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,25 +51,23 @@ def _all_device_data(self) -> None:
5151
"""Helper-function for get_all_devices().
5252
Collect initial data for each device and add to self.gw_data and self.gw_devices.
5353
"""
54-
for dev_id, dev_dict in self._devices.items():
55-
dev_and_data: dict[str, Any] = dev_dict
54+
for device_id, device in self._devices.items():
5655
temp_bs_dict: dict[str, bool] = {}
5756
temp_s_dict: dict[str, Any] = {}
58-
temp_sw_dict: dict[str, str] = {}
59-
data: dict[str, Any] = self._get_device_data(dev_id)
57+
temp_sw_dict: dict[str, bool] = {}
6058

59+
data: dict[str, Any] = self._get_device_data(device_id)
6160
self._create_dicts_from_data(data, temp_bs_dict, temp_s_dict, temp_sw_dict)
62-
self._append_special(dev_id, temp_bs_dict, temp_s_dict)
63-
64-
dev_and_data.update(data)
61+
self._append_special(device_id, temp_bs_dict, temp_s_dict)
62+
device.update(data)
6563
if temp_bs_dict:
66-
dev_and_data["binary_sensors"] = temp_bs_dict
64+
device["binary_sensors"] = temp_bs_dict
6765
if temp_s_dict:
68-
dev_and_data["sensors"] = temp_s_dict
66+
device["sensors"] = temp_s_dict
6967
if temp_sw_dict:
70-
dev_and_data["switches"] = temp_sw_dict
68+
device["switches"] = temp_sw_dict
7169

72-
self.gw_devices[dev_id] = dev_and_data
70+
self.gw_devices[device_id] = device
7371

7472
self.gw_data["active_device"] = self._opentherm_device or self._on_off_device
7573
self.gw_data["cooling_present"] = self._cooling_present

0 commit comments

Comments
 (0)