Skip to content

Commit

Permalink
fix: send missing app install messages on install / uninstall (#208) (#…
Browse files Browse the repository at this point in the history
…209)

fix: send missing app install messages on install / uninstall
Co-authored-by: Christoph Stenglein <[email protected]>
  • Loading branch information
rootzoll and cstenglein authored May 20, 2023
1 parent cabdc70 commit 93a62ad
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/apps/impl/raspiblitz.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ async def run_bonus_script(self, app_id: str, params: str):
"id": app_id,
"mode": mode,
"result": "fail",
"details": "install script did not ran thru",
"details": "install script threw an error",
},
)
# nothing above consider success
Expand Down Expand Up @@ -304,6 +304,9 @@ async def run_bonus_script(self, app_id: str, params: str):
"details": stdoutData["result"],
},
)
await broadcast_sse_msg(
SSE.INSTALLED_APP_STATUS, [updatedAppData]
)
else:
logging.error(f"FAIL - {app_id} was not installed")
logging.debug(f"updatedAppData: {updatedAppData}")
Expand All @@ -317,8 +320,15 @@ async def run_bonus_script(self, app_id: str, params: str):
"details": "install was not effective",
},
)
await broadcast_sse_msg(
SSE.INSTALLED_APP_STATUS, [updatedAppData]
)

elif mode == "off":
await broadcast_sse_msg(
SSE.INSTALL_APP,
{"id": app_id, "mode": mode, "result": "win"},
)
await broadcast_sse_msg(SSE.INSTALLED_APP_STATUS, [updatedAppData])

if not updatedAppData["installed"]:
Expand Down

0 comments on commit 93a62ad

Please sign in to comment.