diff --git a/tcc-exporter b/tcc-exporter index ced5218..26e4d4c 100755 --- a/tcc-exporter +++ b/tcc-exporter @@ -5,6 +5,7 @@ import inspect import json import os import re +import signal import socket import time import urllib.parse @@ -15,7 +16,7 @@ from http.cookiejar import LWPCookieJar from http.server import HTTPServer, BaseHTTPRequestHandler from urllib.error import HTTPError -VERSION = '0.9.0' +VERSION = '0.9.1' CONFIG_FILE = 'persistent/config.yml' PREFIX = 'https://mytotalconnectcomfort.com/' @@ -219,6 +220,10 @@ def log(level, *message): print("[{0}] {1}".format(LOGLEVELS[level], " ".join(message))) +def hup_handler(signum, frame): + load_config() + + def load_config(): global config if not 'config' in globals(): @@ -284,5 +289,6 @@ if __name__ == '__main__': load_config() log('INFO', 'tcc-exporter/{0}'.format(VERSION)) socket.setdefaulttimeout(int(config['tcc.timeout'])) + signal.signal(signal.SIGHUP, hup_handler) main()