8000 Aquacomputer driver enhancements by aleksamagicka · Pull Request #489 · liquidctl/liquidctl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Aquacomputer driver enhancements #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 4, 2022

Conversation

aleksamagicka
Copy link
Member
@aleksamagicka aleksamagicka commented Aug 4, 2022

For aquacomputer.py, make serial number property private and read that and firmware version only when they are requested, but not already cached.

Related: #482


Checklist:

  • Adhere to the development process
  • Conform to the style guide
  • Verify that the changes work as expected on real hardware
  • Add automated tests cases
  • Verify that all (other) automated tests (still) pass
  • Update the README and other applicable documentation pages
  • Update the liquidctl.8 Linux/Unix/Mac OS man page
  • Update or add applicable docs/*guide.md device guides
  • Submit relevant data, scripts or dissectors to https://github.com/liquidctl/collected-device-data

New CLI flag?

  • Adjust the completion scripts in extra/completions/

New device?

  • Regenerate extra/linux/71-liquidctl.rules (instructions in the file header)
  • Add entry to the README's supported device list with applicable notes (at least en)

New driver?

  • Document the protocol in docs/developer/protocol/

@aleksamagicka aleksamagicka changed the title Aquacomputer driver enhacements Aquacomputer driver enhancements Aug 4, 2022
@aleksamagicka
Copy link
Member Author

As far as I can see I didn't change anything that would upset the keyval test...

@jonasmalacofilho
Copy link
Member
jonasmalacofilho commented Aug 4, 2022

As far as I can see I didn't change anything that would upset the keyval test...

I think we just experienced a corruption of the Python interpreter.

The assertion failure, if I read it correctly, was caused by in that specific run a method call

assert store.load(...) == 2

somehow becoming a method reference, turning the assertion in memory to something like

assert store.load == 2

which obviously is false.


Anyway, I restarted the job and then it completed fine.

@@ -93,7 +93,7 @@ def initialize(self, **kwargs):
"""

fw = self.firmware_version
serial_number = self.serial_number
serial_number = self._serial_number
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be self._serial? And how isn't this tripping the tests?


Also, needing two reads in the normal path (which is to call initialize first) isn't ideal, even if the interval between reports is fairly short.

I think it would be better if the properties used a shared _read_device_statics (or something like it) method to parses both fields from a single _read.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self._serial is where the serial number gets stored from within the self._serial_number property (currently), it would be empty on its own.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah, of course!

@jonasmalacofilho
Copy link
Member

Thanks!

@jonasmalacofilho jonasmalacofilho merged commit e911e4d into liquidctl:main Aug 4, 2022
@aleksamagicka aleksamagicka deleted the aqc-fixes branch August 5, 2022 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0