SAIC-iSmart-API / saic-python-mqtt-gateway

MIT License
66 stars 20 forks source link

Remove special characters from MQTT topics. #214

Closed tosate closed 4 months ago

tosate commented 4 months ago

Email addresses can contain special characters like the plus sign (+) that cannot appear in MQTT topics. Since the SAIC user name can be an email address and we use this information as part of the MQTT topics, we need to remove special characters.

This has already been done for subscribing to the setter-topics.

However, it's still missing for publishing MQTT messages and in the Home Assistant auto-discovery messages.

ZionFox commented 4 months ago

I applied these changes manually, and can confirm that it resolves the issue of omitting string sanitation for mqtt topic names. Thank you!

This should be a key part to the 0.6.0 release.