Reload secrets on options config (#3292)

This commit is contained in:
Pascal Vizeli 2021-11-11 12:09:50 +01:00 committed by GitHub
parent 838af87ad7
commit 61d56dce9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -379,8 +379,10 @@ class APIAddons(CoreSysAttributes):
slug: str = request.match_info.get("addon")
if slug != "self":
raise APIForbidden("This can be only read by the Add-on itself!")
addon = self._extract_addon_installed(request)
# Lookup/reload secrets
await self.sys_homeassistant.secrets.reload()
try:
return addon.schema.validate(addon.options)
except vol.Invalid: