Skip to content

Commit

Permalink
Merge pull request #592 from canton7/bugfix/async-add-job
Browse files Browse the repository at this point in the history
Remove use of async_add_job
  • Loading branch information
canton7 authored Apr 13, 2024
2 parents 284caff + e78c0f3 commit 2c88db7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions custom_components/foxess_modbus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry.entry_id, HassDataEntry(controllers=[], modbus_clients=[])
)

for platform in PLATFORMS:
if entry_options.get(platform, True):
hass.async_add_job(hass.config_entries.async_forward_entry_setup(entry, platform))

def create_controller(client: ModbusClient, inverter: dict[str, Any]) -> None:
controller = ModbusController(
hass,
Expand Down Expand Up @@ -129,6 +125,8 @@ def create_controller(client: ModbusClient, inverter: dict[str, Any]) -> None:
hass_data[entry.entry_id]["modbus_clients"] = list(clients.values())
hass_data[entry.entry_id]["unload"] = entry.add_update_listener(async_reload_entry)

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)

return True


Expand Down

0 comments on commit 2c88db7

Please sign in to comment.