Skip to content

Commit af8bd37

Browse files
committed
Add typing for Munch's
1 parent bb2fa1c commit af8bd37

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

plugwise/helper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def _locations_specials(self, loc, location):
349349

350350
def _all_locations(self) -> None:
351351
"""Collect all locations."""
352-
loc = Munch()
352+
loc: Munch = Munch()
353353

354354
# Legacy Anna without outdoor_temp and Stretches have no locations, create one containing all appliances
355355
if len(self._locations) == 0 and self._smile_legacy:
@@ -406,7 +406,7 @@ def _get_module_data(self, appliance, locator, mod_type) -> list[str | None]:
406406
return [v_name, v_model, hw_version, fw_version]
407407
return [None, None, None, None]
408408

409-
def _energy_device_info_finder(self, appliance, appl):
409+
def _energy_device_info_finder(self, appliance, appl) -> Munch:
410410
"""Helper-function for _appliance_info_finder().
411411
Collect energy device info (Circle, Plug, Stealth): firmware, model and vendor name.
412412
"""
@@ -432,7 +432,7 @@ def _energy_device_info_finder(self, appliance, appl):
432432
appl.fw = module_data[3]
433433
return appl
434434

435-
def _appliance_info_finder(self, appliance, appl):
435+
def _appliance_info_finder(self, appliance, appl) -> Munch:
436436
"""Collect device info (Smile/Stretch, Thermostats, OpenTherm/On-Off): firmware, model and vendor name."""
437437
# Find gateway and heater_central devices
438438
if appl.pwclass == "gateway":
@@ -505,7 +505,7 @@ def _appliance_info_finder(self, appliance, appl):
505505
# Cornercase just return existing dict-object
506506
return appl # pragma: no cover
507507

508-
def _appliance_types_finder(self, appliance, appl):
508+
def _appliance_types_finder(self, appliance, appl) -> Munch:
509509
"""Helper-function for _all_appliances() - determine type(s) per appliance."""
510510
# Appliance with location (i.e. a device)
511511
if appliance.find("location") is not None:
@@ -577,7 +577,7 @@ def _all_appliances(self) -> None:
577577
self._on_off_device = ch_state is not None and ot_fault_code is None
578578

579579
for appliance in self._appliances.findall("./appliance"):
580-
appl = Munch()
580+
appl: Munch = Munch()
581581
appl.pwclass = appliance.find("type").text
582582
# Nothing useful in opentherm so skip it
583583
if appl.pwclass == "open_therm_gateway":
@@ -1000,7 +1000,7 @@ def _power_data_from_location(self, loc_id) -> dict[str, Any] | None:
10001000
Collect the power-data based on Location ID.
10011001
"""
10021002
direct_data = {}
1003-
loc = Munch()
1003+
loc: Munch = Munch()
10041004

10051005
if self.smile_type != "power":
10061006
return

0 commit comments

Comments
 (0)