mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Bugfix new async_add_devices function (#6362)
This commit is contained in:
parent
3fa8aff78e
commit
a5b2fc9759
@ -44,8 +44,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_entities,
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
discovery_info=None):
|
|
||||||
"""Setup the Apple TV platform."""
|
"""Setup the Apple TV platform."""
|
||||||
import pyatv
|
import pyatv
|
||||||
|
|
||||||
@ -79,7 +78,7 @@ def async_setup_platform(hass, config, async_add_entities,
|
|||||||
|
|
||||||
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
|
hass.bus.async_listen_once(EVENT_HOMEASSISTANT_STOP, on_hass_stop)
|
||||||
|
|
||||||
yield from async_add_entities([entity])
|
async_add_devices([entity])
|
||||||
|
|
||||||
|
|
||||||
class AppleTvDevice(MediaPlayerDevice):
|
class AppleTvDevice(MediaPlayerDevice):
|
||||||
|
@ -60,8 +60,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
|||||||
|
|
||||||
|
|
||||||
@asyncio.coroutine
|
@asyncio.coroutine
|
||||||
def async_setup_platform(hass, config, async_add_entities,
|
def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
|
||||||
discovery_info=None):
|
|
||||||
"""Setup the Kodi platform."""
|
"""Setup the Kodi platform."""
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
port = config.get(CONF_PORT)
|
port = config.get(CONF_PORT)
|
||||||
@ -84,7 +83,7 @@ def async_setup_platform(hass, config, async_add_entities,
|
|||||||
password=config.get(CONF_PASSWORD),
|
password=config.get(CONF_PASSWORD),
|
||||||
turn_off_action=config.get(CONF_TURN_OFF_ACTION), websocket=websocket)
|
turn_off_action=config.get(CONF_TURN_OFF_ACTION), websocket=websocket)
|
||||||
|
|
||||||
yield from async_add_entities([entity], update_before_add=True)
|
async_add_devices([entity], update_before_add=True)
|
||||||
|
|
||||||
|
|
||||||
class KodiDevice(MediaPlayerDevice):
|
class KodiDevice(MediaPlayerDevice):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user