Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move files to modules #17

Merged
merged 7 commits into from
Oct 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions domoticz.py → modules/domoticz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}

Expand Down
2 changes: 1 addition & 1 deletion helpers.py → modules/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'):
Expand Down
6 changes: 3 additions & 3 deletions reportstate.py → modules/reportstate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import config
import os
import io
import json
Expand All @@ -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."""
Expand Down Expand Up @@ -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
return r.status_code == requests.codes.ok
6 changes: 3 additions & 3 deletions trait.py → modules/trait.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {}
Expand Down
8 changes: 4 additions & 4 deletions smarthome.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Loading