Adding command to skip to the next image, and removing mqtt test code

This commit is contained in:
Jason Williams
2025-05-16 14:53:21 -06:00
parent be56a5f791
commit e8502519e4
2 changed files with 7 additions and 17 deletions

View File

@@ -66,13 +66,18 @@ function displayImage(filename) {
}
function displayWifi() {
console.log('Displaying wifi connection information for 10 minutes')
console.log('Displaying wifi connection information for 10 minutes...')
clearTimeout(ticker)
frame.display_png('img/wifi.png')
frame.show()
ticker = setTimeout(displayAlbum, 600000)
}
function skipToNext() {
clearTimeout(ticker)
displayAlbum()
}
// Subscribe to our MQTT topic...
mqttclient.on('connect', () => {
mqttclient.subscribe('pictureframe/command')
@@ -83,6 +88,7 @@ mqttclient.on('message', (topic, message) => {
message = message.toString()
console.log('MQTT command received: ' + message)
if (message == 'skip') skipToNext()
if (message == 'wifi') displayWifi()
if (message == 'reset') {
clearTimeout(ticker)