Skip to content

Commit 21b752a

Browse files
bulk:
- support for h100i platinum - support for h115i platinum - support for h100i platinum se - support for hx750i - support for hx850i - support for rm850i - support for rm1000i - input manager for keyboard media keys - fixups for elite, platinum and XT aio for default hardware color and packet discard
1 parent 818618b commit 21b752a

30 files changed

+573
-109
lines changed

README.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ Open source Linux interface for iCUE LINK Hub and other Corsair AIOs, Hubs.
2525
| iCUE H100i RGB PRO XT | `1b1c` | `0c20` | |
2626
| iCUE H115i RGB PRO XT | `1b1c` | `0c21` | |
2727
| iCUE H150i RGB PRO XT | `1b1c` | `0c22` | |
28+
| H115i RGB PLATINUM | `1b1c` | `0c17` | |
29+
| H100i RGB PLATINUM | `1b1c` | `0c18` | |
30+
| H100i RGB PLATINUM SE | `1b1c` | `0c19` | |
2831
| Lighting Node CORE | `1b1c` | `0c1a` | <details><summary>Show</summary>HD RGB Series Fan<br />LL RGB Series Fan<br />ML PRO RGB Series Fan<br />QL RGB Series Fan<br />8-LED Series Fan<br />SP RGB Series Fan</details> |
2932
| Lighting Node PRO | `1b1c` | `0c0b` | <details><summary>Show</summary>2x External RGB Hub<br />HD RGB Series Fan<br />LL RGB Series Fan<br />ML PRO RGB Series Fan<br />QL RGB Series Fan<br />8-LED Series Fan<br />SP RGB Series Fan</details> |
3033
| Commander PRO | `1b1c` | `0c10` | <details><summary>Show</summary>2x External RGB Hub<br />4x Temperature Probe<br />Any PWM Fan</details> |
@@ -51,9 +54,13 @@ Open source Linux interface for iCUE LINK Hub and other Corsair AIOs, Hubs.
5154
| ST100 RGB | `1b1c` | `0a34` | RGB |
5255
| MM700 RGB | `1b1c` | `1b9b` | RGB |
5356
| LT100 Smart Lighting Tower | `1b1c` | `0c23` | RGB |
54-
| HX1000i | `1b1c` | `1c1e` | Fan Control |
55-
| HX1200i | `1b1c` | `1c23` | Fan Control |
57+
| HX1000i | `1b1c` | `1c07`<br />`1c1e` | Fan Control |
58+
| HX1200i | `1b1c` | `1c08`<br />`1c23` | Fan Control |
5659
| HX1500i | `1b1c` | `1c1f` | Fan Control |
60+
| HX750i | `1b1c` | `1c05` | Fan Control |
61+
| HX850i | `1b1c` | `1c06` | Fan Control |
62+
| RM850i | `1b1c` | `1c0c` | Fan Control |
63+
| RM1000i | `1b1c` | `1c0d` | Fan Control |
5764

5865
## Installation (automatic)
5966
1. Download either .deb or .rpm package from the latest Release, depends on your Linux distribution

go.mod

+1
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ require (
2121
github.com/prometheus/common v0.55.0 // indirect
2222
github.com/prometheus/procfs v0.15.1 // indirect
2323
golang.org/x/sys v0.22.0 // indirect
24+
golang.org/x/text v0.17.0 // indirect
2425
google.golang.org/protobuf v1.34.2 // indirect
2526
)

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ golang.org/x/image v0.19.0/go.mod h1:y0zrRqlQRWQ5PXaYCOMLTW2fpsxZ8Qh9I/ohnInJEys
4242
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
4343
golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI=
4444
golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
45+
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
46+
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
4547
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
4648
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
4749
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

src/controller/controller.go

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"OpenLinkHub/src/dashboard"
66
"OpenLinkHub/src/devices"
77
"OpenLinkHub/src/devices/lcd"
8+
"OpenLinkHub/src/inputmanager"
89
"OpenLinkHub/src/keyboards"
910
"OpenLinkHub/src/logger"
1011
"OpenLinkHub/src/metrics"
@@ -29,6 +30,7 @@ func Start() {
2930
lcd.Init() // LCD
3031
temperatures.Init() // Temperatures
3132
keyboards.Init() // Keyboards
33+
inputmanager.Init() // Input Manager
3234
devices.Init() // Devices
3335
server.Init() // REST & WebUI
3436
}

src/devices/devices.go

+42-11
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,21 @@ type Device struct {
7878
Instance interface{}
7979
}
8080

