We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 77c4f32 commit 3d69ea5Copy full SHA for 3d69ea5
weconnect/elements/charging_profiles.py
@@ -244,8 +244,15 @@ def __init__(
244
def update(self, fromDict):
245
LOG.debug('Update nextChargingTimer from dict')
246
247
- if 'id' in fromDict and fromDict['id'] < len(self.parent.profiles):
248
- self.timer = self.parent.profiles[fromDict['id']]
+ if 'id' in fromDict and fromDict['id'] is not None:
+ foundTimer = False
249
+ for profile in self.parent.profiles.values():
250
+ if fromDict['id'] in profile.timers:
251
+ self.timer = profile.timers[fromDict['id']]
252
+ foundTimer = True
253
+ break
254
+ if not foundTimer and self.timer is not None:
255
+ self.timer = None
256
257
self.targetSOCreachable.fromDict(fromDict, 'targetSOCreachable')
258
0 commit comments