File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -161,11 +161,13 @@ async def async_get_integration(hass: 'HomeAssistant', domain: str)\
161
161
await int_or_evt .wait ()
162
162
int_or_evt = cache .get (domain , _UNDEF )
163
163
164
- if int_or_evt is _UNDEF :
165
- pass
166
- elif int_or_evt is None :
167
- raise IntegrationNotFound (domain )
168
- else :
164
+ # When we have waited and it's _UNDEF, it doesn't exist
165
+ # We don't cache that it doesn't exist, or else people can't fix it
166
+ # and then restart, because their config will never be valid.
167
+ if int_or_evt is _UNDEF :
168
+ raise IntegrationNotFound (domain )
169
+
170
+ if int_or_evt is not _UNDEF :
169
171
return cast (Integration , int_or_evt )
170
172
171
173
event = cache [domain ] = asyncio .Event ()
@@ -197,7 +199,12 @@ async def async_get_integration(hass: 'HomeAssistant', domain: str)\
197
199
return integration
198
200
199
201
integration = Integration .resolve_legacy (hass , domain )
200
- cache [domain ] = integration
202
+ if integration is not None :
203
+ cache [domain ] = integration
204
+ else :
205
+ # Remove event from cache.
206
+ cache .pop (domain )
207
+
201
208
event .set ()
202
209
203
210
if not integration :
You can’t perform that action at this time.
0 commit comments