The MQTT module emits 'disconnected' when you call disconnect - https://github.com/espruino/EspruinoDocs/blob/master/devices/MQTT.js#L167
For me, this returns an error "event name too long".
A quick look at Espruino's source code [https://github.com/espruino/Espruino/blob/f18509acff2a9fdfb8d7414f46b4e546e3be01d3/src/jswrap_object.c#L484] suggests that an event name can be up to 12 characters long (16 is the length of the constant, minus 4 as in the line of code)
'Disconnected' is 12 characters long, so I feel like it should work, so I'm not quite sure what's going on here.
@Moray started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
The MQTT module emits 'disconnected' when you call disconnect - https://github.com/espruino/EspruinoDocs/blob/master/devices/MQTT.js#L167
For me, this returns an error "event name too long".
A quick look at Espruino's source code [https://github.com/espruino/Espruino/blob/f18509acff2a9fdfb8d7414f46b4e546e3be01d3/src/jswrap_object.c#L484] suggests that an event name can be up to 12 characters long (16 is the length of the constant, minus 4 as in the line of code)
'Disconnected' is 12 characters long, so I feel like it should work, so I'm not quite sure what's going on here.