Skip to content

Commit 612ecaa

Browse files
committed
Better names, remove logging
1 parent 3952139 commit 612ecaa

File tree

2 files changed

+15
-26
lines changed

2 files changed

+15
-26
lines changed

plugwise/helper.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -290,9 +290,9 @@ def __init__(self):
290290
"""Set the constructor for this class."""
291291
self._appl_data: dict[str, Any] = {}
292292
self._appliances: etree | None = None
293-
self._cao_present: bool = False
294-
self._cao_temp: float | None = None
295-
self._cdt_temp: float | None = None
293+
self._anna_cooling_present: bool = False
294+
self._cooling_activation_outdoor_temp: float | None = None
295+
self._cooling_deactivation_threshold: float | None = None
296296
self._cooling_present = False
297297
self._devices: dict[str, str] = {}
298298
self._domain_objects: etree | None = None
@@ -626,11 +626,9 @@ def _all_appliances(self) -> None:
626626
ot_fault_code = self._appliances.find(
627627
".//logs/point_log[type='open_therm_oem_fault_code']"
628628
)
629-
LOGGER.debug("HOI1 %s, %s", c_heating_state, ot_fault_code)
630629
if c_heating_state is not None:
631630
self._opentherm_device = ot_fault_code is not None
632631
self._on_off_device = ot_fault_code is None
633-
LOGGER.debug("HOI2 %s, %s", self._opentherm_device, self._on_off_device)
634632

635633
for appliance in self._appliances.findall("./appliance"):
636634
appl = Munch()
@@ -689,8 +687,6 @@ def _all_appliances(self) -> None:
689687
):
690688
self._appl_data.pop(appl.dev_id)
691689

692-
LOGGER.debug("HOI3 %s", self._appl_data)
693-
694690
def _match_locations(self) -> dict[str, Any]:
695691
"""Helper-function for _scan_thermostats().
696692
Update locations with present appliance-types.
@@ -826,10 +822,10 @@ def _appliance_measurements(
826822
# Anna: save cooling-related measurements for later use
827823
# Use the local outdoor temperature as reference for turning cooling on/off
828824
if measurement == "cooling_activation_outdoor_temperature":
829-
self._cao_present = self._cooling_present = True
830-
self._cao_temp = data.get(measurement)
825+
self._anna_cooling_present = self._cooling_present = True
826+
self._cooling_activation_outdoor_temp = data.get(measurement)
831827
if measurement == "cooling_deactivation_threshold":
832-
self._cdt_temp = data.get(measurement)
828+
self._cooling_deactivation_threshold = data.get(measurement)
833829
if measurement == "outdoor_temperature":
834830
self._outdoor_temp = data.get(measurement)
835831

plugwise/smile.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ def _all_device_data(self) -> None:
5656
device_id, data, device, bs_dict, s_dict, sw_dict
5757
)
5858

59-
LOGGER.debug("HOI6 %s", self._cooling_present)
6059
self.gw_data["smile_name"] = self.smile_name
6160
self.gw_data["gateway_id"] = self.gateway_id
6261
if self._is_thermostat:
@@ -92,22 +91,18 @@ def get_all_devices(self) -> None:
9291
# Collect data for each device via helper function
9392
self._all_device_data()
9493

95-
LOGGER.debug("HOI4, %s", self._devices)
96-
LOGGER.debug(
97-
"HOI4a %s, %s, %s, %s",
98-
self._outdoor_temp,
99-
self._cao_present,
100-
self._cao_temp,
101-
self._cdt_temp,
102-
)
103-
10494
# Anna: indicate possible active heating/cooling operation-mode
10595
# Actual ongoing heating/cooling is shown via heating_state/cooling_state
106-
if self._cao_present:
107-
self._cooling_present = True
108-
if not self.cooling_active and self._outdoor_temp > self._cao_temp:
96+
if self._anna_cooling_present:
97+
if (
98+
not self.cooling_active
99+
and self._outdoor_temp > self._cooling_activation_outdoor_temp
100+
):
109101
self.cooling_active = True
110-
if self.cooling_active and self._outdoor_temp < self._cdt_temp:
102+
if (
103+
self.cooling_active
104+
and self._outdoor_temp < self._cooling_deactivation_threshold
105+
):
111106
self.cooling_active = False
112107

113108
# Don't show cooling_state when no cooling present
@@ -180,8 +175,6 @@ def _device_data_climate(
180175
if ctrl_state := self._control_state(loc_id):
181176
device_data["control_state"] = ctrl_state
182177

183-
LOGGER.debug("HOI5, %s, %s", details, device_data)
184-
185178
# Operation mode: auto, heat, cool
186179
device_data["mode"] = "auto"
187180
if sel_schema == "None":

0 commit comments

Comments
 (0)