Skip to content

Commit

Permalink
Version 1.1.11 - Fixed publishing of empty messages configured throug…
Browse files Browse the repository at this point in the history
…h config-ui-x in startPub
  • Loading branch information
arachnetech committed Apr 28, 2020
1 parent 82f75ed commit e59dfb4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

# Homebridge MQTT-Thing: Release Notes

### Version 1.1.11
+ Fixed publishing of empty messages configured through config-ui-x in startPub

### Version 1.1.10
+ Fixed crash (introduced in version 1.1.9) with confirmed publisher on/off acknowledgement

Expand Down
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2661,7 +2661,9 @@ function makeThing(log, config) {
if( Array.isArray( config.startPub ) ) {
// new format - [ { topic: x, message: y }, ... ]
for( let entry of config.startPub ) {
mqttPublish( entry.topic, 'startPub', entry.message );
if( entry.topic ) {
mqttPublish( entry.topic, 'startPub', entry.message || '' );
}
}
} else {
// old format - object of topic->message
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "homebridge-mqttthing",
"version": "1.1.10",
"version": "1.1.11",
"description": "Homebridge plugin supporting various services over MQTT",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 11 additions & 6 deletions test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,21 @@
"accessory": "mqttthing"
},
{
"accessory": "mqttthing",
"type": "lightbulb-HSV",
"name": "Test HSV Light",
"url": "http://192.168.10.35:1883",
"logMqtt": true,
"codec": "test-codec.js",
"topics": {
"getHSV": "test/hsvlight/getHSV",
"setHSV": "test/hsvlight/setHSV"
"setHSV": "test/hsvlight/setHSV",
"getHSV": "test/hsvlight/getHSV"
},
"logMqtt": true,
"codec": "test-codec.js"
"startPub": [
{
"topic": "test/hsvlight/setHSV"
}
],
"accessory": "mqttthing"
},
{
"accessory": "mqttthing",
Expand Down Expand Up @@ -844,7 +849,7 @@
"offValue": "0",
"confirmationPeriodms": 1000,
"retryLimit": 3
},
},
{
"accessory": "mqttthing",
"type": "switch",
Expand Down

0 comments on commit e59dfb4

Please sign in to comment.