From 101c88e78a6a1154c04f6d668dd10a0a7d60b772 Mon Sep 17 00:00:00 2001 From: VladislavOstapov Date: Mon, 26 Feb 2024 17:02:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BA=D0=BE=D1=81=D0=BC=D0=B5=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- logs_service/services.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/logs_service/services.py b/logs_service/services.py index 7fe4332..3b41849 100644 --- a/logs_service/services.py +++ b/logs_service/services.py @@ -198,10 +198,9 @@ class MbHartService(MbService): def swap_bytes(source): return (source & 0xFF) << 8 | (source & 0xFF00) >> 8 - decoded = decode_ieee((swap_bytes(values[0]) << 16) | swap_bytes(values[1])) # тут еще ебаный byte-swap with self._lock: self._curr_state = { - 'accumulated_flow': int(decoded), + 'accumulated_flow': int(decode_ieee((swap_bytes(values[0]) << 16) | swap_bytes(values[1]))), 'last_update': int(datetime.now().timestamp()), }