Add filtration toggle

This commit is contained in:
Norbert Richter 2022-04-09 18:33:45 +02:00
parent 100e95f2cf
commit 1e2f2385b8
No known key found for this signature in database
GPG Key ID: 6628701A626FA674

View File

@ -732,8 +732,11 @@ const char HTTP_SNS_NEOPOOL_STATUS_ACTIVE[] PROGMEM = "filter:invert(1)";
* Commands
*
* NPFiltration {<state> {speed}}
* get/set manual filtration (state = 0|1, speed = 1..3)
* get/set manual filtration (state = 0..2, speed = 1..3)
* get filtration state if <state> is omitted, otherwise set new state
* 0 - switch filtration pump off
* 1 - switch filtration pump on
* 2 - toggle filtration pump
* for non-standard filtration types additional speed control is possible
*
* NPFiltrationMode {<mode>}
@ -2129,12 +2132,19 @@ void CmndNeopoolFiltration(void)
return;
}
}
if (value[0] >= 0 && value[0] <= 1) {
if (value[0] >= 0 && value[0] <= 2) {
// Set MBF_PAR_FILT_MODE
if (NEOPOOL_MODBUS_OK != NeoPoolWriteRegisterWord(MBF_PAR_FILT_MODE, MBV_PAR_FILT_MANUAL)) {
NeopoolResponseError();
return;
}
if (2 == value[0]) {
if (NEOPOOL_MODBUS_OK != NeoPoolReadRegister(MBF_PAR_FILTRATION_STATE, &data, 1)) {
NeopoolResponseError();
return;
}
value[0] = data ? 0 : 1;
}
// Set filtration mode to manual
if (NEOPOOL_MODBUS_OK != NeoPoolWriteRegisterWord(MBF_PAR_FILT_MANUAL_STATE, value[0])) {
NeopoolResponseError();