Skip to content

Commit

Permalink
hwmon: remove _input suffix from pwmN attributes (#446)
Browse files Browse the repository at this point in the history
  • Loading branch information
codifryed authored and jonasmalacofilho committed Apr 5, 2022
1 parent 3271625 commit b8bbb97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions liquidctl/driver/kraken3.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def _get_status_from_hwmon(self):
return [
(_STATUS_TEMPERATURE, self._hwmon.get_int('temp1_input') * 1e-3, '°C'),
(_STATUS_PUMP_SPEED, self._hwmon.get_int('fan1_input'), 'rpm'),
(_STATUS_PUMP_DUTY, self._hwmon.get_int('pwm1_input') * 100. / 255, '%'),
(_STATUS_PUMP_DUTY, self._hwmon.get_int('pwm1') * 100. / 255, '%'),
]

def get_status(self, direct_access=False, **kwargs):
Expand All @@ -254,11 +254,11 @@ def get_status(self, direct_access=False, **kwargs):
Returns a list of `(property, value, unit)` tuples.
"""

# no driver currently supports pwm1_input, so silently fallback to
# no driver currently supports pwm1, so silently fallback to
# direct mode if it isn't available; for the same reason, also don't
# yet issue a warning when directly accessing the device

if self._hwmon and not direct_access and self._hwmon.has_attribute('pwm1_input'):
if self._hwmon and not direct_access and self._hwmon.has_attribute('pwm1'):
_LOGGER.info('bound to %s kernel driver, reading status from hwmon', self._hwmon.module)
return self._get_status_from_hwmon()

Expand Down
2 changes: 1 addition & 1 deletion liquidctl/driver/smart_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ def _get_status_from_hwmon(self):

for n in range(1, len(self._speed_channels) + 1):
ret.append((f'Fan {n} speed', self._hwmon.get_int(f'fan{n}_input'), 'rpm')),
ret.append((f'Fan {n} duty', self._hwmon.get_int(f'pwm{n}_input') * 100. / 255, '%')),
ret.append((f'Fan {n} duty', self._hwmon.get_int(f'pwm{n}') * 100. / 255, '%')),
ret.append((f'Fan {n} control mode', modes[self._hwmon.get_int(f'pwm{n}_mode')], '')),

# noise level is not available through hwmon, but also not very accurate or useful
Expand Down

0 comments on commit b8bbb97

Please sign in to comment.