Skip to content

Commit

Permalink
outlet.n.status back and new one move to intro `outlet.1.protect.st…
Browse files Browse the repository at this point in the history
…atus` also define in cmdvartab and /docs/nut-names.txt

Signed-off-by: DaRK AnGeL <[email protected]>
  • Loading branch information
masterwishx committed Sep 25, 2024
1 parent eda403f commit 6e63a97
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions data/cmdvartab
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ VARDESC outlet.id "Outlet system identifier"
VARDESC outlet.desc "Outlet description"
VARDESC outlet.switch "Outlet switch control"
VARDESC outlet.status "Outlet switch status"
VARDESC outlet.protect.status "Outlet Protection status"
VARDESC outlet.switchable "Outlet switch ability"
VARDESC outlet.autoswitch.charge.low "Remaining battery level to power off this outlet (percent)"
VARDESC outlet.delay.shutdown "Interval to wait before shutting down this outlet (seconds)"
Expand All @@ -170,6 +171,7 @@ VARDESC outlet.1.id "Outlet system identifier"
VARDESC outlet.1.desc "Outlet description"
VARDESC outlet.1.switch "Outlet switch control"
VARDESC outlet.1.status "Outlet switch status"
VARDESC outlet.1.protect.status "Outlet Protection status"
VARDESC outlet.1.switchable "Outlet switch ability"
VARDESC outlet.1.ecocontrol "Outlet High Efficiency (aka ECO) control info"
VARDESC outlet.1.autoswitch.charge.low "Remaining battery level to power off this outlet (percent)"
Expand All @@ -179,6 +181,7 @@ VARDESC outlet.2.id "Outlet system identifier"
VARDESC outlet.2.desc "Outlet description"
VARDESC outlet.2.switch "Outlet switch control"
VARDESC outlet.2.status "Outlet switch status"
VARDESC outlet.2.protect.status "Outlet Protection status"
VARDESC outlet.2.switchable "Outlet switch ability"
VARDESC outlet.2.ecocontrol "Outlet High Efficiency (aka ECO) control info"
VARDESC outlet.2.autoswitch.charge.low "Remaining battery level to power off this outlet (percent)"
Expand Down
2 changes: 2 additions & 0 deletions docs/nut-names.txt
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,8 @@ of the user manual.
(on/off) | on
| outlet.n.status | Outlet switch status
(on/off) | on
| outlet.n.protect.status | Outlet protection status
(0-2) | protected
| outlet.n.alarm | Alarms for outlets and PDU,
published in ups.alarm | outlet 1 low
voltage warning
Expand Down
9 changes: 4 additions & 5 deletions drivers/mge-hid.c
Original file line number Diff line number Diff line change
Expand Up @@ -1510,11 +1510,9 @@ static hid_info_t mge_hid2nut[] =
{ "outlet.1.id", 0, 0, "UPS.OutletSystem.Outlet.[2].OutletID", NULL, "%.0f", HU_FLAG_STATIC, NULL },
{ "outlet.1.desc", ST_FLAG_RW | ST_FLAG_STRING, 20, "UPS.OutletSystem.Outlet.[2].OutletID", NULL, "PowerShare Outlet 1", HU_FLAG_ABSENT, NULL },
{ "outlet.1.switchable", 0, 0, "UPS.OutletSystem.Outlet.[2].PresentStatus.Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info },
/* FIXME: should better use UPS.OutletSystem.Outlet.[1].Status? */
/* Duplicate data for some units that use a different path,
* Only the first valid one will be used */
/* FIXME: should better use UPS.OutletSystem.Outlet.[1].Status? */
{ "outlet.1.status", 0, 0, "UPS.OutletSystem.Outlet.[2].PresentStatus.SwitchOn/Off", NULL, "%s", 0, on_off_info },
{ "outlet.1.status", 0, 0, "UPS.OutletSystem.Outlet.[1].Status", NULL, "%s", 0, eaton_outlet_protection_status_info },
{ "outlet.1.protect.status", 0, 0, "UPS.OutletSystem.Outlet.[1].Status", NULL, "%s", 0, eaton_outlet_protection_status_info },
{ "outlet.1.designator", 0, 0, "UPS.OutletSystem.Outlet.[1].iDesignator", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */
/* For low end models, with 1 non backup'ed outlet */
{ "outlet.1.status", 0, 0, "UPS.PowerSummary.PresentStatus.ACPresent", NULL, "%s", 0, on_off_info },
Expand All @@ -1536,7 +1534,8 @@ static hid_info_t mge_hid2nut[] =
{ "outlet.2.switchable", ST_FLAG_RW | ST_FLAG_STRING, 3, "UPS.OutletSystem.Outlet.[3].PresentStatus.Switchable", NULL, "%s", HU_FLAG_SEMI_STATIC, pegasus_yes_no_info },
/* Generic version (RO) for other models */
{ "outlet.2.switchable", 0, 0, "UPS.OutletSystem.Outlet.[3].PresentStatus.Switchable", NULL, "%s", 0, yes_no_info },
{ "outlet.2.status", 0, 0, "UPS.OutletSystem.Outlet.[1].Status", NULL, "%s", 0, on_off_info },
{ "outlet.2.status", 0, 0, "UPS.OutletSystem.Outlet.[3].PresentStatus.SwitchOn/Off", NULL, "%s", 0, on_off_info },
{ "outlet.2.protect.status", 0, 0, "UPS.OutletSystem.Outlet.[1].Status", NULL, "%s", 0, eaton_outlet_protection_status_info },
/* FIXME: should better use UPS.OutletSystem.Outlet.[1].Status? */
{ "outlet.2.autoswitch.charge.low", ST_FLAG_RW | ST_FLAG_STRING, 3, "UPS.OutletSystem.Outlet.[3].RemainingCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL },
{ "outlet.2.delay.shutdown", ST_FLAG_RW | ST_FLAG_STRING, 5, "UPS.OutletSystem.Outlet.[3].ShutdownTimer", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL },
Expand Down

0 comments on commit 6e63a97

Please sign in to comment.