mirror of https://github.com/arendst/Tasmota.git
Add 0x to IRRemote and RCSwitch
Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431)
This commit is contained in:
parent
baa5825569
commit
d7715d1d2a
|
@ -2,6 +2,7 @@
|
||||||
* Fix exception on GUI Configure Logging and Configure Other (#5424)
|
* Fix exception on GUI Configure Logging and Configure Other (#5424)
|
||||||
* Add support for sensor SCD30 (#5434)
|
* Add support for sensor SCD30 (#5434)
|
||||||
* Add support for commands in sensor drivers
|
* Add support for commands in sensor drivers
|
||||||
|
* Add 0x to IRRemote (SetOption29) and RCSwitch (SetOption28) received hexadecimal data (#5431)
|
||||||
*
|
*
|
||||||
* 6.4.1.20 20190304
|
* 6.4.1.20 20190304
|
||||||
* Changed webserver content handling from single String to small Chunks increasing RAM
|
* Changed webserver content handling from single String to small Chunks increasing RAM
|
||||||
|
|
|
@ -114,7 +114,7 @@ void IrReceiveCheck(void)
|
||||||
|
|
||||||
if (irrecv->decode(&results)) {
|
if (irrecv->decode(&results)) {
|
||||||
|
|
||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_IRR "Echo %d, RawLen %d, Overflow %d, Bits %d, Value %08X, Decode %d"),
|
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_IRR "Echo %d, RawLen %d, Overflow %d, Bits %d, Value 0x%08X, Decode %d"),
|
||||||
irsend_active, results.rawlen, results.overflow, results.bits, results.value, results.decode_type);
|
irsend_active, results.rawlen, results.overflow, results.bits, results.value, results.decode_type);
|
||||||
|
|
||||||
unsigned long now = millis();
|
unsigned long now = millis();
|
||||||
|
@ -129,7 +129,7 @@ void IrReceiveCheck(void)
|
||||||
if (Settings.flag.ir_receive_decimal) {
|
if (Settings.flag.ir_receive_decimal) {
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("%u"), (uint32_t)results.value);
|
snprintf_P(stemp, sizeof(stemp), PSTR("%u"), (uint32_t)results.value);
|
||||||
} else {
|
} else {
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("\"%lX\""), (uint32_t)results.value);
|
snprintf_P(stemp, sizeof(stemp), PSTR("\"0x%lX\""), (uint32_t)results.value);
|
||||||
}
|
}
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_IRRECEIVED "\":{\"" D_JSON_IR_PROTOCOL "\":\"%s\",\"" D_JSON_IR_BITS "\":%d,\"" D_JSON_IR_DATA "\":%s"),
|
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_IRRECEIVED "\":{\"" D_JSON_IR_PROTOCOL "\":\"%s\",\"" D_JSON_IR_BITS "\":%d,\"" D_JSON_IR_DATA "\":%s"),
|
||||||
GetTextIndexed(sirtype, sizeof(sirtype), iridx, kIrRemoteProtocols), results.bits, stemp);
|
GetTextIndexed(sirtype, sizeof(sirtype), iridx, kIrRemoteProtocols), results.bits, stemp);
|
||||||
|
|
|
@ -49,7 +49,7 @@ void RfReceiveCheck(void)
|
||||||
int protocol = mySwitch.getReceivedProtocol();
|
int protocol = mySwitch.getReceivedProtocol();
|
||||||
int delay = mySwitch.getReceivedDelay();
|
int delay = mySwitch.getReceivedDelay();
|
||||||
|
|
||||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("RFR: Data %lX (%u), Bits %d, Protocol %d, Delay %d"), data, data, bits, protocol, delay);
|
AddLog_P2(LOG_LEVEL_DEBUG, PSTR("RFR: Data 0x%lX (%u), Bits %d, Protocol %d, Delay %d"), data, data, bits, protocol, delay);
|
||||||
|
|
||||||
uint32_t now = millis();
|
uint32_t now = millis();
|
||||||
if ((now - rf_lasttime > RF_TIME_AVOID_DUPLICATE) && (data > 0)) {
|
if ((now - rf_lasttime > RF_TIME_AVOID_DUPLICATE) && (data > 0)) {
|
||||||
|
@ -59,7 +59,7 @@ void RfReceiveCheck(void)
|
||||||
if (Settings.flag.rf_receive_decimal) { // SetOption28 (0 = hexadecimal, 1 = decimal)
|
if (Settings.flag.rf_receive_decimal) { // SetOption28 (0 = hexadecimal, 1 = decimal)
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("%u"), (uint32_t)data);
|
snprintf_P(stemp, sizeof(stemp), PSTR("%u"), (uint32_t)data);
|
||||||
} else {
|
} else {
|
||||||
snprintf_P(stemp, sizeof(stemp), PSTR("\"%lX\""), (uint32_t)data);
|
snprintf_P(stemp, sizeof(stemp), PSTR("\"0x%lX\""), (uint32_t)data);
|
||||||
}
|
}
|
||||||
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_RFRECEIVED "\":{\"" D_JSON_RF_DATA "\":%s,\"" D_JSON_RF_BITS "\":%d,\"" D_JSON_RF_PROTOCOL "\":%d,\"" D_JSON_RF_PULSE "\":%d}}"),
|
snprintf_P(mqtt_data, sizeof(mqtt_data), PSTR("{\"" D_JSON_RFRECEIVED "\":{\"" D_JSON_RF_DATA "\":%s,\"" D_JSON_RF_BITS "\":%d,\"" D_JSON_RF_PROTOCOL "\":%d,\"" D_JSON_RF_PULSE "\":%d}}"),
|
||||||
stemp, bits, protocol, delay);
|
stemp, bits, protocol, delay);
|
||||||
|
|
Loading…
Reference in New Issue