mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-28 05:06:32 +00:00
Fix Build MQTT topic string based on FullTopic
This commit is contained in:
parent
a4b05b88a5
commit
1495338f53
@ -23,6 +23,7 @@ class lwdecode_cls
|
||||
|
||||
def LwDecode(data)
|
||||
import json
|
||||
import string
|
||||
|
||||
var deviceData = data['LwReceived']
|
||||
var deviceName = deviceData.keys()()
|
||||
@ -44,7 +45,11 @@ class lwdecode_cls
|
||||
end
|
||||
|
||||
if Payload.size() && self.LwDecoders.find(decoder)
|
||||
var topic = "tele/" + self.thisDevice + "/SENSOR"
|
||||
var topic = string.replace(string.replace(
|
||||
tasmota.cmd('FullTopic',true)['FullTopic'],
|
||||
'%topic%', tasmota.cmd('Topic',true)['Topic']),
|
||||
'%prefix%', tasmota.cmd('Prefix',true)['Prefix3']) # tele
|
||||
+ 'SENSOR'
|
||||
var decoded = self.LwDecoders[decoder].decodeUplink(Node, RSSI, FPort, Payload)
|
||||
var mqttData = {"LwDecoded":{deviceName:decoded}}
|
||||
mqtt.publish(topic, json.dump(mqttData))
|
||||
|
Loading…
x
Reference in New Issue
Block a user