files.
Signed-off-by: Mika Laitio <lamikr@pilppa.org>
// parse date
date = W1Util::parse_date_str(item);
}
- // skip the device type and device id fields
- // TODO: store device type and id to own file
- else if (ii >= 3) {
+ else if (ii >= 1) {
suc_flg = string_to_number<double>(val, item, dec);
if (suc_flg) {
//log_debug("adding number: %f\n", val);
#define DEVICE_CONFIG__SECTION_TYPE "device"
#define DEVICE_CONFIG__SECTION_NAME "base_data"
#define DEVICE_CONFIG_VALUE_KEY__TYPE "type"
+#define DEVICE_CONFIG_VALUE_KEY__ID "id"
#define DEVICE_CONFIG_VALUE_KEY__NAME "name"
namespace w1 {
if (type.empty() == true) {
type = ret_val->get_device_type();
config->set_cfg_value(DEVICE_CONFIG_VALUE_KEY__TYPE, type);
+ config->set_cfg_value(DEVICE_CONFIG_VALUE_KEY__ID, ret_val->get_id());
}
}
}
string W1Device::get_formatted_value(string value) {
string ret_val;
- ret_val = get_time() + "|" + get_device_type() + "|" + id + "|" + value + " " + get_unit();
+ ret_val = get_time() + "|" + value + " " + get_unit();
add_to_memory_cache(ret_val);
return ret_val;
}