Skip to content

Commit ba09f98

Browse files
authored
Fix for async_config_entry_first_refresh warning
1 parent c20d2fa commit ba09f98

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

custom_components/hpprinter/managers/ha_coordinator.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import sys
33

4+
from homeassistant.config_entries import ConfigEntryState
45
from homeassistant.core import Event, callback
56
from homeassistant.helpers.dispatcher import (
67
async_dispatcher_connect,
@@ -88,7 +89,10 @@ async def initialize(self):
8889

8990
await self._api.initialize()
9091

91-
await self.async_config_entry_first_refresh()
92+
if entry.state == ConfigEntryState.LOADED:
93+
await self.async_refresh()
94+
else:
95+
await self.async_config_entry_first_refresh()
9296

9397
def _load_signal_handlers(self):
9498
loop = self.hass.loop

0 commit comments

Comments
 (0)