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

Commit 31ed20d

Browse files
gjdvarska
authored andcommitted
corrected existing power consumption attributes and added additional power consumption values
1 parent 538d9f2 commit 31ed20d

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

daikinapi.py

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,18 @@ def _get_week(self, ex=False):
9494
"""
9595
Example (ex=False):
9696
ret=OK,today_runtime=601,datas=0/0/0/0/0/0/1000
97+
<<<<<<< HEAD
9798
(datas: values in Watt/hour, last day last)
9899
Example (ex=True):
99100
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
100101
(week_*: values in 100Watt/hour, last day first)
101102
Probably 'ex' refers to "exclusively this device"
103+
=======
104+
(datas: values in Watts, last day last)
105+
Example (ex=True):
106+
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
107+
(week_*: values in 100Watts, last day first)
108+
>>>>>>> 038728d (corrected existing power consumption attributes and added additional power consumption values)
102109
:return: dict
103110
"""
104111
return self._get("/aircon/get_week_power" + ("_ex" if ex else ""))
@@ -107,11 +114,18 @@ def _get_year(self, ex=False):
107114
"""
108115
Example (ex=False):
109116
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
117+
<<<<<<< HEAD
110118
(*_year: values in 100Watt/hour per month (jan-dec))
111119
Example (ex=True):
112120
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
113121
(*_year_*: values in 100Watt/hour per month (jan-dec))
114122
Probably 'ex' refers to "exclusively this device"
123+
=======
124+
(*_year: values in 100Watts per month (jan-dec))
125+
Example (ex=True):
126+
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
127+
(*_year_*: values in 100Watts per month (jan-dec))
128+
>>>>>>> 038728d (corrected existing power consumption attributes and added additional power consumption values)
115129
:return: dict
116130
"""
117131
return self._get("/aircon/get_year_power" + ("_ex" if ex else ""))
@@ -372,13 +386,12 @@ def today_runtime(self):
372386
"""
373387
return int(self._get_week()["today_runtime"])
374388

375-
def today_energy_consumption_ex(self, ex=True, mode="heat"):
389+
def today_power_consumption_ex(self, ex=True, mode="heat"):
376390
"""
377-
unit energy consumption today (in Watt/hour)
391+
unit power consumption today (in Watts)
378392
:param ex: boolean indicating whether to take form '_ex'
379-
Probably 'ex' refers to "exclusively this device"
380393
:param mode: string from ("heat", "cool") describing mode of operation; ignored if ex==False
381-
:return: Watt/hour of energy consumption
394+
:return: Watts of power consumption
382395
"""
383396
assert not ex or mode in ("heat", "cool"), 'mode should be from ("heat", "cool") if ex==True'
384397
res = self._get_week(ex=ex)
@@ -388,14 +401,14 @@ def today_energy_consumption_ex(self, ex=True, mode="heat"):
388401
return res * 100 if ex else res
389402

390403
@property
391-
def today_energy_consumption(self, ex=False):
404+
def today_power_consumption(self, ex=False):
392405
"""
393-
unit energy consumption today (in Watt/hour)
394-
:return: Watt/hour of energy consumption
406+
unit power consumption today (in Watts)
407+
:return: Watts of power consumption
395408
"""
396-
return self.today_energy_consumption_ex(ex=ex, mode=None)
409+
return self.today_power_consumption_ex(ex=ex, mode=None)
397410

398-
def month_energy_consumption(self, month=None):
411+
def month_power_consumption(self, month=None):
399412
"""
400413
energy consumption
401414
:param month: optional argument to request a particular month-of-year (january=1); None defaults to current month
@@ -409,12 +422,12 @@ def month_energy_consumption(self, month=None):
409422
return int(self._get_year()["this_year"].split("/")[month-1]) / 10.0
410423

411424
@property
412-
def current_month_energy_consumption(self, month=None):
425+
def current_month_power_consumption(self, month=None):
413426
"""
414427
energy consumption
415428
:return: current month to date energy consumption in kWh or None if not retrievable
416429
"""
417-
return self.month_energy_consumption(month=month)
430+
return self.month_power_consumption(month=month)
418431

419432
@property
420433
def price_int(self):

0 commit comments

Comments
 (0)