nextEventTime

This commit is contained in:
Karl Hudgell 2022-12-15 12:37:46 +00:00
parent f052a4a2ec
commit 9ab4d3b7ff
3 changed files with 17 additions and 3 deletions

View File

@ -38,7 +38,8 @@ def get_heating_status()->dict:
"currentSetpoint": utils.convert_to_real_temp(data['currentSetpoint']),
"lastTimerSetPoint": utils.convert_to_real_temp(data['lastTimerSetPoint']),
"lastTimerDurationMinutes": data['lastTimerDurationMinutes'],
"nextScheduleEventUtcTime": utils.format_datetime(data['nextScheduleEventUtcTime'])
"nextScheduleEventUtcTime": utils.format_datetime(data['nextScheduleEventUtcTime']),
"nextEventTime":utils.format_time(data['nextScheduleEventUtcTime'])
}
return heatingStatus, 200

View File

@ -23,7 +23,9 @@ def get_water_status()->dict:
"currentSetpoint": utils.convert_to_real_temp(data['currentSetpoint']),
"lastTimerSetPoint": utils.convert_to_real_temp(data['lastTimerSetPoint']),
"lastTimerDurationMinutes": data['lastTimerDurationMinutes'],
"nextScheduleEventUtcTime": utils.format_datetime(data['nextScheduleEventUtcTime'])
"nextScheduleEventUtcTime": utils.format_datetime(data['nextScheduleEventUtcTime']),
"nextEventTime":utils.format_time(data['nextScheduleEventUtcTime'])
}
return waterStatus, 200

View File

@ -40,3 +40,14 @@ def format_datetime(date_time:int)->str:
str: _description_
"""
return datetime.datetime.fromtimestamp(date_time).strftime('%d-%m-%Y %H:%M:%S')
def format_time(date_time:int)->str:
"""_summary_
Args:
date_time (int): _description_
Returns:
str: _description_
"""
return datetime.datetime.fromtimestamp(date_time).strftime('%H:%M:%S')