Remove redundant cli methods, add 'reboot' command hack

This commit is contained in:
Oleg Kalachev 2025-07-22 13:52:11 +03:00
parent 764e5159d0
commit 10ab7862a0

View File

@ -294,6 +294,8 @@ class Flix:
def cli(self, cmd: str, wait_response: bool = True) -> str:
cmd = cmd.strip()
if cmd == 'reboot':
wait_response = False # reboot command doesn't respond
cmd_bytes = (cmd + '\n').encode('utf-8')
if len(cmd_bytes) > 70:
raise ValueError(f'Command is too long: {len(cmd_bytes)} > 70')
@ -310,9 +312,3 @@ class Flix:
except TimeoutError:
continue
raise RuntimeError(f'Failed to send command {cmd} after 3 attempts')
def reboot(self):
self.cli('reboot', wait_response=False)
def reset(self):
self.cli('reset')