Die Flag-Funktion fürs mDNS-Icon korregiert
This commit is contained in:
+4
-16
@@ -154,22 +154,12 @@ static lv_indev_t *lvgl_touch_indev = NULL;
|
|||||||
/* --- Button Handle global halten, falls benötigt --- */
|
/* --- Button Handle global halten, falls benötigt --- */
|
||||||
static button_handle_t g_btn = NULL;
|
static button_handle_t g_btn = NULL;
|
||||||
|
|
||||||
static void app_update_mdns_influx_status(void)
|
static void app_update_mdns_status_from_nvs(void)
|
||||||
{
|
{
|
||||||
char *url = NULL;
|
char *url = NULL;
|
||||||
|
bool ok = storage_load_service_url(&url);
|
||||||
|
|
||||||
// Ich kenne deine exakte storage-API nicht – bitte eine vorhandene Funktion nutzen:
|
sys_status_set_mdns_ok(ok && url && url[0]); // nur mDNS
|
||||||
// Beispiele: storage_load_service_url(&url) oder storage_get_service_url(&url)
|
|
||||||
// -> Nimm die, die bei dir existiert.
|
|
||||||
bool ok = storage_load_service_url(&url); // <- ggf. Namen anpassen
|
|
||||||
|
|
||||||
if (ok && url && url[0]) {
|
|
||||||
sys_status_set_mdns_ok(true);
|
|
||||||
sys_status_set_influx_ok(true);
|
|
||||||
} else {
|
|
||||||
sys_status_set_mdns_ok(false);
|
|
||||||
sys_status_set_influx_ok(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url) free(url);
|
if (url) free(url);
|
||||||
}
|
}
|
||||||
@@ -247,9 +237,7 @@ static esp_err_t app_lvgl_init(void)
|
|||||||
|
|
||||||
static void ui_tick_cb(lv_timer_t *t) {
|
static void ui_tick_cb(lv_timer_t *t) {
|
||||||
(void)t;
|
(void)t;
|
||||||
|
app_update_mdns_status_from_nvs();
|
||||||
app_update_mdns_influx_status(); // <<< NEU
|
|
||||||
|
|
||||||
if (lvgl_port_lock(0)) {
|
if (lvgl_port_lock(0)) {
|
||||||
ui_update_status_icons();
|
ui_update_status_icons();
|
||||||
tick_screen(0);
|
tick_screen(0);
|
||||||
|
|||||||
Reference in New Issue
Block a user