Skip to content

Commit d9dab18

Browse files
committed
Clean up
1 parent fb31ff6 commit d9dab18

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

plugwise/common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _power_data_energy_diff(
171171
diff = 1
172172
if "produced" in measurement:
173173
diff = -1
174-
if net_string not in direct_data["sensors"]:
174+
if net_string not in data["sensors"]:
175175
tmp_val: float | int = 0
176176
else:
177177
tmp_val = data["sensors"][net_string]

plugwise/helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ def _power_data_from_location(self, loc_id: str) -> GwEntityData:
552552
553553
Collect the power-data based on Location ID, from LOCATIONS.
554554
"""
555-
direct_data: GwEntityData = {"sensors": {}}
555+
data: GwEntityData = {"sensors": {}}
556556
loc = Munch()
557557
log_list: list[str] = ["point_log", "cumulative_log", "interval_log"]
558558
t_string = "tariff"
@@ -561,10 +561,10 @@ def _power_data_from_location(self, loc_id: str) -> GwEntityData:
561561
loc.logs = search.find(f'./location[@id="{loc_id}"]/logs')
562562
for loc.measurement, loc.attrs in P1_MEASUREMENTS.items():
563563
for loc.log_type in log_list:
564-
self._collect_power_values(direct_data, loc, t_string)
564+
self._collect_power_values(data, loc, t_string)
565565

566-
self._count += len(direct_data["sensors"])
567-
return direct_data
566+
self._count += len(data["sensors"])
567+
return data
568568

569569
def _appliance_measurements(
570570
self,

plugwise/legacy/helper.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _power_data_from_modules(self) -> GwEntityData:
316316
317317
Collect the power-data from MODULES (P1 legacy only).
318318
"""
319-
direct_data: GwEntityData = {"sensors": {}}
319+
data: GwEntityData = {"sensors": {}}
320320
loc = Munch()
321321
mod_list: list[str] = ["interval_meter", "cumulative_meter", "point_meter"]
322322
t_string = "tariff_indicator"
@@ -327,10 +327,10 @@ def _power_data_from_modules(self) -> GwEntityData:
327327
loc.meas_list = loc.measurement.split("_")
328328
for loc.logs in mod_logs:
329329
for loc.log_type in mod_list:
330-
self._collect_power_values(direct_data, loc, t_string, legacy=True)
330+
self._collect_power_values(data, loc, t_string, legacy=True)
331331

332-
self._count += len(direct_data["sensors"])
333-
return direct_data
332+
self._count += len(data["sensors"])
333+
return data
334334

335335
def _appliance_measurements(
336336
self,

0 commit comments

Comments
 (0)