Skip to content

Commit

Permalink
Add z3_reload command
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Jul 27, 2023
1 parent 2f6956f commit 69805e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions custom_components/xiaomi_gateway3/core/gateway/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ async def telnet_send(self, command: str):
await sh.exec("killall openmiio_agent")
await asyncio.sleep(1)
await self.openmiio_prepare_gateway(sh)
elif command == "z3_reload":
await sh.exec("killall Lumi_Z3GatewayHost_MQTT")
else:
await sh.exec(command)
return True
Expand Down
3 changes: 2 additions & 1 deletion custom_components/xiaomi_gateway3/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def __init__(self, gateway: "XGateway", device: XDevice, conv: Converter):
CMD_REBOOT,
CMD_FTP,
CMD_OPENMIIO_RELOAD,
"z3_reload",
]
else:
self._attr_options = [
Expand Down Expand Up @@ -117,7 +118,7 @@ async def async_select_option(self, option: str) -> None:
elif option == CMD_FWLOCK:
lock = await self.gw.gw3_read_lock()
self.device.update({"command": option, "lock": lock})
elif option in (CMD_FTP, CMD_REBOOT, CMD_OPENMIIO_RELOAD):
elif option in (CMD_FTP, CMD_REBOOT, CMD_OPENMIIO_RELOAD, "z3_reload"):
ok = await self.gw.telnet_send(option)
self.device.update({"command": "ok", "value": ok})
elif option == CMD_PARENTSCAN:
Expand Down
3 changes: 2 additions & 1 deletion custom_components/xiaomi_gateway3/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@
"reboot": "Gateway reboot",
"ftp": "Gateway run FTP",
"flashzb": "Zigbee flash EZSP",
"openmiio_reload": "OpenmiIO reload"
"openmiio_reload": "OpenmiIO reload",
"z3_reload": "Z3 reload"
}
},
"data": {
Expand Down

0 comments on commit 69805e8

Please sign in to comment.