Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 4ef4d03

Browse files
gjdvarska
authored andcommitted
corrected power consumption to energy consumption and adjusted units
1 parent c997057 commit 4ef4d03

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

daikinapi.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ def _get_week(self, ex=False):
9292
"""
9393
Example (ex=False):
9494
ret=OK,today_runtime=601,datas=0/0/0/0/0/0/1000
95-
(datas: values in Watts, last day last)
95+
(datas: values in Watt/hour, last day last)
9696
Example (ex=True):
9797
ret=OK,s_dayw=2,week_heat=10/0/0/0/0/0/0/0/0/0/0/0/0/0,week_cool=0/0/0/0/0/0/0/0/0/0/0/0/0/0
98-
(week_*: values in 100Watts, last day first)
98+
(week_*: values in 100Watt/hour, last day first)
9999
:return: dict
100100
"""
101101
return self._get("/aircon/get_week_power" + ("_ex" if ex else ""))
@@ -104,10 +104,10 @@ def _get_year(self, ex=False):
104104
"""
105105
Example (ex=False):
106106
ret=OK,previous_year=0/0/0/0/0/0/0/0/0/0/0/0,this_year=0/0/0/0/0/0/0/0/0/1
107-
(*_year: values in 100Watts per month (jan-dec))
107+
(*_year: values in 100Watt/hour per month (jan-dec))
108108
Example (ex=True):
109109
ret=OK,curr_year_heat=0/0/0/0/0/0/0/0/0/0/0/1,prev_year_heat=0/0/0/0/0/0/0/0/0/0/0/0,curr_year_cool=0/0/0/0/0/0/0/0/0/0/0/0,prev_year_cool=0/0/0/0/0/0/0/0/0/0/0/0
110-
(*_year_*: values in 100Watts per month (jan-dec))
110+
(*_year_*: values in 100Watt/hour per month (jan-dec))
111111
:return: dict
112112
"""
113113
return self._get("/aircon/get_year_power" + ("_ex" if ex else ""))
@@ -368,12 +368,12 @@ def today_runtime(self):
368368
"""
369369
return int(self._get_week()["today_runtime"])
370370

371-
def today_power_consumption_ex(self, ex=True, mode="heat"):
371+
def today_energy_consumption_ex(self, ex=True, mode="heat"):
372372
"""
373-
unit power consumption today (in Watts)
373+
unit energy consumption today (in Watt/hour)
374374
:param ex: boolean indicating whether to take form '_ex'
375375
:param mode: string from ("heat", "cool") describing mode of operation; ignored if ex==False
376-
:return: Watts of power consumption
376+
:return: Watt/hour of energy consumption
377377
"""
378378
assert not ex or mode in ("heat", "cool"), 'mode should be from ("heat", "cool") if ex==True'
379379
res = self._get_week(ex=ex)
@@ -383,14 +383,14 @@ def today_power_consumption_ex(self, ex=True, mode="heat"):
383383
return res * 100 if ex else res
384384

385385
@property
386-
def today_power_consumption(self, ex=False):
386+
def today_energy_consumption(self, ex=False):
387387
"""
388-
unit power consumption today (in Watts)
389-
:return: Watts of power consumption
388+
unit energy consumption today (in Watt/hour)
389+
:return: Watt/hour of power consumption
390390
"""
391-
return self.today_power_consumption_ex(ex=ex, mode=None)
391+
return self.today_energy_consumption_ex(ex=ex, mode=None)
392392

393-
def month_power_consumption(self, month=None):
393+
def month_energy_consumption(self, month=None):
394394
"""
395395
energy consumption
396396
:param month: optional argument to request a particular month-of-year (january=1); None defaults to current month
@@ -409,7 +409,7 @@ def current_month_power_consumption(self, month=None):
409409
energy consumption
410410
:return: current month to date energy consumption in kWh or None if not retrievable
411411
"""
412-
return self.month_power_consumption(month=month)
412+
return self.month_energy_consumption(month=month)
413413

414414
@property
415415
def price_int(self):

0 commit comments

Comments
 (0)