Skip to content

Commit

Permalink
TimeToGo (#424)
Browse files Browse the repository at this point in the history
* Update dbushelper.py

added LowSoc in dbus TimeToGo items
TimeToGo is published to /TimeToGo/
  • Loading branch information
corneel27 authored Jan 20, 2023
1 parent ffdd8ec commit 6471152
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ def setup_vedbus(self):
# Create TimeToSoC items
for num in TIME_TO_SOC_POINTS:
self._dbusservice.add_path("/TimeToSoC/" + str(num), None, writeable=True)
#Create TimeToGO item
self._dbusservice.add_path("/TimeToGo", None, writeable=True)

logger.info(f"publish config values = {PUBLISH_CONFIG_VALUES}")
if PUBLISH_CONFIG_VALUES == 1:
Expand Down Expand Up @@ -484,6 +486,13 @@ def publish_dbus(self):
if self.battery.current
else None
)

# Update TimeToGo
self._dbusservice["/TimeToGo"] = (
self.battery.get_timetosoc(SOC_LOW_WARNING, crntPrctPerSec)
if self.battery.current
else None
)

else:
self.battery.time_to_soc_update -= 1
Expand Down

0 comments on commit 6471152

Please sign in to comment.