feat: default IP, reset reason in /status, seeded default group
With no DHCP answer in 15 seconds the controller takes 192.168.4.1/24, for a cable straight to a PC with a static IP. /status reports why the board last restarted. First boot also seeds a default group that the default zone plays to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4372ba4105
commit
2f0c26e9b8
12 files changed
+99
-35
No files matched your search
+8
-2
@@ -277,11 +277,17 @@ void api_seed_defaults(void)
|
||||
}
|
||||
cJSON *fields = cJSON_CreateObject();
|
||||
cJSON_AddStringToObject(fields, "name", "default");
|
||||
char pid[16];
|
||||
seed_profile(fields,
|
||||
char pid[16], gid[16];
|
||||
cJSON *prof = seed_profile(fields,
|
||||
cJSON_Parse("[\"#FF0000\",\"#00FF00\",\"#0000FF\",\"#FFFF00\",\"#FF00FF\",\"#00FFFF\",\"#FFFFFF\",\"#000000\"]"),
|
||||
false, pid, sizeof(pid));
|
||||
cJSON_Delete(fields);
|
||||
api_add_group("default", gid, sizeof(gid));
|
||||
cJSON *gids = cJSON_CreateArray();
|
||||
cJSON_AddItemToArray(gids, cJSON_CreateString(gid));
|
||||
const cJSON *zid = cJSON_GetArrayItem(cJSON_GetObjectItem(prof, "zones"), 0);
|
||||
api_set(cJSON_GetObjectItem(store_coll("zone"), zid->valuestring), "group_ids", gids);
|
||||
store_save("zone");
|
||||
}
|
||||
|
||||
static const cJSON *profile_zones(const cJSON *prof)
|
||||
|
||||
Reference in new issue
Block a user