Update statedata.be topic handling (#23878)
Could would react to any topic including the string "STATE", specifically including "ZBSTATE" payload from the command "ZbScan"
This commit is contained in:
parent
1736c640f3
commit
27532f8d81
@ -36,14 +36,15 @@ class mqttdata_cls
|
||||
end
|
||||
|
||||
def stop()
|
||||
mqtt.unsubscribe("tele/#") # Assume default Fulltopic (%prefix%/%topic%/) and Prefix3 (tele)
|
||||
tasmota.remove_driver(self)
|
||||
end
|
||||
|
||||
def handle_state_data(full_topic, idx, data, databytes)
|
||||
import json
|
||||
|
||||
if string.find(full_topic, "STATE") > 0 # tele/wemos7/STATE
|
||||
var subtopic = string.split(full_topic, "/") # Assume default Fulltopic (%prefix%/%topic%/)
|
||||
var subtopic = string.split(full_topic, "/") # Assume default Fulltopic (%prefix%/%topic%/)
|
||||
if subtopic[-1] == "STATE" # tele/wemos7/STATE
|
||||
var topic = subtopic[1] # wemos7
|
||||
|
||||
var state = json.load(data)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user