Show battery level of PiSugar when PiSugar support is enabled
This commit is contained in:
@@ -345,8 +345,12 @@ class Inkycal:
|
|||||||
logger.info("All images generated successfully!")
|
logger.info("All images generated successfully!")
|
||||||
del errors
|
del errors
|
||||||
|
|
||||||
if self.battery_capacity < 20:
|
if self.use_pi_sugar:
|
||||||
self.info += "Low battery! "
|
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
|
# Assemble image from each module - add info section if specified
|
||||||
self._assemble()
|
self._assemble()
|
||||||
|
|||||||
Reference in New Issue
Block a user