mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Reduce IPP errors when printer is offline (#44413)
This commit is contained in:
parent
0b1791c293
commit
cb82f5159e
@ -48,22 +48,24 @@ async def async_setup(hass: HomeAssistant, config: Dict) -> bool:
|
|||||||
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Set up IPP from a config entry."""
|
"""Set up IPP from a config entry."""
|
||||||
|
|
||||||
# Create IPP instance for this entry
|
coordinator = hass.data[DOMAIN].get(entry.entry_id)
|
||||||
coordinator = IPPDataUpdateCoordinator(
|
if not coordinator:
|
||||||
hass,
|
# Create IPP instance for this entry
|
||||||
host=entry.data[CONF_HOST],
|
coordinator = IPPDataUpdateCoordinator(
|
||||||
port=entry.data[CONF_PORT],
|
hass,
|
||||||
base_path=entry.data[CONF_BASE_PATH],
|
host=entry.data[CONF_HOST],
|
||||||
tls=entry.data[CONF_SSL],
|
port=entry.data[CONF_PORT],
|
||||||
verify_ssl=entry.data[CONF_VERIFY_SSL],
|
base_path=entry.data[CONF_BASE_PATH],
|
||||||
)
|
tls=entry.data[CONF_SSL],
|
||||||
|
verify_ssl=entry.data[CONF_VERIFY_SSL],
|
||||||
|
)
|
||||||
|
hass.data[DOMAIN][entry.entry_id] = coordinator
|
||||||
|
|
||||||
await coordinator.async_refresh()
|
await coordinator.async_refresh()
|
||||||
|
|
||||||
if not coordinator.last_update_success:
|
if not coordinator.last_update_success:
|
||||||
raise ConfigEntryNotReady
|
raise ConfigEntryNotReady
|
||||||
|
|
||||||
hass.data[DOMAIN][entry.entry_id] = coordinator
|
|
||||||
|
|
||||||
for component in PLATFORMS:
|
for component in PLATFORMS:
|
||||||
hass.async_create_task(
|
hass.async_create_task(
|
||||||
hass.config_entries.async_forward_entry_setup(entry, component)
|
hass.config_entries.async_forward_entry_setup(entry, component)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user