Sync empty entities when Google is disabled in cloud (#72806)

This commit is contained in:
Paulus Schoutsen 2022-06-23 05:41:34 -04:00 committed by GitHub
parent 0dd181f922
commit 10b083bbf5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 44 additions and 13 deletions

View file

@ -356,9 +356,6 @@ class AbstractConfig(ABC):
pprint.pformat(payload),
)
if not self.enabled:
return json_response(smart_home.turned_off_response(payload))
if (agent_user_id := self.get_local_agent_user_id(webhook_id)) is None:
# No agent user linked to this webhook, means that the user has somehow unregistered
# removing webhook and stopping processing of this request.
@ -370,6 +367,11 @@ class AbstractConfig(ABC):
webhook.async_unregister(self.hass, webhook_id)
return None
if not self.enabled:
return json_response(
smart_home.api_disabled_response(payload, agent_user_id)
)
result = await smart_home.async_handle_message(
self.hass,
self,