Merge pull request #6635 from s-hadinger/ir_rules

Fix Rules were not triggered with IR unknown protocol or in sonoff-ir
This commit is contained in:
Theo Arends 2019-10-13 22:34:41 +02:00 committed by GitHub
commit 173535a066
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 14 deletions

View File

@ -2,6 +2,7 @@
* 6.6.0.18 20191010
* Add command DimmerRange in Light module to support 2 byte dimming ranges from Tuya
* Add Zigbee additional commands and sending messages to control devices (#6095)
* Fix Rules were not triggered with IR unknown protocol or in sonoff-it (#6629)
*
* 6.6.0.17 20191009
* Add command SetOption34 0..255 to set backlog delay. Default value is 200 (mSeconds) (#6562)

View File

@ -174,13 +174,13 @@ void IrReceiveCheck(void)
ResponseJsonEndEnd();
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
if (iridx) {
XdrvRulesProcess();
XdrvRulesProcess();
#ifdef USE_DOMOTICZ
if (iridx) {
unsigned long value = results.value | (iridx << 28); // [Protocol:4, Data:28]
DomoticzSensor(DZ_COUNT, value); // Send data as Domoticz Counter value
#endif // USE_DOMOTICZ
}
#endif // USE_DOMOTICZ
}
irrecv->resume();

View File

@ -198,15 +198,11 @@ String sendIRJsonState(const struct decode_results &results) {
void IrReceiveCheck(void)
{
char sirtype[14]; // Max is AIWA_RC_T501
int8_t iridx = 0;
decode_results results;
if (irrecv->decode(&results)) {
uint32_t now = millis();
// if ((now - ir_lasttime > IR_TIME_AVOID_DUPLICATE) && (UNKNOWN != results.decode_type) && (results.bits > 0)) {
if (!irsend_active && (now - ir_lasttime > IR_TIME_AVOID_DUPLICATE)) {
ir_lasttime = now;
@ -236,13 +232,7 @@ void IrReceiveCheck(void)
ResponseJsonEndEnd();
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
if (iridx) {
XdrvRulesProcess();
#ifdef USE_DOMOTICZ
unsigned long value = results.value | (iridx << 28); // [Protocol:4, Data:28]
DomoticzSensor(DZ_COUNT, value); // Send data as Domoticz Counter value
#endif // USE_DOMOTICZ
}
XdrvRulesProcess();
}
irrecv->resume();