From 35aaeca43e49f1ae80629623708e6cef133f7087 Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:18:46 +0200 Subject: [PATCH 1/7] move config.py to modules/config.py --- config.py => modules/config.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename config.py => modules/config.py (100%) diff --git a/config.py b/modules/config.py similarity index 100% rename from config.py rename to modules/config.py From cf30908f281ed1d30e2db940d1ee57737ea95a5b Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:20:02 +0200 Subject: [PATCH 2/7] Update and move domoticz.py to modules/domoticz.py --- domoticz.py => modules/domoticz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename domoticz.py => modules/domoticz.py (99%) diff --git a/domoticz.py b/modules/domoticz.py similarity index 99% rename from domoticz.py rename to modules/domoticz.py index 083b9ad..6e3009a 100644 --- a/domoticz.py +++ b/modules/domoticz.py @@ -5,9 +5,9 @@ import json import os import re -import config +import modules.config as config -from helpers import logger, get_settings +from modules.helpers import logger, get_settings aogDevs = {} From fa65ffb4ece7786f375ea515c3a28f2271329ca0 Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:21:28 +0200 Subject: [PATCH 3/7] Update and move helpers.py to modules/helpers.py --- helpers.py => modules/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename helpers.py => modules/helpers.py (96%) diff --git a/helpers.py b/modules/helpers.py similarity index 96% rename from helpers.py rename to modules/helpers.py index 0fe770b..2990652 100644 --- a/helpers.py +++ b/modules/helpers.py @@ -8,7 +8,7 @@ import random import string -import config +import modules.config as config # Enable log in config.py if need # # if hasattr(config, 'LOG_FILE'): From 3d779759d2b5d8030d6aa489c127a997fa437325 Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:23:00 +0200 Subject: [PATCH 4/7] Update and move reportstate.py to modules/reportstate.py --- reportstate.py => modules/reportstate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename reportstate.py => modules/reportstate.py (98%) diff --git a/reportstate.py b/modules/reportstate.py similarity index 98% rename from reportstate.py rename to modules/reportstate.py index 404bdf5..c661c25 100644 --- a/reportstate.py +++ b/modules/reportstate.py @@ -1,4 +1,4 @@ -import config + import os import io import json @@ -108,4 +108,4 @@ def call_homegraph_api(self, rt, payload): r.raise_for_status() logger.debug("Device state reported %s" % (json.dumps(payload, indent=2, sort_keys=True))) - return r.status_code == requests.codes.ok \ No newline at end of file + return r.status_code == requests.codes.ok From 5cadc462aa29cd92d209bf3b0a680ff920d62b9b Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:24:00 +0200 Subject: [PATCH 5/7] Update and move trait.py to modules/trait.py --- trait.py => modules/trait.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename trait.py => modules/trait.py (98%) diff --git a/trait.py b/modules/trait.py similarity index 98% rename from trait.py rename to modules/trait.py index 00007e9..340675f 100644 --- a/trait.py +++ b/modules/trait.py @@ -2,9 +2,9 @@ import hashlib import base64 import json -import config -from helpers import get_settings, _tempConvert -from domoticz import getDomoticzState, queryDomoticz +import modules.config as config +from modules.helpers import get_settings, _tempConvert +from modules.domoticz import getDomoticzState, queryDomoticz attempts = 1 blocked = {} From 8698c84655f8e68503b6de8f196a0cc3d5366a09 Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:25:24 +0200 Subject: [PATCH 6/7] Update smarthome.py --- smarthome.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/smarthome.py b/smarthome.py index 644f7c1..5e48f14 100644 --- a/smarthome.py +++ b/smarthome.py @@ -1,20 +1,20 @@ # -*- coding: utf-8 -*- import flask_login -import config import importlib import urllib import os import sys import json import hashlib +import modules.config as config from time import time, sleep from werkzeug.utils import secure_filename from werkzeug.middleware.proxy_fix import ProxyFix -from domoticz import getDomoticzDevices, queryDomoticz, saveJson -from helpers import logger, get_settings, save_settings, remove_user, check_token, get_token, random_string, get_device, get_devices, generateToken, generateCsrfToken, csrfProtect -from reportstate import ReportState +from modules.domoticz import getDomoticzDevices, queryDomoticz, saveJson +from modules.helpers import logger, get_settings, save_settings, remove_user, check_token, get_token, random_string, get_device, get_devices, generateToken, generateCsrfToken, csrfProtect +from modules.reportstate import ReportState from flask import Flask, redirect, request, url_for, render_template, send_from_directory, jsonify, session, flash, Response from secrets import compare_digest From 043e74d4f48074a28ea94050814e7020b660f1b5 Mon Sep 17 00:00:00 2001 From: DewGew Date: Sun, 15 Oct 2023 18:30:18 +0200 Subject: [PATCH 7/7] Update reportstate.py --- modules/reportstate.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/reportstate.py b/modules/reportstate.py index c661c25..66518fb 100644 --- a/modules/reportstate.py +++ b/modules/reportstate.py @@ -1,4 +1,3 @@ - import os import io import json @@ -7,8 +6,9 @@ import requests import google.auth.crypt import google.auth.jwt +import module.config as config -from helpers import logger, get_settings +from modules.helpers import logger, get_settings class ReportState: """Google Report State implementation."""