Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test

# The build workflow needs API credentials, which pull requests from forks do not
# get. These tests decode recorded responses instead, so they need no secrets.
on:
pull_request:
push:
branches:
- main

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.12', '3.13']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt pytest pytest-asyncio mypy
- name: Test
run: python -m pytest tests -q
- name: Type check
run: mypy -p weheat.abstractions --install-types --non-interactive
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/venv/
/weheat_backend_client.egg-info/
/weheat.egg-info/
/build/
/.idea/
*.pyc
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "weheat"
version = "2026.4.8"
version = "2026.9.2"
description = "Weheat Backend"
authors = ["Jesper Raemaekers <jesper.raemaekers@wefabricate.com>", "Kjell van Straaten <kjell.van.straaten@wefabricate.com>"]
license = "MIT"
Expand All @@ -10,7 +10,7 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "Weheat Backend"]
include = ["weheat/py.typed"]

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.10"

urllib3 = ">= 1.25.3"
python-dateutil = ">=2.8.2"
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
# prerequisite: setuptools
# http://pypi.python.org/pypi/setuptools
NAME = "weheat"
VERSION = "2026.4.8"
PYTHON_REQUIRES = ">=3.7"
VERSION = "2026.9.2"
PYTHON_REQUIRES = ">=3.10"
REQUIRES = [
"urllib3 >= 1.25.3, < 3.0.0",
"python-dateutil",
Expand Down
22 changes: 15 additions & 7 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import pytest
from dataclasses import dataclass
from keycloak import KeycloakOpenID

def pytest_addoption(parser):
# These are used by the STK500 interface
Expand All @@ -10,42 +9,42 @@ def pytest_addoption(parser):
action="store",
type=str,
help="API url",
required=True,
default=None,
)
parser.addoption(
"--auth_url",
action="store",
type=str,
help="Authentication url",
required=True,
default=None,
)
parser.addoption(
"--client_id",
action="store",
type=str,
help="Client id",
required=True,
default=None,
)
parser.addoption(
"--client_secret",
action="store",
type=str,
help="Client secret",
required=True,
default=None,
)
parser.addoption(
"--user",
action="store",
type=str,
help="User email",
required=True,
default=None,
)
parser.addoption(
"--password",
action="store",
type=str,
help="User password",
required=True,
default=None,
)


Expand All @@ -63,8 +62,17 @@ class ApiInfo:
access_token: str


OPTIONS = ("api_url", "auth_url", "client_id", "client_secret", "user", "password")


@pytest.fixture()
def api_fixture(request):
missing = [name for name in OPTIONS if not request.config.getoption(f"--{name}")]
if missing:
pytest.skip(f"needs the API options: {', '.join('--' + name for name in missing)}")

from keycloak import KeycloakOpenID

