Limit Github event subscription if polling is disabled (#78662)

This commit is contained in:
Joakim Sørensen 2022-09-18 11:40:42 +02:00 committed by GitHub
parent 69c5d910d4
commit 87f8ebceb2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 2 deletions

View file

@ -38,7 +38,9 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
await coordinator.async_config_entry_first_refresh()
await coordinator.subscribe()
if not entry.pref_disable_polling:
await coordinator.subscribe()
hass.data[DOMAIN][repository] = coordinator