mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Remove unused arguments in forked_daapd initialisation (#138289)
This commit is contained in:
parent
327bb34be1
commit
4807682fc5
@ -85,9 +85,9 @@ async def async_setup_entry(
|
|||||||
async_add_entities: AddConfigEntryEntitiesCallback,
|
async_add_entities: AddConfigEntryEntitiesCallback,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Set up forked-daapd from a config entry."""
|
"""Set up forked-daapd from a config entry."""
|
||||||
host = config_entry.data[CONF_HOST]
|
host: str = config_entry.data[CONF_HOST]
|
||||||
port = config_entry.data[CONF_PORT]
|
port: int = config_entry.data[CONF_PORT]
|
||||||
password = config_entry.data[CONF_PASSWORD]
|
password: str = config_entry.data[CONF_PASSWORD]
|
||||||
forked_daapd_api = ForkedDaapdAPI(
|
forked_daapd_api = ForkedDaapdAPI(
|
||||||
async_get_clientsession(hass), host, port, password
|
async_get_clientsession(hass), host, port, password
|
||||||
)
|
)
|
||||||
@ -95,8 +95,6 @@ async def async_setup_entry(
|
|||||||
clientsession=async_get_clientsession(hass),
|
clientsession=async_get_clientsession(hass),
|
||||||
api=forked_daapd_api,
|
api=forked_daapd_api,
|
||||||
ip_address=host,
|
ip_address=host,
|
||||||
api_port=port,
|
|
||||||
api_password=password,
|
|
||||||
config_entry=config_entry,
|
config_entry=config_entry,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -240,9 +238,7 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
|||||||
|
|
||||||
_attr_should_poll = False
|
_attr_should_poll = False
|
||||||
|
|
||||||
def __init__(
|
def __init__(self, clientsession, api, ip_address, config_entry):
|
||||||
self, clientsession, api, ip_address, api_port, api_password, config_entry
|
|
||||||
):
|
|
||||||
"""Initialize the ForkedDaapd Master Device."""
|
"""Initialize the ForkedDaapd Master Device."""
|
||||||
# Leave the api public so the browse media helpers can use it
|
# Leave the api public so the browse media helpers can use it
|
||||||
self.api = api
|
self.api = api
|
||||||
@ -269,7 +265,7 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
|||||||
self._on_remove = None
|
self._on_remove = None
|
||||||
self._available = False
|
self._available = False
|
||||||
self._clientsession = clientsession
|
self._clientsession = clientsession
|
||||||
self._config_entry = config_entry
|
self._entry_id = config_entry.entry_id
|
||||||
self.update_options(config_entry.options)
|
self.update_options(config_entry.options)
|
||||||
self._paused_event = asyncio.Event()
|
self._paused_event = asyncio.Event()
|
||||||
self._pause_requested = False
|
self._pause_requested = False
|
||||||
@ -282,42 +278,42 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
|||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_UPDATE_PLAYER.format(self._config_entry.entry_id),
|
SIGNAL_UPDATE_PLAYER.format(self._entry_id),
|
||||||
self._update_player,
|
self._update_player,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_UPDATE_QUEUE.format(self._config_entry.entry_id),
|
SIGNAL_UPDATE_QUEUE.format(self._entry_id),
|
||||||
self._update_queue,
|
self._update_queue,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_UPDATE_OUTPUTS.format(self._config_entry.entry_id),
|
SIGNAL_UPDATE_OUTPUTS.format(self._entry_id),
|
||||||
self._update_outputs,
|
self._update_outputs,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_UPDATE_MASTER.format(self._config_entry.entry_id),
|
SIGNAL_UPDATE_MASTER.format(self._entry_id),
|
||||||
self._update_callback,
|
self._update_callback,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_CONFIG_OPTIONS_UPDATE.format(self._config_entry.entry_id),
|
SIGNAL_CONFIG_OPTIONS_UPDATE.format(self._entry_id),
|
||||||
self.update_options,
|
self.update_options,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
self.async_on_remove(
|
self.async_on_remove(
|
||||||
async_dispatcher_connect(
|
async_dispatcher_connect(
|
||||||
self.hass,
|
self.hass,
|
||||||
SIGNAL_UPDATE_DATABASE.format(self._config_entry.entry_id),
|
SIGNAL_UPDATE_DATABASE.format(self._entry_id),
|
||||||
self._update_database,
|
self._update_database,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -411,9 +407,9 @@ class ForkedDaapdMaster(MediaPlayerEntity):
|
|||||||
self._track_info = defaultdict(str)
|
self._track_info = defaultdict(str)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def unique_id(self):
|
def unique_id(self) -> str:
|
||||||
"""Return unique ID."""
|
"""Return unique ID."""
|
||||||
return self._config_entry.entry_id
|
return self._entry_id
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user