Merge pull request #7093 from ascillato/patch-1

Add new tele- rule triggers
This commit is contained in:
Theo Arends 2019-12-02 19:53:26 +01:00 committed by GitHub
commit 45d5999ea2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -565,7 +565,7 @@ void MqttShowState(void)
if (i == LightDevice()) { LightState(1); } // call it only once
} else {
#endif
ResponseAppend_P(PSTR(",\"%s\":\"%s\""), GetPowerDevice(stemp1, i, sizeof(stemp1), Settings.flag.device_index_enable), // SetOption26 - Switch between POWER or POWER1
ResponseAppend_P(PSTR(",\"%s\":{\"STATE\":\"%s\"}"), GetPowerDevice(stemp1, i, sizeof(stemp1), Settings.flag.device_index_enable), // SetOption26 - Switch between POWER or POWER1
GetStateText(bitRead(power, i-1)));
#ifdef USE_SONOFF_IFAN
if (IsModuleIfan()) {
@ -592,7 +592,7 @@ void MqttPublishTeleState(void)
mqtt_data[0] = '\0';
MqttShowState();
MqttPublishPrefixTopic_P(TELE, PSTR(D_RSLT_STATE), MQTT_TELE_RETAIN);
#ifdef USE_SCRIPT
#if defined(USE_RULES) || defined(USE_SCRIPT)
RulesTeleperiod(); // Allow rule based HA messages
#endif // USE_SCRIPT
}