Skip to content

Commit

Permalink
Stop socat in Mi Home mode
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Oct 31, 2020
1 parent a453683 commit 352586d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions custom_components/xiaomi_gateway3/core/gateway3.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,12 @@ def _prepeare_gateway(self, with_devices: bool = False):
self.debug("Stop Lumi Zigbee")
shell.stop_lumi_zigbee()

elif "Lumi_Z3GatewayHost_MQTT" not in ps:
shell.run_lumi_zigbee()
else:
if "socat" in ps:
shell.stop_socat()

if "Lumi_Z3GatewayHost_MQTT" not in ps:
shell.run_lumi_zigbee()
# elif "Lumi_Z3GatewayHost_MQTT -n 1 -b 115200 -v" not in ps:
# self.debug("Run public Zigbee console")
# shell.run_public_zb_console()
Expand Down
3 changes: 3 additions & 0 deletions custom_components/xiaomi_gateway3/core/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def check_or_download_socat(self):
def run_socat(self):
self.exec(f"{CHECK_SOCAT} && {RUN_SOCAT}")

def stop_socat(self):
self.exec(f"killall socat")

def run_lumi_zigbee(self):
self.exec("daemon_app.sh &")

Expand Down

0 comments on commit 352586d

Please sign in to comment.