Home Assistant Unofficial Reference 2024.12.1
__init__.py
Go to the documentation of this file.
1 """Life360 integration."""
2 
3 from __future__ import annotations
4 
5 from homeassistant.config_entries import ConfigEntry, ConfigEntryState
6 from homeassistant.core import HomeAssistant
7 from homeassistant.helpers import issue_registry as ir
8 
9 DOMAIN = "life360"
10 
11 
12 async def async_setup_entry(hass: HomeAssistant, _: ConfigEntry) -> bool:
13  """Set up config entry."""
14  ir.async_create_issue(
15  hass,
16  DOMAIN,
17  DOMAIN,
18  is_fixable=False,
19  severity=ir.IssueSeverity.ERROR,
20  translation_key="integration_removed",
21  translation_placeholders={
22  "entries": "/config/integrations/integration/life360"
23  },
24  )
25  return True
26 
27 
28 async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
29  """Unload config entry."""
30  if all(
31  config_entry.state is ConfigEntryState.NOT_LOADED
32  for config_entry in hass.config_entries.async_entries(DOMAIN)
33  if config_entry.entry_id != entry.entry_id
34  ):
35  ir.async_delete_issue(hass, DOMAIN, DOMAIN)
36  return True
bool async_setup_entry(HomeAssistant hass, ConfigEntry _)
Definition: __init__.py:12
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)
Definition: __init__.py:28