Skip to content

Commit

Permalink
Merge branch 'master' into heatingRod
Browse files Browse the repository at this point in the history
  • Loading branch information
CFenner authored Jan 22, 2025
2 parents f7e5f3d + ee3bbfa commit d57f1e7
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/draft-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
pull-requests: read
steps:
- name: 🚀 Run Release Drafter
uses: release-drafter/release-drafter@v6.0.0
uses: release-drafter/release-drafter@v6.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: 🚀 Run pytest
run: poetry run pytest --cov PyViCare
- name: ⬆️ Upload coverage artifact
uses: actions/upload-artifact@v4.5.0
uses: actions/upload-artifact@v4.6.0
with:
name: coverage-${{ matrix.python }}
path: .coverage
22 changes: 22 additions & 0 deletions PyViCare/PyViCareHeatPump.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,28 @@ def setDomesticHotWaterHysteresisSwitchOff(self, temperature: float) -> Any:
"""
return self.service.setProperty("heating.dhw.temperature.hysteresis", "setHysteresisSwitchOffValue", {'hysteresis': temperature})

@handleNotSupported
def getSupplyPressureUnit(self) -> str:
# Returns heating supply pressure unit (e.g. bar)
return str(self.service.getProperty("heating.sensors.pressure.supply")["properties"]["value"]["unit"])

@handleNotSupported
def getSupplyPressure(self) -> float:
# Returns heating supply pressure
return float(self.service.getProperty("heating.sensors.pressure.supply")["properties"]["value"]["value"])

@handleNotSupported
def getSeasonalPerformanceFactorDHW(self) -> float:
return float(self.service.getProperty("heating.spf.dhw")["properties"]["value"]["value"])

@handleNotSupported
def getSeasonalPerformanceFactorHeating(self) -> float:
return float(self.service.getProperty("heating.spf.heating")["properties"]["value"]["value"])

@handleNotSupported
def getSeasonalPerformanceFactorTotal(self) -> float:
return float(self.service.getProperty("heating.spf.total")["properties"]["value"]["value"])

@handleNotSupported
def getHeatingRodStarts(self) -> int:
return int(self.service.getProperty("heating.heatingRod.statistics")["properties"]["starts"]["value"])
Expand Down
48 changes: 24 additions & 24 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ mypy = "^1.11.2"
pylint = "^3.2.6"
pytest = "^8.3.2"
pytest-cov = "^6.0.0"
ruff = "^0.8.0"
ruff = "^0.9.0"
types-deprecated = "^1.2.15.20241117"
types-requests = ">=2.31"

Expand Down
4 changes: 0 additions & 4 deletions tests/test_TestForMissingProperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def test_missingProperties(self):
'heating.power.purchase.current',
'heating.power.sold.cumulative',
'heating.power.sold.current',
'heating.sensors.pressure.supply',
'heating.sensors.temperature.allengra',

'heating.dhw.operating.modes.active',
Expand Down Expand Up @@ -99,9 +98,6 @@ def test_missingProperties(self):
'heating.scop.dhw', # deprecated
'heating.scop.heating', # deprecated
'heating.scop.total', # deprecated
'heating.spf.dhw',
'heating.spf.heating',
'heating.spf.total',
]

all_features = self.read_all_features()
Expand Down
9 changes: 9 additions & 0 deletions tests/test_Vitocal250A.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,15 @@ def test_getDomesticHotWaterStorageTemperature(self):
self.assertEqual(
self.device.getDomesticHotWaterStorageTemperature(), 58.8)

def test_getSupplyPressure(self):
self.assertEqual(self.device.getSupplyPressure(), 2.1)
self.assertEqual(self.device.getSupplyPressureUnit(), "bar")

def test_getSeasonalPerformanceFactor(self):
self.assertEqual(self.device.getSeasonalPerformanceFactorDHW(), 4.1)
self.assertEqual(self.device.getSeasonalPerformanceFactorHeating(), 3.2)
self.assertEqual(self.device.getSeasonalPerformanceFactorTotal(), 3.9)

def test_getHeatingRod(self):
self.assertEqual(self.device.getHeatingRodHeatProductionCurrent(), 0)
self.assertEqual(self.device.getHeatingRodPowerConsumptionCurrent(), 0)
Expand Down

0 comments on commit d57f1e7

Please sign in to comment.