mirror of https://github.com/arendst/Tasmota.git
parent
52f642b0c0
commit
cb192c5c2d
|
@ -1371,8 +1371,8 @@ void PublishStatus(uint8_t payload)
|
|||
}
|
||||
|
||||
if ((0 == payload) || (3 == payload)) {
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS3_LOGGING "\":{\"" D_CMND_SERIALLOG "\":%d,\"" D_CMND_WEBLOG "\":%d,\"" D_CMND_SYSLOG "\":%d,\"" D_CMND_LOGHOST "\":\"%s\",\"" D_CMND_LOGPORT "\":%d,\"" D_CMND_SSID "\":[\"%s\",\"%s\"],\"" D_CMND_TELEPERIOD "\":%d,\"" D_CMND_SETOPTION "\":[\"%08X\",\"%08X\"]}}"),
|
||||
Settings.seriallog_level, Settings.weblog_level, Settings.syslog_level, Settings.syslog_host, Settings.syslog_port, Settings.sta_ssid[0], Settings.sta_ssid[1], Settings.tele_period, Settings.flag.data, Settings.flag2.data);
|
||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_CMND_STATUS D_STATUS3_LOGGING "\":{\"" D_CMND_SERIALLOG "\":%d,\"" D_CMND_WEBLOG "\":%d,\"" D_CMND_SYSLOG "\":%d,\"" D_CMND_LOGHOST "\":\"%s\",\"" D_CMND_LOGPORT "\":%d,\"" D_CMND_SSID "\":[\"%s\",\"%s\"],\"" D_CMND_TELEPERIOD "\":%d,\"" D_CMND_SETOPTION "\":[\"%08X\",\"%08X\",\"%08X\"]}}"),
|
||||
Settings.seriallog_level, Settings.weblog_level, Settings.syslog_level, Settings.syslog_host, Settings.syslog_port, Settings.sta_ssid[0], Settings.sta_ssid[1], Settings.tele_period, Settings.flag.data, Settings.flag2.data, Settings.flag3.data);
|
||||
MqttPublishPrefixTopic_P(option, PSTR(D_CMND_STATUS "3"));
|
||||
}
|
||||
|
||||
|
|
|
@ -48,11 +48,11 @@ from StringIO import StringIO
|
|||
|
||||
a_on_off = ["OFF","ON "]
|
||||
|
||||
a_setoption = [
|
||||
a_setoption = [[
|
||||
"Save power state and use after restart",
|
||||
"Restrict button actions to single, double and hold",
|
||||
"Show value units in JSON messages",
|
||||
"MQTT",
|
||||
"MQTT enabled",
|
||||
"Respond as Command topic instead of RESULT",
|
||||
"MQTT retain on Power",
|
||||
"MQTT retain on Button",
|
||||
|
@ -74,13 +74,24 @@ a_setoption = [
|
|||
"MQTT serial",
|
||||
"Rules until 5.14.0b",
|
||||
"Rules once mode until 5.14.0b",
|
||||
"KNX",
|
||||
"KNX enabled",
|
||||
"Use Power device index on single relay devices",
|
||||
"KNX enhancement",
|
||||
"RF receive decimal",
|
||||
"IR receive decimal",
|
||||
"Enforce HASS light group",
|
||||
"Do not show Wifi and Mqtt state using Led"]
|
||||
"Do not show Wifi and Mqtt state using Led"
|
||||
],[
|
||||
"Timers enabled",
|
||||
"","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","","",
|
||||
"","","",""
|
||||
]]
|
||||
|
||||
a_features = [[
|
||||
"","","USE_I2C","USE_SPI",
|
||||
|
@ -144,6 +155,8 @@ else:
|
|||
fp.close()
|
||||
|
||||
def StartDecode():
|
||||
print ("\n*** decode-status.py v20180725 by Theo Arends ***")
|
||||
|
||||
# print("Decoding\n{}".format(obj))
|
||||
|
||||
if ("StatusSNS" in obj):
|
||||
|
@ -152,17 +165,29 @@ def StartDecode():
|
|||
|
||||
if ("Status" in obj):
|
||||
if ("FriendlyName" in obj["Status"]):
|
||||
print("\nDecoding information for device {}{}".format(obj["Status"]["FriendlyName"][0], time))
|
||||
print("Decoding information for device {}{}".format(obj["Status"]["FriendlyName"][0], time))
|
||||
|
||||
if ("StatusLOG" in obj):
|
||||
if ("SetOption" in obj["StatusLOG"]):
|
||||
options = []
|
||||
option = obj["StatusLOG"]["SetOption"][0]
|
||||
i_option = int(option,16)
|
||||
for i in range(len(a_setoption)):
|
||||
if (a_setoption[i]):
|
||||
state = (i_option >> i) & 1
|
||||
options.append(str("{0:2d} ({1}) {2}".format(i, a_on_off[state], a_setoption[i])))
|
||||
o = 0
|
||||
p = 0
|
||||
|
||||
r = 1
|
||||
if (len(obj["StatusLOG"]["SetOption"]) == 3):
|
||||
r = 2
|
||||
|
||||
for f in range(r):
|
||||
if (f == 1):
|
||||
o = 2
|
||||
p = 50
|
||||
|
||||
option = obj["StatusLOG"]["SetOption"][o]
|
||||
i_option = int(option,16)
|
||||
for i in range(len(a_setoption[f])):
|
||||
if (a_setoption[f][i]):
|
||||
state = (i_option >> i) & 1
|
||||
options.append(str("{0:2d} ({1}) {2}".format(i + p, a_on_off[state], a_setoption[f][i])))
|
||||
|
||||
print("\nOptions")
|
||||
for i in range(len(options)):
|
||||
|
|
Loading…
Reference in New Issue