also now filling in the drying fields with default data based on the ambient component, or what was last used in the bin
This commit is contained in:
parent
a225f02795
commit
17728714a3
3 changed files with 18 additions and 15 deletions
|
|
@ -332,14 +332,23 @@ export default function BinVisualizer(props: Props) {
|
|||
setNewGrainSettings(bin.customGrain());
|
||||
}
|
||||
if (bin.settings) {
|
||||
let t = bin.settings.outdoorTemp;
|
||||
let t = 0
|
||||
let h = 0
|
||||
if(ambient){
|
||||
t = ambient.temperature
|
||||
h = ambient.humidity
|
||||
}else{
|
||||
t = bin.settings.outdoorTemp;//use what is already set in the bin settings
|
||||
h = bin.settings.outdoorHumidity
|
||||
}
|
||||
|
||||
if (user.settings.temperatureUnit === pond.TemperatureUnit.TEMPERATURE_UNIT_FAHRENHEIT) {
|
||||
t = CtoF(t);
|
||||
}
|
||||
setOutdoorTemp(t);
|
||||
setOutdoorHumidity(h)
|
||||
}
|
||||
if (bin.settings) setOutdoorHumidity(bin.settings.outdoorHumidity);
|
||||
}, [bin, user]);
|
||||
}, [bin, user, ambient]);
|
||||
|
||||
useEffect(() => {
|
||||
//if(loadingTrend) return
|
||||
|
|
@ -1998,7 +2007,7 @@ export default function BinVisualizer(props: Props) {
|
|||
}
|
||||
b.settings.mode = newBinMode;
|
||||
}
|
||||
|
||||
console.log(b.settings)
|
||||
binAPI.updateBin(bin.key(), b.settings, as).then(resp => {
|
||||
refresh();
|
||||
});
|
||||
|
|
@ -2025,8 +2034,8 @@ export default function BinVisualizer(props: Props) {
|
|||
if(refresh) updateBin();
|
||||
}}
|
||||
defaultTargetMoisture={bin.settings.inventory?.initialMoisture}
|
||||
// defaultOutdoorTemp={get this from any ambient sensors}
|
||||
// defaultOutdoorHumidity={get this from any ambient sensors}
|
||||
defaultOutdoorTemp={outdoorTemp}
|
||||
defaultOutdoorHumidity={outdoorHumidity}
|
||||
changeTargetMoisture={newMoisture => {
|
||||
setTargetMoisture(newMoisture)
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue