Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gas boiler): accessor for gas and power consumption UoM #520

Merged
merged 4 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions PyViCare/PyViCareGazBoiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def getVolumetricFlowReturn(self):
# Gas consumption for Heating data:
@handleNotSupported
def getGasSummaryConsumptionHeatingUnit(self):
return self.service.getProperty("heating.gas.consumption.summary.heating")["properties"]["day"]["unit"]
return self.service.getProperty("heating.gas.consumption.summary.heating")["properties"]["currentDay"]["unit"]

@handleNotSupported
def getGasSummaryConsumptionHeatingCurrentDay(self):
Expand Down Expand Up @@ -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"]["unit"]["value"]
return self.service.getProperty("heating.gas.consumption.summary.dhw")["properties"]["currentDay"]["unit"]

@handleNotSupported
def getGasSummaryConsumptionDomesticHotWaterCurrentDay(self):
Expand Down Expand Up @@ -209,7 +209,7 @@ def getGasSummaryConsumptionDomesticHotWaterLastYear(self):
# Power consumption for Heating:
@handleNotSupported
def getPowerSummaryConsumptionHeatingUnit(self):
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["day"]["unit"]
return self.service.getProperty("heating.power.consumption.summary.heating")["properties"]["currentDay"]["unit"]

@handleNotSupported
def getPowerSummaryConsumptionHeatingCurrentDay(self):
Expand Down Expand Up @@ -238,7 +238,7 @@ def getPowerSummaryConsumptionHeatingLastYear(self):
# Power consumption for Domestic Hot Water:
@handleNotSupported
def getPowerSummaryConsumptionDomesticHotWaterUnit(self):
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["day"]["unit"]
return self.service.getProperty("heating.power.consumption.summary.dhw")["properties"]["currentDay"]["unit"]

@handleNotSupported
def getPowerSummaryConsumptionDomesticHotWaterCurrentDay(self):
Expand Down
4 changes: 4 additions & 0 deletions tests/test_Vitodens100W.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ def test_getBurnerModulation(self):

def test_getGasSummaryConsumptionHeatingCurrentDay(self):
self.assertEqual(self.device.getGasSummaryConsumptionHeatingCurrentDay(), 11.2)
self.assertEqual(self.device.getGasSummaryConsumptionHeatingUnit(), "cubicMeter")

def test_getGasSummaryConsumptionDomesticHotWaterCurrentMonth(self):
self.assertEqual(self.device.getGasSummaryConsumptionDomesticHotWaterCurrentMonth(), 13.7)
self.assertEqual(self.device.getGasSummaryConsumptionDomesticHotWaterUnit(), "cubicMeter")

def test_getPowerSummaryConsumptionHeatingCurrentDay(self):
self.assertEqual(self.device.getPowerSummaryConsumptionHeatingCurrentDay(), 0.9)
self.assertEqual(self.device.getPowerSummaryConsumptionHeatingUnit(), "kilowattHour")

def test_getPowerSummaryConsumptionDomesticHotWaterCurrentYear(self):
self.assertEqual(self.device.getPowerSummaryConsumptionDomesticHotWaterCurrentYear(), 18)
self.assertEqual(self.device.getPowerSummaryConsumptionDomesticHotWaterUnit(), "kilowattHour")

def test_getGasSummaryConsumptionDomesticHotWaterUnit(self):
self.assertEqual(self.device.getGasSummaryConsumptionDomesticHotWaterUnit(), "cubicMeter")
Loading