Skip to content

Commit

Permalink
Update helpers.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Noltari committed Oct 26, 2023
1 parent ebed270 commit b9343d1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sim/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,11 @@ def api_json_error(error: str) -> dict[str, Any]:
def api_json_response(data: dict[str, Any]) -> Any:
"""Return Local API error."""
return web.json_response(data, dumps=api_json_dumps)


def celsius_to_fahrenheit(celsius: float | int) -> float | int:
"""Convert Celsius to Fahrenheit."""
fahrenheit = (celsius * 9 / 5) + 32
if type(temp) is float:
return fahrenheit
return int(fahrenheit)

0 comments on commit b9343d1

Please sign in to comment.