Increase upper limits user entry for energy drivers (#16059)

This commit is contained in:
Theo Arends 2024-06-30 17:26:39 +02:00
parent 33062dc839
commit 65588b8126
4 changed files with 12 additions and 12 deletions

View File

@ -604,7 +604,7 @@ bool McpCommand(void)
if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_active_power) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 100);
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_POWER;
McpGetCalibration();
@ -614,7 +614,7 @@ bool McpCommand(void)
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_voltage_rms) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 10);
if ((value > 1000) && (value < 2600)) { // Between 100V and 260V
if ((value > 1000) && (value < 4000)) { // Between 100V and 400V
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_VOLTAGE;
McpGetCalibration();
@ -624,7 +624,7 @@ bool McpCommand(void)
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && mcp_current_rms) {
value = (unsigned long)(CharToFloat(XdrvMailbox.data) * 10);
if ((value > 100) && (value < 80000)) { // Between 10mA and 8A
if ((value > 100) && (value < 800000)) { // Between 10mA and 80A
XdrvMailbox.payload = value;
mcp_calibrate |= MCP_CALIBRATE_CURRENT;
McpGetCalibration();

View File

@ -829,7 +829,7 @@ bool Ade7953Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.active_power[channel]) {
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
#ifdef ADE7953_ACCU_ENERGY
float power_calibration = (float)(Ade7953.active_power[channel] * 1000) / value; // 0.00 W
power_calibration *= ADE7953_POWER_CORRECTION;
@ -842,14 +842,14 @@ bool Ade7953Command(void) {
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.voltage_rms[channel]) {
if ((value > 10000) && (value < 26000)) { // Between 100V and 260V
if ((value > 10000) && (value < 40000)) { // Between 100V and 400V
XdrvMailbox.payload = (Ade7953.voltage_rms[channel] * 100) / value; // 0.00 V
}
}
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && Ade7953.current_rms[channel]) {
if ((value > 2000) && (value < 1000000)) { // Between 20mA and 10A
if ((value > 2000) && (value < 10000000)) { // Between 20mA and 100A
XdrvMailbox.payload = ((Ade7953.current_rms[channel] * 100) / value) * 100; // 0.00 mA
}
}

View File

@ -624,7 +624,7 @@ bool Cse7761Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.active_power[channel]) {
if ((value > 100) && (value < 200000)) { // Between 1W and 2000W
if ((value > 100) && (value < 2000000)) { // Between 1W and 20000W
XdrvMailbox.payload = ((CSE7761Data.active_power[channel]) / value) * 100;
}
}
@ -635,7 +635,7 @@ bool Cse7761Command(void) {
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.voltage_rms) {
if ((value > 10000) && (value < 26000)) { // Between 100V and 260V
if ((value > 10000) && (value < 40000)) { // Between 100V and 400V
XdrvMailbox.payload = (CSE7761Data.voltage_rms * 100) / value;
}
}
@ -646,7 +646,7 @@ bool Cse7761Command(void) {
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len && CSE7761Data.current_rms[channel]) {
if ((value > 1000) && (value < 1000000)) { // Between 10mA and 10A
if ((value > 1000) && (value < 10000000)) { // Between 10mA and 100A
XdrvMailbox.payload = ((CSE7761Data.current_rms[channel] * 100) / value) * 1000;
}
}

View File

@ -264,21 +264,21 @@ bool Bl6523Command(void) {
}
else if (CMND_POWERSET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 100) && (abs_value < 200000)) { // Between 1.00 and 2000.00 W
if ((abs_value > 100) && (abs_value < 2000000)) { // Between 1.00 and 20000.00 W
XdrvMailbox.payload = abs_value;
}
}
}
else if (CMND_VOLTAGESET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 10000) && (abs_value < 26000)) { // Between 100.00 and 260.00 V
if ((abs_value > 10000) && (abs_value < 40000)) { // Between 100.00 and 400.00 V
XdrvMailbox.payload = abs_value;
}
}
}
else if (CMND_CURRENTSET == Energy->command_code) {
if (XdrvMailbox.data_len) {
if ((abs_value > 1000) && (abs_value < 1000000)) { // Between 10.00 mA and 10.00000 A
if ((abs_value > 1000) && (abs_value < 10000000)) { // Between 10.00 mA and 100.00000 A
XdrvMailbox.payload = abs_value;
}
}