Define outlets with fixed numbers

This commit is contained in:
Anton 2023-09-04 22:36:23 +03:00
parent 3d010be219
commit 7d7a827eb5

View File

@ -35,7 +35,7 @@
#define RPI_HID_VERSION "RPi HID 0.1" #define RPI_HID_VERSION "RPi HID 0.1"
/* RPi */ /* RPi */
#define RPI_VENDORID 0x051D #define RPI_VENDORID 0x6969
/* USB IDs device table */ /* USB IDs device table */
static usb_device_id_t rpi_usb_device_table[] = { static usb_device_id_t rpi_usb_device_table[] = {
@ -170,10 +170,22 @@ static hid_info_t rpi_hid2nut[] = {
{ "beeper.disable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL }, { "beeper.disable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "1", HU_TYPE_CMD, NULL },
{ "beeper.mute", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "3", HU_TYPE_CMD, NULL }, { "beeper.mute", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "3", HU_TYPE_CMD, NULL },
{ "outlet.%i.switchable", 0, 0, "UPS.OutletSystem.Outlet.[%i].Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info }, { "outlet.1.switchable", 0, 0, "UPS.OutletSystem.Outlet.[1].Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info },
{ "outlet.%i.load.on", 0, 0, "UPS.OutletSystem.Outlet.[%i].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, { "outlet.1.load.on", 0, 0, "UPS.OutletSystem.Outlet.[1].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
{ "outlet.%i.load.off", 0, 0, "UPS.OutletSystem.Outlet.[%i].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL }, { "outlet.1.load.off", 0, 0, "UPS.OutletSystem.Outlet.[1].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.%i.load.cycle", 0, 0, "UPS.OutletSystem.Outlet.[%i].DelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL }, { "outlet.1.load.cycle", 0, 0, "UPS.OutletSystem.Outlet.[1].DelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL },
{ "outlet.2.switchable", 0, 0, "UPS.OutletSystem.Outlet.[2].Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info },
{ "outlet.2.load.on", 0, 0, "UPS.OutletSystem.Outlet.[2].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
{ "outlet.2.load.off", 0, 0, "UPS.OutletSystem.Outlet.[2].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.2.load.cycle", 0, 0, "UPS.OutletSystem.Outlet.[2].DelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL },
{ "outlet.3.switchable", 0, 0, "UPS.OutletSystem.Outlet.[3].Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info },
{ "outlet.3.load.on", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
{ "outlet.3.load.off", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.3.load.cycle", 0, 0, "UPS.OutletSystem.Outlet.[3].DelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL },
{ "outlet.4.switchable", 0, 0, "UPS.OutletSystem.Outlet.[4].Switchable", NULL, "%s", HU_FLAG_STATIC, yes_no_info },
{ "outlet.4.load.on", 0, 0, "UPS.OutletSystem.Outlet.[4].DelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL },
{ "outlet.4.load.off", 0, 0, "UPS.OutletSystem.Outlet.[4].DelayBeforeShutdown", NULL, DEFAULT_OFFDELAY, HU_TYPE_CMD, NULL },
{ "outlet.4.load.cycle", 0, 0, "UPS.OutletSystem.Outlet.[4].DelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL },
/* end of structure. */ /* end of structure. */
{ NULL, 0, 0, NULL, NULL, NULL, 0, NULL } { NULL, 0, 0, NULL, NULL, NULL, 0, NULL }