Skip to content

Commit

Permalink
God
Browse files Browse the repository at this point in the history
  • Loading branch information
aunefyren committed Feb 4, 2024
1 parent efb0d0b commit ed9ddbd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"cSpell.words": [
"Bluesound",
"HACS"
"HACS",
"hass"
]
}
29 changes: 29 additions & 0 deletions custom_components/bluesound_alt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,30 @@
"""The Bluesound component."""
from __future__ import annotations

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant

from . import hub
from .const import DOMAIN

async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up Hello World from a config entry."""
# Store an instance of the "connecting" class that does the work of speaking
# with your actual devices.
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = hub.Hub(hass, entry.data["host"])

# This creates each HA object for each platform your device requires.
# It's done by calling the `async_setup_entry` function in each platform module.
await hass.config_entries.async_forward_entry_setups(entry, "media_player")
return True

async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
# This is called when an entry/configured device is to be removed. The class
# needs to unload itself, and remove callbacks. See the classes for further
# details
unload_ok = await hass.config_entries.async_unload_platforms(entry, "media_player")
if unload_ok:
hass.data[DOMAIN].pop(entry.entry_id)

return unload_ok

0 comments on commit ed9ddbd

Please sign in to comment.