homieiot / homie-esp8266

💡 ESP8266 framework for Homie, a lightweight MQTT convention for the IoT
http://homieiot.github.io/homie-esp8266
MIT License
1.36k stars 308 forks source link

Homie.isConfigured() now check only if valid (not load json) #721

Closed elbowz closed 2 years ago

elbowz commented 3 years ago

Avoid loading config each time want check if device is configured (calling isConfigured()).

Fix: Remove the spam message "/homie/config.json doesn't exist" in config mode, when put isConfigured() in loop().

notes: I have made some test and it seems work, but in this way you can call Homie.isConfigured() only after Homie.setup().

...or maybe can be added something:

bool HomieClass::isConfigured() {
  if(!_setupCalled) return Interface::get().getConfig().load();
  else return Interface::get().getConfig().isValid();
}
elbowz commented 2 years ago

Are there some news, feedback or timing about this PR and the other one (#720)

Thx!