mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
don't process dallas if gpio is 0
This commit is contained in:
@@ -35,14 +35,14 @@ uuid::log::Logger DallasSensor::logger_{F_(dallassensor), uuid::log::Facility::D
|
|||||||
void DallasSensor::start() {
|
void DallasSensor::start() {
|
||||||
reload();
|
reload();
|
||||||
|
|
||||||
#ifndef EMSESP_STANDALONE
|
// disabled if dallas gpio is 0
|
||||||
if (dallas_gpio_) {
|
if (dallas_gpio_) {
|
||||||
|
#ifndef EMSESP_STANDALONE
|
||||||
bus_.begin(dallas_gpio_);
|
bus_.begin(dallas_gpio_);
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
// API call
|
||||||
// API call
|
Command::add_with_json(EMSdevice::DeviceType::DALLASSENSOR, F_(info), [&](const char * value, const int8_t id, JsonObject & json) { return command_info(value, id, json); });
|
||||||
Command::add_with_json(EMSdevice::DeviceType::DALLASSENSOR, F_(info), [&](const char * value, const int8_t id, JsonObject & json) { return command_info(value, id, json); });
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// load the MQTT settings
|
// load the MQTT settings
|
||||||
@@ -59,6 +59,10 @@ void DallasSensor::reload() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DallasSensor::loop() {
|
void DallasSensor::loop() {
|
||||||
|
if (!dallas_gpio_) {
|
||||||
|
return; // dallas gpio is 0 (disabled)
|
||||||
|
}
|
||||||
|
|
||||||
#ifndef EMSESP_STANDALONE
|
#ifndef EMSESP_STANDALONE
|
||||||
uint32_t time_now = uuid::get_uptime();
|
uint32_t time_now = uuid::get_uptime();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user