mirror of
https://github.com/cheveguerra/TotalConnect.git
synced 2026-08-18 16:36:40 +00:00
Add APP_VERSION 06.07.26 with mouseover tooltip on logo
This commit is contained in:
@@ -177,6 +177,7 @@ CACHE_FILE = os.path.join(BASE_DIR, 'locations_cache.json')
|
||||
LAST_STATE_FILE = os.path.join(BASE_DIR, 'last_state.json')
|
||||
LAST_EVENT_IDS_FILE = os.path.join(BASE_DIR, 'last_event_ids.json')
|
||||
LOG_FILE = os.path.join(BASE_DIR, 'activity.log')
|
||||
APP_VERSION = "06.07.26"
|
||||
polling_trigger_event = threading.Event()
|
||||
soap_disabled_accounts = set()
|
||||
soap_session_ids = {} # dict: username -> GUID SessionId para SOAP GetLiveEvents
|
||||
@@ -1165,7 +1166,7 @@ def generate_html_report(data):
|
||||
<div class="container">
|
||||
<header>
|
||||
<div>
|
||||
<h1>TotalConnect 2.0</h1>
|
||||
<h1 title="v{APP_VERSION}" style="cursor: help;">TotalConnect 2.0</h1>
|
||||
<div class="header-subtitle">Monitoreo centralizado de alarmas</div>
|
||||
</div>
|
||||
<div style="display: flex; align-items: center; gap: 12px; flex-wrap: wrap;">
|
||||
@@ -2142,14 +2143,38 @@ def run_update(accounts=None, exclude=None, full_refresh=False):
|
||||
status_val = status_val.value
|
||||
|
||||
is_disarmed = (status_val == 10200 or str(status_val).upper() == "DISARMED")
|
||||
is_triggered = len(prev.get('triggered_partitions', [])) > 0
|
||||
|
||||
# Alarma real activa en zonas o particiones
|
||||
is_triggered = (
|
||||
len(prev.get('triggered_partitions', [])) > 0 or
|
||||
any(z.get('status') == 'Alarma' for z in prev.get('active_zones', []))
|
||||
)
|
||||
has_faults = len(prev.get('active_zones', [])) > 0
|
||||
|
||||
if is_disarmed or is_triggered or has_faults:
|
||||
group_b_pool.append((loc_id, location))
|
||||
# Peso de severidad:
|
||||
# 0 = Alarma Activa (Prioridad Absoluta)
|
||||
# 1 = Zonas con fallas/abiertas (Prioridad Media)
|
||||
# 2 = Desarmado simple (Prioridad Baja)
|
||||
severity_weight = 2
|
||||
if is_triggered:
|
||||
severity_weight = 0
|
||||
elif has_faults:
|
||||
severity_weight = 1
|
||||
|
||||
group_b_pool.append((loc_id, location, severity_weight))
|
||||
|
||||
group_b_pool.sort(key=get_download_epoch)
|
||||
group_b = group_b_pool[:7]
|
||||
# Ordenar por severidad de fallo/alarma primero, y en caso de empate por antigüedad
|
||||
def sort_group_b(item):
|
||||
loc_tuple = item
|
||||
loc_id_str = str(loc_tuple[0])
|
||||
prev = last_loc_map.get(loc_id_str, {})
|
||||
dl_epoch = prev.get('last_download_epoch', 0)
|
||||
severity = loc_tuple[2]
|
||||
return (severity, dl_epoch)
|
||||
|
||||
group_b_pool.sort(key=sort_group_b)
|
||||
group_b = [(x[0], x[1]) for x in group_b_pool[:7]]
|
||||
group_b_ids = {x[0] for x in group_b}
|
||||
|
||||
# 5. Construir Grupo C (Triggers de SOAP pendientes)
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# -*- mode: python ; coding: utf-8 -*-
|
||||
|
||||
|
||||
a = Analysis(
|
||||
['index.py'],
|
||||
pathex=[],
|
||||
binaries=[],
|
||||
datas=[],
|
||||
hiddenimports=[],
|
||||
hookspath=[],
|
||||
hooksconfig={},
|
||||
runtime_hooks=[],
|
||||
excludes=[],
|
||||
noarchive=False,
|
||||
optimize=0,
|
||||
)
|
||||
pyz = PYZ(a.pure)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
a.binaries,
|
||||
a.datas,
|
||||
[],
|
||||
name='totalconnect',
|
||||
debug=False,
|
||||
bootloader_ignore_signals=False,
|
||||
strip=False,
|
||||
upx=True,
|
||||
upx_exclude=[],
|
||||
runtime_tmpdir=None,
|
||||
console=True,
|
||||
disable_windowed_traceback=False,
|
||||
argv_emulation=False,
|
||||
target_arch=None,
|
||||
codesign_identity=None,
|
||||
entitlements_file=None,
|
||||
)
|
||||
Reference in New Issue
Block a user