WeConnect-python icon indicating copy to clipboard operation
WeConnect-python copied to clipboard

startTime date conversion error Domoticz NL

Open Andreotti100 opened this issue 1 year ago • 0 comments

I use this API to get my battery status and range from my VW ID.3.

The time set fails when I call this from Domoticz with NL region settings. So, I had to disable some code to get it working:

def update(self, fromDict):  # noqa: C901
    LOG.debug('Update recurring timer from dict')

    # this fails in my Domoticz plugin:
    # --------------------------------->
    # if 'startTime' in fromDict:
    #     self.startTime.setValueWithCarTime(datetime.strptime(f'{fromDict["startTime"]}+00:00', '%H:%M%z'),
    #                                        lastUpdateFromCar=None, fromServer=True)
    # else:
    #     self.startTime.enabled = False
    # 
    # if 'targetTime' in fromDict:
    #     self.targetTime.setValueWithCarTime(datetime.strptime(f'{fromDict["targetTime"]}+00:00', '%H:%M%z'),
    #                                         lastUpdateFromCar=None, fromServer=True)
    # else:
    #     self.targetTime.enabled = False
    # <---
    # No need for time in Domoticz:
    self.startTime.enabled = False

Andreotti100 avatar Nov 22 '24 22:11 Andreotti100