Skip to content

Commit

Permalink
Merge pull request #2042 from rleidner/soc_ovms_p4
Browse files Browse the repository at this point in the history
soc_ovms: fix missing confDict issue on 1st connect
  • Loading branch information
benderl authored Dec 12, 2024
2 parents 1927094 + 2e78295 commit 896d9ad
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/modules/vehicles/ovms/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,17 @@ async def _fetch_soc(self,
self.vehicle = vehicle
self.ovms_appl_value = OVMS_APPL_VALUE + str(self.vehicle)
self.config = deepcopy(conf)
self.confDict = self.config.__dict__
self.confDict["configuration"] = self.config.configuration.__dict__
log.debug("self.confDict2=" + dumps(self.confDict, indent=4))

tokenstr = self.config.configuration.token
if 'token' in self.confDict['configuration']:
tokenstr = self.confDict['configuration']['token']
log.debug("read tokenstr (" + str(tokenstr) + ") from configuration")
else:
tokenstr = ""
log.debug("init tokenstr to (" + str(tokenstr) + ")")
log.debug("tokenstr=" + str(tokenstr))

if tokenstr is None or tokenstr == "":
self.token = self.create_token()
Expand All @@ -152,9 +161,6 @@ async def _fetch_soc(self,
else:
log.debug("_fetch_soc using token=" + self.token)

self.confDict = self.config.__dict__
self.confDict["configuration"] = self.config.configuration.__dict__

self.cleanup_token()

status_code, statusDict = self.get_status()
Expand Down

0 comments on commit 896d9ad

Please sign in to comment.