merged
This commit is contained in:
@@ -165,7 +165,12 @@ class Inkycal:
|
||||
self.pisugar = PiSugar()
|
||||
|
||||
self.battery_capacity = self.pisugar.get_battery()
|
||||
logger.info(f"PiSugar battery capacity: {self.battery_capacity}%")
|
||||
|
||||
if not self.battery_capacity:
|
||||
logger.warning("[PISUGAR] Could not get battery capacity! Is the board off? Setting battery capacity to 0%")
|
||||
self.battery_capacity = 100
|
||||
else:
|
||||
logger.info(f"PiSugar battery capacity: {self.battery_capacity}%")
|
||||
|
||||
if self.battery_capacity < 20:
|
||||
logger.warning("Battery capacity is below 20%!")
|
||||
@@ -342,8 +347,12 @@ class Inkycal:
|
||||
logger.info("All images generated successfully!")
|
||||
del errors
|
||||
|
||||
if self.battery_capacity < 20:
|
||||
self.info += "Low battery! "
|
||||
if self.use_pi_sugar:
|
||||
self.battery_capacity = self.pisugar.get_battery() or 0
|
||||
if self.battery_capacity < 20:
|
||||
self.info += f"Low battery! ({self.battery_capacity})% "
|
||||
else:
|
||||
self.info += f"Battery: {self.battery_capacity}% "
|
||||
|
||||
# Assemble image from each module - add info section if specified
|
||||
self._assemble()
|
||||
|
||||
Reference in New Issue
Block a user