Skip to content

Commit 14f8b07

Browse files
committed
Clean up self-vars
1 parent c1c186d commit 14f8b07

File tree

4 files changed

+10
-59
lines changed

4 files changed

+10
-59
lines changed

plugwise/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,10 @@ class SmileCommon:
3434

3535
def __init__(self) -> None:
3636
"""Init."""
37-
self._appliances: etree
3837
self._cooling_present: bool
3938
self._count: int
4039
self._domain_objects: etree
41-
self._heater_id: str
4240
self._on_off_device: bool
43-
self._opentherm_device: bool
4441
self.gw_entities: dict[str, GwEntityData]
4542
self.smile_name: str
4643
self.smile_type: str

plugwise/helper.py

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -71,53 +71,18 @@ class SmileHelper(SmileCommon):
7171

7272
def __init__(self) -> None:
7373
"""Set the constructor for this class."""
74-
self._cooling_present: bool
75-
self._count: int
76-
self._dhw_allowed_modes: list[str] = []
77-
self._domain_objects: etree
7874
self._endpoint: str
7975
self._elga: bool
8076
self._gateway_id: str
81-
self._gw_allowed_modes: list[str] = []
82-
self._home_loc_id: str
83-
self._home_location: etree
8477
self._is_thermostat: bool
8578
self._last_active: dict[str, str | None]
86-
self._last_modified: dict[str, str] = {}
8779
self._loc_data: dict[str, ThermoLoc]
88-
self._notifications: dict[str, dict[str, str]] = {}
89-
self._on_off_device: bool
90-
self._opentherm_device: bool
91-
self._reg_allowed_modes: list[str] = []
9280
self._schedule_old_states: dict[str, dict[str, str]]
93-
self._status: etree
94-
self._stretch_v2: bool
95-
self._system: etree
96-
self._thermo_locs: dict[str, ThermoLoc] = {}
97-
###################################################################
98-
# '_cooling_enabled' can refer to the state of the Elga heatpump
99-
# connected to an Anna. For Elga, 'elga_status_code' in (8, 9)
100-
# means cooling mode is available, next to heating mode.
101-
# 'elga_status_code' = 8 means cooling is active, 9 means idle.
102-
#
103-
# '_cooling_enabled' cam refer to the state of the Loria or
104-
# Thermastage heatpump connected to an Anna. For these,
105-
# 'cooling_enabled' = on means set to cooling mode, instead of to
106-
# heating mode.
107-
# 'cooling_state' = on means cooling is active.
108-
###################################################################
109-
self._cooling_active = False
110-
self._cooling_enabled = False
111-
112-
self.gw_entities: dict[str, GwEntityData]
11381
self.smile_hw_version: str | None
11482
self.smile_mac_address: str | None
11583
self.smile_model: str
11684
self.smile_model_id: str | None
117-
self.smile_name: str
118-
self.smile_type: str
11985
self.smile_version: version.Version | None
120-
self.smile_zigbee_mac_address: str | None
12186
self._zones: dict[str, GwEntityData]
12287
SmileCommon.__init__(self)
12388

@@ -657,7 +622,11 @@ def _update_anna_cooling(self, entity_id: str, data: GwEntityData) -> None:
657622
self._update_loria_cooling(data)
658623

659624
def _update_elga_cooling(self, data: GwEntityData) -> None:
660-
"""# Anna+Elga: base cooling_state on the elga-status-code."""
625+
"""# Anna+Elga: base cooling_state on the elga-status-code.
626+
627+
For Elga, 'elga_status_code' in (8, 9) means cooling is enabled.
628+
'elga_status_code' = 8 means cooling is active, 9 means idle.
629+
"""
661630
if data["thermostat_supports_cooling"]:
662631
# Techneco Elga has cooling-capability
663632
self._cooling_present = True
@@ -679,7 +648,11 @@ def _update_elga_cooling(self, data: GwEntityData) -> None:
679648
self._count -= 1
680649

681650
def _update_loria_cooling(self, data: GwEntityData) -> None:
682-
"""Loria/Thermastage: base cooling-related on cooling_state and modulation_level."""
651+
"""Loria/Thermastage: base cooling-related on cooling_state and modulation_level.
652+
653+
For the Loria or Thermastage heatpump connected to an Anna cooling-enabled is
654+
indicated via the Cooling Enable switch in the Plugwise App.
655+
"""
683656
# For Loria/Thermastage it's not clear if cooling_enabled in xml shows the correct status,
684657
# setting it specifically:
685658
self._cooling_enabled = data["binary_sensors"]["cooling_enabled"] = data[

plugwise/legacy/helper.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,29 +62,14 @@ class SmileLegacyHelper(SmileCommon):
6262
def __init__(self) -> None:
6363
"""Set the constructor for this class."""
6464
self._appliances: etree
65-
self._count: int
66-
self._domain_objects: etree
67-
self._heater_id: str
68-
self._home_loc_id: str
6965
self._is_thermostat: bool
70-
self._last_modified: dict[str, str] = {}
7166
self._loc_data: dict[str, ThermoLoc]
7267
self._locations: etree
7368
self._modules: etree
74-
self._notifications: dict[str, dict[str, str]] = {}
75-
self._on_off_device: bool
76-
self._opentherm_device: bool
77-
self._outdoor_temp: float
78-
self._status: etree
7969
self._stretch_v2: bool
80-
self._system: etree
81-
self.gateway_id: str
8270
self.gw_entities: dict[str, GwEntityData] = {}
83-
self.smile_hw_version: str | None
8471
self.smile_mac_address: str | None
8572
self.smile_model: str
86-
self.smile_name: str
87-
self.smile_type: str
8873
self.smile_version: Version | None
8974
self.smile_zigbee_mac_address: str | None
9075
SmileCommon.__init__(self)

plugwise/smile.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
LOCATIONS,
1919
MAX_SETPOINT,
2020
MIN_SETPOINT,
21-
NONE,
2221
NOTIFICATIONS,
2322
OFF,
2423
RULES,
@@ -63,11 +62,8 @@ def __init__(
6362
smile_version: Version | None,
6463
) -> None:
6564
"""Set the constructor for this class."""
66-
self._cooling_enabled = False
6765
self._cooling_present = _cooling_present
6866
self._elga = _elga
69-
self._gateway_id: str = NONE
70-
self._heater_id: str = NONE
7167
self._is_thermostat = _is_thermostat
7268
self._last_active = _last_active
7369
self._loc_data = _loc_data

0 commit comments

Comments
 (0)