Skip to content

Commit

Permalink
Add host to gateway device 2
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Jan 7, 2024
1 parent 4bfbb83 commit 9a92bcb
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions custom_components/sagemcom_fast/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@
SERVICE_REBOOT = "reboot"


async def async_setup(hass: HomeAssistant, config: dict):
"""Set up the Sagemcom component."""

hass.data.setdefault(DOMAIN, {})

return True


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
"""Set up Sagemcom from a config entry."""

Expand Down Expand Up @@ -102,7 +94,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

await coordinator.async_refresh()

hass.data[DOMAIN][entry.entry_id] = {
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = {
"coordinator": coordinator,
"update_listener": entry.add_update_listener(update_listener),
}
Expand All @@ -118,7 +110,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
name=f"{gateway.manufacturer} {gateway.model_number}",
model=gateway.model_name,
sw_version=gateway.software_version,
configuration_url=host,
configuration_url=f"{'https' if ssl else 'http'}://{host}",
)

# Register components
Expand Down

0 comments on commit 9a92bcb

Please sign in to comment.