sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:homeassistant/components/lock/trigger.py
"""Provides triggers for locks.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN, LockState TRIGGERS: dict[str, type[Trigger]] = { "jammed": make_entity_target_state_trigger(DOMAIN, LockState.JAMMED), ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lock/trigger.py", "license": "Apache License 2.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/nederlandse_spoorwegen/diagnostics.py
"""Diagnostics support for Nederlandse Spoorwegen.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.const import CONF_API_KEY from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nederlandse_spoorwegen/diagnostics.py", "license": "Apache License 2.0", "lines": 106, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nintendo_parental_controls/select.py
"""Nintendo Switch Parental Controls select entity definitions.""" from __future__ import annotations from collections.abc import Callable, Coroutine from dataclasses import dataclass from enum import StrEnum from typing import Any from pynintendoparental.enum import DeviceTimerMode from homeassistant.components.se...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nintendo_parental_controls/select.py", "license": "Apache License 2.0", "lines": 72, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/openrgb/select.py
"""Select platform for OpenRGB integration.""" from __future__ import annotations from homeassistant.components.select import SelectEntity from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity_platform import AddConfigEntryEnti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openrgb/select.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/overseerr/models.py
"""Data models for Overseerr integration.""" from dataclasses import dataclass from python_overseerr import IssueCount, RequestCount @dataclass class OverseerrData: """Data model for Overseerr coordinator.""" requests: RequestCount issues: IssueCount
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/overseerr/models.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/pooldose/number.py
"""Number entities for the Seko PoolDose integration.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, cast from homeassistant.components.number import ( NumberDeviceClass, NumberEntity, NumberEntityDescription, ) from homeassistant.const import ( CONCENTRAT...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/pooldose/number.py", "license": "Apache License 2.0", "lines": 127, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/pooldose/select.py
"""Select entities for the Seko PoolDose integration.""" from __future__ import annotations from dataclasses import dataclass import logging from typing import TYPE_CHECKING, Any, cast from homeassistant.components.select import SelectEntity, SelectEntityDescription from homeassistant.const import EntityCategory, Un...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/pooldose/select.py", "license": "Apache License 2.0", "lines": 139, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/risco/models.py
"""Models for Risco integration.""" from collections.abc import Callable from dataclasses import dataclass, field from typing import Any from pyrisco import RiscoLocal @dataclass class LocalData: """A data class for local data passed to the platforms.""" system: RiscoLocal partition_updates: dict[int, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/risco/models.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/risco/services.py
"""Services for Risco integration.""" from datetime import datetime import voluptuous as vol from homeassistant.const import ATTR_CONFIG_ENTRY_ID, ATTR_TIME, CONF_TYPE from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/risco/services.py", "license": "Apache License 2.0", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/saunum/binary_sensor.py
"""Binary sensor platform for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import TYPE_CHECKING from pysaunum import SaunumData from homeassistant.components.binary_sensor import ( BinarySenso...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/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/saunum/sensor.py
"""Sensor platform for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import TYPE_CHECKING from pysaunum import SaunumData from homeassistant.components.sensor import ( SensorDeviceClass, Se...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/sensor.py", "license": "Apache License 2.0", "lines": 79, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/scene/trigger.py
"""Provides triggers for scenes.""" from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN from homeassistant.core import HomeAssistant, State from homeassistant.helpers.trigger import ( ENTITY_STATE_TRIGGER_SCHEMA, EntityTriggerBase, Trigger, ) from . import DOMAIN class SceneActivatedTrigger...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/scene/trigger.py", "license": "Apache License 2.0", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/shelly/services.py
"""Support for services.""" from typing import TYPE_CHECKING, Any, cast from aioshelly.const import RPC_GENERATIONS from aioshelly.exceptions import DeviceConnectionError, RpcCallError import voluptuous as vol from homeassistant.config_entries import ConfigEntryState from homeassistant.const import ATTR_DEVICE_ID fr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/shelly/services.py", "license": "Apache License 2.0", "lines": 143, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/siren/trigger.py
"""Provides triggers for sirens.""" from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from . import DOMAIN TRIGGERS: dict[str, type[Trigger]] = { "turned_on": make_entity_target_stat...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/siren/trigger.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/entity.py
"""Base entity for Sunricher DALI integration.""" from __future__ import annotations import logging from PySrDaliGateway import CallbackEventType, DaliObjectBase, Device from homeassistant.core import callback from homeassistant.helpers.entity import Entity _LOGGER = logging.getLogger(__name__) class DaliCenterE...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/sunricher_dali/entity.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/sunricher_dali/scene.py
"""Support for DALI Center Scene entities.""" import logging from typing import Any from PySrDaliGateway import Scene from homeassistant.components.scene import Scene as SceneEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.en...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/sunricher_dali/scene.py", "license": "Apache License 2.0", "lines": 33, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/switch/trigger.py
"""Provides triggers for switch platform.""" from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN TRIGGERS: dict[str, type[Trigger]] = { "turned_on": make_enti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switch/trigger.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/switchbot/button.py
"""Button support for SwitchBot devices.""" import logging import switchbot from homeassistant.components.button import ButtonEntity from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from homeas...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switchbot/button.py", "license": "Apache License 2.0", "lines": 85, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/template/validators.py
"""Template config validation methods.""" from collections.abc import Callable from enum import StrEnum import logging from typing import Any import voluptuous as vol from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN from homeassistant.helpers import config_validation as cv from homeassistant.helpers....
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/template/validators.py", "license": "Apache License 2.0", "lines": 288, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/teslemetry/application_credentials.py
"""Application Credentials platform the Teslemetry integration.""" from homeassistant.components.application_credentials import ( AuthorizationServer, ClientCredential, ) from homeassistant.core import HomeAssistant from homeassistant.helpers import config_entry_oauth2_flow from .const import AUTHORIZE_URL, T...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/teslemetry/application_credentials.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/teslemetry/oauth.py
"""Provide oauth implementations for the Teslemetry integration.""" from __future__ import annotations from typing import Any from homeassistant.core import HomeAssistant from homeassistant.helpers import config_entry_oauth2_flow from .const import AUTHORIZE_URL, TOKEN_URL class TeslemetryImplementation( conf...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/teslemetry/oauth.py", "license": "Apache License 2.0", "lines": 39, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/tibber/application_credentials.py
"""Application credentials platform for Tibber.""" from homeassistant.components.application_credentials import AuthorizationServer from homeassistant.core import HomeAssistant AUTHORIZE_URL = "https://thewall.tibber.com/connect/authorize" TOKEN_URL = "https://thewall.tibber.com/connect/token" async def async_get_a...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/tibber/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/tplink_omada/services.py
"""Services for the TP-Link Omada integration.""" from typing import cast from tplink_omada_client.exceptions import OmadaClientException import voluptuous as vol from homeassistant.config_entries import ConfigEntry, ConfigEntryState from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/tplink_omada/services.py", "license": "Apache License 2.0", "lines": 58, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/transmission/helpers.py
"""Helper functions for Transmission.""" from typing import Any from transmission_rpc.torrent import Torrent def format_torrent(torrent: Torrent) -> dict[str, Any]: """Format a single torrent.""" value: dict[str, Any] = {} value["id"] = torrent.id value["name"] = torrent.name value["status"] = ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/transmission/helpers.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/update/trigger.py
"""Provides triggers for update platform.""" from homeassistant.const import STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN TRIGGERS: dict[str, type[Trigger]] = { "update_became_available": make_e...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/update/trigger.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/vesync/services.py
"""Support for VeSync Services.""" from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant, ServiceCall, callback from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers.dispatcher import async_dispatcher_send from . import VesyncConfigEntr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vesync/services.py", "license": "Apache License 2.0", "lines": 27, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/vivotek/config_flow.py
"""Config flow for Vivotek IP cameras integration.""" import logging from typing import Any from libpyvivotek.vivotek import SECURITY_LEVELS, VivotekCameraError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult, OptionsFlow from homeassistant.const import ( CONF_AUTHE...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vivotek/config_flow.py", "license": "Apache License 2.0", "lines": 160, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/vivotek/const.py
"""Constants for the Vivotek integration.""" CONF_FRAMERATE = "framerate" CONF_SECURITY_LEVEL = "security_level" CONF_STREAM_PATH = "stream_path" DOMAIN = "vivotek" MANUFACTURER = "Vivotek" INTEGRATION_TITLE = "Vivotek"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vivotek/const.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/watts/application_credentials.py
"""Application credentials for Watts integration.""" from homeassistant.components.application_credentials import AuthorizationServer from homeassistant.core import HomeAssistant from .const import OAUTH2_AUTHORIZE, OAUTH2_TOKEN async def async_get_authorization_server(hass: HomeAssistant) -> AuthorizationServer: ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/application_credentials.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/watts/climate.py
"""Climate platform for Watts Vision integration.""" from __future__ import annotations import logging from typing import Any from visionpluspython.models import ThermostatDevice from homeassistant.components.climate import ( ClimateEntity, ClimateEntityFeature, HVACMode, ) from homeassistant.const impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/climate.py", "license": "Apache License 2.0", "lines": 131, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/watts/config_flow.py
"""Config flow for Watts Vision integration.""" from collections.abc import Mapping import logging from typing import Any from visionpluspython.auth import WattsVisionAuth from homeassistant.config_entries import ( SOURCE_REAUTH, SOURCE_RECONFIGURE, ConfigFlowResult, ) from homeassistant.helpers import c...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/config_flow.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/watts/const.py
"""Constants for the Watts Vision+ integration.""" from visionpluspython.models import SwitchDevice, ThermostatDevice, ThermostatMode from homeassistant.components.climate import HVACMode DOMAIN = "watts" OAUTH2_AUTHORIZE = "https://visionlogin.b2clogin.com/visionlogin.onmicrosoft.com/B2C_1A_VISION_UNIFIEDSIGNUPORS...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/const.py", "license": "Apache License 2.0", "lines": 29, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/watts/coordinator.py
"""Data coordinator for Watts Vision integration.""" from __future__ import annotations from dataclasses import dataclass from datetime import datetime, timedelta import logging from typing import TYPE_CHECKING from visionpluspython.client import WattsVisionClient from visionpluspython.exceptions import ( WattsV...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/coordinator.py", "license": "Apache License 2.0", "lines": 209, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/watts/entity.py
"""Base entity for Watts Vision integration.""" from __future__ import annotations from typing import cast from visionpluspython.models import Device from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .c...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/entity.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/wmspro/switch.py
"""Support for loads connected with WMS WebControl pro.""" from __future__ import annotations from datetime import timedelta from typing import Any from wmspro.const import ( WMS_WebControl_pro_API_actionDescription, WMS_WebControl_pro_API_responseType, ) from homeassistant.components.switch import SwitchEn...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/wmspro/switch.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/wsdot/config_flow.py
"""Adds config flow for wsdot.""" import logging from types import MappingProxyType from typing import Any import voluptuous as vol import wsdot as wsdot_api from homeassistant.config_entries import ( SOURCE_USER, ConfigEntry, ConfigFlow, ConfigFlowResult, ConfigSubentry, ConfigSubentryFlow, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/wsdot/config_flow.py", "license": "Apache License 2.0", "lines": 136, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/wsdot/const.py
"""Constants for wsdot component.""" ATTRIBUTION = "Data provided by WSDOT" CONF_DATA = "data" CONF_TITLE = "title" CONF_TRAVEL_TIMES = "travel_time" DOMAIN = "wsdot" SUBENTRY_TRAVEL_TIMES = "travel_time"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/wsdot/const.py", "license": "Apache License 2.0", "lines": 7, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/actron_air/test_switch.py
"""Tests for the Actron Air switch platform.""" from unittest.mock import MagicMock, patch from actron_neo_api import ActronAirAPIError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import ( DOMAIN as SWITCH_DOMAIN, SERVICE_TURN_OFF, SERVICE_TURN_ON, ) ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/actron_air/test_switch.py", "license": "Apache License 2.0", "lines": 106, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/adguard/test_switch.py
"""Tests for the AdGuard Home switch entity.""" from collections.abc import Callable import logging from typing import Any from unittest.mock import AsyncMock from adguardhome import AdGuardHomeError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import SERVICE_TURN...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adguard/test_switch.py", "license": "Apache License 2.0", "lines": 139, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airobot/test_diagnostics.py
"""Test the Airobot 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_dia...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/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/airobot/test_number.py
"""Test the Airobot number platform.""" from unittest.mock import AsyncMock from pyairobotrest.exceptions import AirobotError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.number import ( ATTR_VALUE, DOMAIN as NUMBER_DOMAIN, SERVICE_SET_VALUE, ) from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/test_number.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/airobot/test_sensor.py
"""Tests for the Airobot sensor platform.""" 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 tests.common import MockConfigEntry, snapshot_platform @pytest...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airobot/test_sensor.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/airpatrol/test_climate.py
"""Test the AirPatrol climate platform.""" from collections.abc import Generator from datetime import timedelta from typing import Any from unittest.mock import patch from airpatrol.api import AirPatrolAPI from freezegun.api import FrozenDateTimeFactory import pytest from homeassistant.components.airpatrol.climate i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airpatrol/test_climate.py", "license": "Apache License 2.0", "lines": 333, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airpatrol/test_config_flow.py
"""Test the AirPatrol config flow.""" from unittest.mock import patch from airpatrol.api import AirPatrolAPI, AirPatrolAuthenticationError, AirPatrolError import pytest from homeassistant.components.airpatrol.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CON...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airpatrol/test_config_flow.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/airpatrol/test_init.py
"""Test the AirPatrol integration setup.""" from unittest.mock import patch from airpatrol.api import AirPatrolAPI, AirPatrolAuthenticationError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant, State from tests.common import MockConfigEntry async def test_loa...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airpatrol/test_init.py", "license": "Apache License 2.0", "lines": 56, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/airpatrol/test_sensor.py
"""Test the AirPatrol sensor platform.""" from collections.abc import Generator from unittest.mock import patch from airpatrol.api import AirPatrolAPI import pytest from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from test...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airpatrol/test_sensor.py", "license": "Apache License 2.0", "lines": 45, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/anglian_water/test_coordinator.py
"""Tests for the Anglian Water coordinator.""" from unittest.mock import AsyncMock from pyanglianwater.meter import SmartMeter import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.anglian_water.coordinator import ( AnglianWaterUpdateCoordinator, ) from homeassistant.componen...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/anglian_water/test_coordinator.py", "license": "Apache License 2.0", "lines": 142, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/bsblan/test_services.py
"""Tests for BSB-LAN services.""" from datetime import time from typing import Any from unittest.mock import MagicMock from bsblan import BSBLANError, DaySchedule, DeviceTime, TimeSlot from freezegun.api import FrozenDateTimeFactory import pytest import voluptuous as vol from homeassistant.components.bsblan.const im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bsblan/test_services.py", "license": "Apache License 2.0", "lines": 531, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/button/test_trigger.py
"""Test button trigger.""" import pytest from homeassistant.const import ( ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN, ) from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigger, parametrize_target_e...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/button/test_trigger.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/cookidoo/test_calendar.py
"""Test for calendar platform of the Cookidoo integration.""" from collections.abc import Generator from datetime import UTC, datetime from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.config_entries import ConfigEntryState from homeassistant.c...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/cookidoo/test_calendar.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/device_tracker/test_trigger.py
"""Test device_tracker trigger.""" from typing import Any import pytest from homeassistant.const import ( ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_HOME, STATE_NOT_HOME, ) from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigger...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/device_tracker/test_trigger.py", "license": "Apache License 2.0", "lines": 191, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/egauge/test_config_flow.py
"""Tests for the eGauge config flow.""" from unittest.mock import MagicMock from egauge_async.exceptions import EgaugeAuthenticationError, EgaugePermissionError from httpx import ConnectError import pytest from homeassistant.components.egauge.const import DOMAIN from homeassistant.config_entries import SOURCE_USER f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/egauge/test_config_flow.py", "license": "Apache License 2.0", "lines": 116, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/egauge/test_init.py
"""Tests for the eGauge integration.""" from unittest.mock import MagicMock from egauge_async.exceptions import ( EgaugeAuthenticationError, EgaugeParsingException, EgaugePermissionError, ) from httpx import ConnectError import pytest from homeassistant.config_entries import ConfigEntryState from homeass...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/egauge/test_init.py", "license": "Apache License 2.0", "lines": 60, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/egauge/test_sensor.py
"""Tests for the eGauge sensor platform.""" from datetime import timedelta from unittest.mock import MagicMock from egauge_async.exceptions import EgaugeAuthenticationError from freezegun.api import FrozenDateTimeFactory from httpx import ConnectError import pytest from syrupy.assertion import SnapshotAssertion from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/egauge/test_sensor.py", "license": "Apache License 2.0", "lines": 115, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/ekeybionyx/test_event.py
"""Test the ekey bionyx event platform.""" from http import HTTPStatus from aiohttp.test_utils import TestClient from homeassistant.components.event import ATTR_EVENT_TYPE, ATTR_EVENT_TYPES from homeassistant.config_entries import ConfigEntryState from homeassistant.const import STATE_UNAVAILABLE, STATE_UNKNOWN from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ekeybionyx/test_event.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/fish_audio/const.py
"""Constants for the Testing of the Fish Audio text-to-speech integration.""" from unittest.mock import MagicMock from fishaudio.types import Voice from fishaudio.types.account import Credits MOCK_VOICE_1 = MagicMock(spec=Voice) MOCK_VOICE_1.id = "voice-alpha" MOCK_VOICE_1.title = "Alpha Voice" MOCK_VOICE_1.language...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fish_audio/const.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fish_audio/test_config_flow.py
"""Config flow tests for Fish Audio.""" from __future__ import annotations from unittest.mock import AsyncMock from fishaudio import AuthenticationError, FishAudioError import pytest from homeassistant.components.fish_audio.const import ( CONF_BACKEND, CONF_LANGUAGE, CONF_LATENCY, CONF_NAME, CON...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fish_audio/test_config_flow.py", "license": "Apache License 2.0", "lines": 265, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fish_audio/test_init.py
"""Tests for the Fish Audio integration setup.""" from __future__ import annotations from unittest.mock import AsyncMock from fishaudio import FishAudioError, ServerError import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import Mo...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fish_audio/test_init.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fish_audio/test_tts.py
"""Tests for the Fish Audio TTS entity.""" from __future__ import annotations from http import HTTPStatus from pathlib import Path from unittest.mock import AsyncMock, MagicMock from fishaudio import RateLimitError from fishaudio.exceptions import ServerError import pytest from homeassistant.components import tts f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fish_audio/test_tts.py", "license": "Apache License 2.0", "lines": 263, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fluss/test_button.py
"""Tests for the Fluss Buttons.""" from __future__ import annotations from unittest.mock import AsyncMock from fluss_api import FlussApiClient, FlussApiClientError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from hom...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fluss/test_button.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fluss/test_config_flow.py
"""Tests for the Fluss+ config flow.""" from unittest.mock import AsyncMock from fluss_api import ( FlussApiClientAuthenticationError, FlussApiClientCommunicationError, ) import pytest from homeassistant.components.fluss.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fluss/test_config_flow.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/fluss/test_init.py
"""Test script for Fluss+ integration initialization.""" from unittest.mock import AsyncMock from fluss_api import ( FlussApiClientAuthenticationError, FlussApiClientCommunicationError, FlussApiClientError, ) import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.core ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fluss/test_init.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/fressnapf_tracker/test_binary_sensor.py
"""Test the Fressnapf Tracker binary_sensor platform.""" from collections.abc import AsyncGenerator 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 enti...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fressnapf_tracker/test_config_flow.py
"""Test the Fressnapf Tracker config flow.""" from collections.abc import Callable from unittest.mock import AsyncMock, MagicMock from fressnapftracker import ( FressnapfTrackerInvalidPhoneNumberError, FressnapfTrackerInvalidTokenError, SmsCodeResponse, ) import pytest from homeassistant import config_en...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_config_flow.py", "license": "Apache License 2.0", "lines": 378, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fressnapf_tracker/test_device_tracker.py
"""Test the Fressnapf Tracker device tracker platform.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, MagicMock, patch from fressnapftracker import Tracker import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNAVAILABLE, Platform from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_device_tracker.py", "license": "Apache License 2.0", "lines": 46, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fressnapf_tracker/test_init.py
"""Test the Fressnapf Tracker integration init.""" from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from fressnapftracker import ( FressnapfTrackerError, FressnapfTrackerInvalidTrackerResponseError, ) import pytest from syrupy.assertion import SnapshotAssertion from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_init.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/fressnapf_tracker/test_light.py
"""Test the Fressnapf Tracker light platform.""" from collections.abc import AsyncGenerator from unittest.mock import MagicMock, patch from fressnapftracker import ( FressnapfTrackerError, FressnapfTrackerInvalidTokenError, Tracker, TrackerFeatures, TrackerSettings, ) import pytest from syrupy.ass...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_light.py", "license": "Apache License 2.0", "lines": 181, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fressnapf_tracker/test_sensor.py
"""Test the Fressnapf Tracker sensor platform.""" from collections.abc import AsyncGenerator 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_regi...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_sensor.py", "license": "Apache License 2.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/fressnapf_tracker/test_switch.py
"""Test the Fressnapf Tracker switch platform.""" from collections.abc import AsyncGenerator from unittest.mock import MagicMock, patch from fressnapftracker import ( FressnapfTrackerError, FressnapfTrackerInvalidTokenError, Tracker, TrackerFeatures, TrackerSettings, ) import pytest from syrupy.as...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/fressnapf_tracker/test_switch.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/gentex_homelink/test_config_flow.py
"""Test the homelink config flow.""" from http import HTTPStatus from unittest.mock import AsyncMock import botocore.exceptions import pytest from homeassistant.components.gentex_homelink.const import DOMAIN, OAUTH2_TOKEN_URL from homeassistant.config_entries import SOURCE_USER from homeassistant.core import HomeAss...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/gentex_homelink/test_config_flow.py", "license": "Apache License 2.0", "lines": 152, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/gentex_homelink/test_event.py
"""Test that the devices and entities are correctly configured.""" import time from unittest.mock import AsyncMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNKNOWN from homeassistant.core import HomeAssistant import homeassistant.helpers.entity_registry as er...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/gentex_homelink/test_event.py", "license": "Apache License 2.0", "lines": 48, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/gentex_homelink/test_init.py
"""Test that the integration is initialized correctly.""" from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.gentex_homelink.const import DOMAIN from homeassistant.config_entries import ConfigEntryState from homeassistant.core import ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/gentex_homelink/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/google_drive/test_diagnostic.py
"""Test GIOS diagnostics.""" import json from unittest.mock import AsyncMock, MagicMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.backup import DOMAIN as BACKUP_DOMAIN, AgentBackup from homeassistant.core import HomeAssistant from homeassistant.setup import async_setu...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_drive/test_diagnostic.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/google_drive/test_sensor.py
"""Tests for the Google Drive sensor platform.""" import json from unittest.mock import AsyncMock, MagicMock from freezegun.api import FrozenDateTimeFactory from google_drive_api.exceptions import GoogleDriveApiError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.backup im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_drive/test_sensor.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/growatt_server/test_services.py
"""Test Growatt Server services.""" from unittest.mock import patch import growattServer import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.growatt_server.const import DOMAIN from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/growatt_server/test_services.py", "license": "Apache License 2.0", "lines": 586, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hikvision/test_binary_sensor.py
"""Test Hikvision binary sensors.""" import logging from unittest.mock import MagicMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.hikvision.const import DOMAIN from homeassistant.const import (...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hikvision/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 278, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hikvision/test_config_flow.py
"""Test the Hikvision config flow.""" from unittest.mock import AsyncMock, MagicMock import requests from homeassistant.components.hikvision.const import DOMAIN from homeassistant.config_entries import SOURCE_IMPORT, SOURCE_USER from homeassistant.const import ( CONF_HOST, CONF_PASSWORD, CONF_PORT, C...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hikvision/test_config_flow.py", "license": "Apache License 2.0", "lines": 355, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/hikvision/test_init.py
"""Test Hikvision integration setup and unload.""" from unittest.mock import MagicMock from xml.etree.ElementTree import ParseError import pytest import requests from homeassistant.config_entries import ConfigEntryState from homeassistant.const import CONF_SSL from homeassistant.core import HomeAssistant from . imp...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hikvision/test_init.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_trigger.py
"""Test humidifier trigger.""" from typing import Any import pytest from homeassistant.components.humidifier.const import ( ATTR_ACTION, ATTR_CURRENT_HUMIDITY, HumidifierAction, ) from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/humidifier/test_trigger.py", "license": "Apache License 2.0", "lines": 374, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/lamarzocco/test_bluetooth.py
"""Tests for La Marzocco Bluetooth connection.""" from datetime import timedelta from unittest.mock import MagicMock, patch from bleak.backends.device import BLEDevice from freezegun.api import FrozenDateTimeFactory from pylamarzocco.const import MachineMode, ModelName, WidgetType from pylamarzocco.exceptions import ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/lamarzocco/test_bluetooth.py", "license": "Apache License 2.0", "lines": 358, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/lock/test_trigger.py
"""Test lock triggers.""" from typing import Any import pytest from homeassistant.components.lock import DOMAIN, LockState from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigg...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/lock/test_trigger.py", "license": "Apache License 2.0", "lines": 222, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/nederlandse_spoorwegen/test_diagnostics.py
"""Tests for the diagnostics data provided by the Nederlandse Spoorwegen integration.""" from unittest.mock import AsyncMock import pytest from syrupy.assertion import SnapshotAssertion from syrupy.filters import props from homeassistant.components.nederlandse_spoorwegen.const import DOMAIN from homeassistant.core i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/nederlandse_spoorwegen/test_diagnostics.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/nintendo_parental_controls/test_select.py
"""Tests for Nintendo Switch Parental Controls select platform.""" from unittest.mock import AsyncMock, patch from pynintendoparental.enum import DeviceTimerMode from syrupy.assertion import SnapshotAssertion from homeassistant.components.select import ( ATTR_OPTION, DOMAIN as SELECT_DOMAIN, SERVICE_SELE...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/nintendo_parental_controls/test_select.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/openrgb/test_select.py
"""Tests for the OpenRGB select platform.""" from collections.abc import Generator from types import SimpleNamespace from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory from openrgb.utils import OpenRGBDisconnected import pytest from syrupy.assertion import SnapshotAssertion fr...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/openrgb/test_select.py", "license": "Apache License 2.0", "lines": 341, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pooldose/test_number.py
"""Tests for the Seko PoolDose number platform.""" from copy import deepcopy from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory from pooldose.request_status import RequestStatus import pytest from syrupy.assertion import SnapshotAssertion from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pooldose/test_number.py", "license": "Apache License 2.0", "lines": 135, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pooldose/test_select.py
"""Tests for the Seko PoolDose select platform.""" from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory from pooldose.request_status import RequestStatus import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.select imp...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pooldose/test_select.py", "license": "Apache License 2.0", "lines": 249, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/risco/test_services.py
"""Tests for the Risco services.""" from datetime import datetime from unittest.mock import patch import pytest from homeassistant.components.risco import DOMAIN from homeassistant.components.risco.const import SERVICE_SET_TIME from homeassistant.config_entries import ConfigEntryState from homeassistant.const import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/risco/test_services.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/saunum/test_binary_sensor.py
"""Test the Saunum binary sensor platform.""" from __future__ import annotations from dataclasses import replace from freezegun.api import FrozenDateTimeFactory from pysaunum import SaunumException import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNAVAILABLE, Platfo...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_binary_sensor.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/saunum/test_sensor.py
"""Test the Saunum sensor platform.""" from __future__ import annotations from dataclasses import replace from freezegun.api import FrozenDateTimeFactory from pysaunum import SaunumException import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNAVAILABLE, Platform from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_sensor.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/components/scene/test_trigger.py
"""Test scene trigger.""" import pytest from homeassistant.const import ( ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_UNAVAILABLE, STATE_UNKNOWN, ) from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, arm_trigger, parametrize_target_en...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/scene/test_trigger.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/shelly/test_services.py
"""Tests for Shelly services.""" from unittest.mock import Mock from aioshelly.exceptions import DeviceConnectionError, RpcCallError import pytest from homeassistant.components.shelly.const import ATTR_KEY, ATTR_VALUE, DOMAIN from homeassistant.components.shelly.services import ( SERVICE_GET_KVS_VALUE, SERVI...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/shelly/test_services.py", "license": "Apache License 2.0", "lines": 229, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/siren/test_trigger.py
"""Test siren triggers.""" from typing import Any import pytest from homeassistant.components.siren import DOMAIN from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/siren/test_trigger.py", "license": "Apache License 2.0", "lines": 189, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/sunricher_dali/test_scene.py
"""Test the Sunricher DALI scene platform.""" from unittest.mock import MagicMock import pytest from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import de...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/sunricher_dali/test_scene.py", "license": "Apache License 2.0", "lines": 79, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/switch/test_trigger.py
"""Test switch triggers.""" from typing import Any import pytest from homeassistant.components.switch import DOMAIN from homeassistant.const import ATTR_LABEL_ID, CONF_ENTITY_ID, STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant, ServiceCall from tests.components import ( TriggerStateDescription,...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/switch/test_trigger.py", "license": "Apache License 2.0", "lines": 189, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/switchbot/test_button.py
"""Tests for the switchbot button platform.""" from collections.abc import Callable from datetime import UTC, datetime, timedelta, timezone from unittest.mock import AsyncMock, patch import pytest from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.const import ATTR_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/switchbot/test_button.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/components/template/test_validators.py
"""Test template validators.""" from typing import Any import pytest from homeassistant.components.template import validators as cv from homeassistant.components.template.template_entity import TemplateEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.template import Template from .conf...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/template/test_validators.py", "license": "Apache License 2.0", "lines": 962, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/tibber/test_sensor.py
"""Tests for the Tibber Data API sensors and coordinator.""" from __future__ import annotations from unittest.mock import AsyncMock import pytest from homeassistant.components.recorder import Recorder from homeassistant.components.tibber.const import DOMAIN from homeassistant.core import HomeAssistant from homeassi...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/tibber/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/tplink_omada/test_binary_sensor.py
"""Tests for TP-Link Omada sensor entities.""" from datetime import timedelta from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from tplink_omada_client.definitions import DeviceStatus, DeviceStatusCategory from tpli...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/tplink_omada/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 105, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/tplink_omada/test_services.py
"""Tests for TP-Link Omada integration services.""" from unittest.mock import MagicMock import pytest from tplink_omada_client.exceptions import OmadaClientException from homeassistant.components.tplink_omada.const import DOMAIN from homeassistant.components.tplink_omada.services import async_setup_services from hom...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/tplink_omada/test_services.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/transmission/test_sensor.py
"""Tests for the Transmission sensor platform.""" from unittest.mock import AsyncMock, 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 setup_integration f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/transmission/test_sensor.py", "license": "Apache License 2.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test