diff --git a/app/Routes/heating.py b/app/Routes/heating.py index f53cf51..34d83a2 100644 --- a/app/Routes/heating.py +++ b/app/Routes/heating.py @@ -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 diff --git a/app/Routes/water.py b/app/Routes/water.py index 966827f..122e218 100644 --- a/app/Routes/water.py +++ b/app/Routes/water.py @@ -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 diff --git a/app/lib/utils.py b/app/lib/utils.py index 6bc3f53..de6bd09 100644 --- a/app/lib/utils.py +++ b/app/lib/utils.py @@ -39,4 +39,15 @@ def format_datetime(date_time:int)->str: Returns: str: _description_ """ - return datetime.datetime.fromtimestamp(date_time).strftime('%d-%m-%Y %H:%M:%S') \ No newline at end of file + 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') \ No newline at end of file