1 """The Internet Printing Protocol (IPP) integration."""
3 from __future__
import annotations
15 from .const
import CONF_BASE_PATH
16 from .coordinator
import IPPDataUpdateCoordinator
18 PLATFORMS = [Platform.SENSOR]
20 type IPPConfigEntry = ConfigEntry[IPPDataUpdateCoordinator]
24 """Set up IPP from a config entry."""
26 if (device_id := entry.unique_id)
is None:
27 device_id = entry.entry_id
31 host=entry.data[CONF_HOST],
32 port=entry.data[CONF_PORT],
33 base_path=entry.data[CONF_BASE_PATH],
34 tls=entry.data[CONF_SSL],
35 verify_ssl=entry.data[CONF_VERIFY_SSL],
38 await coordinator.async_config_entry_first_refresh()
40 entry.runtime_data = coordinator
42 await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
48 """Unload a config entry."""
49 return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
bool async_setup_entry(HomeAssistant hass, IPPConfigEntry entry)
bool async_unload_entry(HomeAssistant hass, ConfigEntry entry)