160 updateScreen(); |
160 updateScreen(); |
161 } |
161 } |
162 }); |
162 }); |
163 |
163 |
164 function updateScreen() { |
164 function updateScreen() { |
165 console.log('mode ' + record.mode + ' profile ' + record.profile_state + ' name ' + record.profile_name); |
|
166 $('#room_thb').html(global.room_temp + '°C ' + global.room_hum + '% humidity'); |
165 $('#room_thb').html(global.room_temp + '°C ' + global.room_hum + '% humidity'); |
167 $('#info_system').html(record.unit); |
166 $('#info_system').html(record.unit); |
168 $('#info_beer').html(record.beercode + ' - ' + record.beername); |
167 $('#info_beer').html(record.beercode + ' - ' + record.beername); |
169 $('#info_mode').jqxDropDownList('selectItem', record.mode); |
168 $('#info_mode').jqxDropDownList('selectItem', record.mode); |
170 $('#info_stage').jqxDropDownList('selectItem', record.stage); |
169 $('#info_stage').jqxDropDownList('selectItem', record.stage); |
457 global.room_hum = obj.THB.humidity; |
456 global.room_hum = obj.THB.humidity; |
458 updateScreen(); |
457 updateScreen(); |
459 } |
458 } |
460 |
459 |
461 if (obj.type == 'fermenter' && obj.unit == record.unit) { |
460 if (obj.type == 'fermenter' && obj.unit == record.unit) { |
462 // console.log('ws got this device ' + msg); |
|
463 record.beeruuid = obj.metric.product.uuid; |
461 record.beeruuid = obj.metric.product.uuid; |
464 record.beercode = obj.metric.product.code; |
462 record.beercode = obj.metric.product.code; |
465 record.beername = obj.metric.product.name; |
463 record.beername = obj.metric.product.name; |
466 record.yeast_lo = obj.metric.product.yeast_lo; |
464 record.yeast_lo = obj.metric.product.yeast_lo; |
467 record.yeast_hi = obj.metric.product.yeast_hi; |
465 record.yeast_hi = obj.metric.product.yeast_hi; |
494 record.profile_state = obj.metric.profile.state; |
492 record.profile_state = obj.metric.profile.state; |
495 record.profile_percent = obj.metric.profile.percent; |
493 record.profile_percent = obj.metric.profile.percent; |
496 record.profile_inittemp_high = obj.metric.profile.inittemp.high; |
494 record.profile_inittemp_high = obj.metric.profile.inittemp.high; |
497 record.profile_inittemp_low = obj.metric.profile.inittemp.low; |
495 record.profile_inittemp_low = obj.metric.profile.inittemp.low; |
498 } else { |
496 } else { |
499 record.profile_uuid = 'Haha'; |
497 record.profile_uuid = ''; |
500 record.profile_name = ''; |
498 record.profile_name = ''; |
501 record.profile_state = ''; |
499 record.profile_state = ''; |
502 record.profile_percent = 0; |
500 record.profile_percent = 0; |
503 } |
501 } |
504 updateScreen(); |
502 updateScreen(); |