EATON HID: add missing usages and paths - ECO Mode#2637
EATON HID: add missing usages and paths - ECO Mode#2637jimklimov merged 99 commits intonetworkupstools:masterfrom
Conversation
Signed-off-by: Arnaud Quette <[email protected]>
Signed-off-by: Arnaud Quette <[email protected]>
Signed-off-by: DaRK AnGeL <[email protected]>
drivers/mge-hid.c
Outdated
| /* { "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion },*/ | ||
|
|
||
| { "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
| { "device.usb.mode", ST_FLAG_STRING, 20, "UPS.System.USB.Mode", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ |
There was a problem hiding this comment.
I don't think this one is useful, and not a string (1 to set in bootloader )
drivers/mge-hid.c
Outdated
|
|
||
| { "device.usb.version", ST_FLAG_STRING, 20, "UPS.System.USB.iVersion", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
| { "device.usb.mode", ST_FLAG_STRING, 20, "UPS.System.USB.Mode", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ | ||
| { "device.gateway.power.rate", ST_FLAG_STRING, 20, "UPS.System.Gateway.PowerRate", NULL, NULL, HU_FLAG_STATIC, stringid_conversion }, /* FIXME */ |
There was a problem hiding this comment.
ditto above, don't think it's useful, and not a string (level of power provided by the UPS to the network card
drivers/mge-hid.c
Outdated
| { "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.PresentStatus.Used", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_enabled_legacy_info }, */ | ||
| /* This data is the actual ABM status information */ | ||
| { "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.Mode", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_status_info }, | ||
| { "battery.charger.status", 0, 0, "UPS.BatterySystem.Charger.Status", NULL, "%.0f", HU_FLAG_QUICK_POLL, eaton_abm_status_info }, |
There was a problem hiding this comment.
to be tested, may be avail on some units, not others. May need both Mode and Status
Unified charger info,bitmap with :
Status on bit 0-3:
0x0: Off
0x1: Charging
0x2: Floating
0x3: On, not charging
0x4: Discharging
0x5-0xF : Reserved
Mode on bit 4-6:
0: CC
1: ABM
2-7 : Reserved
Error on bit 7:
0: Good
1: In error
There was a problem hiding this comment.
Also ABM table commented needs to be changes?
drivers/mge-hid.c
Outdated
| { "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 }, | ||
| { "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, on_off_info }, |
There was a problem hiding this comment.
ditto, may need both.... this one provides more than just on/off
Global status of the load segment :
0 : Not powered
1 : Not protected
2 : Protected
There was a problem hiding this comment.
so to leave { "outlet.2.status", 0, 0, "UPS.OutletSystem.Outlet.[3].PresentStatus.SwitchOn/Off", NULL, "%s", 0, on_off_info }, ?
There was a problem hiding this comment.
0,1,2 thius mean = NULL, "%.2f", 0, NULL }, or NULL, "%.0f", HU_FLAG_STATIC, NULL },
There was a problem hiding this comment.
means a lookup function, something like:
static info_lkp_t eaton_enable_disable_info[] = {
{ 0, "not powered", NULL, NULL },
{ 1, "not protected", NULL, NULL },
{ 2, "protected", NULL, NULL },
{ 0, NULL, NULL, NULL }
};
drivers/mge-hid.c
Outdated
| { "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, on_off_info }, | ||
| /* FIXME: should better use UPS.OutletSystem.Outlet.[1].Status? */ | ||
| { "outlet.1.idesignator", 0, 0, "UPS.OutletSystem.Outlet.[1].iDesignator", NULL, "%s", 0, on_off_info }, /* needs to check */ |
There was a problem hiding this comment.
stringid_conversion (thats an iValue, so indexed string), not on_off ;)
drivers/mge-hid.c
Outdated
| /* 0: The outlet is not ECO controlled. / 1 : The outlet is ECO controlled. => Readonly! use some yes_no_info | ||
| { "outlet.1.ecocontrol", 0, 0, "UPS.OutletSystem.Outlet.[2].ECOControl", NULL, "%.2f", 0, NULL },*/ | ||
| /* 0: The outlet is not ECO controlled. / 1 : The outlet is ECO controlled. => Readonly! use some yes_no_info */ | ||
| { "outlet.1.ecocontrol", 0, 0, "UPS.OutletSystem.Outlet.[2].ECOControl", NULL, "%.2f", 0, NULL }, |
There was a problem hiding this comment.
nut suitable name to be found!
need a lookup function, like on_off, but for:
0 : The outlet is not ECO controlled.
1 : The outlet is ECO controlled.
Signed-off-by: DaRK AnGeL <[email protected]>
|
Ref: #2495 2nding @jimklimov comment to base of master, and include my base PR in yours |
masterwishx
left a comment
There was a problem hiding this comment.
to be tested, may be avail on some units, not others. May need both Mode and Status
Unified charger info,bitmap with :
Status on bit 0-3:
0x0: Off
0x1: Charging
0x2: Floating
0x3: On, not charging
0x4: Discharging
0x5-0xF : Reserved
Mode on bit 4-6:
0: CC
1: ABM
2-7 : Reserved
Error on bit 7:
0: Good
1: In error
So this is not right table? and needs to change as you wrote above?
- Charger ABM mode | Charging | Floating | Resting | Discharging | Disabled | Disabled
- UPS.BatterySystem.Charger.Mode | 1 | 3 | 4 | 2 | 6 | 6
Signed-off-by: DaRK AnGeL <[email protected]>
Signed-off-by: DaRK AnGeL <[email protected]>
Signed-off-by: DaRK AnGeL <[email protected]>
|
Found that "Editing" a PR now allows to change the target branch, so this instance is now the main one of the flock. |
|
@arnaudquette-eaton @jimklimov I made some changes from comments, please check when you have time |
| @@ -689,6 +689,12 @@ static info_lkp_t pegasus_yes_no_info[] = { | |||
| { 0, NULL, NULL, NULL } | |||
| }; | |||
|
|
|||
There was a problem hiding this comment.
Added function like yes_no
drivers/mge-hid.c
Outdated
| { 0, NULL, NULL, NULL } | ||
| }; | ||
|
|
||
| static info_lkp_t eaton_outlet_status_enable_disable_info[] = { |
There was a problem hiding this comment.
Added func for outlet_status
|
✅ Build nut 2.8.2.2340-master completed (commit 6afacfd52a by @masterwishx) |
|
✅ Build nut 2.8.2.2349-master completed (commit cbece0107f by @jimklimov) |
…andard as around [networkupstools#2637] Signed-off-by: Jim Klimov <[email protected]>
|
This PR is not as contended as the follow-up in #2660 with deeper changes into existing driver logic, so it was a good idea to separate the two :) I intend to merge this one as soon as CI is satisfied with the recent revision. |
Signed-off-by: Jim Klimov <[email protected]>
…ls#2637 (revised in later PR) Signed-off-by: Jim Klimov <[email protected]>
…upstools#2637] Signed-off-by: Jim Klimov <[email protected]>
Confirm #2637 for ECO/bypass mode , #2660 added statuses for ABM , @jimklimov sorry again that not made a separate pr for ABM |
Adding HE/ECO mode, Bypass On/Off for Eaton USB UPS Online Models + Adding Missing usages and paths
Continue work for #2636
Fixes #2485
Ref #2495
Added: