Skip to content

Commit

Permalink
Fix UI not working with LAN mode disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jbatonnet committed Jan 24, 2025
1 parent 4f2e8a9 commit d7c16a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion files/4-rinkhals/opt/rinkhals/ui/rinkhals-ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ def decode(self, s: str):
BUILTIN_APP_PATH = f'{RINKHALS_ROOT}/home/rinkhals/apps'
USER_APP_PATH = f'{RINKHALS_HOME}/apps'

REMOTE_MODE = 'cloud'
if os.path.isfile('/useremain/dev/remote_ctrl_mode'):
with open('/useremain/dev/remote_ctrl_mode', 'r') as f:
REMOTE_MODE = f.read().strip()


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

# Subscribe to print event to exit in case of print
if not SIMULATOR:
if not SIMULATOR and REMOTE_MODE == 'lan':
subscribe_mqtt()

# Monitor K3SysUi process to exit if it dies
Expand Down

0 comments on commit d7c16a0

Please sign in to comment.