1 """The local_file component."""
8 from .const
import DOMAIN
9 from .util
import check_file_path_access
11 PLATFORMS = [Platform.CAMERA]
15 """Set up Local file from a config entry."""
16 file_path: str = entry.options[CONF_FILE_PATH]
17 if not await hass.async_add_executor_job(check_file_path_access, file_path):
19 translation_domain=DOMAIN,
20 translation_key=
"not_readable_path",
21 translation_placeholders={
"file_path": file_path},
24 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
25 entry.async_on_unload(entry.add_update_listener(update_listener))
31 """Unload Local file config entry."""
32 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
36 """Handle options update."""
37 await hass.config_entries.async_reload(entry.entry_id)
bool async_setup_entry(HomeAssistant hass, ConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
None update_listener(HomeAssistant hass, ConfigEntry entry)