round complex numbers to account for SML provided precision
This commit is contained in:
parent
d9ab8d9d96
commit
ab6d472510
1 changed files with 1 additions and 1 deletions
|
|
@ -68,7 +68,7 @@ class TasmotaSMLParser:
|
|||
precision = 0
|
||||
|
||||
try:
|
||||
human_readable = f"{msg.value * pow(10, msg.scaler)}{unit} ({name})"
|
||||
human_readable = f"{round(msg.value * pow(10, msg.scaler), precision)}{unit} ({name})"
|
||||
except TypeError:
|
||||
if msg.unit in UNITS and msg.name in OBIS_NAMES:
|
||||
human_readable = f"{msg.value}{unit} ({name})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue