Skip to content

Commit

Permalink
Merge pull request #102
Browse files Browse the repository at this point in the history
* Fix for 2024.3.0
  • Loading branch information
oeriksen authored Mar 17, 2024
1 parent a75d3b5 commit 446d4fc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions custom_components/ams/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ async def async_setup(hass: HomeAssistant, config: Config):
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up AMS as config entry."""
_setup(hass, entry.data)
hass.async_create_task(
hass.config_entries.async_forward_entry_setup(entry, "sensor")
)
await hass.config_entries.async_forward_entry_setup(entry, "sensor")
return True


Expand Down Expand Up @@ -411,7 +409,10 @@ def _check_for_new_sensors_and_update(self, sensor_data):
_LOGGER.debug("Got %s new devices from the serial",
len(new_devices))
_LOGGER.debug("DUMP %s", sensor_data)
async_dispatcher_send(self._hass, SIGNAL_NEW_AMS_SENSOR)
self._hass.async_create_task(self._signal_new_sensor())
else:
# _LOGGER.debug("sensors are the same, updating states")
async_dispatcher_send(self._hass, SIGNAL_UPDATE_AMS)

async def _signal_new_sensor(self) -> None:
async_dispatcher_send(self._hass, SIGNAL_NEW_AMS_SENSOR)

0 comments on commit 446d4fc

Please sign in to comment.