Besseres Fehlerverhalten bei fehlendem Scaler
This commit is contained in:
parent
4fcf826e03
commit
ce17b68bfb
@ -84,12 +84,16 @@ class TasmotaSMLParser:
|
|||||||
f"{round(msg.value * pow(10, msg.scaler), precision)}{unit} ({name})"
|
f"{round(msg.value * pow(10, msg.scaler), precision)}{unit} ({name})"
|
||||||
)
|
)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
if msg.unit in UNITS and msg.name in OBIS_NAMES:
|
try:
|
||||||
human_readable = f"{msg.value}{unit} ({name})"
|
human_readable = f"{msg.value}{unit} ({name})"
|
||||||
elif msg.unit in UNITS and msg.name not in OBIS_NAMES:
|
except:
|
||||||
human_readable = f"{msg.value}{unit}"
|
try:
|
||||||
else:
|
human_readable = f"{msg.value}{unit}"
|
||||||
human_readable = f"{msg.value}"
|
except:
|
||||||
|
try:
|
||||||
|
human_readable = f"{msg.value}"
|
||||||
|
except:
|
||||||
|
human_readable = ""
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"obis": msg.obis,
|
"obis": msg.obis,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user