mirror of
https://github.com/esphome/esphome.git
synced 2024-11-23 07:28:10 +01:00
commit
db3b955b0f
3 changed files with 6 additions and 5 deletions
|
@ -42,11 +42,11 @@ void arch_init() {
|
||||||
// Idle task watchdog is disabled on ESP-IDF
|
// Idle task watchdog is disabled on ESP-IDF
|
||||||
#elif defined(USE_ARDUINO)
|
#elif defined(USE_ARDUINO)
|
||||||
enableLoopWDT();
|
enableLoopWDT();
|
||||||
// Disable idle task watchdog on the core we're using (Arduino pins the process to a core)
|
// Disable idle task watchdog on the core we're using (Arduino pins the task to a core)
|
||||||
#if CONFIG_ARDUINO_RUNNING_CORE == 0
|
#if defined(CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0) && CONFIG_ARDUINO_RUNNING_CORE == 0
|
||||||
disableCore0WDT();
|
disableCore0WDT();
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_ARDUINO_RUNNING_CORE == 1
|
#if defined(CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1) && CONFIG_ARDUINO_RUNNING_CORE == 1
|
||||||
disableCore1WDT();
|
disableCore1WDT();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -17,7 +17,7 @@ MQTTButtonComponent::MQTTButtonComponent(button::Button *button) : MQTTComponent
|
||||||
|
|
||||||
void MQTTButtonComponent::setup() {
|
void MQTTButtonComponent::setup() {
|
||||||
this->subscribe(this->get_command_topic_(), [this](const std::string &topic, const std::string &payload) {
|
this->subscribe(this->get_command_topic_(), [this](const std::string &topic, const std::string &payload) {
|
||||||
if (payload == "press") {
|
if (payload == "PRESS") {
|
||||||
this->button_->press();
|
this->button_->press();
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGW(TAG, "'%s': Received unknown status payload: %s", this->friendly_name().c_str(), payload.c_str());
|
ESP_LOGW(TAG, "'%s': Received unknown status payload: %s", this->friendly_name().c_str(), payload.c_str());
|
||||||
|
@ -31,6 +31,7 @@ void MQTTButtonComponent::dump_config() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void MQTTButtonComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryConfig &config) {
|
void MQTTButtonComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryConfig &config) {
|
||||||
|
config.state_topic = false;
|
||||||
if (!this->button_->get_device_class().empty())
|
if (!this->button_->get_device_class().empty())
|
||||||
root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
|
root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2021.12.1"
|
__version__ = "2021.12.2"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue