MeshAddicts / meshinfo

Realtime web UI to run against a Meshtastic regional or private mesh network.
8 stars 1 forks source link

Handle invalid relative humidity #7

Closed quimnut closed 9 hours ago

quimnut commented 1 month ago

I have some values like -4.47034800288293e-08% for relative humidity will make round(2) fail in the template.

quimnut commented 1 month ago

Or possibly a 0 reading causing; meshinfo_1 | {{ item.payload.relative_humidity | round(2) }}% meshinfo_1 | File “/usr/local/lib/python3.10/site-packages/jinja2/filters.py”, line 1169, in do_round

meshinfo_1 | type NoneType doesn’t define round method

i tried not none in the template with no change, removed the round and the latest render leads me to believe its a 0 value.

kevinelliott commented 4 weeks ago

I have some values like -4.47034800288293e-08% for relative humidity will make round(2) fail in the template.

Thanks for submitting this.

Seems sometimes it does not appropriately detect None, which is a little strange!

kevinelliott commented 6 days ago

@quimnut Are you still seeing this happen? I believe this is fixed, but if not, please let me know.

quimnut commented 10 hours ago

Maybe but it wont get as far to render that with unicode shortnames I assume this is.

meshinfo1 | Rendering node^B.html meshinfo_1 | embedded null byte

quimnut commented 10 hours ago

The only packets with valid data for node info and chat etc are the encrypted packets.

quimnut commented 9 hours ago

purging the old json helped, updated now, looks good. "73.47%"