Bump pychromecast to 14.0.0 (#108374)
* Pass unregister callback to cast HomeAssisstantController * Update tests * Bump pychromecast to 14.0.0 * Fix lint warning, adjust tests * Improve test coverage
This commit is contained in:
parent
dc09633cc2
commit
06a21d4ed9
10 changed files with 152 additions and 66 deletions
|
@ -1,7 +1,6 @@
|
|||
"""Home Assistant Cast integration for Cast."""
|
||||
from __future__ import annotations
|
||||
|
||||
from pychromecast.controllers.homeassistant import HomeAssistantController
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import auth, config_entries, core
|
||||
|
@ -11,7 +10,7 @@ from homeassistant.helpers import config_validation as cv, dispatcher, instance_
|
|||
from homeassistant.helpers.network import NoURLAvailableError, get_url
|
||||
from homeassistant.helpers.service import async_register_admin_service
|
||||
|
||||
from .const import DOMAIN, SIGNAL_HASS_CAST_SHOW_VIEW
|
||||
from .const import DOMAIN, SIGNAL_HASS_CAST_SHOW_VIEW, HomeAssistantControllerData
|
||||
|
||||
SERVICE_SHOW_VIEW = "show_lovelace_view"
|
||||
ATTR_VIEW_PATH = "view_path"
|
||||
|
@ -55,7 +54,7 @@ async def async_setup_ha_cast(
|
|||
|
||||
hass_uuid = await instance_id.async_get(hass)
|
||||
|
||||
controller = HomeAssistantController(
|
||||
controller_data = HomeAssistantControllerData(
|
||||
# If you are developing Home Assistant Cast, uncomment and set to
|
||||
# your dev app id.
|
||||
# app_id="5FE44367",
|
||||
|
@ -68,7 +67,7 @@ async def async_setup_ha_cast(
|
|||
dispatcher.async_dispatcher_send(
|
||||
hass,
|
||||
SIGNAL_HASS_CAST_SHOW_VIEW,
|
||||
controller,
|
||||
controller_data,
|
||||
call.data[ATTR_ENTITY_ID],
|
||||
call.data[ATTR_VIEW_PATH],
|
||||
call.data.get(ATTR_URL_PATH),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue