fix ChargingTime

This commit is contained in:
vikt0rm
2022-04-14 10:42:22 +02:00
parent dedbda2c84
commit e35a180420

View File

@@ -51,7 +51,6 @@ class DbusGoeChargerService:
self._dbusservice.add_path('/FirmwareVersion', int(data['fwv'].replace('.', ''))) self._dbusservice.add_path('/FirmwareVersion', int(data['fwv'].replace('.', '')))
self._dbusservice.add_path('/HardwareVersion', 2) self._dbusservice.add_path('/HardwareVersion', 2)
self._dbusservice.add_path('/Serial', data['sse']) self._dbusservice.add_path('/Serial', data['sse'])
self._dbusservice.add_path('/ChargingTime', 0) # not availabel on go-eCharger
self._dbusservice.add_path('/Connected', 1) self._dbusservice.add_path('/Connected', 1)
self._dbusservice.add_path('/UpdateIndex', 0) self._dbusservice.add_path('/UpdateIndex', 0)
@@ -252,11 +251,12 @@ def main():
DBusGMainLoop(set_as_default=True) DBusGMainLoop(set_as_default=True)
#formatting #formatting
_kwh = lambda p, v: (str(round(v, 2)) + 'KWh') _kwh = lambda p, v: (str(round(v, 2)) + 'kWh')
_a = lambda p, v: (str(round(v, 1)) + 'A') _a = lambda p, v: (str(round(v, 1)) + 'A')
_w = lambda p, v: (str(round(v, 1)) + 'W') _w = lambda p, v: (str(round(v, 1)) + 'W')
_v = lambda p, v: (str(round(v, 1)) + 'V') _v = lambda p, v: (str(round(v, 1)) + 'V')
_degC = lambda p, v: (str(v) + '°C') _degC = lambda p, v: (str(v) + '°C')
_s = lambda p, v: (str(v) + 's')
#start our main-service #start our main-service
pvac_output = DbusGoeChargerService( pvac_output = DbusGoeChargerService(
@@ -267,6 +267,7 @@ def main():
'/Ac/L2/Power': {'initial': 0, 'textformat': _w}, '/Ac/L2/Power': {'initial': 0, 'textformat': _w},
'/Ac/L3/Power': {'initial': 0, 'textformat': _w}, '/Ac/L3/Power': {'initial': 0, 'textformat': _w},
'/Ac/Energy/Forward': {'initial': 0, 'textformat': _kwh}, '/Ac/Energy/Forward': {'initial': 0, 'textformat': _kwh},
'/ChargingTime': {'initial': 0, 'textformat': _s},
'/Ac/Voltage': {'initial': 0, 'textformat': _v}, '/Ac/Voltage': {'initial': 0, 'textformat': _v},
'/Current': {'initial': 0, 'textformat': _a}, '/Current': {'initial': 0, 'textformat': _a},