From 5c98b7876636b7811d5fc4ccbc162ed1d2429d46 Mon Sep 17 00:00:00 2001 From: jziolkowski Date: Sun, 15 Sep 2024 01:39:43 +0200 Subject: [PATCH] fix crash on menu buttons without device selected, fixes #235 --- tdmgr/GUI/devices.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tdmgr/GUI/devices.py b/tdmgr/GUI/devices.py index 3c2dba5..60d0038 100644 --- a/tdmgr/GUI/devices.py +++ b/tdmgr/GUI/devices.py @@ -1,5 +1,6 @@ import os from json import dumps +from typing import Optional from PyQt5.QtCore import QDir, QSortFilterProxyModel, Qt, QUrl, pyqtSignal from PyQt5.QtGui import QColor, QIcon @@ -62,7 +63,7 @@ def __init__(self, parent, *args, **kwargs): self.mqtt = parent.mqtt self.env = parent.env - self.device: TasmotaDevice + self.device: Optional[TasmotaDevice] = None self.idx = None self.nam = QNetworkAccessManager()