420 payload = xstrcat(payload, buf); |
420 payload = xstrcat(payload, buf); |
421 |
421 |
422 /* |
422 /* |
423 * Loaded profile and state |
423 * Loaded profile and state |
424 */ |
424 */ |
425 if (unit->mode == UNITMODE_PROFILE && unit->profile) { |
425 if (unit->profile) { |
426 for (profile = Config.profiles; profile; profile = profile->next) { |
426 for (profile = Config.profiles; profile; profile = profile->next) { |
427 if (strcmp(unit->profile, profile->uuid) == 0) { |
427 if (strcmp(unit->profile, profile->uuid) == 0) { |
428 payload = xstrcat(payload, (char *)",\"profile\":{\"uuid\":\""); |
428 payload = xstrcat(payload, (char *)",\"profile\":{\"uuid\":\""); |
429 payload = xstrcat(payload, unit->profile); |
429 payload = xstrcat(payload, unit->profile); |
430 payload = xstrcat(payload, (char *)",\"name\":\""); |
430 payload = xstrcat(payload, (char *)"\",\"name\":\""); |
431 payload = xstrcat(payload, profile->name); |
431 payload = xstrcat(payload, profile->name); |
432 payload = xstrcat(payload, (char *)"\",\"inittemp\":{\"low\":"); |
432 payload = xstrcat(payload, (char *)"\",\"state\":\""); |
|
433 payload = xstrcat(payload, (char *)PROFSTATE[unit->prof_state]); |
|
434 payload = xstrcat(payload, (char *)"\",\"percent\":"); |
|
435 sprintf(buf, "%d", unit->prof_percent); |
|
436 payload = xstrcat(payload, buf); |
|
437 payload = xstrcat(payload, (char *)",\"inittemp\":{\"low\":"); |
433 sprintf(buf, "%.1f", profile->inittemp_lo); |
438 sprintf(buf, "%.1f", profile->inittemp_lo); |
434 payload = xstrcat(payload, buf); |
439 payload = xstrcat(payload, buf); |
435 payload = xstrcat(payload, (char *)",\"high\":"); |
440 payload = xstrcat(payload, (char *)",\"high\":"); |
436 sprintf(buf, "%.1f", profile->inittemp_hi); |
441 sprintf(buf, "%.1f", profile->inittemp_hi); |
437 payload = xstrcat(payload, buf); |
442 payload = xstrcat(payload, buf); |