Merge pull request #578 from iprak/hass-discovery-ip-change

Invoke discovery on ip change
This commit is contained in:
openshwprojects
2023-01-05 18:50:24 +01:00
committed by GitHub
3 changed files with 24 additions and 7 deletions

View File

@ -2564,6 +2564,12 @@ int http_fn_cfg_pins(http_request_t* request) {
// saving the configuration instead of waiting.
//CFG_Save_SetupTimer();
CFG_Save_IfThereArePendingChanges();
// Invoke Hass discovery if configuration has changed and not in safe mode.
if (!bSafeMode && CFG_HasFlag(OBK_FLAG_AUTOMAIC_HASS_DISCOVERY)) {
Main_ScheduleHomeAssistantDiscovery(1);
}
hprintf255(request, "Pins update - %i reqs, %i changed!<br><br>", iChangedRequested, iChanged);
}
// strcat(outbuf,"<button type=\"button\">Click Me!</button>");
@ -2666,6 +2672,7 @@ const char* g_obk_flagNames[] = {
#else
"[UART] Use alternate UART for BL0942, CSE, TuyaMCU, etc",
#endif
"[HASS] Invoke HomeAssistant discovery on change to ip address, configuration",
"error",
"error",
"error",