Skip to content

Commit

Permalink
Merge pull request openviess#44 from Steve668/master
Browse files Browse the repository at this point in the history
issue with reading power consumption from GazBoiler
  • Loading branch information
somm15 authored Nov 4, 2020
2 parents 5c38bea + 6f91fdf commit 7f319e0
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions PyViCare/PyViCareGazBoiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,51 @@ def getBoilerTemperature(self):
except KeyError:
return "error"

def getCurrentPower(self):
def getPowerConsumptionDays(self):
try:
return self.service.getProperty('heating.burner.current.power')['properties']['value']['value']
return self.service.getProperty('heating.power.consumption.total')['properties']['day']['value']
except KeyError:
return "error"

def getPowerConsumptionToday(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['day']['value'][0]
except KeyError:
return "error"

def getPowerConsumptionWeeks(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['week']['value']
except KeyError:
return "error"

def getPowerConsumptionThisWeek(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['week']['value'][0]
except KeyError:
return "error"

def getPowerConsumptionMonths(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['month']['value']
except KeyError:
return "error"

def getPowerConsumptionThisMonth(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['month']['value'][0]
except KeyError:
return "error"

def getPowerConsumptionYears(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['year']['value']
except KeyError:
return "error"

def getPowerConsumptionThisYear(self):
try:
return self.service.getProperty('heating.power.consumption.total')['properties']['year']['value'][0]
except KeyError:
return "error"

Expand Down

0 comments on commit 7f319e0

Please sign in to comment.