Skip to content

Commit

Permalink
Remove time.sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
niceboy committed Feb 10, 2022
1 parent 67ed859 commit 8dfcadb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions custom_components/aqara_gateway/core/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -770,15 +770,13 @@ def prepare_aqaragateway(shell, model):
shell.run_command(command)
command = "mkdir -p /data/scripts"
shell.write(command.encode() + b"\n")
time.sleep(1)
command = "echo -e '#!/bin/sh\r\n\r\nfw_manager.sh -r\r\n" \
"fw_manager.sh -t -k' > /data/scripts/post_init.sh"
shell.run_command(command)
command = "chmod a+x /data/scripts/post_init.sh"
shell.run_command(command)
command = "mkdir -p /data/bin"
shell.write(command.encode() + b"\n")
time.sleep(1)
if model in SIGMASTAR_MODELS:
shell.check_bin('mosquitto', MD5_MOSQUITTO_NEW_ARMV7L , 'bin/armv7l/mosquitto_new')
command = "chattr +i /data/scripts"
Expand Down
1 change: 0 additions & 1 deletion custom_components/aqara_gateway/core/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ def run_basis_cli(self, command: str, as_bytes=False) -> Union[str, bytes]:
def file_exist(self, filename: str) -> bool:
""" check file exit """
raw = self.run_command("ls -al {}".format(filename))
time.sleep(.1)
if "No such" not in str(raw):
return True
return False
Expand Down

0 comments on commit 8dfcadb

Please sign in to comment.