custom_components/bahmcloud_store/views.py aktualisiert
This commit is contained in:
@@ -273,14 +273,12 @@ class BCSApiView(HomeAssistantView):
|
|||||||
if action == "refresh":
|
if action == "refresh":
|
||||||
_LOGGER.info("BCS manual refresh triggered via API")
|
_LOGGER.info("BCS manual refresh triggered via API")
|
||||||
try:
|
try:
|
||||||
await self.core.refresh()
|
# Centralized service (same path as timer), includes logging and signal_updated
|
||||||
self.core.signal_updated()
|
await self.core.full_refresh(source="manual")
|
||||||
return web.json_response({"ok": True})
|
return web.json_response({"ok": True})
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
_LOGGER.error("BCS manual refresh failed: %s", e)
|
_LOGGER.error("BCS manual refresh failed: %s", e)
|
||||||
return web.json_response(
|
return web.json_response({"ok": False, "message": "Refresh failed"}, status=500)
|
||||||
{"ok": False, "message": "Refresh failed"}, status=500
|
|
||||||
)
|
|
||||||
|
|
||||||
# --- Existing JSON based operations ---
|
# --- Existing JSON based operations ---
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user