fix: using better symbols for ups charging status
This commit is contained in:
parent
297d9cd3b9
commit
1318275b36
@ -12,12 +12,13 @@
|
|||||||
import logging
|
import logging
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
|
import RPi.GPIO as GPIO
|
||||||
|
|
||||||
|
import pwnagotchi
|
||||||
|
import pwnagotchi.plugins as plugins
|
||||||
|
import pwnagotchi.ui.fonts as fonts
|
||||||
from pwnagotchi.ui.components import LabeledValue
|
from pwnagotchi.ui.components import LabeledValue
|
||||||
from pwnagotchi.ui.view import BLACK
|
from pwnagotchi.ui.view import BLACK
|
||||||
import pwnagotchi.ui.fonts as fonts
|
|
||||||
import pwnagotchi.plugins as plugins
|
|
||||||
import pwnagotchi
|
|
||||||
import RPi.GPIO as GPIO
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: add enable switch in config.yml an cleanup all to the best place
|
# TODO: add enable switch in config.yml an cleanup all to the best place
|
||||||
@ -50,12 +51,9 @@ class UPS:
|
|||||||
try:
|
try:
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(4, GPIO.IN)
|
GPIO.setup(4, GPIO.IN)
|
||||||
if (GPIO.input(4) == GPIO.HIGH):
|
return '+' if GPIO.input(4) == GPIO.HIGH else '-'
|
||||||
return '⚡'
|
|
||||||
if (GPIO.input(4) == GPIO.LOW):
|
|
||||||
return '%'
|
|
||||||
except:
|
except:
|
||||||
return '%'
|
return '-'
|
||||||
|
|
||||||
|
|
||||||
class UPSLite(plugins.Plugin):
|
class UPSLite(plugins.Plugin):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user