# HG changeset patch # User Michiel Broek # Date 1714307126 -7200 # Node ID 93a87fe230cc93c5dd962ea8ace489b96732ecff # Parent 844588d0df65c3b8db15566501353560c4386d6c Log marking device missing if a onewire devices goes away. Fixes in fermenters display. Added Present and Inuse columns in devices list. diff -r 844588d0df65 -r 93a87fe230cc thermferm/one-wire.c --- a/thermferm/one-wire.c Thu Apr 25 16:44:54 2024 +0200 +++ b/thermferm/one-wire.c Sun Apr 28 14:25:26 2024 +0200 @@ -252,6 +252,7 @@ if (strcmp(dev_w1->address, device->address) == 0) { // pthread_mutex_lock(&mutexes[LOCK_DEVICES]); device->present = DEVPRESENT_NO; + syslog(LOG_NOTICE, "One-wire device %s marked device %s not present", dev_w1->address, device->address); // pthread_mutex_unlock(&mutexes[LOCK_DEVICES]); } } diff -r 844588d0df65 -r 93a87fe230cc www/js/fermenter.js --- a/www/js/fermenter.js Thu Apr 25 16:44:54 2024 +0200 +++ b/www/js/fermenter.js Sun Apr 28 14:25:26 2024 +0200 @@ -464,17 +464,23 @@ record.beername = obj.metric.product.name; record.yeast_lo = obj.metric.product.yeast_lo; record.yeast_hi = obj.metric.product.yeast_hi; - record.air_state = obj.metric.air.state; - record.air_temperature = obj.metric.air.temperature; - record.beer_state = obj.metric.beer.state; - record.beer_temperature = obj.metric.beer.temperature; - record.chiller_state = obj.metric.chiller.state; - record.chiller_temperature = obj.metric.chiller.temperature; - if (obj.metric.heater.state !== undefined) + if (obj.metric.air) { + record.air_state = obj.metric.air.state; + record.air_temperature = obj.metric.air.temperature; + } + if (obj.metric.beer) { + record.beer_state = obj.metric.beer.state; + record.beer_temperature = obj.metric.beer.temperature; + } + if (obj.metric.chiller) { + record.chiller_state = obj.metric.chiller.state; + record.chiller_temperature = obj.metric.chiller.temperature; + } + if (obj.metric.heater) record.heater_state = obj.metric.heater.state; - if (obj.metric.cooler.state !== undefined) + if (obj.metric.cooler) record.cooler_state = obj.metric.cooler.state; - if (obj.metric.fan.state !== undefined) + if (obj.metric.fan) record.fan_state = obj.metric.fan.state; if (obj.metric.door) record.door_state = obj.metric.door.state; diff -r 844588d0df65 -r 93a87fe230cc www/js/set_devices.js --- a/www/js/set_devices.js Thu Apr 25 16:44:54 2024 +0200 +++ b/www/js/set_devices.js Sun Apr 28 14:25:26 2024 +0200 @@ -195,13 +195,15 @@ }); }, columns: [ - { text: 'Address', datafield: 'address', width: 200 }, - { text: 'Sub', datafield: 'subdevice', width: 60 }, + { text: 'Address', datafield: 'address', width: 180 }, + { text: 'Sub', datafield: 'subdevice', width: 50 }, + { text: 'Present', datafield: 'present', width: 80 }, { text: 'Type', datafield: 'type', width: 100 }, - { text: 'Direction', datafield: 'direction', width: 120 }, + { text: 'Direction', datafield: 'direction', width: 110 }, { text: 'Value', datafield: 'value', width: 80 }, + { text: 'Used', datafield: 'inuse', width: 60 }, { text: 'Description', datafield: 'description' }, - { text: 'Last change', datafield: 'timestamp', width: 200, + { text: 'Last change', datafield: 'timestamp', width: 190, cellsrenderer: function(index, datafield, value, defaultvalue, column, rowdata) { var date = new Date((value * 1000) - tzoffset).toISOString().slice(0, 19).replace("T", " "); return '' + date + '';