denverquane / MMM-Teslamate

Magic Mirror Module for the Teslamate utility
MIT License
53 stars 14 forks source link

Connection doesn't work if port is different than default 1883 #31

Closed greenmansuperhero closed 2 years ago

greenmansuperhero commented 2 years ago

Hey, I've tried to connect to my MQTT server and it failed due to connection issue.

The problem here is that the single pipe operator, if the port is specified, in fact is doing a bitwise operation during string concatenation. I would change it with the coalesce operator "??" instead:

https://github.com/denverquane/MMM-Teslamate/blob/183a3715f5b0017bee3a7e0a43563b9be4cc1eaf/MMM-Teslamate.js#L30

This has to be changed also in node_helper file.

Hope this helps.

denverquane commented 2 years ago

Fixed, appreciate the heads up