kantlivelong / OctoPrint-UPS

Integrates a UPS monitored by NUT into OctoPrint
GNU Affero General Public License v3.0
17 stars 7 forks source link

Move from nut2 to PyNUTClient #17

Open thurask opened 3 months ago

thurask commented 3 months ago

What does this PR do and why is it necessary?

Move from old nut2 Python lib to more recent, still supported and first party PyNUTClient Python lib.

How was it tested? How can it be tested by the reviewer?

I don't get any errors in Octoprint's log on my setup (Raspberry Pi OS Bookworm + OctoPrint 1.10.1 + CyberPower UPS over USB) although I do only have the one UPS handy to test with; that said, this PR should cover what the old library did 1:1.

What are the relevant tickets if any?

16

kantlivelong commented 3 months ago

Thanks for the PR!

Going to test this as is but could you change importing the module as nut2 to just import PyNut and use that?

from PyNUTClient import PyNut

thurask commented 3 months ago

Done 👍