(v2) add GPIOs to WebUI as configurable options (LED, Rx, Tx, Dallas sensor) #466

This commit is contained in:
proddy
2020-08-29 15:16:19 +02:00
parent 844267eeef
commit 24d5da36a6
16 changed files with 142 additions and 73 deletions

View File

@@ -36,7 +36,9 @@ void Sensors::start() {
reload();
#ifndef EMSESP_STANDALONE
bus_.begin(SENSOR_GPIO);
if (dallas_gpio_) {
bus_.begin(dallas_gpio_);
}
#endif
}
@@ -47,6 +49,8 @@ void Sensors::reload() {
mqtt_format_ = settings.mqtt_format; // single, nested or ha
});
EMSESP::emsespSettingsService.read([&](EMSESPSettings & settings) { dallas_gpio_ = settings.dallas_gpio; });
if (mqtt_format_ == MQTT_format::HA) {
for (uint8_t i = 0; i < MAX_SENSORS; registered_ha_[i++] = false)
;