Fix pisugar2.py to check for "new model" and correctly display charging voice.

This commit is contained in:
Jeroen Oudshoorn
2024-12-15 00:22:14 +01:00
parent b016766e87
commit 55ba9e0ee8

View File

@ -74,7 +74,7 @@ class PiSugar(plugins.Plugin):
logging.info("BATT GET VALUE IS : " + str(capacity)) logging.info("BATT GET VALUE IS : " + str(capacity))
# new model use battery_power_plugged & battery_allow_charging to detect real charging status # new model use battery_power_plugged & battery_allow_charging to detect real charging status
if self.is_new_model: if self.is_new_model:
if self.ps.get_battery_power_plugged().value and self.ps.get_battery_allow_charging().value: if self.ps.get_battery_power_plugged() and self.ps.get_battery_allow_charging():
ui.set("chg", "CHG") ui.set("chg", "CHG")
ui.update(force=True, new_data={"status": "Power!! I can feel it!"}) ui.update(force=True, new_data={"status": "Power!! I can feel it!"})
else: else: