From 1830daf6aa42810832809c6f181176cc18537628 Mon Sep 17 00:00:00 2001 From: jadon <16850875+wolffshots@users.noreply.github.com> Date: Fri, 24 May 2024 19:46:22 +0200 Subject: [PATCH] chore: just making sure we don't truncate --- custom_components/audiobookshelf/sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom_components/audiobookshelf/sensor.py b/custom_components/audiobookshelf/sensor.py index 7aa4b76..23bc938 100644 --- a/custom_components/audiobookshelf/sensor.py +++ b/custom_components/audiobookshelf/sensor.py @@ -59,10 +59,10 @@ async def extract_library_details(data: dict) -> dict: def get_total_duration(total_duration: float): """Calculate the total duration in hours and round it to 0 decimal places.""" - return round(total_duration / 60 / 60, 0) + return round(total_duration / 60.0 / 60.0, 0) def get_total_size(total_size: float): - return round(total_size / 1024 / 1024 / 1024, 2) + return round(total_size / 1024.0 / 1024.0 / 1024.0, 2) async def fetch_library_stats(session, id): """Fetch data from a single endpoint."""