forked from networkupstools/nut
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sbhid-ups: fix Eaton/MGE mapping for beeper handling
Two HID Paths exists for handling beeper status and commands. However, only one historic was implement, which was not actually suitable for issuing the commands on newer units (such as 3S, 5P*, ...) (reported by Sergey Talchuk) Closes: networkupstools#9
- Loading branch information
Showing
1 changed file
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* | ||
* Copyright (C) | ||
* 2003 - 2015 Arnaud Quette <[email protected]> | ||
* 2015 Arnaud Quette <[email protected]> | ||
* 2015 - 2016 Eaton / Arnaud Quette <[email protected]> | ||
* | ||
* Sponsored by MGE UPS SYSTEMS <http://www.mgeups.com> | ||
* | ||
|
@@ -37,7 +37,7 @@ | |
#include "usbhid-ups.h" | ||
#include "mge-hid.h" | ||
|
||
#define MGE_HID_VERSION "MGE HID 1.41" | ||
#define MGE_HID_VERSION "MGE HID 1.42" | ||
|
||
/* (prev. MGE Office Protection Systems, prev. MGE UPS SYSTEMS) */ | ||
/* Eaton */ | ||
|
@@ -1142,6 +1142,9 @@ static hid_info_t mge_hid2nut[] = | |
{ "ups.timer.reboot", 0, 0, "UPS.PowerSummary.DelayBeforeReboot", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL}, | ||
{ "ups.test.result", 0, 0, "UPS.BatterySystem.Battery.Test", NULL, "%s", 0, test_read_info }, | ||
{ "ups.test.interval", ST_FLAG_RW | ST_FLAG_STRING, 8, "UPS.BatterySystem.Battery.TestPeriod", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, | ||
/* Duplicate data for some units (such as 3S) that use a different path | ||
* Only the first valid one will be used */ | ||
{ "ups.beeper.status", 0 ,0, "UPS.BatterySystem.Battery.AudibleAlarmControl", NULL, "%s", HU_FLAG_SEMI_STATIC, beeper_info }, | ||
{ "ups.beeper.status", 0 ,0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "%s", HU_FLAG_SEMI_STATIC, beeper_info }, | ||
{ "ups.temperature", 0, 0, "UPS.PowerSummary.Temperature", NULL, "%s", 0, kelvin_celsius_conversion }, | ||
{ "ups.power", 0, 0, "UPS.PowerConverter.Output.ApparentPower", NULL, "%.0f", 0, NULL }, | ||
|
@@ -1338,8 +1341,13 @@ static hid_info_t mge_hid2nut[] = | |
{ "shutdown.reboot", 0, 0, "UPS.PowerSummary.DelayBeforeReboot", NULL, "10", HU_TYPE_CMD, NULL}, | ||
{ "beeper.off", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL }, | ||
{ "beeper.on", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "2", HU_TYPE_CMD, NULL }, | ||
/* Duplicate commands for some units (such as 3S) that use a different path | ||
* Only the first valid one will be used */ | ||
{ "beeper.mute", 0, 0, "UPS.BatterySystem.Battery.AudibleAlarmControl", NULL, "3", HU_TYPE_CMD, NULL }, | ||
{ "beeper.mute", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "3", HU_TYPE_CMD, NULL }, | ||
{ "beeper.disable", 0, 0, "UPS.BatterySystem.Battery.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL }, | ||
{ "beeper.disable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL }, | ||
{ "beeper.enable", 0, 0, "UPS.BatterySystem.Battery.AudibleAlarmControl", NULL, "2", HU_TYPE_CMD, NULL }, | ||
{ "beeper.enable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "2", HU_TYPE_CMD, NULL }, | ||
|
||
/* Command for the outlet collection */ | ||
|