косметическое исправление
This commit is contained in:
parent
b8d0ce72c4
commit
101c88e78a
@ -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()),
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user