added support for IR DENON commands
This commit is contained in:
parent
a5e117d54d
commit
422c441533
2 changed files with 20 additions and 1 deletions
|
@ -84,7 +84,7 @@ void executeCommandWithData(std::string command, commandData commandData, std::s
|
||||||
auto current = commandData.commandPayloads.begin();
|
auto current = commandData.commandPayloads.begin();
|
||||||
data = std::stoull(*current, &sz, 0);
|
data = std::stoull(*current, &sz, 0);
|
||||||
}
|
}
|
||||||
Serial.printf("execute: will send IR SONY, data (%" PRIu64 ")\r\n", data);
|
Serial.printf("execute: will send IR SONY 15 bit, data (%" PRIu64 ")\r\n", data);
|
||||||
IrSender.sendSony(data, 15);
|
IrSender.sendSony(data, 15);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -108,6 +108,24 @@ void executeCommandWithData(std::string command, commandData commandData, std::s
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case IR_DENON: {
|
||||||
|
std::string::size_type sz = 0; // alias of size_t
|
||||||
|
uint64_t data;
|
||||||
|
if (commandData.commandPayloads.empty() && (additionalPayload == "")) {
|
||||||
|
Serial.printf("execute: cannot send IR DENON 48 bit, because both data and payload are empty\r\n");
|
||||||
|
} else {
|
||||||
|
if (additionalPayload != "") {
|
||||||
|
data = std::stoull(additionalPayload, &sz, 0);
|
||||||
|
} else {
|
||||||
|
auto current = commandData.commandPayloads.begin();
|
||||||
|
data = std::stoull(*current, &sz, 0);
|
||||||
|
}
|
||||||
|
Serial.printf("execute: will send IR DENON 48 bit, data (%" PRIu64 ")\r\n", data);
|
||||||
|
IrSender.sendDenon(data, 48);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_WIFI_AND_MQTT
|
#ifdef ENABLE_WIFI_AND_MQTT
|
||||||
case MQTT: {
|
case MQTT: {
|
||||||
auto current = commandData.commandPayloads.begin();
|
auto current = commandData.commandPayloads.begin();
|
||||||
|
|
|
@ -103,6 +103,7 @@ enum commandHandlers {
|
||||||
IR_SAMSUNG,
|
IR_SAMSUNG,
|
||||||
IR_SONY,
|
IR_SONY,
|
||||||
IR_RC5,
|
IR_RC5,
|
||||||
|
IR_DENON,
|
||||||
#ifdef ENABLE_WIFI_AND_MQTT
|
#ifdef ENABLE_WIFI_AND_MQTT
|
||||||
MQTT,
|
MQTT,
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue