bmsd/fermenters.c

changeset 189
6470e5c6a001
parent 0
033898178630
child 192
7f69b43e6084
equal deleted inserted replaced
188:0ef62ec2d5b0 189:6470e5c6a001
1 /** 1 /**
2 * @file fermenters.c 2 * @file fermenters.c
3 * @brief Handle fermenters status 3 * @brief Handle fermenters status
4 * @author Michiel Broek <mbroek at mbse dot eu> 4 * @author Michiel Broek <mbroek at mbse dot eu>
5 * 5 *
6 * Copyright (C) 2018 6 * Copyright (C) 2018-2019
7 * 7 *
8 * This file is part of the bms (Brewery Management System) 8 * This file is part of the bms (Brewery Management System)
9 * 9 *
10 * This is free software; you can redistribute it and/or modify it 10 * This is free software; you can redistribute it and/or modify it
11 * under the terms of the GNU General Public License as published by the 11 * under the terms of the GNU General Public License as published by the
268 } 268 }
269 if (json_object_object_get_ex(sensor, "state", &val)) { 269 if (json_object_object_get_ex(sensor, "state", &val)) {
270 if (fermenter->profile_state) 270 if (fermenter->profile_state)
271 free(fermenter->profile_state); 271 free(fermenter->profile_state);
272 fermenter->profile_state = xstrcpy((char *)json_object_get_string(val)); 272 fermenter->profile_state = xstrcpy((char *)json_object_get_string(val));
273 }
274 if (json_object_object_get_ex(sensor, "percent", &val)) {
275 fermenter->profile_percent = json_object_get_int(val);
273 } 276 }
274 if (json_object_object_get_ex(sensor, "inittemp", &temp)) { 277 if (json_object_object_get_ex(sensor, "inittemp", &temp)) {
275 if (json_object_object_get_ex(temp, "low", &val)) { 278 if (json_object_object_get_ex(temp, "low", &val)) {
276 fermenter->profile_inittemp_low = json_object_get_double(val); 279 fermenter->profile_inittemp_low = json_object_get_double(val);
277 } 280 }

mercurial