mirror of https://github.com/arendst/Tasmota.git
Add rule support after every command execution
* Add incremental beeps to Ifan03 remote control fan speed buttons (#6636) * Add rule support after every command execution like Fanspeed#Data=2 (#6636)
This commit is contained in:
parent
3ff1bcd64c
commit
ee2519070f
|
@ -5,6 +5,8 @@
|
||||||
* Fix Rules were not triggered with IR unknown protocol or in sonoff-it (#6629)
|
* Fix Rules were not triggered with IR unknown protocol or in sonoff-it (#6629)
|
||||||
* Add define USE_DEEPSLEEP and command DeepSleepTime 0 or 10..86400 (seconds) to enter deepsleep mode (#6638)
|
* Add define USE_DEEPSLEEP and command DeepSleepTime 0 or 10..86400 (seconds) to enter deepsleep mode (#6638)
|
||||||
* Add define USE_SONOFF_RF to enable/disable Sonoff Rf support (#6648)
|
* Add define USE_SONOFF_RF to enable/disable Sonoff Rf support (#6648)
|
||||||
|
* Add incremental beeps to Ifan03 remote control fan speed buttons (#6636)
|
||||||
|
* Add rule support after every command execution like Fanspeed#Data=2 (#6636)
|
||||||
*
|
*
|
||||||
* 6.6.0.17 20191009
|
* 6.6.0.17 20191009
|
||||||
* Add command SetOption34 0..255 to set backlog delay. Default value is 200 (mSeconds) (#6562)
|
* Add command SetOption34 0..255 to set backlog delay. Default value is 200 (mSeconds) (#6562)
|
||||||
|
|
|
@ -225,9 +225,7 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len)
|
||||||
|
|
||||||
if (mqtt_data[0] != '\0') {
|
if (mqtt_data[0] != '\0') {
|
||||||
MqttPublishPrefixTopic_P(RESULT_OR_STAT, type);
|
MqttPublishPrefixTopic_P(RESULT_OR_STAT, type);
|
||||||
#ifdef USE_SCRIPT
|
|
||||||
XdrvRulesProcess();
|
XdrvRulesProcess();
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
fallback_topic_flag = false;
|
fallback_topic_flag = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ void SonoffIfanReceived(void)
|
||||||
snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_FANSPEED " %d"), action);
|
snprintf_P(svalue, sizeof(svalue), PSTR(D_CMND_FANSPEED " %d"), action);
|
||||||
ExecuteCommand(svalue, SRC_REMOTE);
|
ExecuteCommand(svalue, SRC_REMOTE);
|
||||||
#ifdef USE_BUZZER
|
#ifdef USE_BUZZER
|
||||||
BuzzerEnabledBeep(action); // Beep action times
|
BuzzerEnabledBeep((action) ? action : 1, (action) ? 1 : 4); // Beep action times
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -140,7 +140,7 @@ void SonoffIfanReceived(void)
|
||||||
if (7 == mode) {
|
if (7 == mode) {
|
||||||
// AA 55 01 07 00 01 01 0A - Rf long press - forget RF codes
|
// AA 55 01 07 00 01 01 0A - Rf long press - forget RF codes
|
||||||
#ifdef USE_BUZZER
|
#ifdef USE_BUZZER
|
||||||
BuzzerEnabledBeep(4); // Beep four times
|
BuzzerEnabledBeep(4, 1); // Beep four times
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,8 +45,8 @@ void BuzzerOff(void)
|
||||||
//void BuzzerBeep(uint32_t count = 1, uint32_t on = 1, uint32_t off = 1, uint32_t tune = 0);
|
//void BuzzerBeep(uint32_t count = 1, uint32_t on = 1, uint32_t off = 1, uint32_t tune = 0);
|
||||||
void BuzzerBeep(uint32_t count, uint32_t on, uint32_t off, uint32_t tune)
|
void BuzzerBeep(uint32_t count, uint32_t on, uint32_t off, uint32_t tune)
|
||||||
{
|
{
|
||||||
Buzzer.set[0] = off;
|
Buzzer.set[0] = off; // off duration in 100 mSec steps
|
||||||
Buzzer.set[1] = on;
|
Buzzer.set[1] = on; // on duration in 100 mSec steps
|
||||||
Buzzer.duration = 1; // Start buzzer on first step
|
Buzzer.duration = 1; // Start buzzer on first step
|
||||||
Buzzer.tune = 0;
|
Buzzer.tune = 0;
|
||||||
if (tune) {
|
if (tune) {
|
||||||
|
@ -78,10 +78,10 @@ void BuzzerBeep(uint32_t count) {
|
||||||
BuzzerBeep(count, 1, 1, 0);
|
BuzzerBeep(count, 1, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BuzzerEnabledBeep(uint32_t count)
|
void BuzzerEnabledBeep(uint32_t count, uint32_t duration)
|
||||||
{
|
{
|
||||||
if (Settings.flag3.buzzer_enable) { // SetOption67
|
if (Settings.flag3.buzzer_enable) { // SetOption67
|
||||||
BuzzerBeep(count);
|
BuzzerBeep(count, duration, 1, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue