diff --git a/app/src/App.vue b/app/src/App.vue index 638503f..b81942b 100644 --- a/app/src/App.vue +++ b/app/src/App.vue @@ -43,7 +43,7 @@ Promise.all([this.loadStats(), this.loadSettings()]).then(() => { // init app let goto - const setupFinished = true // TODO + const setupFinished = this.stats.device.configured const wifiConnected = this.stats.wifi.connected // only on initial navigation diff --git a/lib/app/app.cpp b/lib/app/app.cpp index ce1bba3..2fe769b 100644 --- a/lib/app/app.cpp +++ b/lib/app/app.cpp @@ -122,6 +122,7 @@ void setupApp() doc["device"]["hostname"] = WiFi.getHostname(); doc["device"]["runtime"] = ceil(millis() / 1000); doc["device"]["bootCycle"] = deviceGetBootCount(); + doc["device"]["configured"] = deviceIsConfigured(); doc["device"]["screen"]["width"] = displayGetWidth(); doc["device"]["screen"]["height"] = displayGetHeight(); diff --git a/lib/device/device.cpp b/lib/device/device.cpp index 8270fbf..df9d0c6 100644 --- a/lib/device/device.cpp +++ b/lib/device/device.cpp @@ -12,7 +12,6 @@ char DeviceId[21 + 1]; void sleepDevice(); bool isBootTimeOver(); - void setupDevice() { // increment boot number and print it every reboot @@ -52,6 +51,11 @@ unsigned int deviceGetBootCount() return bootCount; } +bool deviceIsConfigured() +{ + return !(NVS.getString("wifi.ssid").isEmpty() || NVS.getString("device.name").isEmpty() || NVS.getString("device.theme").isEmpty()); +} + bool isBootTimeOver() { return millis() - bootTime >= 60000; diff --git a/lib/device/device.h b/lib/device/device.h index d8bb27a..3df3660 100644 --- a/lib/device/device.h +++ b/lib/device/device.h @@ -12,6 +12,7 @@ void loopDevice(); void deviceSetSleepInterval(long interval); long deviceGetSleepInterval(); unsigned int deviceGetBootCount(); +bool deviceIsConfigured(); extern char DeviceId[21 +1];