From ddde65964d3998a3070f2879b5878bf8ea5facfb Mon Sep 17 00:00:00 2001 From: Robert Resch Date: Fri, 26 Jan 2024 10:04:25 +0100 Subject: [PATCH] Revert "Convert total stats time from seconds to minutes" (#401) --- deebot_client/commands/json/stats.py | 7 +------ tests/commands/json/test_stats.py | 15 --------------- 2 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 tests/commands/json/test_stats.py diff --git a/deebot_client/commands/json/stats.py b/deebot_client/commands/json/stats.py index 5a1db4be..2aaf6b67 100644 --- a/deebot_client/commands/json/stats.py +++ b/deebot_client/commands/json/stats.py @@ -1,5 +1,4 @@ """Stats commands.""" -from math import floor from typing import Any from deebot_client.event_bus import EventBus @@ -44,10 +43,6 @@ def _handle_body_data_dict( :return: A message response """ - stats_event = TotalStatsEvent( - data["area"], - floor(data["time"] / 60), # Convert seconds to minutes - data["count"], - ) + stats_event = TotalStatsEvent(data["area"], data["time"], data["count"]) event_bus.notify(stats_event) return HandlingResult.success() diff --git a/tests/commands/json/test_stats.py b/tests/commands/json/test_stats.py deleted file mode 100644 index d9b89828..00000000 --- a/tests/commands/json/test_stats.py +++ /dev/null @@ -1,15 +0,0 @@ -from deebot_client.commands.json import GetTotalStats -from deebot_client.events import TotalStatsEvent -from tests.helpers import get_request_json, get_success_body - -from . import assert_command - - -async def test_GetTotalStats() -> None: - area = 123 - time = 167 - count = 56 - json = get_request_json( - get_success_body({"area": area, "time": time * 60, "count": count}) - ) - await assert_command(GetTotalStats(), json, TotalStatsEvent(area, time, count))