improve performance & debug

This commit is contained in:
Florian Bezannier
2021-04-30 10:26:55 +02:00
parent 86cb20f9e6
commit 5f75d3fb30
16 changed files with 117 additions and 121 deletions
+3 -4
View File
@@ -1,6 +1,5 @@
import json
import threading
import traceback
from copy import copy
from datetime import datetime, timedelta
from hashlib import md5
@@ -91,10 +90,10 @@ class ChargeControl:
if self._next_stop_hour is not None and self._next_stop_hour < now:
self._next_stop_hour += timedelta(days=1)
self.retry_count = 0
except AttributeError:
logger.error("Probably can't retrieve all information from API: %s", traceback.format_exc())
except (AttributeError, ValueError):
logger.exception("Probably can't retrieve all information from API:")
except: # pylint: disable=bare-except
logger.error(traceback.format_exc())
logger.exception("Charge control:")
def get_dict(self):
chd = copy(self.__dict__)