api_info = ApiInfo(request.config.getoption('--api_url'), request.config.getoption('--auth_url'),
request.config.getoption('--client_id'), request.config.getoption('--client_secret'),
request.config.getoption('--user'), request.config.getoption('--password'), "")
Expand Down
20 changes: 20 additions & 0 deletions tests/fixtures/energy_total.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"totalEInHeating": 5717.358,
"totalEInStandby": 103.82725,
"totalEInDhw": 2143.2793,
"totalEInHeatingDefrost": 36.181,
"totalEInDhwDefrost": 0.045924444,
"totalEInCooling": 832.4635,
"totalEOutHeating": 27152.229,
"totalEOutDhw": 6509.1094,
"totalEOutHeatingDefrost": -799.50616,
"totalEOutDhwDefrost": -1.0773816,
"totalEOutCooling": -4438.936,
"totalEInIUStandby": 245.75871,
"totalEInIUHeating": 426.02554,
"totalEInIUDhw": 252.08315,
"totalEInIUHeatingDefrost": 22.127708,
"totalEInIUDhwDefrost": 0.038020276,
"totalEInIUCooling": 95.72314,
"heatPumpId": "00000000-0000-4000-8000-000000000000"
}
13 changes: 13 additions & 0 deletions tests/fixtures/heat_pump.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"controlBoardId": "11111111-1111-4111-8111-111111111111",
"name": null,
"model": 0,
"dhwType": 1,
"boilerType": 1,
"status": 70,
"commissionedAt": "2024-07-05T16:00:00Z",
"serialNumber": "SN-0000-0000",
"partNumber": "2580-2255-2903",
"state": 3,
"id": "00000000-0000-4000-8000-000000000000"
}
24 changes: 24 additions & 0 deletions tests/fixtures/heat_pumps_list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"metadata": {
"totalCount": 1,
"pageSize": 10,
"currentPage": 1,
"totalPages": 1
},
"data": [
{
"firmwareVersion": null,
"controlBoardId": "11111111-1111-4111-8111-111111111111",
"name": null,
"model": 0,
"dhwType": 1,
"boilerType": 1,
"status": 40,
"commissionedAt": "2024-07-05T16:00:00Z",
"serialNumber": "SN-0000-0000",
"partNumber": "2580-2255-2903",
"state": 3,
"id": "00000000-0000-4000-8000-000000000000"
}
]
}
122 changes: 122 additions & 0 deletions tests/fixtures/log_aggregated_cooling.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"timeBucket": "2026-09-01T12:26:00Z",
"interval": "Minute",
"timeCoveredInInterval": 60,
"heatPumpStateStandby": 0,
"heatPumpStateHeating": 0,
"heatPumpStateCooling": 60,
"heatPumpStateHeatingDefrost": 0,
"heatPumpStateDhwDefrost": 0,
"heatPumpStateDhw": 0,
"heatPumpStateLegionella": 0,
"heatPumpStateManualControl": 0,
"controlBridgeStatusWaterPump": 60,
"controlBridgeStatusDhwValve": 0,
"controlBridgeStatusGasBoiler": 0,
"controlBridgeStatusElectricHeater": 0,
"controlBridgeStatusWaterPump2": 60,
"t1Average": 53.4,
"t1Min": 53.4,
"t1Max": 53.4,
"t2Average": 48.1,
"t2Min": 48.1,
"t2Max": 48.1,
"tAirInAverage": 21.1,
"tAirInMin": 20.9,
"tAirInMax": 21.2,
"tAirOutAverage": 21.4,
"tAirOutMin": 20.4,
"tAirOutMax": 22.2,
"tWaterInAverage": 21.4,
"tWaterInMin": 21.4,
"tWaterInMax": 21.4,
"tWaterOutAverage": 18.8,
"tWaterOutMin": 18.3,
"tWaterOutMax": 19.1,
"tWaterHouseInAverage": 19.7,
"tWaterHouseInMin": 19.2,
"tWaterHouseInMax": 20,
"rpmAverage": 900,
"rpmMin": 900,
"rpmMax": 900,
"thermostatStateOff": 60,
"thermostatStateOn": 0,
"tRoomAverage": 22.1,
"tRoomMin": 22.1,
"tRoomMax": 22.1,
"tRoomTargetAverage": 21,
"tRoomTargetMin": 21,
"tRoomTargetMax": 21,
"tThermostatSetpointAverage": 18,
"tThermostatSetpointMin": 18,
"tThermostatSetpointMax": 18,
"otBoilerFeedTemperatureAverage": null,
"otBoilerFeedTemperatureMin": null,
"otBoilerFeedTemperatureMax": null,
"otBoilerReturnTemperatureAverage": null,
"otBoilerReturnTemperatureMin": null,
"otBoilerReturnTemperatureMax": null,
"centralHeatingFlowAverage": 1.3,
"centralHeatingFlowMin": 1.29,
"centralHeatingFlowMax": 1.32,
"centralHeatingFlowStateStandby": 0,
"centralHeatingFlowStateStandbyNoPwm": 0,
"centralHeatingFlowStateMotorBlocked": 0,
"centralHeatingFlowStatePumping": 60,
"centralHeatingFlowStatePumpingNoPwm": 0,
"centralHeatingFlowStateSuboptimalRunning": 0,
"centralHeatingFlowStateStoppedMomentarily": 0,
"centralHeatingFlowStateStoppedPermanentDamage": 0,
"dhwFlowAverage": null,
"dhwFlowMin": null,
"dhwFlowMax": null,
"dhwFlowStateStandby": 0,
"dhwFlowStateStandbyNoPwm": 60,
"dhwFlowStateMotorBlocked": 0,
"dhwFlowStatePumping": 0,
"dhwFlowStatePumpingNoPwm": 0,
"dhwFlowStateSuboptimalRunning": 0,
"dhwFlowStateStoppedMomentarily": 0,
"dhwFlowStateStoppedPermanentDamage": 0,
"hqMessageVersionMin": 1,
"hqMessageVersionMax": 1,
"dhwControlMethodFixedSetpoint": 0,
"dhwControlMethodManualSchedule": 0,
"dhwControlMethodWeheatIntelligence": 0,
"dhwTargetTemperatureAverage": 55,
"dhwTargetTemperatureMin": 55,
"dhwTargetTemperatureMax": 55,
"coolingExponentialBackoffAverage": 180,
"coolingExponentialBackoffMin": 180,
"coolingExponentialBackoffMax": 180,
"coolingStartConditionsControlMethod": 60,
"coolingStartConditionsDtc": 60,
"coolingStartConditionsOutsideAirTemperature": 60,
"coolingStartConditionsInsideTemperature": 60,
"coolingStartConditionsIndoorUnitConnected": 60,
"coolingStartConditionsWaterToAir": 60,
"coolingStartConditionsDemand": 15,
"coolingStartConditionsWaterTemperature": 60,
"coolingStartConditionsContactNotBlocked": 60,
"coolingStartConditionsExBackoff": 60,
"coolingStartConditionsHeatCoolDelay": 60,
"coolingPauseReasonNone": 60,
"coolingPauseReasonRoomTemperatureTooLow": 0,
"coolingPauseReasonOutsideTemperatureTooLow": 0,
"coolingPauseReasonOutsideColderThenWaterTemperature": 0,
"coolingPauseReasonWaterTemperatureBelowSetpoint": 0,
"coolingPauseReasonHeatPumpControl": 0,
"coolingPauseReasonWaterTemperatureBelowDewpoint": 0,
"coolingPauseReasonContactBlocked": 0,
"coolingPauseReasonDemand": 0,
"coolingStopReasonNone": 60,
"coolingStopReasonDtc": 0,
"coolingStopReasonControlMethod": 0,
"coolingStopReasonNoIndoorUnitCommunication": 0,
"coolingStopReasonHeatPumpControl": 0,
"coolingStopReasonCoolingControl": 0,
"coolingStopReasonSwitchOver": 0,
"coolingStopReasonOtCoolingDisabled": 0,
"lastCoolingTimeMin": null,
"lastCoolingTimeMax": null
}
Loading
Loading