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

Check for new version #66

Merged
merged 10 commits into from
Dec 8, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Check version
DewGew authored Dec 8, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 362bd5779397e6f978cac4069161daa47973374d
14 changes: 10 additions & 4 deletions modules/routes.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
from modules.reportstate import ReportState
from modules.database import db, User, Settings
from modules.domoticz import saveJson, getDomoticzDevices
from modules.helpers import logger, get_devices, generateToken, remove_user
from modules.helpers import logger, get_devices, generateToken, remove_user, getVersion
from sqlalchemy import or_

report_state = ReportState()
@@ -21,6 +21,7 @@ def dashboard():

reportstate = report_state.report_state_enabled()
devices = get_devices(current_user.username)
version = getVersion()

if devices is None:
getDomoticzDevices(current_user.username)
@@ -30,7 +31,8 @@ def dashboard():
user=User.query.filter_by(username=current_user.username).first(),
reportstate=reportstate,
devices=devices,
_csrf_token=session['_csrf_token']
_csrf_token=session['_csrf_token'],
version = version
)


@@ -41,6 +43,7 @@ def devices():
dbsettings = Settings.query.get_or_404(1)
devices = get_devices(current_user.username)
dbuser = User.query.filter_by(username=current_user.username).first()
version = getVersion()

if request.method == "POST":

@@ -164,7 +167,8 @@ def devices():
dbsettings=dbsettings,
reportstate=reportstate,
devices=devices,
_csrf_token=session['_csrf_token']
_csrf_token=session['_csrf_token'],
version = version
)


@@ -283,14 +287,16 @@ def settings():
dbusers = User.query.all()
reportstate = report_state.report_state_enabled()
devices = get_devices(current_user.username)
version = getVersion()

return render_template('settings.html',
user=User.query.filter_by(username=current_user.username).first(),
dbsettings=dbsettings,
dbusers=dbusers,
reportstate=reportstate,
devices=devices,
_csrf_token=session['_csrf_token']
_csrf_token=session['_csrf_token'],
version = version
)