Small fix for the velbus clear-cache service (#83279)

This commit is contained in:
Maikel Punie 2022-12-05 17:12:27 +01:00 committed by GitHub
parent 4f4d60c105
commit 1011c30cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,7 +139,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Handle a clear cache service call.""" """Handle a clear cache service call."""
# clear the cache # clear the cache
with suppress(FileNotFoundError): with suppress(FileNotFoundError):
if call.data[CONF_ADDRESS]: if CONF_ADDRESS in call.data and call.data[CONF_ADDRESS]:
await hass.async_add_executor_job( await hass.async_add_executor_job(
os.unlink, os.unlink,
hass.config.path( hass.config.path(