Skip to content

Commit bfdd205

Browse files
dan-rfrenck
authored andcommitted
Require OhmeAdvancedSettingsCoordinator to run regardless of entities (home-assistant#151701)
1 parent fcc3f92 commit bfdd205

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

homeassistant/components/ohme/coordinator.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ohme import ApiException, OhmeApiClient
1111

1212
from homeassistant.config_entries import ConfigEntry
13-
from homeassistant.core import HomeAssistant
13+
from homeassistant.core import HomeAssistant, callback
1414
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
1515

1616
from .const import DOMAIN
@@ -83,6 +83,21 @@ class OhmeAdvancedSettingsCoordinator(OhmeBaseCoordinator):
8383

8484
coordinator_name = "Advanced Settings"
8585

86+
def __init__(
87+
self, hass: HomeAssistant, config_entry: OhmeConfigEntry, client: OhmeApiClient
88+
) -> None:
89+
"""Initialise coordinator."""
90+
super().__init__(hass, config_entry, client)
91+
92+
@callback
93+
def _dummy_listener() -> None:
94+
pass
95+
96+
# This coordinator is used by the API library to determine whether the
97+
# charger is online and available. It is therefore required even if no
98+
# entities are using it.
99+
self.async_add_listener(_dummy_listener)
100+
86101
async def _internal_update_data(self) -> None:
87102
"""Fetch data from API endpoint."""
88103
await self.client.async_get_advanced_settings()

0 commit comments

Comments
 (0)