Compare commits

...

9 Commits

Author SHA1 Message Date
0377b396c9 Merge pull request #267 from renewedbullet/patch-2
Update pisugarx.py
2024-12-22 02:17:51 +01:00
3fc319b650 auto-update fix
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
2024-12-22 02:01:08 +01:00
f34471e044 pisugarx 0 decimals for capacity
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
2024-12-22 01:54:20 +01:00
LH
de7e9b1c6d Update pisugarx.py
limits % to  no deci dunno how i missed this lol

Signed-off-by: LH <140523069+renewedbullet@users.noreply.github.com>
2024-12-21 19:47:35 -05:00
868314e244 Version 2.9.3-2 has some fixes coming.
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
2024-12-22 01:08:08 +01:00
7a8cc36a38 Set interface-name in the bt-tether config.
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
2024-12-22 01:07:46 +01:00
a3dce7fcbd Merge remote-tracking branch 'origin/noai' into noai 2024-12-22 00:59:27 +01:00
0472faa2bf Show only 2 decimals for capacity in %.
Signed-off-by: Jeroen Oudshoorn <oudshoorn.jeroen@gmail.com>
2024-12-22 00:59:19 +01:00
ae2eb77c7b Update backup.sh 2024-12-21 15:57:10 +01:00
5 changed files with 21 additions and 11 deletions

View File

@ -1 +1 @@
__version__ = '2.9.3'
__version__ = '2.9.3-2'

View File

@ -58,7 +58,7 @@ def check(version, repo, native=True):
def make_path_for(name):
path = os.path.join("/opt/", name)
path = os.path.join("/home/pi/", name)
if os.path.exists(path):
logging.debug("[update] deleting %s" % path)
shutil.rmtree(path, ignore_errors=True, onerror=None)
@ -138,10 +138,20 @@ def install(display, update):
if not os.path.exists(source_path):
source_path = "%s-%s" % (source_path, update['available'])
# setup.py is going to install data files for us
# first we create a new virtual environment and activate it
os.system("cd /home/pi && source .pwn/bin/activate")
os.system("cd %s && pip3 install ." % source_path)
try:
# Activate the virtual environment and install the package
subprocess.run(
["bash", "-c", f"source /home/pi/.pwn/bin/activate && pip install {source_path}"],
check=True
)
# Clean up the source directory
shutil.rmtree(source_path, ignore_errors=True)
except subprocess.CalledProcessError as e:
logging.error(f"Installation failed: {e}")
except Exception as e:
logging.error(f"Unexpected error: {e}")
return True

View File

@ -30,6 +30,7 @@ class BTTether(plugins.Plugin):
file = f'''
[connection]
id=bluetooth
interface-name=bnep0
type=bluetooth
autoconnect=yes
[bluetooth]

View File

@ -264,7 +264,7 @@ class PiSugar(plugins.Plugin):
if self.drot == 0: # show battery voltage
ui.set('bat', f"{voltage:.2f}V")
elif self.drot == 1: # show battery capacity
ui.set('bat', f"{capacity}%")
ui.set('bat', f"{capacity:.0f}%")
else: # show battery temperature
ui.set('bat', f"{temp}°C")
else:
@ -272,7 +272,7 @@ class PiSugar(plugins.Plugin):
if self.default_display == 'voltage':
ui.set('bat', f"{voltage:.2f}V")
elif self.default_display in ['percentage', 'percent']:
ui.set('bat', f"{capacity}%")
ui.set('bat', f"{capacity:.0f}%")
elif self.default_display == 'temp':
ui.set('bat', f"{temp}°C")

View File

@ -32,8 +32,7 @@ OUTPUT=${OUTPUT:-${UNIT_HOSTNAME}-backup-$(date +%s).tgz}
# username to use for ssh
UNIT_USERNAME=${UNIT_USERNAME:-pi}
# what to backup
FILES_TO_BACKUP="
/boot/firmware/cmdline.txt \
FILES_TO_BACKUP="/boot/firmware/cmdline.txt \
/boot/firmware/config.txt \
/root/settings.yaml \
/root/client_secrets.json \