Skip to content
Merged
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Ongoing

- Improve testing: compare internal and code testcounters, line up fixture and test-json format, fix a missed count.

## v1.9.0

- Add support for Anna P1 via PR [#809](https://github.com/plugwise/python-plugwise/pull/809)
Expand Down
9 changes: 6 additions & 3 deletions plugwise/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ def _update_for_cooling(self, entity: GwEntityData) -> None:
entity["thermostat"] = temp_dict
if "setpoint" in sensors:
sensors.pop("setpoint")
self._count -= 1
sensors["setpoint_low"] = temp_dict["setpoint_low"]
sensors["setpoint_high"] = temp_dict["setpoint_high"]
self._count += 2 # add 4, remove 2
self._count += 3 # add 4, remove 1
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Outdated

def _get_location_data(self, loc_id: str) -> GwEntityData:
"""Helper-function for _all_entity_data() and async_update().
Expand All @@ -164,8 +165,9 @@ def _get_location_data(self, loc_id: str) -> GwEntityData:
):
data["control_state"] = str(ctrl_state)

data["sensors"].pop("setpoint") # remove, only used in _control_state()
self._count -= 1
if "setpoint" in data["sensors"]:
data["sensors"].pop("setpoint") # remove, only used in _control_state()
self._count -= 1

# Thermostat data (presets, temperatures etc)
self._climate_data(loc_id, zone, data)
Expand Down Expand Up @@ -238,6 +240,7 @@ def _get_adam_data(self, entity: GwEntityData, data: GwEntityData) -> None:
and self._cooling_present
):
data["binary_sensors"]["cooling_enabled"] = self._cooling_enabled
self._count += 1

# Show the allowed regulation_modes and gateway_modes
if entity["dev_class"] == "gateway":
Expand Down
3 changes: 2 additions & 1 deletion scripts/tests_and_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ set +u

if [ -z "${GITHUB_ACTIONS}" ] || [ "$1" == "test_and_coverage" ] ; then
# Python tests (rerun with debug if failures)
PYTHONPATH=$(pwd) pytest -qx tests/ --cov='.' --no-cov-on-fail --cov-report term-missing || PYTHONPATH=$(pwd) pytest -xrpP --log-level debug tests/
# PYTHONPATH=$(pwd) pytest -qx tests/ --cov='.' --no-cov-on-fail --cov-report term-missing ||
PYTHONPATH=$(pwd) pytest -xrpP --log-level debug tests/
handle_command_error "python code testing"
fi

Expand Down
Loading