Skip to content

Commit c0883ac

Browse files
committed
Show minute-based hotspot info only when hotspot is active
1 parent 9736265 commit c0883ac

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/lib_cron_ip.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,13 @@ def display_wifi_qr(self, FrameTime=None, force=False):
102102

103103
FrameTime = self.__conf_DISP_FRAME_TIME_IP * 2 if FrameTime is None else FrameTime
104104

105-
if not os.path.isfile(self.__const_WIFI_QR_FILE_PATH):
106-
lib_comitup.comitup().create_wifi_link_qr_image()
105+
cu = lib_comitup.comitup()
106+
if cu.hotspot_active() or force:
107+
if not os.path.isfile(self.__const_WIFI_QR_FILE_PATH):
108+
cu.create_wifi_link_qr_image()
107109

108-
if os.path.isfile(self.__const_WIFI_QR_FILE_PATH):
109-
self.__display.message([f'set:time={FrameTime},temp,hidden=WIFI_QR', f":IMAGE={self.__const_WIFI_QR_FILE_PATH}"], logging=False)
110+
if os.path.isfile(self.__const_WIFI_QR_FILE_PATH):
111+
self.__display.message([f'set:time={FrameTime},temp,hidden=WIFI_QR', f":IMAGE={self.__const_WIFI_QR_FILE_PATH}"], logging=False)
110112

111113
def mail_ip(self):
112114
IP_sent_Markerfile = self.__setup.get_val('const_IP_SENT_MARKERFILE')

0 commit comments

Comments
 (0)