diff --git a/custom_components/worldtidesinfocustom/__init__.py b/custom_components/worldtidesinfocustom/__init__.py index d852114..421b2f7 100644 --- a/custom_components/worldtidesinfocustom/__init__.py +++ b/custom_components/worldtidesinfocustom/__init__.py @@ -176,10 +176,12 @@ async def async_setup_entry(hass, config_entry): hass.data[DOMAIN][DATA_COORDINATOR][config_entry.entry_id] = coordinator - for platform in PLATFORMS: - hass.async_create_task( - hass.config_entries.async_forward_entry_setup(config_entry, platform) - ) + #for platform in PLATFORMS: + # hass.async_create_task( + # hass.config_entries.async_forward_entry_setup(config_entry, platform) + # ) + + await hass.config_entries.async_forward_entry_setups(config_entry, PLATFORMS) return True diff --git a/custom_components/worldtidesinfocustom/sensor.py b/custom_components/worldtidesinfocustom/sensor.py index cb165f6..6cb144b 100644 --- a/custom_components/worldtidesinfocustom/sensor.py +++ b/custom_components/worldtidesinfocustom/sensor.py @@ -1667,7 +1667,8 @@ async def async_added_to_hass(self): # self.schedule_update_ha_state(force_refresh=True) current_time = time.time() - self._worldtide_data_coordinator.check_if_tide_file_exist_for_init(current_time) + # self._worldtide_data_coordinator.check_if_tide_file_exist_for_init(current_time) + await self._hass.async_add_executor_job(self._worldtide_data_coordinator.check_if_tide_file_exist_for_init, current_time) self.schedule_update_ha_state(force_refresh=True)