Skip to content

Commit d7c16a0

Browse files
committed
Fix UI not working with LAN mode disabled
1 parent 4f2e8a9 commit d7c16a0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

files/4-rinkhals/opt/rinkhals/ui/rinkhals-ui.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ def decode(self, s: str):
3939
BUILTIN_APP_PATH = f'{RINKHALS_ROOT}/home/rinkhals/apps'
4040
USER_APP_PATH = f'{RINKHALS_HOME}/apps'
4141

42+
REMOTE_MODE = 'cloud'
43+
if os.path.isfile('/useremain/dev/remote_ctrl_mode'):
44+
with open('/useremain/dev/remote_ctrl_mode', 'r') as f:
45+
REMOTE_MODE = f.read().strip()
46+
4247

4348
def log(message):
4449
print(datetime.now().strftime('%Y-%m-%d %H:%M:%S') + ' [rinkhals-ui] ' + message, flush = True)
@@ -149,7 +154,7 @@ def main():
149154
log(f'Home: {RINKHALS_HOME}')
150155

151156
# Subscribe to print event to exit in case of print
152-
if not SIMULATOR:
157+
if not SIMULATOR and REMOTE_MODE == 'lan':
153158
subscribe_mqtt()
154159

155160
# Monitor K3SysUi process to exit if it dies

0 commit comments

Comments
 (0)