ab8c127a4a466f2c137239c0eb06c8143adea106,homeassistant/components/media_player/firetv.py,,setup_platform,#Any#Any#Any#Any#,48
Before Change
port = config.get(CONF_PORT)
device_id = config.get(CONF_DEVICE)
try:
response = requests.get(
DEVICE_LIST_URL.format(proto, host, port)).json()
if device_id in response[CONF_DEVICES].keys():
add_entities([FireTVDevice(proto, host, port, device_id, name)])
_LOGGER.info("Device %s accessible and ready for control",
device_id)
else:
_LOGGER.warning("Device %s is not registered with firetv-server",
device_id)
except requests.exceptions.RequestException:
_LOGGER.error("Could not connect to firetv-server at %s", host)
class FireTV:
The firetv-server client.
Should a native Python 3 ADB module become available, python-firetv can
After Change
ftv = FireTV(host)
adb_log = ""
if not ftv.available:
_LOGGER.warning("Could not connect to Fire TV at %s%s", host, adb_log)
return
name = config[CONF_NAME]
get_source = config[CONF_GET_SOURCE]
get_sources = config[CONF_GET_SOURCES]
device = FireTVDevice(ftv, name, get_source, get_sources)
add_entities([device])
_LOGGER.info("Setup Fire TV at %s%s", host, adb_log)
def adb_decorator(override_available=False):
Send an ADB command if the device is available and not locked.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: home-assistant/home-assistant
Commit Name: ab8c127a4a466f2c137239c0eb06c8143adea106
Time: 2018-11-18
Author: JeffLIrion@users.noreply.github.com
File Name: homeassistant/components/media_player/firetv.py
Class Name:
Method Name: setup_platform
Project Name: polyaxon/polyaxon
Commit Name: 26d237186b852c342691aedfe81ac23851445f03
Time: 2018-06-07
Author: mouradmourafiq@gmail.com
File Name: polyaxon/scheduler/tasks/notebooks.py
Class Name:
Method Name: projects_notebook_start
Project Name: pantsbuild/pants
Commit Name: fd1456ac36e0a1ebfb800c9593f1540858ca7bea
Time: 2015-07-17
Author: kwilson@twopensource.com
File Name: src/python/pants/backend/core/tasks/reporting_server.py
Class Name: KillServer
Method Name: execute