косметическое исправление

This commit is contained in:
VladislavOstapov 2024-02-26 17:02:27 +03:00
parent b8d0ce72c4
commit 101c88e78a

View File

@ -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()),
}