sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_config_flow.py | """Test the Home Assistant Connect ZBT-2 config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock, call, patch
import pytest
from homeassistant.components.homeassistant_connect_zbt2.const import DOMAIN
from homeassistant.components.homeassistant_hardware import (
DOMAIN as ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 483,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_hardware.py | """Test the Home Assistant Connect ZBT-2 hardware platform."""
from homeassistant.components.homeassistant_connect_zbt2.const import DOMAIN
from homeassistant.components.usb import DOMAIN as USB_DOMAIN
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import HomeAssistant
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_hardware.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_init.py | """Test the Home Assistant Connect ZBT-2 integration."""
from datetime import timedelta
from unittest.mock import patch
import pytest
from homeassistant.components.homeassistant_connect_zbt2.const import DOMAIN
from homeassistant.components.usb import DOMAIN as USB_DOMAIN, USBDevice
from homeassistant.config_entries... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_init.py",
"license": "Apache License 2.0",
"lines": 109,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_update.py | """Test Connect ZBT-2 firmware update entity."""
import pytest
from homeassistant.components.homeassistant_hardware.helpers import (
async_notify_firmware_info,
)
from homeassistant.components.homeassistant_hardware.util import (
ApplicationType,
FirmwareInfo,
)
from homeassistant.core import HomeAssistan... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_update.py",
"license": "Apache License 2.0",
"lines": 113,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/homeassistant_connect_zbt2/test_util.py | """Test Connect ZBT-2 utilities."""
from homeassistant.components.homeassistant_connect_zbt2.const import DOMAIN
from homeassistant.components.homeassistant_connect_zbt2.util import (
get_usb_service_info,
)
from homeassistant.helpers.service_info.usb import UsbServiceInfo
from tests.common import MockConfigEntry... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/homeassistant_connect_zbt2/test_util.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/imeon_inverter/test_select.py | """Test the Imeon Inverter selects."""
from unittest.mock import MagicMock, patch
from freezegun.api import FrozenDateTimeFactory
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_OPTION,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/imeon_inverter/test_select.py",
"license": "Apache License 2.0",
"lines": 43,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/irm_kmi/test_config_flow.py | """Tests for the IRM KMI config flow."""
from unittest.mock import MagicMock
from homeassistant.components.irm_kmi.const import CONF_LANGUAGE_OVERRIDE, DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import (
ATTR_LATITUDE,
ATTR_LONGITUDE,
CONF_LOCATION,
CONF_UNIQU... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/irm_kmi/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 123,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/irm_kmi/test_init.py | """Tests for the IRM KMI integration."""
from unittest.mock import AsyncMock
from homeassistant.components.irm_kmi.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_load_unload_config_en... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/irm_kmi/test_init.py",
"license": "Apache License 2.0",
"lines": 31,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/irm_kmi/test_weather.py | """Test for the weather entity of the IRM KMI integration."""
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.weather import (
DOMAIN as WEATHER_DOMAIN,
SERVICE_GET_FORECASTS,
)
from homeassistant.const import ATTR_ENTITY_ID
from ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/irm_kmi/test_weather.py",
"license": "Apache License 2.0",
"lines": 84,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lawn_mower/test_intent.py | """The tests for the lawn mower platform."""
from homeassistant.components.lawn_mower import (
DOMAIN,
SERVICE_DOCK,
SERVICE_START_MOWING,
LawnMowerActivity,
LawnMowerEntityFeature,
intent as lawn_mower_intent,
)
from homeassistant.const import ATTR_SUPPORTED_FEATURES
from homeassistant.core im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lawn_mower/test_intent.py",
"license": "Apache License 2.0",
"lines": 99,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/letpot/test_number.py | """Test number entities for the LetPot integration."""
from unittest.mock import MagicMock, patch
from letpot.exceptions import LetPotConnectionException, LetPotException
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DO... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/letpot/test_number.py",
"license": "Apache License 2.0",
"lines": 83,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/libre_hardware_monitor/test_config_flow.py | """Test the LibreHardwareMonitor config flow."""
from unittest.mock import AsyncMock
from librehardwaremonitor_api import (
LibreHardwareMonitorConnectionError,
LibreHardwareMonitorNoDevicesError,
LibreHardwareMonitorUnauthorizedError,
)
import pytest
from homeassistant.components.libre_hardware_monitor.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/libre_hardware_monitor/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 202,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/libre_hardware_monitor/test_sensor.py | """Test the LibreHardwareMonitor sensor."""
from dataclasses import replace
from datetime import timedelta
import logging
from types import MappingProxyType
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
from librehardwaremonitor_api import (
LibreHardwareMonitorConnectionErro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/libre_hardware_monitor/test_sensor.py",
"license": "Apache License 2.0",
"lines": 298,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/media_source/test_helper.py | """Test media source helpers."""
from unittest.mock import Mock, patch
import pytest
from homeassistant.components import media_source
from homeassistant.components.media_player import BrowseError
from homeassistant.components.media_source import const, models
from homeassistant.core import HomeAssistant
from homeas... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/media_source/test_helper.py",
"license": "Apache License 2.0",
"lines": 103,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/media_source/test_http.py | """Test media source HTTP."""
from unittest.mock import patch
import pytest
import yarl
from homeassistant.components import media_source
from homeassistant.components.media_player import BrowseError, MediaClass
from homeassistant.components.media_source import const
from homeassistant.core import HomeAssistant
from... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/media_source/test_http.py",
"license": "Apache License 2.0",
"lines": 102,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nederlandse_spoorwegen/const.py | """Constants for the Nederlandse Spoorwegen integration tests."""
API_KEY = "abc1234567"
# Date/time format strings
DATETIME_FORMAT_LENGTH = 16 # "DD-MM-YYYY HH:MM" format
DATE_SEPARATOR = "-"
DATETIME_SPACE = " "
TIME_SEPARATOR = ":"
# Test route names
TEST_ROUTE_TITLE_1 = "Route 1"
TEST_ROUTE_TITLE_2 = "Route 2"
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nederlandse_spoorwegen/const.py",
"license": "Apache License 2.0",
"lines": 12,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nederlandse_spoorwegen/test_config_flow.py | """Test config flow for Nederlandse Spoorwegen integration."""
from datetime import time
from typing import Any
from unittest.mock import AsyncMock
import pytest
from requests import ConnectionError as RequestsConnectionError, HTTPError, Timeout
from homeassistant.components.nederlandse_spoorwegen.const import (
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nederlandse_spoorwegen/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 390,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nederlandse_spoorwegen/test_sensor.py | """Test the Nederlandse Spoorwegen sensor."""
from collections.abc import Generator
from datetime import date, datetime
from unittest.mock import AsyncMock, patch
import zoneinfo
import pytest
from requests.exceptions import ConnectionError as RequestsConnectionError
from syrupy.assertion import SnapshotAssertion
fr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nederlandse_spoorwegen/test_sensor.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ntfy/test_event.py | """Tests for the ntfy event platform."""
import asyncio
from collections.abc import AsyncGenerator
from datetime import UTC, datetime, timedelta
from unittest.mock import AsyncMock, patch
from aiontfy import Event
from aiontfy.exceptions import (
NtfyConnectionError,
NtfyForbiddenError,
NtfyHTTPError,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ntfy/test_event.py",
"license": "Apache License 2.0",
"lines": 178,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ntfy/test_services.py | """Tests for the ntfy notify platform."""
from typing import Any
from aiontfy import BroadcastAction, HttpAction, Message, ViewAction
from aiontfy.exceptions import (
NtfyException,
NtfyHTTPError,
NtfyUnauthorizedAuthenticationError,
)
import pytest
import voluptuous as vol
from yarl import URL
from home... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ntfy/test_services.py",
"license": "Apache License 2.0",
"lines": 501,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/portainer/test_binary_sensor.py | """Tests for the Portainer binary sensor platform."""
from unittest.mock import AsyncMock, patch
from freezegun.api import FrozenDateTimeFactory
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
PortainerTimeoutError,
)
import pytest
from syrupy.assertion import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 85,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/portainer/test_config_flow.py | """Test the Portainer config flow."""
from unittest.mock import AsyncMock, MagicMock
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
PortainerTimeoutError,
)
import pytest
from homeassistant.components.portainer.const import DOMAIN
from homeassistant.config_en... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 284,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/portainer/test_init.py | """Test the Portainer initial specific behavior."""
from unittest.mock import AsyncMock
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionError,
PortainerTimeoutError,
)
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.portaine... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/portainer/test_init.py",
"license": "Apache License 2.0",
"lines": 157,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/prowl/test_notify.py | """Test the Prowl notifications."""
from typing import Any
from unittest.mock import AsyncMock
import prowlpy
import pytest
from homeassistant.components import notify
from homeassistant.components.prowl.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssista... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prowl/test_notify.py",
"license": "Apache License 2.0",
"lines": 196,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/pushover/test_notify.py | """Test the pushover notify platform."""
from unittest.mock import MagicMock, patch
import pytest
from homeassistant.components.pushover import DOMAIN
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
@pytest.fixture(autouse=False)
def mock_pushover():
"""Mock pushover."""
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/pushover/test_notify.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/radio_browser/test_media_source.py | """Tests for radio_browser media_source."""
from unittest.mock import AsyncMock
import pytest
from radios import FilterBy, Order
from homeassistant.components import media_source
from homeassistant.components.radio_browser.media_source import async_get_media_source
from homeassistant.core import HomeAssistant
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/radio_browser/test_media_source.py",
"license": "Apache License 2.0",
"lines": 55,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/route_b_smart_meter/test_config_flow.py | """Test the Smart Meter B-route config flow."""
from collections.abc import Generator
from unittest.mock import AsyncMock, Mock, patch
from momonga import MomongaSkJoinFailure, MomongaSkScanFailure
import pytest
from serial.tools.list_ports_linux import SysFS
from homeassistant.components.route_b_smart_meter.const i... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/route_b_smart_meter/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/route_b_smart_meter/test_init.py | """Tests for the Smart Meter B Route integration init."""
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_async_setup_entry_success(
hass: HomeAssistant, mock_momonga, mock_config_entry: MockConfigEntr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/route_b_smart_meter/test_init.py",
"license": "Apache License 2.0",
"lines": 14,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/route_b_smart_meter/test_sensor.py | """Tests for the Smart Meter B-Route sensor."""
from unittest.mock import Mock
from freezegun.api import FrozenDateTimeFactory
from momonga import MomongaError
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.route_b_smart_meter.const import DEFAULT_SCAN_INTERVAL
from homeassistant.const ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/route_b_smart_meter/test_sensor.py",
"license": "Apache License 2.0",
"lines": 43,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/satel_integra/test_config_flow.py | """Test the satel integra config flow."""
from typing import Any
from unittest.mock import AsyncMock, MagicMock
import pytest
from homeassistant.components.binary_sensor import BinarySensorDeviceClass
from homeassistant.components.satel_integra.const import (
CONF_ARM_HOME_MODE,
CONF_DEVICE_PARTITIONS,
C... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/satel_integra/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 346,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/satel_integra/test_diagnostics.py | """Tests for satel integra diagnostics."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from syrupy.filters import props
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnostics impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/satel_integra/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sftp_storage/asyncssh_mock.py | """Mock classes for asyncssh module."""
from __future__ import annotations
import json
from typing import Self
from unittest.mock import AsyncMock
from asyncssh.misc import async_context_manager
class SSHClientConnectionMock:
"""Class that mocks SSH Client connection."""
def __init__(self, *args, **kwargs... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sftp_storage/asyncssh_mock.py",
"license": "Apache License 2.0",
"lines": 104,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sftp_storage/test_backup.py | """Test the Backup SFTP Location platform."""
from io import StringIO
import json
from typing import Any
from unittest.mock import MagicMock, patch
from asyncssh.sftp import SFTPError
import pytest
from homeassistant.components.sftp_storage.backup import (
async_register_backup_agents_listener,
)
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sftp_storage/test_backup.py",
"license": "Apache License 2.0",
"lines": 347,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sftp_storage/test_config_flow.py | """Tests config_flow."""
from collections.abc import Awaitable, Callable
from pathlib import Path
from tempfile import NamedTemporaryFile
from unittest.mock import patch
from asyncssh import KeyImportError, generate_private_key
from asyncssh.misc import PermissionDenied
from asyncssh.sftp import SFTPNoSuchFile, SFTPP... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sftp_storage/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 183,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sftp_storage/test_init.py | """Tests for SFTP Storage."""
from pathlib import Path
from unittest.mock import patch
from asyncssh.sftp import SFTPPermissionDenied
import pytest
from homeassistant.components.sftp_storage import SFTPConfigEntryData
from homeassistant.components.sftp_storage.const import DOMAIN
from homeassistant.config_entries im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sftp_storage/test_init.py",
"license": "Apache License 2.0",
"lines": 162,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot_cloud/test_climate.py | """Test for the switchbot_cloud climate."""
from unittest.mock import patch
from switchbot_api import Device, Remote, SmartRadiatorThermostatCommands, SwitchBotAPI
from homeassistant.components.climate import (
ATTR_FAN_MODE,
ATTR_HVAC_MODE,
ATTR_TEMPERATURE,
DOMAIN as CLIMATE_DOMAIN,
SERVICE_SET... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_climate.py",
"license": "Apache License 2.0",
"lines": 400,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switchbot_cloud/test_humidifier.py | """Test for the switchbot_cloud humidifiers."""
from unittest.mock import patch
import pytest
import switchbot_api
from switchbot_api import Device
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.humidifier import DOMAIN as HUMIDIFIER_DOMAIN
from homeassistant.components.switchbot_cloud ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switchbot_cloud/test_humidifier.py",
"license": "Apache License 2.0",
"lines": 201,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/tasmota/test_camera.py | """The tests for the Tasmota camera platform."""
from asyncio import Future
import copy
import json
from unittest.mock import patch
import pytest
from homeassistant.components.camera import CameraState
from homeassistant.components.tasmota.const import DEFAULT_PREFIX
from homeassistant.const import ATTR_ASSUMED_STAT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/tasmota/test_camera.py",
"license": "Apache License 2.0",
"lines": 255,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/togrill/test_select.py | """Test select for ToGrill integration."""
from unittest.mock import Mock
import pytest
from syrupy.assertion import SnapshotAssertion
from togrill_bluetooth.packets import (
GrillType,
PacketA0Notify,
PacketA8Notify,
PacketA303Write,
Taste,
)
from homeassistant.components.select import (
ATT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/togrill/test_select.py",
"license": "Apache License 2.0",
"lines": 154,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/usage_prediction/test_common_control.py | """Test the common control usage prediction."""
from __future__ import annotations
from unittest.mock import patch
import uuid
from freezegun import freeze_time
import pytest
from homeassistant.components.usage_prediction.common_control import (
async_predict_common_control,
time_category,
)
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/usage_prediction/test_common_control.py",
"license": "Apache License 2.0",
"lines": 348,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/usage_prediction/test_init.py | """Test usage_prediction integration."""
import asyncio
from unittest.mock import patch
import pytest
from homeassistant.components.usage_prediction import get_cached_common_control
from homeassistant.components.usage_prediction.models import EntityUsagePredictions
from homeassistant.core import HomeAssistant
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/usage_prediction/test_init.py",
"license": "Apache License 2.0",
"lines": 51,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/usage_prediction/test_websocket.py | """Test usage_prediction WebSocket API."""
from collections.abc import Generator
from copy import deepcopy
from datetime import datetime, timedelta
from unittest.mock import Mock, patch
from freezegun import freeze_time
import pytest
from homeassistant.components.usage_prediction.models import EntityUsagePredictions... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/usage_prediction/test_websocket.py",
"license": "Apache License 2.0",
"lines": 93,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vesync/test_binary_sensor.py | """Tests for the binary sensor module."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from .co... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vesync/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 40,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/victron_remote_monitoring/test_config_flow.py | """Test the Victron VRM Solar Forecast config flow."""
from unittest.mock import AsyncMock, Mock
import pytest
from victron_vrm.exceptions import AuthenticationError, VictronVRMError
from homeassistant.components.victron_remote_monitoring.config_flow import SiteNotFound
from homeassistant.components.victron_remote_m... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_remote_monitoring/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 291,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/victron_remote_monitoring/test_init.py | """Tests for Victron Remote Monitoring integration setup and auth handling."""
from __future__ import annotations
import pytest
from victron_vrm.exceptions import AuthenticationError, VictronVRMError
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState
from homeassistant.core import HomeAssistant... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_remote_monitoring/test_init.py",
"license": "Apache License 2.0",
"lines": 42,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/victron_remote_monitoring/test_sensor.py | """Tests for the VRM Forecasts sensors.
Consolidates most per-sensor assertions into snapshot-based regression tests.
"""
from __future__ import annotations
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_remote_monitoring/test_sensor.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/volvooncall/test_init.py | """Test the Volvo On Call integration setup."""
from homeassistant.components.volvooncall.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from tests.common import MockConfigEntry
async d... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/volvooncall/test_init.py",
"license": "Apache License 2.0",
"lines": 59,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/wled/test_analytics.py | """Tests for analytics platform."""
from homeassistant.components.analytics import async_devices_payload
from homeassistant.components.wled import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from homeassistant.setup import async_setup_component
from test... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/wled/test_analytics.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/workday/test_calendar.py | """Tests for calendar platform of Workday integration."""
from datetime import datetime, timedelta
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.calendar import (
DOMAIN as CALENDAR_DOMAIN,
EVENT_END_DATETIME,
EVENT_START_DATETIME,
EVENT_SUMMARY,
SERV... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/workday/test_calendar.py",
"license": "Apache License 2.0",
"lines": 76,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/hassfest/test_conditions.py | """Tests for hassfest conditions."""
import io
import json
from pathlib import Path
from unittest.mock import patch
import pytest
from homeassistant.util.yaml.loader import parse_yaml
from script.hassfest import conditions
from script.hassfest.model import Config
from . import get_integration
CONDITION_DESCRIPTION... | {
"repo_id": "home-assistant/core",
"file_path": "tests/hassfest/test_conditions.py",
"license": "Apache License 2.0",
"lines": 140,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/hassfest/test_triggers.py | """Tests for hassfest triggers."""
import io
import json
from pathlib import Path
from unittest.mock import patch
import pytest
from homeassistant.util.yaml.loader import parse_yaml
from script.hassfest import triggers
from script.hassfest.model import Config
from . import get_integration
TRIGGER_DESCRIPTION_FILEN... | {
"repo_id": "home-assistant/core",
"file_path": "tests/hassfest/test_triggers.py",
"license": "Apache License 2.0",
"lines": 134,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_base64.py | """Test base64 encoding and decoding functions for Home Assistant templates."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
@pytest.mark.parametrize(
("value_template", "expected"),
[
('{{ "homeassi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_base64.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_collection.py | """Test collection extension."""
from __future__ import annotations
from typing import Any
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from tests.helpers.template.helpers import render
@pytest.mark.parametrize(
("value", "expected"),
[
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_collection.py",
"license": "Apache License 2.0",
"lines": 241,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_crypto.py | """Test cryptographic hash functions for Home Assistant templates."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
def test_md5(hass: HomeAssistant) -> None:
"""Test the md5 function and filter."""
ha_md5 = "3d15e5c102c341... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_crypto.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_math.py | """Test mathematical and statistical functions for Home Assistant templates."""
from __future__ import annotations
import math
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.template.extensions import MathExtension
from tests... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_math.py",
"license": "Apache License 2.0",
"lines": 438,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_regex.py | """Test regex template extension."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from tests.helpers.template.helpers import render
def test_regex_match(hass: HomeAssistant) -> None:
"""Test regex_match method.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_regex.py",
"license": "Apache License 2.0",
"lines": 118,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_string.py | """Test string template extension."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from tests.helpers.template.helpers import render
def test_ordinal(hass: HomeAssistant) -> None:
"""Test the ordinal filter."""
tests = [
(1, "1st"),
(2, "2nd"),
(3,... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_string.py",
"license": "Apache License 2.0",
"lines": 101,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/test_context.py | """Test template context management for Home Assistant."""
from __future__ import annotations
import jinja2
from homeassistant.helpers.template.context import (
TemplateContextManager,
render_with_context,
template_context_manager,
template_cv,
)
def test_template_context_manager() -> None:
"""... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/test_context.py",
"license": "Apache License 2.0",
"lines": 65,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/test_helpers.py | """Test template helper functions."""
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
)
from homeassistant.helpers.template.helpers import raise_no_default, resolve_area_id
from tests.common ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/test_helpers.py",
"license": "Apache License 2.0",
"lines": 85,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/test_render_info.py | """Test template render information tracking for Home Assistant."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import TemplateError
from homeassistant.helpers import template
from homeassistant.helpers.template.render_info import (
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/test_render_info.py",
"license": "Apache License 2.0",
"lines": 145,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/test_service_info.py | """Test service_info helpers."""
import pytest
from homeassistant.helpers.service_info.dhcp import DhcpServiceInfo
from homeassistant.helpers.service_info.esphome import ESPHomeServiceInfo
# Ensure that incorrectly formatted mac addresses are rejected, even
# on a constant outside of a test
try:
_ = DhcpServiceI... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/test_service_info.py",
"license": "Apache License 2.0",
"lines": 30,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vegehub/test_switch.py | """Unit tests for the VegeHub integration's switch.py."""
from unittest.mock import patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from . import init_integration
from .... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vegehub/test_switch.py",
"license": "Apache License 2.0",
"lines": 87,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/roomba/test_sensor.py | """Tests for IRobotEntity usage in Roomba sensor platform."""
from unittest.mock import AsyncMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from tes... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/roomba/test_sensor.py",
"license": "Apache License 2.0",
"lines": 22,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/snoo/test_button.py | """Test Snoo Buttons."""
from unittest.mock import AsyncMock, patch
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistan... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/snoo/test_button.py",
"license": "Apache License 2.0",
"lines": 29,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/util/test_async_iterator.py | """Tests for async iterator utility functions."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncIterator
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.util.async_iterator import (
Abort,
AsyncIteratorReader,
AsyncIteratorWriter,
)
de... | {
"repo_id": "home-assistant/core",
"file_path": "tests/util/test_async_iterator.py",
"license": "Apache License 2.0",
"lines": 93,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/velux/test_cover.py | """Tests for the Velux cover platform."""
from unittest.mock import AsyncMock
import pytest
from pyvlx.exception import PyVLXException
from pyvlx.opening_device import (
Awning,
DualRollerShutter,
GarageDoor,
Gate,
RollerShutter,
Window,
)
from homeassistant.components.cover import (
ATTR... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/velux/test_cover.py",
"license": "Apache License 2.0",
"lines": 411,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:homeassistant/components/ai_task/media_source.py | """Expose images as media sources."""
from __future__ import annotations
from pathlib import Path
from homeassistant.components.media_source import MediaSource, local_source
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from .const import DATA_MEDIA_SOURCE, DOM... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/ai_task/media_source.py",
"license": "Apache License 2.0",
"lines": 23,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/airos/binary_sensor.py | """AirOS Binary Sensor component for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Generic, TypeVar
from airos.data import AirOSDataBaseClass
from homeassistant.components.binary_sensor import (
BinarySensorDeviceC... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/airos/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/airq/number.py | """Definition of air-Q number platform used to control the LED strips."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
import logging
from aioairq.core import AirQ
from homeassistant.components.number import NumberEntity, NumberEntityDescriptio... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/airq/number.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/apcupsd/entity.py | """Base entity for APCUPSd integration."""
from __future__ import annotations
from homeassistant.helpers.entity import EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .coordinator import APCUPSdCoordinator
class APCUPSdEntity(CoordinatorEntity[APCUPSdCoordinator]):
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/apcupsd/entity.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/asuswrt/helpers.py | """Helpers for AsusWRT integration."""
from __future__ import annotations
from typing import Any
TRANSLATION_MAP = {
"wan_rx": "sensor_rx_bytes",
"wan_tx": "sensor_tx_bytes",
"total_usage": "cpu_total_usage",
"usage": "mem_usage_perc",
"free": "mem_free",
"used": "mem_used",
"wan_rx_speed... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/asuswrt/helpers.py",
"license": "Apache License 2.0",
"lines": 41,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/august/application_credentials.py | """application_credentials platform for the august integration."""
from homeassistant.components.application_credentials import AuthorizationServer
from homeassistant.core import HomeAssistant
OAUTH2_AUTHORIZE = "https://auth.august.com/authorization"
OAUTH2_TOKEN = "https://auth.august.com/access_token"
async def ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/august/application_credentials.py",
"license": "Apache License 2.0",
"lines": 11,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/bayesian/config_flow.py | """Config flow for the Bayesian integration."""
from collections.abc import Mapping
from enum import StrEnum
import logging
from typing import Any
import voluptuous as vol
from homeassistant.components.alarm_control_panel import DOMAIN as ALARM_DOMAIN
from homeassistant.components.binary_sensor import (
DOMAIN a... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/bayesian/config_flow.py",
"license": "Apache License 2.0",
"lines": 569,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/fan/intent.py | """Intents for the fan integration."""
import voluptuous as vol
from homeassistant.core import HomeAssistant
from homeassistant.helpers import intent
from . import ATTR_PERCENTAGE, DOMAIN, SERVICE_TURN_ON
INTENT_FAN_SET_SPEED = "HassFanSetSpeed"
async def async_setup_intents(hass: HomeAssistant) -> None:
"""S... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/fan/intent.py",
"license": "Apache License 2.0",
"lines": 25,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/husqvarna_automower/event.py | """Creates the event entities for supported mowers."""
from collections.abc import Callable
import logging
from aioautomower.model import SingleMessageData
from homeassistant.components.event import (
DOMAIN as EVENT_DOMAIN,
EventEntity,
EventEntityDescription,
)
from homeassistant.core import HomeAssist... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/husqvarna_automower/event.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/huum/number.py | """Control for steamer."""
from __future__ import annotations
import logging
from huum.const import SaunaStatus
from homeassistant.components.number import NumberEntity
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from .const import C... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/huum/number.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/knx/storage/serialize.py | """Custom serializer for KNX schemas."""
from typing import Any, cast
import voluptuous as vol
from voluptuous_serialize import UNSUPPORTED, UnsupportedType, convert
from homeassistant.const import Platform
from homeassistant.helpers import selector
from .entity_store_schema import KNX_SCHEMA_FOR_PLATFORM
from .knx... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/knx/storage/serialize.py",
"license": "Apache License 2.0",
"lines": 37,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/letpot/select.py | """Support for LetPot select entities."""
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from enum import StrEnum
from typing import Any
from letpot.deviceclient import LetPotDeviceClient
from letpot.models import DeviceFeature, LightMode, TemperatureUnit
from homeassistant.compone... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/letpot/select.py",
"license": "Apache License 2.0",
"lines": 146,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/nina/diagnostics.py | """Diagnostics for the Nina integration."""
from dataclasses import asdict
from typing import Any
from homeassistant.core import HomeAssistant
from .coordinator import NinaConfigEntry
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: NinaConfigEntry
) -> dict[str, Any]:
"""Return di... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nina/diagnostics.py",
"license": "Apache License 2.0",
"lines": 17,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/opower/repairs.py | """Repairs for Opower."""
from __future__ import annotations
from homeassistant.components.repairs import RepairsFlow
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResult
class UnsupportedUtilityFixFlow(RepairsFlow):
"""Handler for removing a configuration entry that... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/opower/repairs.py",
"license": "Apache License 2.0",
"lines": 34,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/pooldose/config_flow.py | """Config flow for the Seko PoolDose integration."""
from __future__ import annotations
import logging
from typing import Any
from pooldose.client import PooldoseClient
from pooldose.request_status import RequestStatus
from pooldose.type_definitions import APIVersionResponse
import voluptuous as vol
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/pooldose/config_flow.py",
"license": "Apache License 2.0",
"lines": 159,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/pooldose/const.py | """Constants for the Seko Pooldose integration."""
from __future__ import annotations
from homeassistant.const import UnitOfTemperature, UnitOfVolume, UnitOfVolumeFlowRate
DOMAIN = "pooldose"
MANUFACTURER = "SEKO"
# Unit mappings for select entities (water meter and flow rate)
# Keys match API values exactly: lower... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/pooldose/const.py",
"license": "Apache License 2.0",
"lines": 18,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/pooldose/coordinator.py | """Data update coordinator for the PoolDose integration."""
from __future__ import annotations
from datetime import timedelta
import logging
from pooldose.client import PooldoseClient
from pooldose.request_status import RequestStatus
from pooldose.type_definitions import DeviceInfoDict, StructuredValuesDict
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/pooldose/coordinator.py",
"license": "Apache License 2.0",
"lines": 54,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/pooldose/entity.py | """Base entity for Seko Pooldose integration."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import Any, Literal
from pooldose.type_definitions import DeviceInfoDict, ValueDict
from homeassistant.const import CONF_MAC
from homeassistant.exceptions import ServiceVal... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/pooldose/entity.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/pooldose/sensor.py | """Sensors for the Seko PoolDose integration."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import TYPE_CHECKING
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeas... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/pooldose/sensor.py",
"license": "Apache License 2.0",
"lines": 219,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/qbus/binary_sensor.py | """Support for Qbus binary sensor."""
from dataclasses import dataclass
from typing import cast
from qbusmqttapi.discovery import QbusMqttDevice, QbusMqttOutput
from qbusmqttapi.factory import QbusMqttTopicFactory
from qbusmqttapi.state import QbusMqttDeviceState, QbusMqttWeatherState
from homeassistant.components.b... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/qbus/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/qbus/sensor.py | """Support for Qbus sensor."""
from dataclasses import dataclass
from qbusmqttapi.discovery import QbusMqttOutput
from qbusmqttapi.state import (
GaugeStateProperty,
QbusMqttGaugeState,
QbusMqttHumidityState,
QbusMqttThermoState,
QbusMqttVentilationState,
QbusMqttWeatherState,
)
from homeassi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/qbus/sensor.py",
"license": "Apache License 2.0",
"lines": 323,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/russound_rio/media_browser.py | """Support for Russound media browsing."""
from aiorussound import RussoundClient, Zone
from aiorussound.const import FeatureFlag
from aiorussound.util import is_feature_supported
from homeassistant.components.media_player import BrowseMedia, MediaClass
from homeassistant.core import HomeAssistant
async def async_b... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/russound_rio/media_browser.py",
"license": "Apache License 2.0",
"lines": 83,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/config_flow.py | """Config flow for the Sleep as Android integration."""
from __future__ import annotations
from homeassistant.helpers import config_entry_flow
from .const import DOMAIN
config_entry_flow.register_webhook_flow(
DOMAIN,
"Sleep as Android",
{"docs_url": "https://www.home-assistant.io/integrations/sleep_as_... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/config_flow.py",
"license": "Apache License 2.0",
"lines": 10,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/const.py | """Constants for the Sleep as Android integration."""
DOMAIN = "sleep_as_android"
ATTR_EVENT = "event"
ATTR_VALUE1 = "value1"
ATTR_VALUE2 = "value2"
ATTR_VALUE3 = "value3"
MAP_EVENTS = {
"sleep_tracking_paused": "paused",
"sleep_tracking_resumed": "resumed",
"sleep_tracking_started": "started",
"slee... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/const.py",
"license": "Apache License 2.0",
"lines": 28,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/diagnostics.py | """Diagnostics platform for Sleep as Android integration."""
from __future__ import annotations
from typing import Any
from homeassistant.core import HomeAssistant
from . import SleepAsAndroidConfigEntry
async def async_get_config_entry_diagnostics(
hass: HomeAssistant, config_entry: SleepAsAndroidConfigEntry... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/diagnostics.py",
"license": "Apache License 2.0",
"lines": 12,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/entity.py | """Base entity for Sleep as Android integration."""
from __future__ import annotations
from abc import abstractmethod
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.h... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/entity.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/event.py | """Event platform for Sleep as Android integration."""
from __future__ import annotations
from dataclasses import dataclass
from enum import StrEnum
from homeassistant.components.event import (
EventDeviceClass,
EventEntity,
EventEntityDescription,
)
from homeassistant.core import HomeAssistant, callback... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/event.py",
"license": "Apache License 2.0",
"lines": 143,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sleep_as_android/sensor.py | """Sensor platform for Sleep as Android integration."""
from __future__ import annotations
from datetime import datetime
from enum import StrEnum
from homeassistant.components.sensor import (
RestoreSensor,
SensorDeviceClass,
SensorEntityDescription,
)
from homeassistant.core import HomeAssistant, callba... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sleep_as_android/sensor.py",
"license": "Apache License 2.0",
"lines": 78,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/smarla/sensor.py | """Support for the Swing2Sleep Smarla sensor entities."""
from dataclasses import dataclass
from pysmarlaapi.federwiege.services.classes import Property
from homeassistant.components.sensor import (
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import UnitOfLength, U... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/smarla/sensor.py",
"license": "Apache License 2.0",
"lines": 87,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sonos/select.py | """Select entities for Sonos."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from homeassistant.components.select import SelectEntity, SelectEntityDescription
from homeassistant.core import HomeAssistant
from homeassistant.helpers.dispatcher import async_dispatcher_connect
fro... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sonos/select.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/switchbot_cloud/cover.py | """Support for the Switchbot BlindTilt, Curtain, Curtain3, RollerShade as Cover."""
import asyncio
from typing import Any
from switchbot_api import (
BlindTiltCommands,
CommonCommands,
CurtainCommands,
Device,
Remote,
RollerShadeCommands,
SwitchBotAPI,
)
from homeassistant.components.cove... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/switchbot_cloud/cover.py",
"license": "Apache License 2.0",
"lines": 193,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/telegram_bot/notify.py | """Telegram bot notification entity."""
from typing import Any
from homeassistant.components.notify import (
NotifyEntity,
NotifyEntityDescription,
NotifyEntityFeature,
)
from homeassistant.config_entries import ConfigSubentry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/telegram_bot/notify.py",
"license": "Apache License 2.0",
"lines": 42,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/template/event.py | """Support for events which integrates with other components."""
from __future__ import annotations
import logging
from typing import Any, Final
import voluptuous as vol
from homeassistant.components.event import (
DOMAIN as EVENT_DOMAIN,
ENTITY_ID_FORMAT,
EventDeviceClass,
EventEntity,
)
from homea... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/template/event.py",
"license": "Apache License 2.0",
"lines": 173,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/template/schemas.py | """Shared schemas for config entry and YAML config items."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.const import (
CONF_DEVICE_ID,
CONF_ENTITY_PICTURE_TEMPLATE,
CONF_ICON,
CONF_ICON_TEMPLATE,
CONF_NAME,
CONF_OPTIMISTIC,
CONF_UNIQUE_ID,
CONF_VARI... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/template/schemas.py",
"license": "Apache License 2.0",
"lines": 91,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.