Closed RedEarth1 closed 9 months ago
Hey. That does make sense as the object is not JSON serializable. It's surprising that is just blindly tries to dump the state into a JSON encoder, it could easily be serialized by using todict
. Many integrations use dataclasses for passing data, so I'm surprised there aren't problems more often. I'll have a look to see what I can do, but this requires a few changes to both this integration and the base library just to be compatible with this other integration.
Oh ok, it turns out this isn't too major as the encoder in Home Assistant has some support for custom methods. I think it should work now as of 1.0.0 beta-2.
Hi, I've tried 1.0.0 beta-2 and I think your fix has solved the problem. The error has stopped appearing in the HA logs and I can now see the mug firmware being reported on the MQTT statestream in MQTT explorer. Thanks for looking into it
Awesome! Thanks for pointing it out. I'll close this then, but don't hesitate if you have other issues.
Description
I have MQTT Statestream enabled in Home Assistant, and the Ember Mug Integration is causing errors each time the mug state changes because MugFirmwareInfo is not JSON serializable. I have had to temporarily exclude the mug state in the MQTT statestream config using an entity glob, this prevents the errors.
Logs / Errors