Skip to content

Commit

Permalink
DA: Set datetime
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Villaro-Dixon <[email protected]>
  • Loading branch information
Frankkkkk committed Oct 30, 2023
1 parent 89e382c commit b587dfd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion daikin_altherma/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,21 @@ def adapter_model(self) -> str:

@property
def unit_datetime(self) -> datetime.datetime:
"""Returns the current date of the unit. Takes time to refresh"""
"""Returns the current date of the unit. Is refreshed every minute or so"""
d = self._requestValueHP("0/DateTime/la", "/m2m:rsp/pc/m2m:cin/con")
return datetime.datetime.strptime(d, self.DATETIME_FMT)

def set_unit_datetime(self, d):
"""Sets the datetime of your unit. Does not work on all units"""
sd = datetime.datetime.strftime(d, self.DATETIME_FMT)

payload = {
"con": sd,
"cnf": "text/plain:0",
}
print(self._requestValueHP("0/DateTime", "/", payload))


@property
def unit_model(self) -> str:
"""Returns the model of the heating unit.
Expand Down

0 comments on commit b587dfd

Please sign in to comment.