Skip to content

Commit 4c7c6fc

Browse files
authored
Merge 6cfd10d into 093e44b
2 parents 093e44b + 6cfd10d commit 4c7c6fc

3 files changed

Lines changed: 8 additions & 85 deletions

File tree

data/cmdvartab

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,6 @@ CMDDESC bypass.start "Put the UPS in Bypass mode"
260260
CMDDESC bypass.stop "Take the UPS out of Bypass mode"
261261
CMDDESC experimental.ecomode.enable "Put UPS in High Efficiency (aka ECO) mode"
262262
CMDDESC experimental.ecomode.disable "Take the UPS out of High Efficiency (aka ECO) mode"
263-
CMDDESC experimental.ecomode.start.auto "Put UPS in Bypass mode then High Efficiency (aka ECO) mode"
264-
CMDDESC experimental.ecomode.stop.auto "Take the UPS out of High Efficiency (aka ECO) mode after exiting Bypass mode"
265263
CMDDESC experimental.essmode.enable "Put UPS in Energy Saver System (aka ESS) mode"
266264
CMDDESC experimental.essmode.disable "Take the UPS out of Energy Saver System (aka ESS) mode"
267265
CMDDESC experimental.test.beeper.start "Start testing the UPS beeper"

docs/nut-names.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,10 +1059,6 @@ to last as part of NUT standard protocol in the long run.
10591059
| Put UPS in High Efficiency (aka ECO) mode
10601060
| experimental.ecomode.disable | usbhid-ups => mge-hid (Eaton/MGE)
10611061
| Take the UPS out of High Efficiency (aka ECO) mode
1062-
| experimental.ecomode.start.auto | usbhid-ups => mge-hid (Eaton/MGE)
1063-
| Put UPS in Bypass mode then High Efficiency (aka ECO) mode
1064-
| experimental.ecomode.stop.auto | usbhid-ups => mge-hid (Eaton/MGE)
1065-
| Take the UPS out of High Efficiency (aka ECO) mode after exiting Bypass mode
10661062
| experimental.essmode.enable | usbhid-ups => mge-hid (Eaton/MGE)
10671063
| Put UPS in Energy Saver System (aka ESS) mode
10681064
| experimental.essmode.disable | usbhid-ups => mge-hid (Eaton/MGE)

drivers/mge-hid.c

Lines changed: 8 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ static const char *eaton_input_bypass_check_range(double value)
10621062
NUT_STRARG(out_frequency_nominal_str));
10631063

10641064
/* Disable Bypass mode switching, do not enter Bypass mode */
1065-
dstate_setinfo("input.bypass.switch.on", "disabled");
1065+
dstate_setinfo("input.bypass.switch.off", "off");
10661066
upsdebugx(1, "%s: Disable Bypass mode due to missing input/output variables.", __func__);
10671067
return NULL;
10681068
}
@@ -1131,7 +1131,7 @@ static const char *eaton_input_bypass_check_range(double value)
11311131
upsdebugx(1, "Input Bypass frequency is outside Bypass transfer limits: %.1f Hz", bypass_frequency);
11321132
}
11331133
/* Disable Bypass mode switching, do not enter Bypass mode */
1134-
dstate_setinfo("input.bypass.switch.on", "disabled");
1134+
dstate_setinfo("input.bypass.switch.off", "off");
11351135
upsdebugx(1, "%s: Disable Bypass mode due to input conditions being outside the transfer limits.", __func__);
11361136
return NULL;
11371137
}
@@ -1151,73 +1151,6 @@ static info_lkp_t eaton_input_bypass_mode_off_info[] = {
11511151
{ 0, NULL, NULL, NULL }
11521152
};
11531153

