kpetremann / mqtt-exporter

Simple generic MQTT Prometheus exporter for IoT working out of the box
https://hub.docker.com/r/kpetrem/mqtt-exporter
MIT License
103 stars 29 forks source link

Fix: Don't crash when not able to decode payload. #9

Closed rin closed 3 years ago

rin commented 3 years ago

(Copied from https://github.com/kpetremann/mqtt-exporter/pull/8 )

Disclaimer: These are the first three lines of Python I've ever written.

I encountered a UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte when trying to use this exporter with data from my Xiaomi Roborock vacuum. It's probably the map_data which I don't care about anyway, so this was my fix.

Screenshot 2021-02-13 at 14 34 48
kpetremann commented 3 years ago

Thanks for the PR ;)

rin commented 3 years ago

Thanks for teaching me about python :)

On Sat, Feb 13, 2021 at 7:19 PM Kevin Petremann notifications@github.com wrote:

Thanks for the PR ;)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kpetremann/mqtt-exporter/pull/9#issuecomment-778657153, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACH5HQKPN5RGGZE43SANODS627A5ANCNFSM4XSLPMNA .