mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-26 20:26:32 +00:00
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:
commit
173535a066
@ -2,6 +2,7 @@
|
|||||||
* 6.6.0.18 20191010
|
* 6.6.0.18 20191010
|
||||||
* Add command DimmerRange in Light module to support 2 byte dimming ranges from Tuya
|
* 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)
|
* 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
|
* 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)
|
||||||
|
@ -174,13 +174,13 @@ void IrReceiveCheck(void)
|
|||||||
ResponseJsonEndEnd();
|
ResponseJsonEndEnd();
|
||||||
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
|
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
|
||||||
|
|
||||||
if (iridx) {
|
XdrvRulesProcess();
|
||||||
XdrvRulesProcess();
|
|
||||||
#ifdef USE_DOMOTICZ
|
#ifdef USE_DOMOTICZ
|
||||||
|
if (iridx) {
|
||||||
unsigned long value = results.value | (iridx << 28); // [Protocol:4, Data:28]
|
unsigned long value = results.value | (iridx << 28); // [Protocol:4, Data:28]
|
||||||
DomoticzSensor(DZ_COUNT, value); // Send data as Domoticz Counter value
|
DomoticzSensor(DZ_COUNT, value); // Send data as Domoticz Counter value
|
||||||
#endif // USE_DOMOTICZ
|
|
||||||
}
|
}
|
||||||
|
#endif // USE_DOMOTICZ
|
||||||
}
|
}
|
||||||
|
|
||||||
irrecv->resume();
|
irrecv->resume();
|
||||||
|
@ -198,15 +198,11 @@ String sendIRJsonState(const struct decode_results &results) {
|
|||||||
|
|
||||||
void IrReceiveCheck(void)
|
void IrReceiveCheck(void)
|
||||||
{
|
{
|
||||||
char sirtype[14]; // Max is AIWA_RC_T501
|
|
||||||
int8_t iridx = 0;
|
|
||||||
|
|
||||||
decode_results results;
|
decode_results results;
|
||||||
|
|
||||||
if (irrecv->decode(&results)) {
|
if (irrecv->decode(&results)) {
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
|
|
||||||
|
|
||||||
// if ((now - ir_lasttime > IR_TIME_AVOID_DUPLICATE) && (UNKNOWN != results.decode_type) && (results.bits > 0)) {
|
// 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)) {
|
if (!irsend_active && (now - ir_lasttime > IR_TIME_AVOID_DUPLICATE)) {
|
||||||
ir_lasttime = now;
|
ir_lasttime = now;
|
||||||
@ -236,13 +232,7 @@ void IrReceiveCheck(void)
|
|||||||
ResponseJsonEndEnd();
|
ResponseJsonEndEnd();
|
||||||
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
|
MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_IRRECEIVED));
|
||||||
|
|
||||||
if (iridx) {
|
XdrvRulesProcess();
|
||||||
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
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
irrecv->resume();
|
irrecv->resume();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user