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
@@ -16,6 +16,14 @@ static const char *const DEFAULTS =
|
||||
"\"pattern\":\"on\",\"colors\":[\"000000\",\"FF0000\"],\"brightness\":100,\"delay\":100,\"step_offset\":0,"
|
||||
"\"step_increment\":1,\"n1\":0,\"n2\":0,\"n3\":0,\"n4\":0,\"n5\":0,\"n6\":0,\"n7\":0,\"n8\":0}";
|
||||
|
||||
void api_add_group(const char *name, char *id, size_t len)
|
||||
{
|
||||
cJSON *g = cJSON_Parse(DEFAULTS);
|
||||
api_set(g, "name", cJSON_CreateString(name));
|
||||
api_add("group", g, id, len);
|
||||
store_save("group");
|
||||
}
|
||||
|
||||
bool api_mac(const cJSON *v, char out[13])
|
||||
{
|
||||
if (!cJSON_IsString(v)) {
|
||||
|
||||
Reference in new issue
Block a user