Search is not available for this dataset
identifier stringlengths 1 155 | parameters stringlengths 2 6.09k | docstring stringlengths 11 63.4k | docstring_summary stringlengths 0 63.4k | function stringlengths 29 99.8k | function_tokens list | start_point list | end_point list | language stringclasses 1
value | docstring_language stringlengths 2 7 | docstring_language_predictions stringlengths 18 23 | is_langid_reliable stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
internal_url_mock | (hass) | Mock internal URL of the instance. | Mock internal URL of the instance. | async def internal_url_mock(hass):
"""Mock internal URL of the instance."""
await async_process_ha_core_config(
hass,
{"internal_url": "http://example.local:8123"},
) | [
"async",
"def",
"internal_url_mock",
"(",
"hass",
")",
":",
"await",
"async_process_ha_core_config",
"(",
"hass",
",",
"{",
"\"internal_url\"",
":",
"\"http://example.local:8123\"",
"}",
",",
")"
] | [
86,
0
] | [
91,
5
] | python | en | ['en', 'fy', 'en'] | True |
test_setup_component_demo | (hass) | Set up the demo platform with defaults. | Set up the demo platform with defaults. | async def test_setup_component_demo(hass):
"""Set up the demo platform with defaults."""
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
assert await async_setup_component(hass, tts.DOMAIN, config)
assert hass.services.has_service(tts.DOMAIN, "demo_say")... | [
"async",
"def",
"test_setup_component_demo",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"with",
"assert_setup_component",
"(",
"1",
",",
"tts",
".",
"DOMAIN",
")",
":",
"assert",
... | [
94,
0
] | [
102,
63
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_demo_no_access_cache_folder | (hass, mock_init_cache_dir) | Set up the demo platform with defaults. | Set up the demo platform with defaults. | async def test_setup_component_demo_no_access_cache_folder(hass, mock_init_cache_dir):
"""Set up the demo platform with defaults."""
config = {tts.DOMAIN: {"platform": "demo"}}
mock_init_cache_dir.side_effect = OSError(2, "No access")
assert not await async_setup_component(hass, tts.DOMAIN, config)
... | [
"async",
"def",
"test_setup_component_demo_no_access_cache_folder",
"(",
"hass",
",",
"mock_init_cache_dir",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"mock_init_cache_dir",
".",
"side_effect",
"=",
"O... | [
105,
0
] | [
113,
67
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service | (hass, empty_cache_dir) | Set up the demo platform and call service. | Set up the demo platform and call service. | async def test_setup_component_and_test_service(hass, empty_cache_dir):
"""Set up the demo platform and call service."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
assert await async_se... | [
"async",
"def",
"test_setup_component_and_test_service",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"plat... | [
116,
0
] | [
144,
15
] | python | en | ['en', 'pt', 'en'] | True |
test_setup_component_and_test_service_with_config_language | (
hass, empty_cache_dir
) | Set up the demo platform and call service. | Set up the demo platform and call service. | async def test_setup_component_and_test_service_with_config_language(
hass, empty_cache_dir
):
"""Set up the demo platform and call service."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo", "language": "de"}}
with assert_setup_component(... | [
"async",
"def",
"test_setup_component_and_test_service_with_config_language",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
... | [
147,
0
] | [
176,
15
] | python | en | ['en', 'pt', 'en'] | True |
test_setup_component_and_test_service_with_config_language_special | (
hass, empty_cache_dir
) | Set up the demo platform and call service with extend language. | Set up the demo platform and call service with extend language. | async def test_setup_component_and_test_service_with_config_language_special(
hass, empty_cache_dir
):
"""Set up the demo platform and call service with extend language."""
import homeassistant.components.demo.tts as demo_tts
demo_tts.SUPPORT_LANGUAGES.append("en_US")
calls = async_mock_service(has... | [
"async",
"def",
"test_setup_component_and_test_service_with_config_language_special",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"import",
"homeassistant",
".",
"components",
".",
"demo",
".",
"tts",
"as",
"demo_tts",
"demo_tts",
".",
"SUPPORT_LANGUAGES",
".",
"appe... | [
179,
0
] | [
211,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_wrong_conf_language | (hass) | Set up the demo platform and call service with wrong config. | Set up the demo platform and call service with wrong config. | async def test_setup_component_and_test_service_with_wrong_conf_language(hass):
"""Set up the demo platform and call service with wrong config."""
config = {tts.DOMAIN: {"platform": "demo", "language": "ru"}}
with assert_setup_component(0, tts.DOMAIN):
assert await async_setup_component(hass, tts.D... | [
"async",
"def",
"test_setup_component_and_test_service_with_wrong_conf_language",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
",",
"\"language\"",
":",
"\"ru\"",
"}",
"}",
"with",
"assert_setup_componen... | [
214,
0
] | [
219,
68
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_service_language | (
hass, empty_cache_dir
) | Set up the demo platform and call service. | Set up the demo platform and call service. | async def test_setup_component_and_test_service_with_service_language(
hass, empty_cache_dir
):
"""Set up the demo platform and call service."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
... | [
"async",
"def",
"test_setup_component_and_test_service_with_service_language",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
... | [
222,
0
] | [
252,
15
] | python | en | ['en', 'pt', 'en'] | True |
test_setup_component_test_service_with_wrong_service_language | (
hass, empty_cache_dir
) | Set up the demo platform and call service. | Set up the demo platform and call service. | async def test_setup_component_test_service_with_wrong_service_language(
hass, empty_cache_dir
):
"""Set up the demo platform and call service."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):... | [
"async",
"def",
"test_setup_component_test_service_with_wrong_service_language",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",... | [
255,
0
] | [
280,
15
] | python | en | ['en', 'pt', 'en'] | True |
test_setup_component_and_test_service_with_service_options | (
hass, empty_cache_dir
) | Set up the demo platform and call service with options. | Set up the demo platform and call service with options. | async def test_setup_component_and_test_service_with_service_options(
hass, empty_cache_dir
):
"""Set up the demo platform and call service with options."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tt... | [
"async",
"def",
"test_setup_component_and_test_service_with_service_options",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
... | [
283,
0
] | [
317,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_with_service_options_def | (hass, empty_cache_dir) | Set up the demo platform and call service with default options. | Set up the demo platform and call service with default options. | async def test_setup_component_and_test_with_service_options_def(hass, empty_cache_dir):
"""Set up the demo platform and call service with default options."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.... | [
"async",
"def",
"test_setup_component_and_test_with_service_options_def",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",... | [
320,
0
] | [
354,
19
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_service_options_wrong | (
hass, empty_cache_dir
) | Set up the demo platform and call service with wrong options. | Set up the demo platform and call service with wrong options. | async def test_setup_component_and_test_service_with_service_options_wrong(
hass, empty_cache_dir
):
"""Set up the demo platform and call service with wrong options."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_com... | [
"async",
"def",
"test_setup_component_and_test_service_with_service_options_wrong",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAI... | [
357,
0
] | [
386,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_base_url_set | (hass) | Set up the demo platform with ``base_url`` set and call service. | Set up the demo platform with ``base_url`` set and call service. | async def test_setup_component_and_test_service_with_base_url_set(hass):
"""Set up the demo platform with ``base_url`` set and call service."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo", "base_url": "http://fnord"}}
with assert_setup_comp... | [
"async",
"def",
"test_setup_component_and_test_service_with_base_url_set",
"(",
"hass",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
... | [
389,
0
] | [
413,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_clear_cache | (hass, empty_cache_dir) | Set up the demo platform and call service clear cache. | Set up the demo platform and call service clear cache. | async def test_setup_component_and_test_service_clear_cache(hass, empty_cache_dir):
"""Set up the demo platform and call service clear cache."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
... | [
"async",
"def",
"test_setup_component_and_test_service_clear_cache",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{... | [
416,
0
] | [
449,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_receive_voice | (
hass, demo_provider, hass_client
) | Set up the demo platform and call service and receive voice. | Set up the demo platform and call service and receive voice. | async def test_setup_component_and_test_service_with_receive_voice(
hass, demo_provider, hass_client
):
"""Set up the demo platform and call service and receive voice."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_c... | [
"async",
"def",
"test_setup_component_and_test_service_with_receive_voice",
"(",
"hass",
",",
"demo_provider",
",",
"hass_client",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
... | [
452,
0
] | [
487,
40
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_test_service_with_receive_voice_german | (
hass, demo_provider, hass_client
) | Set up the demo platform and call service and receive voice. | Set up the demo platform and call service and receive voice. | async def test_setup_component_and_test_service_with_receive_voice_german(
hass, demo_provider, hass_client
):
"""Set up the demo platform and call service and receive voice."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo", "language": "de"}}... | [
"async",
"def",
"test_setup_component_and_test_service_with_receive_voice_german",
"(",
"hass",
",",
"demo_provider",
",",
"hass_client",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"... | [
490,
0
] | [
524,
40
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_web_view_wrong_file | (hass, hass_client) | Set up the demo platform and receive wrong file from web. | Set up the demo platform and receive wrong file from web. | async def test_setup_component_and_web_view_wrong_file(hass, hass_client):
"""Set up the demo platform and receive wrong file from web."""
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
assert await async_setup_component(hass, tts.DOMAIN, config)
client... | [
"async",
"def",
"test_setup_component_and_web_view_wrong_file",
"(",
"hass",
",",
"hass_client",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"with",
"assert_setup_component",
"(",
"1",
",",
"tts",
".... | [
527,
0
] | [
539,
39
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_web_view_wrong_filename | (hass, hass_client) | Set up the demo platform and receive wrong filename from web. | Set up the demo platform and receive wrong filename from web. | async def test_setup_component_and_web_view_wrong_filename(hass, hass_client):
"""Set up the demo platform and receive wrong filename from web."""
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN):
assert await async_setup_component(hass, tts.DOMAIN, config)
... | [
"async",
"def",
"test_setup_component_and_web_view_wrong_filename",
"(",
"hass",
",",
"hass_client",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"with",
"assert_setup_component",
"(",
"1",
",",
"tts",
... | [
542,
0
] | [
554,
39
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_test_without_cache | (hass, empty_cache_dir) | Set up demo platform without cache. | Set up demo platform without cache. | async def test_setup_component_test_without_cache(hass, empty_cache_dir):
"""Set up demo platform without cache."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo", "cache": False}}
with assert_setup_component(1, tts.DOMAIN):
assert awa... | [
"async",
"def",
"test_setup_component_test_without_cache",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"pl... | [
557,
0
] | [
579,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_test_with_cache_call_service_without_cache | (
hass, empty_cache_dir
) | Set up demo platform with cache and call service without cache. | Set up demo platform with cache and call service without cache. | async def test_setup_component_test_with_cache_call_service_without_cache(
hass, empty_cache_dir
):
"""Set up demo platform with cache and call service without cache."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
config = {tts.DOMAIN: {"platform": "demo", "cache": True}}
with ... | [
"async",
"def",
"test_setup_component_test_with_cache_call_service_without_cache",
"(",
"hass",
",",
"empty_cache_dir",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"config",
"=",
"{",
"tts",
".",
"DOMAIN... | [
582,
0
] | [
607,
15
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_test_with_cache_dir | (
hass, empty_cache_dir, demo_provider
) | Set up demo platform with cache and call service without cache. | Set up demo platform with cache and call service without cache. | async def test_setup_component_test_with_cache_dir(
hass, empty_cache_dir, demo_provider
):
"""Set up demo platform with cache and call service without cache."""
calls = async_mock_service(hass, DOMAIN_MP, SERVICE_PLAY_MEDIA)
_, demo_data = demo_provider.get_tts_audio("bla", "en")
cache_file = (
... | [
"async",
"def",
"test_setup_component_test_with_cache_dir",
"(",
"hass",
",",
"empty_cache_dir",
",",
"demo_provider",
")",
":",
"calls",
"=",
"async_mock_service",
"(",
"hass",
",",
"DOMAIN_MP",
",",
"SERVICE_PLAY_MEDIA",
")",
"_",
",",
"demo_data",
"=",
"demo_prov... | [
610,
0
] | [
646,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_test_with_error_on_get_tts | (hass) | Set up demo platform with wrong get_tts_audio. | Set up demo platform with wrong get_tts_audio. | async def test_setup_component_test_with_error_on_get_tts(hass):
"""Set up demo platform with wrong get_tts_audio."""
config = {tts.DOMAIN: {"platform": "demo"}}
with assert_setup_component(1, tts.DOMAIN), patch(
"homeassistant.components.demo.tts.DemoProvider.get_tts_audio",
return_value=(... | [
"async",
"def",
"test_setup_component_test_with_error_on_get_tts",
"(",
"hass",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"with",
"assert_setup_component",
"(",
"1",
",",
"tts",
".",
"DOMAIN",
")",... | [
649,
0
] | [
657,
68
] | python | en | ['en', 'da', 'en'] | True |
test_setup_component_load_cache_retrieve_without_mem_cache | (
hass, demo_provider, empty_cache_dir, hass_client
) | Set up component and load cache and get without mem cache. | Set up component and load cache and get without mem cache. | async def test_setup_component_load_cache_retrieve_without_mem_cache(
hass, demo_provider, empty_cache_dir, hass_client
):
"""Set up component and load cache and get without mem cache."""
_, demo_data = demo_provider.get_tts_audio("bla", "en")
cache_file = (
empty_cache_dir / "42f18378fd4393d18c... | [
"async",
"def",
"test_setup_component_load_cache_retrieve_without_mem_cache",
"(",
"hass",
",",
"demo_provider",
",",
"empty_cache_dir",
",",
"hass_client",
")",
":",
"_",
",",
"demo_data",
"=",
"demo_provider",
".",
"get_tts_audio",
"(",
"\"bla\"",
",",
"\"en\"",
")"... | [
660,
0
] | [
683,
40
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_web_get_url | (hass, hass_client) | Set up the demo platform and receive file from web. | Set up the demo platform and receive file from web. | async def test_setup_component_and_web_get_url(hass, hass_client):
"""Set up the demo platform and receive file from web."""
config = {tts.DOMAIN: {"platform": "demo"}}
await async_setup_component(hass, tts.DOMAIN, config)
client = await hass_client()
url = "/api/tts_get_url"
data = {"platfor... | [
"async",
"def",
"test_setup_component_and_web_get_url",
"(",
"hass",
",",
"hass_client",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"await",
"async_setup_component",
"(",
"hass",
",",
"tts",
".",
... | [
686,
0
] | [
702,
5
] | python | en | ['en', 'en', 'en'] | True |
test_setup_component_and_web_get_url_bad_config | (hass, hass_client) | Set up the demo platform and receive wrong file from web. | Set up the demo platform and receive wrong file from web. | async def test_setup_component_and_web_get_url_bad_config(hass, hass_client):
"""Set up the demo platform and receive wrong file from web."""
config = {tts.DOMAIN: {"platform": "demo"}}
await async_setup_component(hass, tts.DOMAIN, config)
client = await hass_client()
url = "/api/tts_get_url"
... | [
"async",
"def",
"test_setup_component_and_web_get_url_bad_config",
"(",
"hass",
",",
"hass_client",
")",
":",
"config",
"=",
"{",
"tts",
".",
"DOMAIN",
":",
"{",
"\"platform\"",
":",
"\"demo\"",
"}",
"}",
"await",
"async_setup_component",
"(",
"hass",
",",
"tts"... | [
705,
0
] | [
717,
28
] | python | en | ['en', 'en', 'en'] | True |
test_tags_with_wave | (hass, demo_provider) | Set up the demo platform and call service and receive voice. | Set up the demo platform and call service and receive voice. | async def test_tags_with_wave(hass, demo_provider):
"""Set up the demo platform and call service and receive voice."""
# below data represents an empty wav file
demo_data = bytes.fromhex(
"52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 02 00"
+ "22 56 00 00 88 58 01 00 04... | [
"async",
"def",
"test_tags_with_wave",
"(",
"hass",
",",
"demo_provider",
")",
":",
"# below data represents an empty wav file",
"demo_data",
"=",
"bytes",
".",
"fromhex",
"(",
"\"52 49 46 46 24 00 00 00 57 41 56 45 66 6d 74 20 10 00 00 00 01 00 02 00\"",
"+",
"\"22 56 00 00 88 5... | [
720,
0
] | [
738,
35
] | python | en | ['en', 'en', 'en'] | True |
is_on | (hass, entity_id=None) |
Return true if specified media player entity_id is on.
Check all media player if no entity_id specified.
|
Return true if specified media player entity_id is on. | def is_on(hass, entity_id=None):
"""
Return true if specified media player entity_id is on.
Check all media player if no entity_id specified.
"""
entity_ids = [entity_id] if entity_id else hass.states.entity_ids(DOMAIN)
return any(
not hass.states.is_state(entity_id, STATE_OFF) for enti... | [
"def",
"is_on",
"(",
"hass",
",",
"entity_id",
"=",
"None",
")",
":",
"entity_ids",
"=",
"[",
"entity_id",
"]",
"if",
"entity_id",
"else",
"hass",
".",
"states",
".",
"entity_ids",
"(",
"DOMAIN",
")",
"return",
"any",
"(",
"not",
"hass",
".",
"states",... | [
178,
0
] | [
187,
5
] | python | en | ['en', 'error', 'th'] | False |
_rename_keys | (**keys) | Create validator that renames keys.
Necessary because the service schema names do not match the command parameters.
Async friendly.
| Create validator that renames keys. | def _rename_keys(**keys):
"""Create validator that renames keys.
Necessary because the service schema names do not match the command parameters.
Async friendly.
"""
def rename(value):
for to_key, from_key in keys.items():
if from_key in value:
value[to_key] = v... | [
"def",
"_rename_keys",
"(",
"*",
"*",
"keys",
")",
":",
"def",
"rename",
"(",
"value",
")",
":",
"for",
"to_key",
",",
"from_key",
"in",
"keys",
".",
"items",
"(",
")",
":",
"if",
"from_key",
"in",
"value",
":",
"value",
"[",
"to_key",
"]",
"=",
... | [
190,
0
] | [
204,
17
] | python | en | ['en', 'af', 'en'] | True |
async_setup | (hass, config) | Track states and offer events for media_players. | Track states and offer events for media_players. | async def async_setup(hass, config):
"""Track states and offer events for media_players."""
component = hass.data[DOMAIN] = EntityComponent(
logging.getLogger(__name__), DOMAIN, hass, SCAN_INTERVAL
)
hass.components.websocket_api.async_register_command(websocket_handle_thumbnail)
hass.compo... | [
"async",
"def",
"async_setup",
"(",
"hass",
",",
"config",
")",
":",
"component",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"=",
"EntityComponent",
"(",
"logging",
".",
"getLogger",
"(",
"__name__",
")",
",",
"DOMAIN",
",",
"hass",
",",
"SCAN_INTERVA... | [
207,
0
] | [
339,
15
] | python | en | ['en', 'en', 'en'] | True |
async_setup_entry | (hass, entry) | Set up a config entry. | Set up a config entry. | async def async_setup_entry(hass, entry):
"""Set up a config entry."""
return await hass.data[DOMAIN].async_setup_entry(entry) | [
"async",
"def",
"async_setup_entry",
"(",
"hass",
",",
"entry",
")",
":",
"return",
"await",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
".",
"async_setup_entry",
"(",
"entry",
")"
] | [
342,
0
] | [
344,
59
] | python | en | ['en', 'en', 'en'] | True |
async_unload_entry | (hass, entry) | Unload a config entry. | Unload a config entry. | async def async_unload_entry(hass, entry):
"""Unload a config entry."""
return await hass.data[DOMAIN].async_unload_entry(entry) | [
"async",
"def",
"async_unload_entry",
"(",
"hass",
",",
"entry",
")",
":",
"return",
"await",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
".",
"async_unload_entry",
"(",
"entry",
")"
] | [
347,
0
] | [
349,
60
] | python | en | ['en', 'es', 'en'] | True |
websocket_handle_thumbnail | (hass, connection, msg) | Handle get media player cover command.
Async friendly.
| Handle get media player cover command. | async def websocket_handle_thumbnail(hass, connection, msg):
"""Handle get media player cover command.
Async friendly.
"""
component = hass.data[DOMAIN]
player = component.get_entity(msg["entity_id"])
if player is None:
connection.send_message(
websocket_api.error_message(m... | [
"async",
"def",
"websocket_handle_thumbnail",
"(",
"hass",
",",
"connection",
",",
"msg",
")",
":",
"component",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"player",
"=",
"component",
".",
"get_entity",
"(",
"msg",
"[",
"\"entity_id\"",
"]",
")",
"if",
... | [
986,
0
] | [
1020,
5
] | python | en | ['nl', 'en', 'en'] | True |
websocket_browse_media | (hass, connection, msg) |
Browse media available to the media_player entity.
To use, media_player integrations can implement MediaPlayerEntity.async_browse_media()
|
Browse media available to the media_player entity. | async def websocket_browse_media(hass, connection, msg):
"""
Browse media available to the media_player entity.
To use, media_player integrations can implement MediaPlayerEntity.async_browse_media()
"""
component = hass.data[DOMAIN]
player: Optional[MediaPlayerDevice] = component.get_entity(msg... | [
"async",
"def",
"websocket_browse_media",
"(",
"hass",
",",
"connection",
",",
"msg",
")",
":",
"component",
"=",
"hass",
".",
"data",
"[",
"DOMAIN",
"]",
"player",
":",
"Optional",
"[",
"MediaPlayerDevice",
"]",
"=",
"component",
".",
"get_entity",
"(",
"... | [
1040,
0
] | [
1092,
46
] | python | en | ['en', 'error', 'th'] | False |
MediaPlayerEntity.state | (self) | State of the player. | State of the player. | def state(self):
"""State of the player."""
return None | [
"def",
"state",
"(",
"self",
")",
":",
"return",
"None"
] | [
359,
4
] | [
361,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.access_token | (self) | Access token for this media player. | Access token for this media player. | def access_token(self) -> str:
"""Access token for this media player."""
if self._access_token is None:
self._access_token = secrets.token_hex(32)
return self._access_token | [
"def",
"access_token",
"(",
"self",
")",
"->",
"str",
":",
"if",
"self",
".",
"_access_token",
"is",
"None",
":",
"self",
".",
"_access_token",
"=",
"secrets",
".",
"token_hex",
"(",
"32",
")",
"return",
"self",
".",
"_access_token"
] | [
364,
4
] | [
368,
33
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.volume_level | (self) | Volume level of the media player (0..1). | Volume level of the media player (0..1). | def volume_level(self):
"""Volume level of the media player (0..1)."""
return None | [
"def",
"volume_level",
"(",
"self",
")",
":",
"return",
"None"
] | [
371,
4
] | [
373,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.is_volume_muted | (self) | Boolean if volume is currently muted. | Boolean if volume is currently muted. | def is_volume_muted(self):
"""Boolean if volume is currently muted."""
return None | [
"def",
"is_volume_muted",
"(",
"self",
")",
":",
"return",
"None"
] | [
376,
4
] | [
378,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_content_id | (self) | Content ID of current playing media. | Content ID of current playing media. | def media_content_id(self):
"""Content ID of current playing media."""
return None | [
"def",
"media_content_id",
"(",
"self",
")",
":",
"return",
"None"
] | [
381,
4
] | [
383,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_content_type | (self) | Content type of current playing media. | Content type of current playing media. | def media_content_type(self):
"""Content type of current playing media."""
return None | [
"def",
"media_content_type",
"(",
"self",
")",
":",
"return",
"None"
] | [
386,
4
] | [
388,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_duration | (self) | Duration of current playing media in seconds. | Duration of current playing media in seconds. | def media_duration(self):
"""Duration of current playing media in seconds."""
return None | [
"def",
"media_duration",
"(",
"self",
")",
":",
"return",
"None"
] | [
391,
4
] | [
393,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_position | (self) | Position of current playing media in seconds. | Position of current playing media in seconds. | def media_position(self):
"""Position of current playing media in seconds."""
return None | [
"def",
"media_position",
"(",
"self",
")",
":",
"return",
"None"
] | [
396,
4
] | [
398,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_position_updated_at | (self) | When was the position of the current playing media valid.
Returns value from homeassistant.util.dt.utcnow().
| When was the position of the current playing media valid. | def media_position_updated_at(self):
"""When was the position of the current playing media valid.
Returns value from homeassistant.util.dt.utcnow().
"""
return None | [
"def",
"media_position_updated_at",
"(",
"self",
")",
":",
"return",
"None"
] | [
401,
4
] | [
406,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_image_url | (self) | Image url of current playing media. | Image url of current playing media. | def media_image_url(self):
"""Image url of current playing media."""
return None | [
"def",
"media_image_url",
"(",
"self",
")",
":",
"return",
"None"
] | [
409,
4
] | [
411,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_image_remotely_accessible | (self) | If the image url is remotely accessible. | If the image url is remotely accessible. | def media_image_remotely_accessible(self) -> bool:
"""If the image url is remotely accessible."""
return False | [
"def",
"media_image_remotely_accessible",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"False"
] | [
414,
4
] | [
416,
20
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_image_hash | (self) | Hash value for media image. | Hash value for media image. | def media_image_hash(self):
"""Hash value for media image."""
url = self.media_image_url
if url is not None:
return hashlib.sha256(url.encode("utf-8")).hexdigest()[:16]
return None | [
"def",
"media_image_hash",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"media_image_url",
"if",
"url",
"is",
"not",
"None",
":",
"return",
"hashlib",
".",
"sha256",
"(",
"url",
".",
"encode",
"(",
"\"utf-8\"",
")",
")",
".",
"hexdigest",
"(",
")",
... | [
419,
4
] | [
425,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_get_media_image | (self) | Fetch media image of current playing image. | Fetch media image of current playing image. | async def async_get_media_image(self):
"""Fetch media image of current playing image."""
url = self.media_image_url
if url is None:
return None, None
return await self._async_fetch_image_from_cache(url) | [
"async",
"def",
"async_get_media_image",
"(",
"self",
")",
":",
"url",
"=",
"self",
".",
"media_image_url",
"if",
"url",
"is",
"None",
":",
"return",
"None",
",",
"None",
"return",
"await",
"self",
".",
"_async_fetch_image_from_cache",
"(",
"url",
")"
] | [
427,
4
] | [
433,
60
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_get_browse_image | (
self,
media_content_type: str,
media_content_id: str,
media_image_id: Optional[str] = None,
) |
Optionally fetch internally accessible image for media browser.
Must be implemented by integration.
|
Optionally fetch internally accessible image for media browser. | async def async_get_browse_image(
self,
media_content_type: str,
media_content_id: str,
media_image_id: Optional[str] = None,
) -> Tuple[Optional[str], Optional[str]]:
"""
Optionally fetch internally accessible image for media browser.
Must be implemented by ... | [
"async",
"def",
"async_get_browse_image",
"(",
"self",
",",
"media_content_type",
":",
"str",
",",
"media_content_id",
":",
"str",
",",
"media_image_id",
":",
"Optional",
"[",
"str",
"]",
"=",
"None",
",",
")",
"->",
"Tuple",
"[",
"Optional",
"[",
"str",
"... | [
435,
4
] | [
446,
25
] | python | en | ['en', 'error', 'th'] | False |
MediaPlayerEntity.media_title | (self) | Title of current playing media. | Title of current playing media. | def media_title(self):
"""Title of current playing media."""
return None | [
"def",
"media_title",
"(",
"self",
")",
":",
"return",
"None"
] | [
449,
4
] | [
451,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_artist | (self) | Artist of current playing media, music track only. | Artist of current playing media, music track only. | def media_artist(self):
"""Artist of current playing media, music track only."""
return None | [
"def",
"media_artist",
"(",
"self",
")",
":",
"return",
"None"
] | [
454,
4
] | [
456,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_album_name | (self) | Album name of current playing media, music track only. | Album name of current playing media, music track only. | def media_album_name(self):
"""Album name of current playing media, music track only."""
return None | [
"def",
"media_album_name",
"(",
"self",
")",
":",
"return",
"None"
] | [
459,
4
] | [
461,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_album_artist | (self) | Album artist of current playing media, music track only. | Album artist of current playing media, music track only. | def media_album_artist(self):
"""Album artist of current playing media, music track only."""
return None | [
"def",
"media_album_artist",
"(",
"self",
")",
":",
"return",
"None"
] | [
464,
4
] | [
466,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_track | (self) | Track number of current playing media, music track only. | Track number of current playing media, music track only. | def media_track(self):
"""Track number of current playing media, music track only."""
return None | [
"def",
"media_track",
"(",
"self",
")",
":",
"return",
"None"
] | [
469,
4
] | [
471,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_series_title | (self) | Title of series of current playing media, TV show only. | Title of series of current playing media, TV show only. | def media_series_title(self):
"""Title of series of current playing media, TV show only."""
return None | [
"def",
"media_series_title",
"(",
"self",
")",
":",
"return",
"None"
] | [
474,
4
] | [
476,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_season | (self) | Season of current playing media, TV show only. | Season of current playing media, TV show only. | def media_season(self):
"""Season of current playing media, TV show only."""
return None | [
"def",
"media_season",
"(",
"self",
")",
":",
"return",
"None"
] | [
479,
4
] | [
481,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_episode | (self) | Episode of current playing media, TV show only. | Episode of current playing media, TV show only. | def media_episode(self):
"""Episode of current playing media, TV show only."""
return None | [
"def",
"media_episode",
"(",
"self",
")",
":",
"return",
"None"
] | [
484,
4
] | [
486,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_channel | (self) | Channel currently playing. | Channel currently playing. | def media_channel(self):
"""Channel currently playing."""
return None | [
"def",
"media_channel",
"(",
"self",
")",
":",
"return",
"None"
] | [
489,
4
] | [
491,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_playlist | (self) | Title of Playlist currently playing. | Title of Playlist currently playing. | def media_playlist(self):
"""Title of Playlist currently playing."""
return None | [
"def",
"media_playlist",
"(",
"self",
")",
":",
"return",
"None"
] | [
494,
4
] | [
496,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.app_id | (self) | ID of the current running app. | ID of the current running app. | def app_id(self):
"""ID of the current running app."""
return None | [
"def",
"app_id",
"(",
"self",
")",
":",
"return",
"None"
] | [
499,
4
] | [
501,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.app_name | (self) | Name of the current running app. | Name of the current running app. | def app_name(self):
"""Name of the current running app."""
return None | [
"def",
"app_name",
"(",
"self",
")",
":",
"return",
"None"
] | [
504,
4
] | [
506,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.source | (self) | Name of the current input source. | Name of the current input source. | def source(self):
"""Name of the current input source."""
return None | [
"def",
"source",
"(",
"self",
")",
":",
"return",
"None"
] | [
509,
4
] | [
511,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.source_list | (self) | List of available input sources. | List of available input sources. | def source_list(self):
"""List of available input sources."""
return None | [
"def",
"source_list",
"(",
"self",
")",
":",
"return",
"None"
] | [
514,
4
] | [
516,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.sound_mode | (self) | Name of the current sound mode. | Name of the current sound mode. | def sound_mode(self):
"""Name of the current sound mode."""
return None | [
"def",
"sound_mode",
"(",
"self",
")",
":",
"return",
"None"
] | [
519,
4
] | [
521,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.sound_mode_list | (self) | List of available sound modes. | List of available sound modes. | def sound_mode_list(self):
"""List of available sound modes."""
return None | [
"def",
"sound_mode_list",
"(",
"self",
")",
":",
"return",
"None"
] | [
524,
4
] | [
526,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.shuffle | (self) | Boolean if shuffle is enabled. | Boolean if shuffle is enabled. | def shuffle(self):
"""Boolean if shuffle is enabled."""
return None | [
"def",
"shuffle",
"(",
"self",
")",
":",
"return",
"None"
] | [
529,
4
] | [
531,
19
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.repeat | (self) | Return current repeat mode. | Return current repeat mode. | def repeat(self):
"""Return current repeat mode."""
return None | [
"def",
"repeat",
"(",
"self",
")",
":",
"return",
"None"
] | [
534,
4
] | [
536,
19
] | python | en | ['en', 'la', 'en'] | True |
MediaPlayerEntity.supported_features | (self) | Flag media player features that are supported. | Flag media player features that are supported. | def supported_features(self):
"""Flag media player features that are supported."""
return 0 | [
"def",
"supported_features",
"(",
"self",
")",
":",
"return",
"0"
] | [
539,
4
] | [
541,
16
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.turn_on | (self) | Turn the media player on. | Turn the media player on. | def turn_on(self):
"""Turn the media player on."""
raise NotImplementedError() | [
"def",
"turn_on",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
543,
4
] | [
545,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_turn_on | (self) | Turn the media player on. | Turn the media player on. | async def async_turn_on(self):
"""Turn the media player on."""
await self.hass.async_add_executor_job(self.turn_on) | [
"async",
"def",
"async_turn_on",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"turn_on",
")"
] | [
547,
4
] | [
549,
60
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.turn_off | (self) | Turn the media player off. | Turn the media player off. | def turn_off(self):
"""Turn the media player off."""
raise NotImplementedError() | [
"def",
"turn_off",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
551,
4
] | [
553,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_turn_off | (self) | Turn the media player off. | Turn the media player off. | async def async_turn_off(self):
"""Turn the media player off."""
await self.hass.async_add_executor_job(self.turn_off) | [
"async",
"def",
"async_turn_off",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"turn_off",
")"
] | [
555,
4
] | [
557,
61
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.mute_volume | (self, mute) | Mute the volume. | Mute the volume. | def mute_volume(self, mute):
"""Mute the volume."""
raise NotImplementedError() | [
"def",
"mute_volume",
"(",
"self",
",",
"mute",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
559,
4
] | [
561,
35
] | python | en | ['en', 'sn', 'en'] | True |
MediaPlayerEntity.async_mute_volume | (self, mute) | Mute the volume. | Mute the volume. | async def async_mute_volume(self, mute):
"""Mute the volume."""
await self.hass.async_add_executor_job(self.mute_volume, mute) | [
"async",
"def",
"async_mute_volume",
"(",
"self",
",",
"mute",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"mute_volume",
",",
"mute",
")"
] | [
563,
4
] | [
565,
70
] | python | en | ['en', 'sn', 'en'] | True |
MediaPlayerEntity.set_volume_level | (self, volume) | Set volume level, range 0..1. | Set volume level, range 0..1. | def set_volume_level(self, volume):
"""Set volume level, range 0..1."""
raise NotImplementedError() | [
"def",
"set_volume_level",
"(",
"self",
",",
"volume",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
567,
4
] | [
569,
35
] | python | en | ['fr', 'zu', 'en'] | False |
MediaPlayerEntity.async_set_volume_level | (self, volume) | Set volume level, range 0..1. | Set volume level, range 0..1. | async def async_set_volume_level(self, volume):
"""Set volume level, range 0..1."""
await self.hass.async_add_executor_job(self.set_volume_level, volume) | [
"async",
"def",
"async_set_volume_level",
"(",
"self",
",",
"volume",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"set_volume_level",
",",
"volume",
")"
] | [
571,
4
] | [
573,
77
] | python | en | ['fr', 'zu', 'en'] | False |
MediaPlayerEntity.media_play | (self) | Send play command. | Send play command. | def media_play(self):
"""Send play command."""
raise NotImplementedError() | [
"def",
"media_play",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
575,
4
] | [
577,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_media_play | (self) | Send play command. | Send play command. | async def async_media_play(self):
"""Send play command."""
await self.hass.async_add_executor_job(self.media_play) | [
"async",
"def",
"async_media_play",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_play",
")"
] | [
579,
4
] | [
581,
63
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_pause | (self) | Send pause command. | Send pause command. | def media_pause(self):
"""Send pause command."""
raise NotImplementedError() | [
"def",
"media_pause",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
583,
4
] | [
585,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_media_pause | (self) | Send pause command. | Send pause command. | async def async_media_pause(self):
"""Send pause command."""
await self.hass.async_add_executor_job(self.media_pause) | [
"async",
"def",
"async_media_pause",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_pause",
")"
] | [
587,
4
] | [
589,
64
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_stop | (self) | Send stop command. | Send stop command. | def media_stop(self):
"""Send stop command."""
raise NotImplementedError() | [
"def",
"media_stop",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
591,
4
] | [
593,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_media_stop | (self) | Send stop command. | Send stop command. | async def async_media_stop(self):
"""Send stop command."""
await self.hass.async_add_executor_job(self.media_stop) | [
"async",
"def",
"async_media_stop",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_stop",
")"
] | [
595,
4
] | [
597,
63
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.media_previous_track | (self) | Send previous track command. | Send previous track command. | def media_previous_track(self):
"""Send previous track command."""
raise NotImplementedError() | [
"def",
"media_previous_track",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
599,
4
] | [
601,
35
] | python | en | ['en', 'it', 'en'] | True |
MediaPlayerEntity.async_media_previous_track | (self) | Send previous track command. | Send previous track command. | async def async_media_previous_track(self):
"""Send previous track command."""
await self.hass.async_add_executor_job(self.media_previous_track) | [
"async",
"def",
"async_media_previous_track",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_previous_track",
")"
] | [
603,
4
] | [
605,
73
] | python | en | ['en', 'it', 'en'] | True |
MediaPlayerEntity.media_next_track | (self) | Send next track command. | Send next track command. | def media_next_track(self):
"""Send next track command."""
raise NotImplementedError() | [
"def",
"media_next_track",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
607,
4
] | [
609,
35
] | python | en | ['en', 'pt', 'en'] | True |
MediaPlayerEntity.async_media_next_track | (self) | Send next track command. | Send next track command. | async def async_media_next_track(self):
"""Send next track command."""
await self.hass.async_add_executor_job(self.media_next_track) | [
"async",
"def",
"async_media_next_track",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_next_track",
")"
] | [
611,
4
] | [
613,
69
] | python | en | ['en', 'pt', 'en'] | True |
MediaPlayerEntity.media_seek | (self, position) | Send seek command. | Send seek command. | def media_seek(self, position):
"""Send seek command."""
raise NotImplementedError() | [
"def",
"media_seek",
"(",
"self",
",",
"position",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
615,
4
] | [
617,
35
] | python | en | ['en', 'ig', 'en'] | True |
MediaPlayerEntity.async_media_seek | (self, position) | Send seek command. | Send seek command. | async def async_media_seek(self, position):
"""Send seek command."""
await self.hass.async_add_executor_job(self.media_seek, position) | [
"async",
"def",
"async_media_seek",
"(",
"self",
",",
"position",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"media_seek",
",",
"position",
")"
] | [
619,
4
] | [
621,
73
] | python | en | ['en', 'ig', 'en'] | True |
MediaPlayerEntity.play_media | (self, media_type, media_id, **kwargs) | Play a piece of media. | Play a piece of media. | def play_media(self, media_type, media_id, **kwargs):
"""Play a piece of media."""
raise NotImplementedError() | [
"def",
"play_media",
"(",
"self",
",",
"media_type",
",",
"media_id",
",",
"*",
"*",
"kwargs",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
623,
4
] | [
625,
35
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.async_play_media | (self, media_type, media_id, **kwargs) | Play a piece of media. | Play a piece of media. | async def async_play_media(self, media_type, media_id, **kwargs):
"""Play a piece of media."""
await self.hass.async_add_executor_job(
ft.partial(self.play_media, media_type, media_id, **kwargs)
) | [
"async",
"def",
"async_play_media",
"(",
"self",
",",
"media_type",
",",
"media_id",
",",
"*",
"*",
"kwargs",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"ft",
".",
"partial",
"(",
"self",
".",
"play_media",
",",
"media_type... | [
627,
4
] | [
631,
9
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.select_source | (self, source) | Select input source. | Select input source. | def select_source(self, source):
"""Select input source."""
raise NotImplementedError() | [
"def",
"select_source",
"(",
"self",
",",
"source",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
633,
4
] | [
635,
35
] | python | en | ['fr', 'su', 'en'] | False |
MediaPlayerEntity.async_select_source | (self, source) | Select input source. | Select input source. | async def async_select_source(self, source):
"""Select input source."""
await self.hass.async_add_executor_job(self.select_source, source) | [
"async",
"def",
"async_select_source",
"(",
"self",
",",
"source",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"select_source",
",",
"source",
")"
] | [
637,
4
] | [
639,
74
] | python | en | ['fr', 'su', 'en'] | False |
MediaPlayerEntity.select_sound_mode | (self, sound_mode) | Select sound mode. | Select sound mode. | def select_sound_mode(self, sound_mode):
"""Select sound mode."""
raise NotImplementedError() | [
"def",
"select_sound_mode",
"(",
"self",
",",
"sound_mode",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
641,
4
] | [
643,
35
] | python | en | ['en', 'mk', 'en'] | True |
MediaPlayerEntity.async_select_sound_mode | (self, sound_mode) | Select sound mode. | Select sound mode. | async def async_select_sound_mode(self, sound_mode):
"""Select sound mode."""
await self.hass.async_add_executor_job(self.select_sound_mode, sound_mode) | [
"async",
"def",
"async_select_sound_mode",
"(",
"self",
",",
"sound_mode",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"select_sound_mode",
",",
"sound_mode",
")"
] | [
645,
4
] | [
647,
82
] | python | en | ['en', 'mk', 'en'] | True |
MediaPlayerEntity.clear_playlist | (self) | Clear players playlist. | Clear players playlist. | def clear_playlist(self):
"""Clear players playlist."""
raise NotImplementedError() | [
"def",
"clear_playlist",
"(",
"self",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
649,
4
] | [
651,
35
] | python | en | ['fr', 'en', 'en'] | True |
MediaPlayerEntity.async_clear_playlist | (self) | Clear players playlist. | Clear players playlist. | async def async_clear_playlist(self):
"""Clear players playlist."""
await self.hass.async_add_executor_job(self.clear_playlist) | [
"async",
"def",
"async_clear_playlist",
"(",
"self",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"clear_playlist",
")"
] | [
653,
4
] | [
655,
67
] | python | en | ['fr', 'en', 'en'] | True |
MediaPlayerEntity.set_shuffle | (self, shuffle) | Enable/disable shuffle mode. | Enable/disable shuffle mode. | def set_shuffle(self, shuffle):
"""Enable/disable shuffle mode."""
raise NotImplementedError() | [
"def",
"set_shuffle",
"(",
"self",
",",
"shuffle",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
657,
4
] | [
659,
35
] | python | en | ['en', 'st', 'en'] | True |
MediaPlayerEntity.async_set_shuffle | (self, shuffle) | Enable/disable shuffle mode. | Enable/disable shuffle mode. | async def async_set_shuffle(self, shuffle):
"""Enable/disable shuffle mode."""
await self.hass.async_add_executor_job(self.set_shuffle, shuffle) | [
"async",
"def",
"async_set_shuffle",
"(",
"self",
",",
"shuffle",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"set_shuffle",
",",
"shuffle",
")"
] | [
661,
4
] | [
663,
73
] | python | en | ['en', 'st', 'en'] | True |
MediaPlayerEntity.set_repeat | (self, repeat) | Set repeat mode. | Set repeat mode. | def set_repeat(self, repeat):
"""Set repeat mode."""
raise NotImplementedError() | [
"def",
"set_repeat",
"(",
"self",
",",
"repeat",
")",
":",
"raise",
"NotImplementedError",
"(",
")"
] | [
665,
4
] | [
667,
35
] | python | en | ['en', 'id', 'en'] | True |
MediaPlayerEntity.async_set_repeat | (self, repeat) | Set repeat mode. | Set repeat mode. | async def async_set_repeat(self, repeat):
"""Set repeat mode."""
await self.hass.async_add_executor_job(self.set_repeat, repeat) | [
"async",
"def",
"async_set_repeat",
"(",
"self",
",",
"repeat",
")",
":",
"await",
"self",
".",
"hass",
".",
"async_add_executor_job",
"(",
"self",
".",
"set_repeat",
",",
"repeat",
")"
] | [
669,
4
] | [
671,
71
] | python | en | ['en', 'id', 'en'] | True |
MediaPlayerEntity.support_play | (self) | Boolean if play is supported. | Boolean if play is supported. | def support_play(self):
"""Boolean if play is supported."""
return bool(self.supported_features & SUPPORT_PLAY) | [
"def",
"support_play",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"supported_features",
"&",
"SUPPORT_PLAY",
")"
] | [
675,
4
] | [
677,
59
] | python | en | ['en', 'en', 'en'] | True |
MediaPlayerEntity.support_pause | (self) | Boolean if pause is supported. | Boolean if pause is supported. | def support_pause(self):
"""Boolean if pause is supported."""
return bool(self.supported_features & SUPPORT_PAUSE) | [
"def",
"support_pause",
"(",
"self",
")",
":",
"return",
"bool",
"(",
"self",
".",
"supported_features",
"&",
"SUPPORT_PAUSE",
")"
] | [
680,
4
] | [
682,
60
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.