Skip to content
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

Restart loops the device when plugged into usb0 #4

Open
alistar79 opened this issue Jan 9, 2023 · 1 comment
Open

Restart loops the device when plugged into usb0 #4

alistar79 opened this issue Jan 9, 2023 · 1 comment

Comments

@alistar79
Copy link

When plugged into usb0 pisugar2 is switched off and device restarts. Anyway to get it to check if usb0 is active before restarting?

@alistar79
Copy link
Author

Not sure how to poke the state of usb0 in python but have a dodgy hack as I don't think the device will hit 0 power and still shutdown gracefully so I have hacked line 90 as so

    if capacity <= self.options['shutdown']:

to

    if capacity <= self.options['shutdown'] and capacity > 0:

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

No branches or pull requests

1 participant