asetek_pro: move firmware version to initialize output

This commit is contained in:
Jonas Malaco 2022-11-21 18:03:03 -03:00
parent 2ac70d41b8
commit c75503b938
3 changed files with 25 additions and 11 deletions

View File

@ -12,24 +12,35 @@ be confused with the Platinum or Pro XT families):
Windows](../README.md#windows-system-level-dependencies)).**
## Initialization
[Initialization]: #initialization
_Changed in git: the firmware version is now reported after
initialization._<br>
The coolers must be initialized sometime after the system boots. Only then it
will be possible to query the device status and perform other operations.
```
# liquidctl initialize
Corsair Hydro H100i Pro
└── Firmware version 2.10.0.0
```
When (re)initializing the device it is possible to select the pump mode:
```
# liquidctl initialize --pump-mode=performance
Corsair Hydro H100i Pro
└── Firmware version 2.10.0.0
```
Allowed pump modes are: `quiet`, `balanced` and `performance`.
## Device monitoring
_Changed in git: the firmware version is no longer reported (see
[Initialization])._<br>
Similarly to other AIOs, the cooler can report fan and pump speeds as well as
the liquid temperature.
@ -40,8 +51,7 @@ Corsair Hydro H100i Pro
├── Fan 1 speed 480 rpm
├── Fan 2 speed 476 rpm
├── Pump mode balanced
├── Pump speed 1890 rpm
└── Firmware version 2.10.0.0
└── Pump speed 1890 rpm
```
## Fan speed control

View File

@ -108,8 +108,16 @@ class HydroPro(_Base690Lc):
raise ValueError(f'unknown pump mode, should be one of: {_quoted(*_PUMP_MODES)}')
self._post([_CMD_WRITE_PUMP_MODE, _PUMP_MODES.index(pump_mode)], read_length=5)
msg = self._post([_CMD_READ_FIRMWARE], read_length=7)
firmware = '{}.{}.{}.{}'.format(*tuple(msg[3:7]))
self.device.release()
return [
('Firmware version', firmware, ''),
]
def get_status(self, **kwargs):
"""Get a status report.
@ -127,9 +135,6 @@ class HydroPro(_Base690Lc):
msg = self._post([_CMD_READ_PUMP_SPEED], read_length=5)
pump_speed = (msg[3] << 8) + msg[4]
msg = self._post([_CMD_READ_FIRMWARE], read_length=7)
firmware = '{}.{}.{}.{}'.format(*tuple(msg[3:7]))
self.device.release()
status = [('Liquid temperature', aio_temp, '°C')]
@ -140,7 +145,6 @@ class HydroPro(_Base690Lc):
return status + [
('Pump mode', pump_mode, ""),
('Pump speed', pump_speed, 'rpm'),
('Firmware version', firmware, '')
]
def _get_fan_speeds(self):

View File

@ -38,7 +38,7 @@ def test_initialize_with_pump_mode(emulate):
with cooler.connect():
cooler.initialize(pump_mode='balanced')
_begin, set_pump = usb_dev._sent_xfers
_begin, set_pump, _fw_version = usb_dev._sent_xfers
assert set_pump == ('write', 1, [0x32, 0x01])
@ -55,7 +55,7 @@ def test_set_profile_of_all_fans(emulate):
cooler.set_speed_profile(channel='fan', profile=[(0, 10), (25, 50), (40, 100)])
_begin, _pump, fan1, fan2 = usb_dev._sent_xfers
_begin, _pump, _fw_version, fan1, fan2 = usb_dev._sent_xfers
assert fan1 == ('write', 1, [0x40, 0x00, 0x00, 0x19, 0x28, 0x3c, 0x3c, 0x3c,
0x3c, 0x0a, 0x32, 0x64, 0x64, 0x64, 0x64, 0x64])
assert fan2 == ('write', 1, [0x40, 0x01, 0x00, 0x19, 0x28, 0x3c, 0x3c, 0x3c,
@ -70,7 +70,7 @@ def test_setting_speed_on_single_fan_2(emulate):
cooler.set_fixed_speed('fan2', 100)
_begin, _pump, fan2 = usb_dev._sent_xfers
_begin, _pump, _fw_version, fan2 = usb_dev._sent_xfers
assert fan2 == ('write', 1, [0x42, 0x01, 0x64])
@ -82,7 +82,7 @@ def test_set_pump_to_fixed_color(emulate):
cooler.set_color(channel='logo', mode='fixed', colors=iter([[0xff, 0x88, 0x44]]))
_begin, _pump, color_change, color_end = usb_dev._sent_xfers
_begin, _pump, _fw_version, color_change, color_end = usb_dev._sent_xfers
assert color_change == ('write', 1, [0x56, 0x02, 0xff, 0x88,
0x44, 0xff, 0x88, 0x44])
assert color_end == ('write', 1, [0x55, 0x01])
@ -97,7 +97,7 @@ def test_set_pump_to_blinking_mode(emulate):
cooler.set_color(channel='logo', mode='blinking', speed='normal',
colors=iter([[0xff, 0x88, 0x44], [0xff, 0xff, 0xff], [0x00, 0x00, 0x00]]))
_begin, _pump, color_change, color_mode, color_end = usb_dev._sent_xfers
_begin, _pump, _fw_version, color_change, color_mode, color_end = usb_dev._sent_xfers
assert color_change == ('write', 1, [0x56, 0x03, 0xff, 0x88, 0x44, 0xff,
0xff, 0xff, 0x00, 0x00, 0x00])
assert color_mode == ('write', 1, [0x53, 0x0A])