mirror of
https://github.com/esphome/esphome.git
synced 2024-12-03 12:14:13 +01:00
added support for extended setUartOutput forms
This commit is contained in:
parent
b3ca1023e8
commit
1d26bbb986
1 changed files with 8 additions and 5 deletions
|
@ -125,11 +125,14 @@ class LedModeCommand : public Command {
|
|||
class UartOutputCommand : public Command {
|
||||
public:
|
||||
UartOutputCommand(bool active) : active_(active) {
|
||||
if (active) {
|
||||
cmd_ = "setUartOutput 1 1";
|
||||
} else {
|
||||
cmd_ = "setUartOutput 1 0";
|
||||
}
|
||||
cmd_ = std::string("setUartOutput 1 ") + std::to_string((int) active);
|
||||
};
|
||||
UartOutputCommand(int type, bool active) : active_(active) {
|
||||
cmd_ = std::string("setUartOutput ") + std::to_string(type) + " " + std::to_string((int) active);
|
||||
};
|
||||
UartOutputCommand(int type, bool active, bool auto_update, int interval) : active_(active) {
|
||||
cmd_ = std::string("setUartOutput ") + std::to_string(type) + " " + std::to_string((int) active) + " " +
|
||||
std::to_string((int) auto_update) + " " + std::to_string(interval);
|
||||
};
|
||||
uint8_t on_message(std::string &message) override;
|
||||
|
||||
|
|
Loading…
Reference in a new issue