Refactor Sensor cmnd

This commit is contained in:
Norbert Richter 2022-04-27 08:23:27 +02:00
parent 732359a885
commit f192284660
No known key found for this signature in database
GPG Key ID: 6628701A626FA674
1 changed files with 10 additions and 10 deletions

View File

@ -142,9 +142,9 @@ void FlowMeterShow(bool json)
* Supported commands for Sensor96: * Supported commands for Sensor96:
* *
* Sensor96 - Show current settings * Sensor96 - Show current settings
* Sensor96 0 0|1 - Show flow value in l/min (0) or m³/h (1)
* Sensor96 1 <correction-factor> - Set sensor 1 factor (x 1000) - to set to 0.2 enter 'Sensor96 1 200' * Sensor96 1 <correction-factor> - Set sensor 1 factor (x 1000) - to set to 0.2 enter 'Sensor96 1 200'
* Sensor96 2 <correction-factor> - Set sensor 2 factor (x 1000) * Sensor96 2 <correction-factor> - Set sensor 2 factor (x 1000)
* Sensor96 9 0|1 - Show flow value in l/min (0) or m³/h (1)
* *
* Flowmeter calibration: * Flowmeter calibration:
* - get the current displayed flow rate (D) * - get the current displayed flow rate (D)
@ -175,21 +175,21 @@ bool FlowMeterCommand(void) {
} }
switch (XdrvMailbox.payload) { switch (XdrvMailbox.payload) {
case 1: // Calibration value case 0: // Unit
case 2: // Calibration value
if (any_value) {
Settings->flowmeter_calibration[XdrvMailbox.payload - 1] = value;
ResponseCmndNumber(value);
show_parms = false;
}
break;
case 9: // Unit
if (any_value) { if (any_value) {
Settings->SensorBits1.flowmeter_unit = value & 1; Settings->SensorBits1.flowmeter_unit = value & 1;
ResponseCmndNumber(value & 1); ResponseCmndNumber(value & 1);
show_parms = false; show_parms = false;
} }
break; break;
case 1: // Sensor calibration value
case 2:
if (any_value) {
Settings->flowmeter_calibration[XdrvMailbox.payload - 1] = value;
ResponseCmndNumber(value);
show_parms = false;
}
break;
} }
if (show_parms) { if (show_parms) {