1154-
/* Function to start ECO(HE) Mode automatically instead of manually starting Bypass and then ECO(HE) Mode */
1155-
static const char *eaton_input_eco_mode_auto_on_fun(double value)
1156-
{
1157-
const char *bypass_switch_on_str = NULL;
1158-
const char *eco_switchable_str = NULL;
1159-
1160-
NUT_UNUSED_VARIABLE(value);
1161-
1162-
/* Check if input.bypass.switch.on is disabled and set it to 'on' */
1163-
bypass_switch_on_str = dstate_getinfo("input.bypass.switch.on");
1164-
if (!strcmp(bypass_switch_on_str, "disabled")) {
1165-
setvar("input.bypass.switch.on", "on");
1166-
} else {
1167-
upsdebugx(1, "Bypass switch on state is: %s , must be disabled before switching on", bypass_switch_on_str);
1168-
return NULL;
1169-
}
1170-
1171-
/* Check if input.eco.switchable is normal and set it to 'ECO' */
1172-
eco_switchable_str = dstate_getinfo("input.eco.switchable");
1173-
if (!strcmp(eco_switchable_str, "normal")) {
1174-
setvar("input.eco.switchable", "ECO");
1175-
} else {
1176-
upsdebugx(1, "ECO switch state is: %s , must be normal before switching to ECO", eco_switchable_str);
1177-
return NULL;
1178-
}
1179-
1180-
upsdebugx(1, "%s: ECO Mode was enabled after switching to Bypass Mode", __func__);
1181-
return NULL;
1182-
}
1183-
1184-
/* Function to stop ECO(HE) Mode automatically instead of manually stoping Bypass and then Online Mode */
1185-
static const char *eaton_input_eco_mode_auto_off_fun(double value)
1186-
{
1187-
const char *bypass_switch_off_str = NULL;
1188-
const char *eco_switchable_str = NULL;
1189-
1190-
NUT_UNUSED_VARIABLE(value);
1191-
1192-
/* Check if input.bypass.switch.off is disabled and set it to 'off' */
1193-
bypass_switch_off_str = dstate_getinfo("input.bypass.switch.off");
1194-
if (!strcmp(bypass_switch_off_str, "disabled")) {
1195-
setvar("input.bypass.switch.off", "off");
1196-
} else {
1197-
upsdebugx(1, "Bypass switch off state is: %s , must be disabled before switching off", bypass_switch_off_str);
1198-
return NULL;
1199-
}
1200-
1201-
/* Check if input.eco.switchable is 'ECO' and set it to normal */
1202-
eco_switchable_str = dstate_getinfo("input.eco.switchable");
1203-
if (!strcmp(eco_switchable_str, "ECO")) {
1204-
setvar("input.eco.switchable", "normal");
1205-
} else {
1206-
upsdebugx(1, "ECO switch state is: %s , must be ECO before switching to normal", eco_switchable_str);
1207-
return NULL;
1208-
}
1209-
1210-
upsdebugx(1, "%s: ECO Mode was disabled after switching from Bypass Mode", __func__);
1211-
return NULL;
1212-
}
1213-
1214-
/* High Efficiency (aka ECO) mode for auto start/stop commands */
1215-
static info_lkp_t eaton_input_eco_mode_auto_on_off_info[] = {
1216-
{ 1, "dummy", eaton_input_eco_mode_auto_on_fun, NULL },
1217-
{ 0, "dummy", eaton_input_eco_mode_auto_off_fun, NULL },
1218-
{ 0, NULL, NULL, NULL }
1219-
};
1220-
12211154
/* Determine country using UPS.PowerSummary.Country.
12221155
* If not present:
12231156
* if PowerConverter.Output.Voltage >= 200 => "Europe"
@@ -2155,18 +2088,14 @@ static hid_info_t mge_hid2nut[] =
21552088
{ "outlet.2.load.on", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeStartup", NULL, "0", HU_TYPE_CMD, NULL },
21562089

21572090
/* Command to switch ECO(HE), ESS Mode */
2158-
{ "experimental.ecomode.disable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "0", HU_TYPE_CMD, eaton_input_eco_mode_on_off_info },
2159-
{ "experimental.ecomode.enable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "1", HU_TYPE_CMD, eaton_input_eco_mode_on_off_info },
2160-
{ "experimental.essmode.enable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "2", HU_TYPE_CMD, eaton_input_eco_mode_on_off_info },
2161-
{ "experimental.essmode.disable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "0", HU_TYPE_CMD, eaton_input_eco_mode_on_off_info },
2162-
/* Command to switch ECO(HE) Mode with switch to Automatic Bypass Mode on before */
2163-
{ "experimental.ecomode.start.auto", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "1", HU_TYPE_CMD, eaton_input_eco_mode_auto_on_off_info },
2164-
/* Command to switch from ECO(HE) Mode with switch from Automatic Bypass Mode on before */
2165-
{ "experimental.ecomode.stop.auto", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "0", HU_TYPE_CMD, eaton_input_eco_mode_auto_on_off_info },
2091+
{ "experimental.ecomode.disable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "0", HU_TYPE_CMD, NULL },
2092+
{ "experimental.ecomode.enable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "1", HU_TYPE_CMD, NULL },
2093+
{ "experimental.essmode.enable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "2", HU_TYPE_CMD, NULL },
2094+
{ "experimental.essmode.disable", 0, 0, "UPS.PowerConverter.Input.[5].Switchable", NULL, "0", HU_TYPE_CMD, NULL },
21662095

21672096
/* Command to switch Automatic Bypass Mode on/off */
2168-
{ "bypass.start", 0, 0, "UPS.PowerConverter.Input.[2].SwitchOnControl", NULL, "1", HU_TYPE_CMD, eaton_input_bypass_mode_on_info },
2169-
{ "bypass.stop", 0, 0, "UPS.PowerConverter.Input.[2].SwitchOffControl", NULL, "1", HU_TYPE_CMD, eaton_input_bypass_mode_off_info },
2097+
{ "bypass.start", 0, 0, "UPS.PowerConverter.Input.[2].SwitchOnControl", NULL, "1", HU_TYPE_CMD, NULL },
2098+
{ "bypass.stop", 0, 0, "UPS.PowerConverter.Input.[2].SwitchOffControl", NULL, "1", HU_TYPE_CMD, NULL },
21702099

21712100
/* end of structure. */
21722101
{ NULL, 0, 0, NULL, NULL, NULL, 0, NULL }

0 commit comments

Comments
 (0)