Skip to content

Commit

Permalink
Fix bug in hours_to_hms introduced in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
pnbruckner committed Dec 7, 2023
1 parent 4341508 commit 2980839
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/sun2/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def get_loc_params(config: Mapping[str, Any]) -> LocParams | None:
def hours_to_hms(hours: Num | None) -> str | None:
"""Convert hours to HH:MM:SS string."""
try:
return str(timedelta(hours=int(cast(Num, hours))))
return str(timedelta(seconds=int(cast(Num, hours) * 3600)))
except TypeError:
return None

Expand Down

0 comments on commit 2980839

Please sign in to comment.