Hallo zusammen,
ich check's gerad' ned:
Ich habe folgende Stelle im Code:
und folgenden Fehler:
Da high_vent_since None ist dürfte diese Stelle im Code eigentlich nicht erreicht werden.
Hat jemand ne Idee ?
ich check's gerad' ned:
Ich habe folgende Stelle im Code:
Code:
292: if high_vent_since is not None and high_vent_since != '':
293: logger.info('high vent status since: ' + str(high_vent_since) + '(floor: ' + str(floor['floor']) + ')')
294: delta = now - datetime.datetime.strptime(high_vent_since, "%d.%m.%Y %H:%M:%S")
295: delta_in_minutes = delta.seconds / 60
Code:
2017-03-06 19:21:42 INFO ventilation_automation high vent status since: None(floor: basement)
2017-03-06 19:21:42 ERROR ventilation_automation time data 'None' does not match format '%d.%m.%Y %H:%M:%S'
Traceback (most recent call last):
File "/mfs/core/lib/config.py", line 263, in __call__
exec(self.bytecode, self.locals)
File "/data/callidomus/local/logics/ventilation_automation.py", line 294, in <module>
delta = now - datetime.datetime.strptime(high_vent_since, "%d.%m.%Y %H:%M:%S")
File "/usr/local/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
tt, fraction = _strptime(data_string, format)
File "/usr/local/lib/python3.6/_strptime.py", line 362, in _strptime
(data_string, format))
ValueError: time data 'None' does not match format '%d.%m.%Y %H:%M:%S'
Hat jemand ne Idee ?


Kommentar