initial docstrings

This commit is contained in:
Karl Hudgell 2022-12-15 15:56:53 +00:00
parent d3e84d471d
commit 87e9143a5e

View File

@ -11,7 +11,6 @@ def convert_to_real_temp(migenie_value:int, flip:bool=False)->float:
""" """
if flip: if flip:
start = [50,5] start = [50,5]
# [88,24]
if migenie_value == 0: if migenie_value == 0:
return 0.0 return 0.0
else: else:
@ -63,21 +62,29 @@ def format_time(date_time:int)->str:
""" """
return datetime.datetime.fromtimestamp(date_time).strftime('%H:%M:%S') return datetime.datetime.fromtimestamp(date_time).strftime('%H:%M:%S')
def format_temp(temp:int): def format_temp(temp:int)->float:
"""_summary_ """_summary_
Args: Args:
temp (int): _description_ temp (int): _description_
Returns: Returns:
_type_: _description_ float: _description_
""" """
temp = str(temp) temp = str(temp)
whole = temp[:-1] whole = temp[:-1]
decimal = temp[-1] decimal = temp[-1]
return float(f"{whole}.{decimal}") return float(f"{whole}.{decimal}")
def is_valid_time(time:int): def is_valid_time(time:int)->bool:
"""_summary_
Args:
time (int): _description_
Returns:
bool: _description_
"""
is_valid = time / 30 is_valid = time / 30
if is_valid.is_integer(): if is_valid.is_integer():
return True return True