Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working when MQTT server does not require credentials #5

Open
tricoos opened this issue Nov 18, 2020 · 1 comment
Open

Not working when MQTT server does not require credentials #5

tricoos opened this issue Nov 18, 2020 · 1 comment

Comments

@tricoos
Copy link

tricoos commented Nov 18, 2020

ARM (Raspberry Pi) - credentials in YAML file exist but are empty as the server does not require credentials:

yeelight    | INFO:__main__:Loading config file...
yeelight    | /app/yamlparser.py:9: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
yeelight    |   yaml_data = yaml.load(stram)
yeelight    | INFO:__main__:Init mqtt client.
yeelight    | Traceback (most recent call last):
yeelight    |   File "/app/main.py", line 97, in <module>
yeelight    |     client.connect()
yeelight    |   File "/app/mqtt.py", line 44, in connect
yeelight    |     _LOGGER.info("Connecting to MQTT server " + self.server + ":" + str(self.port) + " with username (" + self.username + ":" + self.password + ")")
yeelight    | TypeError: can only concatenate str (not "NoneType") to str

Probably the YAML parser does not return empty attributes and you're trying to concatenate NULL in the log message?

@tricoos
Copy link
Author

tricoos commented Jan 1, 2021

Update: it works so far when the log output of the credentials is removed. In any way logging credentials should never be done for security reasons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant