sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:homeassistant/components/qwikswitch/const.py | """Support for Qwikswitch devices."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.util.hass_dict import HassKey
if TYPE_CHECKING:
from pyqwikswitch.async_ import QSUsb
DOMAIN = "qwikswitch"
DATA_QUIKSWITCH: HassKey[QSUsb] = HassKey(DOMAIN)
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/qwikswitch/const.py",
"license": "Apache License 2.0",
"lines": 8,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/saunum/number.py | """Number platform for Saunum Leil Sauna Control Unit."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import TYPE_CHECKING
from pysaunum import (
MAX_DURATION,
MAX_FAN_DURATION,
MIN_DURATION,
MIN_FAN_DURATION,
Sa... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/saunum/number.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/siren/condition.py | """Provides conditions for sirens."""
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import Condition, make_entity_state_condition
from . import DOMAIN
CONDITIONS: dict[str, type[Condition]] = {
"is_off": make_entity_state_con... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/siren/condition.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/sunricher_dali/binary_sensor.py | """Platform for Sunricher DALI binary sensor entities."""
from __future__ import annotations
from PySrDaliGateway import CallbackEventType, Device
from PySrDaliGateway.helper import is_motion_sensor
from PySrDaliGateway.types import MotionState, MotionStatus
from homeassistant.components.binary_sensor import (
B... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sunricher_dali/button.py | """Support for Sunricher DALI device identify button."""
from __future__ import annotations
import logging
from PySrDaliGateway import Device
from PySrDaliGateway.helper import is_light_device
from homeassistant.components.button import ButtonDeviceClass, ButtonEntity
from homeassistant.const import EntityCategory
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/button.py",
"license": "Apache License 2.0",
"lines": 48,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sunricher_dali/sensor.py | """Platform for Sunricher DALI sensor entities."""
from __future__ import annotations
import logging
from PySrDaliGateway import CallbackEventType, Device
from PySrDaliGateway.helper import is_illuminance_sensor, is_light_device
from PySrDaliGateway.types import IlluminanceStatus
from homeassistant.components.senso... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/sensor.py",
"license": "Apache License 2.0",
"lines": 130,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/switch/condition.py | """Provides conditions for switches."""
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import Condition, make_entity_state_condition
from .const import DOMAIN
CONDITIONS: dict[str, type[Condition]] = {
"is_off": make_entity_st... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/switch/condition.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/tibber/binary_sensor.py | """Support for Tibber binary sensors."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
import logging
import tibber
from tibber.data_api import TibberDevice
from homeassistant.components.binary_sensor import (
BinarySensorDeviceClass,
BinarySensorE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/tibber/binary_sensor.py",
"license": "Apache License 2.0",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/todoist/util.py | """Utility functions for the Todoist integration."""
from __future__ import annotations
from datetime import date, datetime
from todoist_api_python.models import Due
from homeassistant.util import dt as dt_util
def parse_due_date(task_due: Due | None) -> date | datetime | None:
"""Parse due date from Todoist ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/todoist/util.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | documentation |
home-assistant/core:homeassistant/components/uhoo/config_flow.py | """Custom uhoo config flow setup."""
from typing import Any
from uhooapi import Client
from uhooapi.errors import UhooError, UnauthorizedError
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_API_KEY
from homeassistant.helpers.aiohttp... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uhoo/config_flow.py",
"license": "Apache License 2.0",
"lines": 57,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/uhoo/const.py | """Static consts for uhoo integration."""
from datetime import timedelta
import logging
DOMAIN = "uhoo"
PLATFORMS = ["sensor"]
LOGGER = logging.getLogger(__package__)
NAME = "uHoo Integration"
MODEL = "uHoo Indoor Air Monitor"
MANUFACTURER = "uHoo Pte. Ltd."
UPDATE_INTERVAL = timedelta(seconds=300)
API_VIRUS = "vi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uhoo/const.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/uhoo/coordinator.py | """Custom uhoo data update coordinator."""
from uhooapi import Client, Device
from uhooapi.errors import UhooError
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
from .const imp... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uhoo/coordinator.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/uhoo/sensor.py | """Custom uhoo sensors setup."""
from collections.abc import Callable
from dataclasses import dataclass
from uhooapi import Device
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.const import (
CONCENTR... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uhoo/sensor.py",
"license": "Apache License 2.0",
"lines": 177,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/utility_meter/services.py | """Support for tracking consumption over given periods of time."""
import logging
import voluptuous as vol
from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import HomeAssistant, ServiceCall, callback, split_entity_id
from homea... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/utility_meter/services.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vacuum/condition.py | """Provides conditions for vacuum cleaners."""
from homeassistant.core import HomeAssistant
from homeassistant.helpers.condition import Condition, make_entity_state_condition
from .const import DOMAIN, VacuumActivity
CONDITIONS: dict[str, type[Condition]] = {
"is_cleaning": make_entity_state_condition(DOMAIN, Va... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vacuum/condition.py",
"license": "Apache License 2.0",
"lines": 16,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/vodafone_station/image.py | """Vodafone Station image."""
from __future__ import annotations
from io import BytesIO
from typing import Final, cast
from aiovodafone.const import WIFI_DATA
from homeassistant.components.image import ImageEntity, ImageEntityDescription
from homeassistant.const import EntityCategory
from homeassistant.core import ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vodafone_station/image.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/vodafone_station/switch.py | """Support for switches."""
from __future__ import annotations
from dataclasses import dataclass
from json.decoder import JSONDecodeError
from typing import Any, Final
from aiovodafone.const import WIFI_DATA, WifiBand, WifiType
from aiovodafone.exceptions import (
AlreadyLogged,
CannotAuthenticate,
Canno... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vodafone_station/switch.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/waterfurnace/config_flow.py | """Config flow for WaterFurnace integration."""
from __future__ import annotations
import logging
from typing import Any
import voluptuous as vol
from waterfurnace.waterfurnace import WaterFurnace, WFCredentialError, WFException
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistan... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/waterfurnace/config_flow.py",
"license": "Apache License 2.0",
"lines": 81,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/waterfurnace/const.py | """Constants for the WaterFurnace integration."""
from datetime import timedelta
from typing import Final
DOMAIN: Final = "waterfurnace"
INTEGRATION_TITLE: Final = "WaterFurnace"
UPDATE_INTERVAL: Final = timedelta(seconds=10)
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/waterfurnace/const.py",
"license": "Apache License 2.0",
"lines": 6,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/yardian/sensor.py | """Sensors for Yardian integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
)
from homeassistant.config_entrie... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/yardian/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:tests/components/airobot/test_button.py | """Tests for the Airobot button platform."""
from unittest.mock import AsyncMock
from pyairobotrest.exceptions import (
AirobotConnectionError,
AirobotError,
AirobotTimeoutError,
)
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.button import DOMAIN as BUTTON_DO... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airobot/test_button.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/airobot/test_switch.py | """Tests for the Airobot switch platform."""
from unittest.mock import AsyncMock
from pyairobotrest.exceptions import AirobotError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airobot/test_switch.py",
"license": "Apache License 2.0",
"lines": 153,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/alarm_control_panel/test_condition.py | """Test alarm_control_panel conditions."""
from typing import Any
import pytest
from homeassistant.components.alarm_control_panel import (
AlarmControlPanelEntityFeature,
AlarmControlPanelState,
)
from homeassistant.const import ATTR_SUPPORTED_FEATURES
from homeassistant.core import HomeAssistant
from tests... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/alarm_control_panel/test_condition.py",
"license": "Apache License 2.0",
"lines": 242,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/anthropic/test_repairs.py | """Tests for the Anthropic repairs flow."""
from __future__ import annotations
from typing import Any
from unittest.mock import AsyncMock, MagicMock, patch
from homeassistant.components.anthropic.const import CONF_CHAT_MODEL, DOMAIN
from homeassistant.config_entries import ConfigEntryState, ConfigSubentry
from homea... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/anthropic/test_repairs.py",
"license": "Apache License 2.0",
"lines": 193,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/assist_satellite/test_condition.py | """Test assist satellite conditions."""
from typing import Any
import pytest
from homeassistant.components.assist_satellite.entity import AssistSatelliteState
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
creat... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/assist_satellite/test_condition.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/bang_olufsen/test_binary_sensor.py | """Test the bang_olufsen binary sensor entities."""
from unittest.mock import AsyncMock
from mozart_api.models import BatteryState
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_registry import EntityRegistry
from .conftest import m... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/bang_olufsen/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/bang_olufsen/test_sensor.py | """Test the bang_olufsen sensor entities."""
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
from mozart_api.models import PairedRemote, PairedRemoteResponse
from homeassistant.components.bang_olufsen.sensor import SCAN_INTERVAL
from homeassistant.const import STATE_UNKNOWN
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/bang_olufsen/test_sensor.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/climate/test_condition.py | """Test climate conditions."""
from typing import Any
import pytest
from homeassistant.components.climate.const import (
ATTR_HVAC_ACTION,
HVACAction,
HVACMode,
)
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/climate/test_condition.py",
"license": "Apache License 2.0",
"lines": 269,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/cloudflare_r2/const.py | """Consts for Cloudflare R2 tests."""
from homeassistant.components.cloudflare_r2.const import (
CONF_ACCESS_KEY_ID,
CONF_BUCKET,
CONF_ENDPOINT_URL,
CONF_SECRET_ACCESS_KEY,
)
USER_INPUT = {
CONF_ACCESS_KEY_ID: "R2AccessKeyIdExample",
CONF_SECRET_ACCESS_KEY: "R2SecretAccessKeyExampleExample",
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/cloudflare_r2/const.py",
"license": "Apache License 2.0",
"lines": 13,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/cloudflare_r2/test_backup.py | """Test the Cloudflare R2 backup platform."""
from collections.abc import AsyncGenerator, AsyncIterator
from io import StringIO
import json
from time import time
from unittest.mock import AsyncMock, Mock, patch
from botocore.exceptions import BotoCoreError, ConnectTimeoutError
import pytest
from homeassistant.compon... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/cloudflare_r2/test_backup.py",
"license": "Apache License 2.0",
"lines": 481,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/cloudflare_r2/test_config_flow.py | """Test the Cloudflare R2 config flow."""
from unittest.mock import AsyncMock, patch
from botocore.exceptions import (
ClientError,
EndpointConnectionError,
ParamValidationError,
)
import pytest
from homeassistant import config_entries
from homeassistant.components.cloudflare_r2.const import (
CONF_B... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/cloudflare_r2/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 120,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/cloudflare_r2/test_init.py | """Test the Cloudflare R2 storage integration."""
from unittest.mock import AsyncMock, patch
from botocore.exceptions import (
ClientError,
EndpointConnectionError,
ParamValidationError,
)
import pytest
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/cloudflare_r2/test_init.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/compit/test_select.py | """Tests for the Compit select platform."""
from typing import Any
from unittest.mock import MagicMock
from compit_inext_api.consts import CompitParameter
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassist... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/compit/test_select.py",
"license": "Apache License 2.0",
"lines": 73,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/device_tracker/test_condition.py | """Test device tracker conditions."""
from typing import Any
import pytest
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
p... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/device_tracker/test_condition.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/components/energy/test_helpers.py | """Test the Energy helpers."""
import pytest
from homeassistant.components.energy.helpers import (
generate_power_sensor_entity_id,
generate_power_sensor_unique_id,
)
def test_generate_power_sensor_unique_id_inverted() -> None:
"""Test unique ID generation for inverted power config."""
config = {"st... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/energy/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/components/esphome/test_water_heater.py | """Test ESPHome water heaters."""
from unittest.mock import call
from aioesphomeapi import APIClient, WaterHeaterInfo, WaterHeaterMode, WaterHeaterState
from homeassistant.components.water_heater import (
ATTR_OPERATION_LIST,
DOMAIN as WATER_HEATER_DOMAIN,
SERVICE_SET_OPERATION_MODE,
SERVICE_SET_TEMP... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/esphome/test_water_heater.py",
"license": "Apache License 2.0",
"lines": 163,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/fan/test_condition.py | """Test fan conditions."""
from typing import Any
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
parametrize_conditi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/fan/test_condition.py",
"license": "Apache License 2.0",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/fritz/test_binary_sensor.py | """Tests for Fritz!Tools binary sensor platform."""
from unittest.mock import patch
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.binary_sensor import STATE_ON
from homeassistant.components.fritz.const import DOMAIN, SCAN_IN... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/fritz/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 53,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/green_planet_energy/test_config_flow.py | """Test the Green Planet Energy config flow."""
from unittest.mock import AsyncMock, MagicMock
from greenplanet_energy_api import (
GreenPlanetEnergyAPIError,
GreenPlanetEnergyConnectionError,
)
import pytest
from homeassistant.components.green_planet_energy.const import DOMAIN
from homeassistant.config_entr... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/green_planet_energy/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 67,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/green_planet_energy/test_init.py | """Test Green Planet Energy setup."""
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_setup_entry(
hass: HomeAssistant, init_integration: MockConfigEntry
) -> None:
"""Test setting up config entry.... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/green_planet_energy/test_init.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/green_planet_energy/test_sensor.py | """Test the Green Planet Energy sensor."""
from freezegun.api import FrozenDateTimeFactory
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from tests.common import MockConfigEntry, snapshot_plat... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/green_planet_energy/test_sensor.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/hdfury/test_button.py | """Tests for the HDFury button platform."""
from unittest.mock import AsyncMock
from hdfury import HDFuryError
import pytest
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 ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/test_button.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/hdfury/test_config_flow.py | """Test the HDFury config flow."""
from ipaddress import ip_address
from unittest.mock import AsyncMock
from hdfury import HDFuryError
from homeassistant.components.hdfury.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from homeassistant.const import CONF_HOST
from homeassi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 259,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/hdfury/test_diagnostics.py | """Tests for the HDFury diagnostics."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.hdfury import PLATFORMS
from homeassistant.core import HomeAssistant
import homeassistant.helpers.entity_registry as er
from . import setup_integration
from tests.common import MockConfigEntry
from t... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/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/hdfury/test_select.py | """Tests for the HDFury select platform."""
from datetime import timedelta
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
from hdfury import HDFuryError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.select import (
DOMAIN as SELECT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/test_select.py",
"license": "Apache License 2.0",
"lines": 130,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/hdfury/test_sensor.py | """Tests for the HDFury sensor platform."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
import homeassistant.helpers.entity_registry as er
from . import setup_integration
from tests.common import MockConfigEntry, ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/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/hdfury/test_switch.py | """Tests for the HDFury switch platform."""
from datetime import timedelta
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
from hdfury import HDFuryError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAI... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hdfury/test_switch.py",
"license": "Apache License 2.0",
"lines": 114,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/hikvision/test_camera.py | """Test Hikvision cameras."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.camera import async_get_image, async_get_stream_source
from homeassistant.components.hikvision.const import DOMAIN
from homeassistant.const import Platfo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/hikvision/test_camera.py",
"license": "Apache License 2.0",
"lines": 129,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/humidifier/test_condition.py | """Test humidifier conditions."""
from typing import Any
import pytest
from homeassistant.components.humidifier.const import ATTR_ACTION, HumidifierAction
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/humidifier/test_condition.py",
"license": "Apache License 2.0",
"lines": 240,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/izone/test_climate.py | """Tests for iZone climate platform."""
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.climate import ClimateEntityFeature
from homeassistant.core import HomeAssistant
import homeassistant.helpers.entity_registry as er
from . import set... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/izone/test_climate.py",
"license": "Apache License 2.0",
"lines": 224,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lawn_mower/test_condition.py | """Test lawn mower conditions."""
from typing import Any
import pytest
from homeassistant.components.lawn_mower.const import LawnMowerActivity
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_conditi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lawn_mower/test_condition.py",
"license": "Apache License 2.0",
"lines": 168,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lg_thinq/test_humidifier.py | """Tests for the LG ThinQ humidifier 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 . import setup_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lg_thinq/test_humidifier.py",
"license": "Apache License 2.0",
"lines": 23,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/lock/test_condition.py | """Test lock conditions."""
from typing import Any
import pytest
from homeassistant.components.lock.const import LockState
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
other_states... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/lock/test_condition.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/mastodon/test_binary_sensor.py | """Tests for the Mastodon binary sensors."""
from unittest.mock import 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 . import setup_integration
fro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/mastodon/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 20,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/media_player/test_condition.py | """Test media player conditions."""
from typing import Any
import pytest
from homeassistant.components.media_player.const import MediaPlayerState
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_cond... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/media_player/test_condition.py",
"license": "Apache License 2.0",
"lines": 192,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/mill/test_climate.py | """Tests for Mill climate."""
import contextlib
from contextlib import nullcontext
from unittest.mock import MagicMock, call, patch
from mill import Heater
from mill_local import OperationMode
import pytest
from homeassistant.components import mill
from homeassistant.components.climate import (
ATTR_HVAC_MODE,
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/mill/test_climate.py",
"license": "Apache License 2.0",
"lines": 491,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/namecheapdns/test_config_flow.py | """Test the Namecheap DynamicDNS config flow."""
from unittest.mock import AsyncMock
from aiohttp import ClientError
import pytest
from homeassistant.components.namecheapdns.const import DOMAIN, UPDATE_URL
from homeassistant.components.namecheapdns.helpers import AuthFailed
from homeassistant.config_entries import (... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/namecheapdns/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 266,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nina/const.py | """Common constants for NINA tests."""
from copy import deepcopy
from typing import Any
from homeassistant.components.nina.const import (
CONF_AREA_FILTER,
CONF_FILTERS,
CONF_HEADLINE_FILTER,
CONF_MESSAGE_SLOTS,
CONF_REGIONS,
CONST_REGION_A_TO_D,
CONST_REGION_E_TO_H,
CONST_REGION_I_TO_... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nina/const.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nrgkick/test_config_flow.py | """Tests for the NRGkick config flow."""
from __future__ import annotations
from ipaddress import ip_address
from typing import Any
from unittest.mock import AsyncMock
from nrgkick_api import (
NRGkickAPIDisabledError,
NRGkickAuthenticationError,
NRGkickConnectionError,
)
import pytest
from homeassistan... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nrgkick/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 762,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nrgkick/test_init.py | """Tests for the NRGkick integration initialization."""
from __future__ import annotations
from unittest.mock import AsyncMock
from nrgkick_api import (
NRGkickAPIDisabledError,
NRGkickAuthenticationError,
NRGkickConnectionError,
)
import pytest
from syrupy.assertion import SnapshotAssertion
from homeas... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nrgkick/test_init.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/nrgkick/test_sensor.py | """Tests for the NRGkick sensor platform."""
from __future__ import annotations
from unittest.mock import AsyncMock
from nrgkick_api import ChargingStatus, ConnectorType
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.const import STATE_UNKNOWN, Platform
from homeassistant.core impor... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/nrgkick/test_sensor.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openevse/test_config_flow.py | """Tests for the OpenEVSE sensor platform."""
from ipaddress import ip_address
from unittest.mock import AsyncMock, MagicMock
from openevsehttp.exceptions import AuthenticationError, MissingSerial
from homeassistant.components.openevse.const import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURC... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openevse/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 412,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/openevse/test_init.py | """Tests for the OpenEVSE integration."""
from unittest.mock import MagicMock
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
async def test_setup_entry_timeout(
hass: HomeAssistant,
mock_config_entry: MockConfi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openevse/test_init.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/components/openevse/test_number.py | """Tests for the OpenEVSE number platform."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as NUMBER_DOMAIN,
SERVICE_SET_VALUE,
)
from homeassistant.const import ATTR_ENTITY_ID, Pla... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openevse/test_number.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/openevse/test_sensor.py | """Tests for the OpenEVSE sensor platform."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.openevse.const import DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import CONF_HOS... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/openevse/test_sensor.py",
"license": "Apache License 2.0",
"lines": 132,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/person/test_condition.py | """Test person conditions."""
from typing import Any
import pytest
from homeassistant.const import STATE_HOME, STATE_NOT_HOME
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
parametri... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/person/test_condition.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/components/person/test_trigger.py | """Test person trigger."""
from typing import Any
import pytest
from homeassistant.components.person.const import DOMAIN
from homeassistant.const import (
ATTR_LABEL_ID,
CONF_ENTITY_ID,
STATE_HOME,
STATE_NOT_HOME,
)
from homeassistant.core import HomeAssistant, ServiceCall
from tests.components impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/person/test_trigger.py",
"license": "Apache License 2.0",
"lines": 192,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/pooldose/test_diagnostics.py | """Test Pooldose diagnostics."""
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagnostics_for_config_entry
from tests.typing import ClientSessionGenerator
async def test_entry_diagno... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/pooldose/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 15,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/prana/test_config_flow.py | """Tests for the Prana config flow."""
from types import SimpleNamespace
from prana_local_api_client.exceptions import (
PranaApiCommunicationError as PranaCommunicationError,
)
from homeassistant.components.prana.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER, SOURCE_ZEROCONF
from home... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prana/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 131,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/prana/test_init.py | """Tests for Prana integration entry points (async_setup_entry / async_unload_entry)."""
from homeassistant.components.prana.const import DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from . import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prana/test_init.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/prana/test_switch.py | """Integration-style tests for Prana switches."""
from unittest.mock import MagicMock, patch
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.switch import (
DOMAIN as SWITCH_DOMAIN,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
)
from homeassistant.const import ATTR_ENTITY... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/prana/test_switch.py",
"license": "Apache License 2.0",
"lines": 64,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/proxmoxve/test_binary_sensor.py | """Test the Proxmox VE binary sensor platform."""
from unittest.mock import MagicMock, patch
from freezegun.api import FrozenDateTimeFactory
from proxmoxer import AuthenticationError
from proxmoxer.core import ResourceException
import pytest
import requests
from requests.exceptions import ConnectTimeout, SSLError
fro... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/proxmoxve/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 68,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/proxmoxve/test_config_flow.py | """Test the config flow for Proxmox VE."""
from __future__ import annotations
from unittest.mock import MagicMock
from proxmoxer import AuthenticationError
from proxmoxer.core import ResourceException
import pytest
import requests
from requests.exceptions import ConnectTimeout, SSLError
from homeassistant.component... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/proxmoxve/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 387,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/proxmoxve/test_init.py | """Tests for the Proxmox VE integration initialization."""
from unittest.mock import MagicMock
from proxmoxer import AuthenticationError
from proxmoxer.core import ResourceException
import pytest
import requests
from requests.exceptions import ConnectTimeout, SSLError
from homeassistant.components.proxmoxve.const im... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/proxmoxve/test_init.py",
"license": "Apache License 2.0",
"lines": 161,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/saunum/test_number.py | """Test the Saunum number platform."""
from __future__ import annotations
from dataclasses import replace
from unittest.mock import MagicMock
from pysaunum import SaunumException
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
DOMAIN as ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/saunum/test_number.py",
"license": "Apache License 2.0",
"lines": 163,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/siren/test_condition.py | """Test siren conditions."""
from typing import Any
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
parametrize_condi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/siren/test_condition.py",
"license": "Apache License 2.0",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sunricher_dali/test_binary_sensor.py | """Test the Sunricher DALI binary sensor platform."""
from unittest.mock import MagicMock
from PySrDaliGateway import CallbackEventType
from PySrDaliGateway.types import MotionState
import pytest
from homeassistant.const import (
STATE_OFF,
STATE_ON,
STATE_UNAVAILABLE,
STATE_UNKNOWN,
Platform,
)
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sunricher_dali/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 209,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sunricher_dali/test_button.py | """Test the Sunricher DALI button platform."""
from unittest.mock import MagicMock
import pytest
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 Ho... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sunricher_dali/test_button.py",
"license": "Apache License 2.0",
"lines": 35,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/sunricher_dali/test_sensor.py | """Test the Sunricher DALI sensor platform."""
from unittest.mock import MagicMock
from PySrDaliGateway import CallbackEventType
import pytest
from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as e... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/sunricher_dali/test_sensor.py",
"license": "Apache License 2.0",
"lines": 147,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/switch/test_condition.py | """Test switch conditions."""
from typing import Any
import pytest
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
parametrize_cond... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/switch/test_condition.py",
"license": "Apache License 2.0",
"lines": 151,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/tailscale/test_coordinator.py | """Tests for the Tailscale coordinator."""
from datetime import timedelta
from unittest.mock import MagicMock
from freezegun.api import FrozenDateTimeFactory
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from tests.common import MockConfigEntry
async def test... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/tailscale/test_coordinator.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/telegram_bot/test_init.py | """Init tests for the Telegram Bot integration."""
from homeassistant.components.telegram_bot.const import (
ATTR_PARSER,
CONF_API_ENDPOINT,
DEFAULT_API_ENDPOINT,
DOMAIN,
PARSER_MD,
PLATFORM_BROADCAST,
)
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import C... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/telegram_bot/test_init.py",
"license": "Apache License 2.0",
"lines": 57,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/tibber/test_binary_sensor.py | """Tests for the Tibber binary sensors."""
from __future__ import annotations
from unittest.mock import AsyncMock
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.recorder import Recorder
from homeassistant.const import STATE_OFF, STATE_ON, Platform
from homeassistant.core ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/tibber/test_binary_sensor.py",
"license": "Apache License 2.0",
"lines": 86,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/uhoo/test_config_flow.py | """Test the Uhoo config flow."""
from unittest.mock import AsyncMock
import pytest
from uhooapi.errors import UhooError, UnauthorizedError
from homeassistant.components.uhoo.const import DOMAIN
from homeassistant.config_entries import SOURCE_USER
from homeassistant.const import CONF_API_KEY
from homeassistant.core i... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/uhoo/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 74,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/uhoo/test_init.py | """Tests for __init__.py with coordinator."""
from unittest.mock import AsyncMock
from aiodns.error import DNSError
from aiohttp.client_exceptions import ClientConnectionError
import pytest
from uhooapi.errors import UhooError, UnauthorizedError
from homeassistant.config_entries import ConfigEntryState
from homeassi... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/uhoo/test_init.py",
"license": "Apache License 2.0",
"lines": 50,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/uhoo/test_sensor.py | """Tests for sensor.py with Uhoo sensors."""
from unittest.mock import AsyncMock, MagicMock
from freezegun.api import FrozenDateTimeFactory
from syrupy.assertion import SnapshotAssertion
from uhooapi.errors import UhooError
from homeassistant.components.uhoo.const import UPDATE_INTERVAL
from homeassistant.const impo... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/uhoo/test_sensor.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/vacuum/test_condition.py | """Test vacuum conditions."""
from typing import Any
import pytest
from homeassistant.components.vacuum import VacuumActivity
from homeassistant.core import HomeAssistant
from tests.components import (
ConditionStateDescription,
assert_condition_gated_by_labs_flag,
create_target_condition,
other_sta... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vacuum/test_condition.py",
"license": "Apache License 2.0",
"lines": 168,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vodafone_station/test_image.py | """Tests for Vodafone Station image platform."""
from http import HTTPStatus
from io import BytesIO
from unittest.mock import AsyncMock, patch
from aiovodafone.const import WIFI_DATA
from freezegun.api import FrozenDateTimeFactory
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.compon... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vodafone_station/test_image.py",
"license": "Apache License 2.0",
"lines": 121,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/vodafone_station/test_switch.py | """Tests for Vodafone Station switch platform."""
from unittest.mock import AsyncMock, patch
from aiovodafone.const import WIFI_DATA
from aiovodafone.exceptions import (
AlreadyLogged,
CannotAuthenticate,
CannotConnect,
GenericLoginError,
)
from freezegun.api import FrozenDateTimeFactory
import pytest... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vodafone_station/test_switch.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/waterfurnace/test_config_flow.py | """Test the WaterFurnace config flow."""
from unittest.mock import AsyncMock, Mock
import pytest
from waterfurnace.waterfurnace import WFCredentialError, WFException
from homeassistant.components.waterfurnace.const import DOMAIN
from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER
from homeassistant.c... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/waterfurnace/test_config_flow.py",
"license": "Apache License 2.0",
"lines": 179,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/yardian/test_sensor.py | """Tests for Yardian sensors."""
from __future__ import annotations
from datetime import UTC, datetime, timedelta
from unittest.mock import AsyncMock
from freezegun.api import FrozenDateTimeFactory
import pytest
from pyyardian import OperationInfo
from syrupy.assertion import SnapshotAssertion
from homeassistant.co... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/yardian/test_sensor.py",
"license": "Apache License 2.0",
"lines": 95,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:homeassistant/components/neato/services.py | """Neato services."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN
from homeassistant.const import ATTR_MODE
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, service
fr... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/neato/services.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/sharkiq/services.py | """Shark IQ services."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, service
from .const import ATTR_ROOMS, DOMAIN
SE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sharkiq/services.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/xiaomi_miio/services.py | """Xiaomi services."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import config_validation as cv, service
from .const import DOMAIN
ATTR_RC_DURATION... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/xiaomi_miio/services.py",
"license": "Apache License 2.0",
"lines": 116,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/ecovacs/services.py | """Ecovacs services."""
from __future__ import annotations
from homeassistant.components.vacuum import DOMAIN as VACUUM_DOMAIN
from homeassistant.core import HomeAssistant, SupportsResponse, callback
from homeassistant.helpers import service
from .const import DOMAIN
SERVICE_RAW_GET_POSITIONS = "raw_get_positions"
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/ecovacs/services.py",
"license": "Apache License 2.0",
"lines": 20,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/huum/sensor.py | """Sensor platform for Huum sauna integration."""
from __future__ import annotations
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
)
from homeassistant.const import UnitOfTemperature
from homeassistant.core import HomeAssistant
from homeassistant.helpers.... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/huum/sensor.py",
"license": "Apache License 2.0",
"lines": 32,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:tests/components/huum/test_sensor.py | """Tests for the Huum sensor entity."""
from unittest.mock import AsyncMock
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 setup_with_selected_platforms
from t... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/huum/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:homeassistant/components/radarr/helpers.py | """Helper functions for Radarr."""
from typing import Any
from aiopyarr import RadarrMovie, RadarrQueue
def format_queue_item(item: Any, base_url: str | None = None) -> dict[str, Any]:
"""Format a single queue item."""
remaining = 1 if item.size == 0 else item.sizeleft / item.size
remaining_pct = 100 *... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/radarr/helpers.py",
"license": "Apache License 2.0",
"lines": 96,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/radarr/services.py | """Define services for the Radarr integration."""
from collections.abc import Awaitable, Callable
from typing import Any, Final, cast
from aiopyarr import exceptions
import voluptuous as vol
from homeassistant.const import CONF_URL
from homeassistant.core import HomeAssistant, ServiceCall, SupportsResponse, callback... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/radarr/services.py",
"license": "Apache License 2.0",
"lines": 100,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:tests/components/radarr/test_services.py | """Test Radarr services."""
from unittest.mock import patch
from aiopyarr import ArrAuthenticationException, ArrConnectionException
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.radarr.const import DOMAIN
from homeassistant.components.radarr.services import (
ATTR_ENT... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/radarr/test_services.py",
"license": "Apache License 2.0",
"lines": 147,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.