gilesknap / maaspower

Provide MAAS power control via webhooks for various remote control power switches.
Apache License 2.0
18 stars 13 forks source link

Provide Example Output of uhubctl commands #12

Closed MCDELTAT closed 2 months ago

MCDELTAT commented 1 year ago

I was wondering if you would be able to provide the example output of a command like uhubctl -p 3 seen here: https://gilesknap.github.io/maaspower/main/how-to/mega4.html

It'd be particularly helpful to see the output for both power states (on/off), if different.

I have a few Raspberry Pis on an HP 2530 Network switch with PoE. I've got some bash that is turning them on and off the PoE ports much like the uhubctl commands in the example. Then I realized that I presumably also need to code in a query function, which should be easy enough if I can better understand how the regex stuff is working.

I'd be happy to expand your documentation and provide a write-up on my stuff once I'm done. Thanks.

MCDELTAT commented 1 year ago

Never mind, should have been able to figure it out from my how trivial the regex is and the code for the utility itself. For anyone reading, the code for the utility can be found here: https://github.com/mvp/uhubctl/blob/v2.4.0/uhubctl.c#L633

So if the port/device is in the on state uhubctl -p 3 will return "power" and if it's in an off state, it will return "off'.

gilesknap commented 1 year ago

@MCDELTAT did you get your device working with maaspower?

It would be nice to keep a list of compatible devices - I guess I could open up the Wiki for that purpose.

gilesknap commented 2 months ago

closing as resolved