81+
type Product struct {
82+
ProductId uint16
83+
Path string
84+
}
85+
8186
var (
8287
expectedPermission = 0666
8388
vendorId uint16 = 6940 // Corsair
8489
interfaceId = 0
8590
devices = make(map[string]*Device, 0)
86-
products = make(map[string]uint16)
87-
keyboards = []uint16{7127, 7165, 7166, 7110, 7083, 7132, 11024, 11015}
91+
products = make(map[string]Product, 0)
92+
keyboards = []uint16{7127, 7165, 7166, 7110, 7083, 11024, 11015}
8893
mouses = []uint16{7059, 7005}
8994
pads = []uint16{7067}
95+
dongles = []uint16{7132}
9096
)
9197

9298
// Stop will stop all active devices
@@ -124,7 +130,7 @@ func GetDeviceTemplate(device interface{}) string {
124130
return ""
125131
}
126132

127-
// UpdateMiscColor will process POST request from a client for misc color change
133+
// UpdateMiscColor will process a POST request from a client for misc color change
128134
func UpdateMiscColor(deviceId string, keyId, keyOptions int, color rgb.Color) uint8 {
129135
if device, ok := devices[deviceId]; ok {
130136
methodName := "UpdateDeviceColor"
@@ -848,14 +854,27 @@ func Init() {
848854
interfaceId = 1 // Mouse
849855
} else if slices.Contains(pads, info.ProductID) {
850856
interfaceId = 1 // Mousepad
857+
} else if slices.Contains(dongles, info.ProductID) {
858+
interfaceId = 1 // USB Dongle
851859
} else {
852860
interfaceId = 0
853861
}
854862
if info.InterfaceNbr == interfaceId {
855863
if interfaceId == 1 {
856-
products[info.Path] = info.ProductID
864+
products[info.Path] = Product{
865+
ProductId: info.ProductID,
866+
Path: info.Path,
867+
}
857868
} else {
858-
products[info.SerialNbr] = info.ProductID
869+
serial := info.SerialNbr
870+
if len(serial) == 0 {
871+
// Devices with no serial, make serial based of productId
872+
serial = strconv.Itoa(int(info.ProductID))
873+
}
874+
products[serial] = Product{
875+
ProductId: info.ProductID,
876+
Path: info.Path,
877+
}
859878
}
860879
}
861880
return nil
@@ -871,21 +890,24 @@ func Init() {
871890
sm, err := smbus.GetSmBus()
872891
if err == nil {
873892
if len(sm.Path) > 0 {
874-
products[sm.Path] = 0
893+
products[sm.Path] = Product{
894+
ProductId: 0,
895+
Path: "",
896+
}
875897
}
876898
} else {
877899
logger.Log(logger.Fields{"error": err}).Warn("No valid I2C devices found")
878900
}
879901
}
880902

881903
// USB-HID
882-
for key, productId := range products {
904+
for key, product := range products {
905+
productId := product.ProductId
883906
if slices.Contains(config.GetConfig().Exclude, productId) {
884907
logger.Log(logger.Fields{"productId": productId}).Warn("Product excluded via config.json")
885908
continue
886909
}
887-
888-
switch productId {
910+
switch product.ProductId {
889911
case 3135: // CORSAIR iCUE Link System Hub
890912
{
891913
go func(vendorId, productId uint16, serialId string) {
@@ -940,7 +962,7 @@ func Init() {
940962
devices[dev.Serial].GetDevice = GetDevice(dev.Serial)
941963
}(vendorId, productId, key)
942964
}
943-
case 3104, 3105, 3106, 3125, 3126, 3127, 3136, 3137:
965+
case 3125, 3126, 3127, 3136, 3137, 3104, 3105, 3106, 3095, 3096, 3097:
944966
// iCUE H100i ELITE RGB
945967
// iCUE H115i ELITE RGB
946968
// iCUE H150i ELITE RGB
@@ -949,6 +971,9 @@ func Init() {
949971
// iCUE H100i RGB PRO XT
950972
// iCUE H115i RGB PRO XT
951973
// iCUE H150i RGB PRO XT
974+
// H115i RGB PLATINUM
975+
// H100i RGB PLATINUM
976+
// H100i RGB PLATINUM SE
952977
{
953978
go func(vendorId, productId uint16) {
954979
dev := elite.Init(vendorId, productId)
@@ -1223,10 +1248,16 @@ func Init() {
12231248
}
12241249
}(vendorId, productId, key)
12251250
}
1226-
case 7198, 7203, 7199:
1251+
case 7198, 7203, 7199, 7173, 7174, 7175, 7176, 7181, 7180:
12271252
// Corsair HX1000i Power Supply
12281253
// Corsair HX1200i Power Supply
12291254
// Corsair HX1500i Power Supply
1255+
// Corsair HX750i Power Supply
1256+
// Corsair HX850i Power Supply
1257+
// Corsair HX1000i Power Supply
1258+
// Corsair HX1200i Power Supply
1259+
// Corsair RM1000i Power Supply
1260+
// Corsair RM850i Power Supply
12301261
{
12311262
go func(vendorId, productId uint16, key string) {
12321263
dev := psuhid.Init(vendorId, productId, key)

0 commit comments

Comments
 (0)