parent
6be20883f0
commit
6b787ee01e
1 changed files with 9 additions and 3 deletions
|
@ -6,13 +6,15 @@ https://home-assistant.io/components/media_player.roku/
|
|||
"""
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.components.media_player import (
|
||||
MEDIA_TYPE_VIDEO, SUPPORT_NEXT_TRACK, SUPPORT_PLAY_MEDIA,
|
||||
SUPPORT_PREVIOUS_TRACK, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET,
|
||||
SUPPORT_SELECT_SOURCE, MediaPlayerDevice)
|
||||
|
||||
SUPPORT_SELECT_SOURCE, MediaPlayerDevice, PLATFORM_SCHEMA)
|
||||
from homeassistant.const import (
|
||||
CONF_HOST, STATE_IDLE, STATE_PLAYING, STATE_UNKNOWN, STATE_HOME)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
REQUIREMENTS = [
|
||||
'https://github.com/bah2830/python-roku/archive/3.1.2.zip'
|
||||
|
@ -27,6 +29,10 @@ SUPPORT_ROKU = SUPPORT_PREVIOUS_TRACK | SUPPORT_NEXT_TRACK |\
|
|||
SUPPORT_PLAY_MEDIA | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE |\
|
||||
SUPPORT_SELECT_SOURCE
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Optional(CONF_HOST): cv.string,
|
||||
})
|
||||
|
||||
|
||||
# pylint: disable=abstract-method
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
@ -41,7 +47,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
hosts.append(discovery_info[0])
|
||||
|
||||
elif CONF_HOST in config:
|
||||
hosts.append(config[CONF_HOST])
|
||||
hosts.append(config.get(CONF_HOST))
|
||||
|
||||
rokus = []
|
||||
for host in hosts:
|
||||
|
|
Loading…
Add table
Reference in a new issue