Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion custom_components/dirigera_platform/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import voluptuous as vol

from homeassistant import config_entries, core
from homeassistant.exceptions import ConfigEntryNotReady
import requests as _requests
from homeassistant.components.light import PLATFORM_SCHEMA
from homeassistant.const import CONF_IP_ADDRESS, CONF_TOKEN, Platform

Expand Down Expand Up @@ -195,7 +197,12 @@ async def async_setup_entry(
platform = ikea_gateway()
hass.data[DOMAIN][PLATFORM] = platform
logger.debug("Starting make_devices...")
await platform.make_devices(hass,hass_data[CONF_IP_ADDRESS], hass_data[CONF_TOKEN])
try:
await platform.make_devices(hass,hass_data[CONF_IP_ADDRESS], hass_data[CONF_TOKEN])
except (_requests.exceptions.ConnectionError, OSError) as err:
raise ConfigEntryNotReady(
f"Cannot connect to IKEA Dirigera hub at {hass_data[CONF_IP_ADDRESS]}: {err}"
) from err

#await hass.async_add_executor_job(platform.make_devices,hass, hass_data[CONF_IP_ADDRESS], hass_data[CONF_TOKEN])

Expand Down
2 changes: 1 addition & 1 deletion custom_components/dirigera_platform/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def available(self):
def device_info(self) -> DeviceInfo:

# Register the device for updates
hub_event_listener.register(self.unique_id, self)
hub_event_listener.register(self.unique_id, registry_entry(self))

return DeviceInfo(
identifiers={("dirigera_platform", self._device_set.id)},
Expand Down