From 2dbbb0d8161c8f3567797d9fc440c68aa99e0783 Mon Sep 17 00:00:00 2001 From: Christopher Fenner <9592452+CFenner@users.noreply.github.com> Date: Wed, 14 Aug 2024 23:53:48 +0200 Subject: [PATCH] fix: correct unit getter for heating.gas.consumption.summary.dhw (#9) * Update PyViCareGazBoiler.py * Update test_Vitodens100W.py * Update PyViCareGazBoiler.py --- PyViCare/PyViCareGazBoiler.py | 2 +- tests/test_Vitodens100W.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PyViCare/PyViCareGazBoiler.py b/PyViCare/PyViCareGazBoiler.py index 0098b584..c46ccc09 100644 --- a/PyViCare/PyViCareGazBoiler.py +++ b/PyViCare/PyViCareGazBoiler.py @@ -180,7 +180,7 @@ def getGasSummaryConsumptionHeatingLastYear(self): # Gas consumption for Domestic Hot Water data: @handleNotSupported def getGasSummaryConsumptionDomesticHotWaterUnit(self): - return self.service.getProperty("heating.gas.consumption.summary.dhw")["properties"]["day"]["unit"] + return self.service.getProperty("heating.gas.consumption.summary.dhw")["properties"]["unit"]["value"] @handleNotSupported def getGasSummaryConsumptionDomesticHotWaterCurrentDay(self): diff --git a/tests/test_Vitodens100W.py b/tests/test_Vitodens100W.py index 2022577d..e85450f0 100644 --- a/tests/test_Vitodens100W.py +++ b/tests/test_Vitodens100W.py @@ -32,3 +32,6 @@ def test_getPowerSummaryConsumptionHeatingCurrentDay(self): def test_getPowerSummaryConsumptionDomesticHotWaterCurrentYear(self): self.assertEqual(self.device.getPowerSummaryConsumptionDomesticHotWaterCurrentYear(), 18) + + def test_getGasSummaryConsumptionDomesticHotWaterUnit(self): + self.assertEqual(self.device.getGasSummaryConsumptionDomesticHotWaterUnit(), "cubicMeter")