sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:tests/components/transmission/test_services.py
"""Tests for the Transmission services.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.transmission.const import ( ATTR_DELETE_DATA, ATTR_DOWNLOAD_PATH, ATTR_LABELS, ATTR_TORRENT, ATTR_TORRENT_FILTER, ATTR_TORRENTS, CONF_ENTRY_ID, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/transmission/test_services.py", "license": "Apache License 2.0", "lines": 290, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/transmission/test_switch.py
"""Tests for the Transmission switch platform.""" from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from transmission_rpc.session import Session from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/transmission/test_switch.py", "license": "Apache License 2.0", "lines": 122, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/update/test_trigger.py
"""Test update triggers.""" from typing import Any import pytest from homeassistant.components.update 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/update/test_trigger.py", "license": "Apache License 2.0", "lines": 173, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/velux/test_init.py
"""Tests for Velux integration initialization and retry behavior. These tests verify that setup retries (ConfigEntryNotReady) are triggered when scene or node loading fails. They also verify that unloading the integration properly disconnects. """ from __future__ import annotations from unittest.mock import patch ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_init.py", "license": "Apache License 2.0", "lines": 124, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/vesync/test_services.py
"""Tests for VeSync services.""" from unittest.mock import AsyncMock import pytest from pyvesync import VeSync from homeassistant.components.vesync import async_setup from homeassistant.components.vesync.const import DOMAIN, SERVICE_UPDATE_DEVS from homeassistant.config_entries import ConfigEntry, ConfigEntryState f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/vesync/test_services.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/vivotek/test_camera.py
"""Tests for the Vivotek camera integration.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from . import setup_integration from tests.common import MockConfigEntry, sn...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/vivotek/test_camera.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/vivotek/test_config_flow.py
"""Tests for the Vivotek config flow.""" from unittest.mock import AsyncMock from libpyvivotek.vivotek import VivotekCameraError import pytest from homeassistant.components.vivotek.camera import DEFAULT_FRAMERATE, DEFAULT_NAME from homeassistant.components.vivotek.const import ( CONF_FRAMERATE, CONF_SECURITY...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/vivotek/test_config_flow.py", "license": "Apache License 2.0", "lines": 207, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/watts/test_application_credentials.py
"""Test application credentials for Watts integration.""" from homeassistant.components.watts.application_credentials import ( async_get_authorization_server, ) from homeassistant.components.watts.const import OAUTH2_AUTHORIZE, OAUTH2_TOKEN from homeassistant.core import HomeAssistant async def test_async_get_au...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/watts/test_application_credentials.py", "license": "Apache License 2.0", "lines": 11, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/watts/test_climate.py
"""Tests for the Watts Vision climate platform.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from visionpluspython.models import ThermostatMode from homeassistant.components.cl...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/watts/test_climate.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/watts/test_config_flow.py
"""Test the Watts Vision config flow.""" from unittest.mock import patch import pytest from homeassistant import config_entries from homeassistant.components.watts.const import DOMAIN, OAUTH2_AUTHORIZE, OAUTH2_TOKEN from homeassistant.core import HomeAssistant from homeassistant.data_entry_flow import FlowResultType...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/watts/test_config_flow.py", "license": "Apache License 2.0", "lines": 373, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/watts/test_init.py
"""Test the Watts Vision integration initialization.""" from datetime import timedelta from unittest.mock import AsyncMock from aiohttp import ClientError from freezegun.api import FrozenDateTimeFactory import pytest from visionpluspython.exceptions import ( WattsVisionAuthError, WattsVisionConnectionError, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/watts/test_init.py", "license": "Apache License 2.0", "lines": 293, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/web_rtc/test_init.py
"""Test the WebRTC integration.""" from webrtc_models import RTCIceServer from homeassistant.components.web_rtc import ( async_get_ice_servers, async_register_ice_servers, ) from homeassistant.core import HomeAssistant, callback from homeassistant.core_config import async_process_ha_core_config from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/web_rtc/test_init.py", "license": "Apache License 2.0", "lines": 212, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/wmspro/test_switch.py
"""Test the wmspro switch support.""" from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.components.wmspro.const import DOMAIN from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/wmspro/test_switch.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/wsdot/test_config_flow.py
"""Define tests for the wsdot config flow.""" from typing import Any from unittest.mock import AsyncMock import pytest from wsdot import WsdotTravelError from homeassistant.components.wsdot.const import ( CONF_TRAVEL_TIMES, DOMAIN, SUBENTRY_TRAVEL_TIMES, ) from homeassistant.config_entries import SOURCE_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/wsdot/test_config_flow.py", "license": "Apache License 2.0", "lines": 235, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/wsdot/test_init.py
"""The tests for the WSDOT platform.""" from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from homeassistant.helpers import issue_registry as ir from tests.common import MockConfigEntry async def test_travel_sensor_setup_no_auth( hass: HomeAssistant, mock...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/wsdot/test_init.py", "license": "Apache License 2.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/labs/helpers.py
"""Helper functions for the Home Assistant Labs integration.""" from __future__ import annotations from collections.abc import Callable, Coroutine from typing import Any from homeassistant.const import EVENT_LABS_UPDATED from homeassistant.core import Event, HomeAssistant, callback from homeassistant.helpers.frame i...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/labs/helpers.py", "license": "Apache License 2.0", "lines": 102, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/adguard/update.py
"""AdGuard Home Update platform.""" from __future__ import annotations from datetime import timedelta from typing import Any from adguardhome import AdGuardHomeError from homeassistant.components.update import UpdateEntity, UpdateEntityFeature from homeassistant.core import HomeAssistant from homeassistant.exceptio...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/adguard/update.py", "license": "Apache License 2.0", "lines": 54, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/airobot/climate.py
"""Climate platform for Airobot thermostat.""" from __future__ import annotations from typing import Any from pyairobotrest.const import ( MODE_AWAY, MODE_HOME, SETPOINT_TEMP_MAX, SETPOINT_TEMP_MIN, ) from pyairobotrest.exceptions import AirobotError from pyairobotrest.models import ThermostatSetting...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/climate.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/airobot/config_flow.py
"""Config flow for the Airobot integration.""" from __future__ import annotations import asyncio from collections.abc import Mapping from dataclasses import dataclass import logging from typing import Any from pyairobotrest import AirobotClient from pyairobotrest.exceptions import ( AirobotAuthError, Airobot...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/config_flow.py", "license": "Apache License 2.0", "lines": 232, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/airobot/coordinator.py
"""Coordinator for the Airobot integration.""" from __future__ import annotations import asyncio from datetime import timedelta import logging from pyairobotrest import AirobotClient from pyairobotrest.exceptions import AirobotAuthError, AirobotConnectionError from homeassistant.config_entries import ConfigEntry fr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/coordinator.py", "license": "Apache License 2.0", "lines": 56, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/airobot/entity.py
"""Base entity for Airobot integration.""" from __future__ import annotations from homeassistant.const import CONF_MAC from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinato...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/entity.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/airobot/models.py
"""Models for the Airobot integration.""" from __future__ import annotations from dataclasses import dataclass from pyairobotrest.models import ThermostatSettings, ThermostatStatus @dataclass class AirobotData: """Data from the Airobot coordinator.""" status: ThermostatStatus settings: ThermostatSetti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/models.py", "license": "Apache License 2.0", "lines": 9, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/alarm_control_panel/trigger.py
"""Provides triggers for alarm control panels.""" from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity import get_supported_features from homeassistant.helpers.trigger import ( EntityTargetStateTriggerBase, Trigger, make_enti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/alarm_control_panel/trigger.py", "license": "Apache License 2.0", "lines": 86, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/anglian_water/config_flow.py
"""Config flow for the Anglian Water integration.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any from aiohttp import CookieJar from pyanglianwater import AnglianWater from pyanglianwater.auth import MSOB2CAuth from pyanglianwater.exceptions import ( InvalidAccountIdErr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anglian_water/config_flow.py", "license": "Apache License 2.0", "lines": 149, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/anglian_water/coordinator.py
"""Anglian Water data coordinator.""" from __future__ import annotations from datetime import timedelta import logging from typing import Any from pyanglianwater import AnglianWater from pyanglianwater.exceptions import ExpiredAccessTokenError, UnknownEndpointError from homeassistant.components.recorder import get_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anglian_water/coordinator.py", "license": "Apache License 2.0", "lines": 148, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/anglian_water/entity.py
"""Anglian Water entity.""" from __future__ import annotations import logging from pyanglianwater.meter import SmartMeter from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import AnglianWat...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anglian_water/entity.py", "license": "Apache License 2.0", "lines": 36, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/anglian_water/sensor.py
"""Anglian Water sensor platform.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from enum import StrEnum from pyanglianwater.meter import SmartMeter from homeassistant.components.sensor import ( EntityCategory, SensorDeviceClass, SensorEntit...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anglian_water/sensor.py", "license": "Apache License 2.0", "lines": 96, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/anthropic/ai_task.py
"""AI Task integration for Anthropic.""" from __future__ import annotations from json import JSONDecodeError import logging from typing import TYPE_CHECKING from homeassistant.components import ai_task, conversation from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anthropic/ai_task.py", "license": "Apache License 2.0", "lines": 69, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/assist_satellite/trigger.py
"""Provides triggers for assist satellites.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN from .entity import AssistSatelliteState TRIGGERS: dict[str, type[Trigger]] = { "idle": make_entity_target_stat...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/assist_satellite/trigger.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/backblaze_b2/backup.py
"""Backup platform for the Backblaze B2 integration.""" import asyncio from collections.abc import AsyncIterator, Callable, Coroutine import functools import json import logging import mimetypes from time import time from typing import Any from b2sdk.v2 import FileVersion from b2sdk.v2.exception import B2Error from ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/backblaze_b2/backup.py", "license": "Apache License 2.0", "lines": 574, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/backblaze_b2/config_flow.py
"""Config flow for the Backblaze B2 integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Any from b2sdk.v2 import exception import voluptuous as vol from homeassistant.config_entries import ConfigEntry, ConfigFlow, ConfigFlowResult from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/backblaze_b2/config_flow.py", "license": "Apache License 2.0", "lines": 252, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/backblaze_b2/const.py
"""Constants for the Backblaze B2 integration.""" from collections.abc import Callable from typing import Final from homeassistant.util.hass_dict import HassKey DOMAIN: Final = "backblaze_b2" CONF_KEY_ID = "key_id" CONF_APPLICATION_KEY = "application_key" CONF_BUCKET = "bucket" CONF_PREFIX = "prefix" DATA_BACKUP_A...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/backblaze_b2/const.py", "license": "Apache License 2.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/backblaze_b2/diagnostics.py
"""Diagnostics support for Backblaze B2.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.core import HomeAssistant from . import BackblazeConfigEntry from .const import CONF_APPLICATION_KEY, CONF_KEY_ID TO_REDACT_ENT...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/backblaze_b2/diagnostics.py", "license": "Apache License 2.0", "lines": 44, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/backblaze_b2/repairs.py
"""Repair issues for the Backblaze B2 integration.""" from __future__ import annotations import logging from b2sdk.v2.exception import ( B2Error, NonExistentBucket, RestrictedBucket, Unauthorized, ) from homeassistant.components.repairs import ConfirmRepairFlow from homeassistant.config_entries impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/backblaze_b2/repairs.py", "license": "Apache License 2.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/binary_sensor/trigger.py
"""Provides triggers for binary sensors.""" from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.entity import get_device_class from homeassistant.helpers.trigger import EntityTargetStateTrigg...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/binary_sensor/trigger.py", "license": "Apache License 2.0", "lines": 50, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/brother/entity.py
"""Define the Brother entity.""" from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import BrotherDataUpdateCoordinator class BrotherPrinterEntity(CoordinatorEntity[Br...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/brother/entity.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/climate/trigger.py
"""Provides triggers for climates.""" import voluptuous as vol from homeassistant.const import ATTR_TEMPERATURE, CONF_OPTIONS from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers.trigger import ( ENTITY_STATE_TRIGGER_SCHEMA_FIRST_LAST, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/climate/trigger.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/cloud/ai_task.py
"""AI Task integration for Home Assistant Cloud.""" from __future__ import annotations import io from json import JSONDecodeError import logging from hass_nabucasa.llm import ( LLMAuthenticationError, LLMError, LLMImageAttachment, LLMRateLimitError, LLMResponseError, LLMServiceError, ) from P...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloud/ai_task.py", "license": "Apache License 2.0", "lines": 164, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/cloud/conversation.py
"""Conversation support for Home Assistant Cloud.""" from __future__ import annotations from typing import Literal from homeassistant.components import conversation from homeassistant.config_entries import ConfigEntry from homeassistant.const import MATCH_ALL from homeassistant.core import HomeAssistant from homeass...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloud/conversation.py", "license": "Apache License 2.0", "lines": 54, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/cloud/entity.py
"""Helpers for cloud LLM chat handling.""" import base64 from collections.abc import AsyncGenerator, Callable, Iterable from enum import StrEnum import json import logging import re from typing import Any, Literal, cast from hass_nabucasa import Cloud, NabuCasaBaseError from hass_nabucasa.llm import ( LLMAuthenti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloud/entity.py", "license": "Apache License 2.0", "lines": 539, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/duckdns/config_flow.py
"""Config flow for the Duck DNS integration.""" from __future__ import annotations import logging from typing import Any import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_ACCESS_TOKEN, CONF_DOMAIN, CONF_NAME from homeassistant.helpers...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/duckdns/config_flow.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/duckdns/const.py
"""Constants for the Duck DNS integration.""" from typing import Final DOMAIN = "duckdns" ATTR_CONFIG_ENTRY: Final = "config_entry_id" ATTR_TXT: Final = "txt" SERVICE_SET_TXT = "set_txt"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/duckdns/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/duckdns/issue.py
"""Issues for Duck DNS integration.""" from homeassistant.core import DOMAIN as HOMEASSISTANT_DOMAIN, HomeAssistant, callback from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue from .const import DOMAIN @callback def deprecate_yaml_issue(hass: HomeAssistant, *, import_success: bool) ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/duckdns/issue.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/energyid/config_flow.py
"""Config flow for EnergyID integration.""" import asyncio from collections.abc import Mapping import logging from typing import Any from aiohttp import ClientError, ClientResponseError from energyid_webhooks.client_v2 import WebhookClient import voluptuous as vol from homeassistant.config_entries import ( Confi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/energyid/config_flow.py", "license": "Apache License 2.0", "lines": 256, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/energyid/const.py
"""Constants for the EnergyID integration.""" from typing import Final DOMAIN: Final = "energyid" NAME: Final = "EnergyID" # --- Config Flow and Entry Data --- CONF_PROVISIONING_KEY: Final = "provisioning_key" CONF_PROVISIONING_SECRET: Final = "provisioning_secret" CONF_DEVICE_ID: Final = "device_id" CONF_DEVICE_NAM...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/energyid/const.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/energyid/energyid_sensor_mapping_flow.py
"""Subentry flow for EnergyID integration, handling sensor mapping management.""" import logging from typing import Any import voluptuous as vol from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass from homeassistant.config_entries import ConfigSubentryFlow, SubentryFlowResult from homeass...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/energyid/energyid_sensor_mapping_flow.py", "license": "Apache License 2.0", "lines": 126, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/esphome/websocket_api.py
"""ESPHome websocket API.""" import logging from typing import Any import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.core import HomeAssistant, callback from .const import CONF_NOISE_PSK _LOGGER = logging.getLogger(__name__) TYPE = "type" ENTRY_ID = "entry_id" @call...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/esphome/websocket_api.py", "license": "Apache License 2.0", "lines": 40, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/essent/config_flow.py
"""Config flow for Essent integration.""" from __future__ import annotations import logging from typing import Any from essent_dynamic_pricing import ( EssentClient, EssentConnectionError, EssentDataError, EssentResponseError, ) from homeassistant.config_entries import ConfigFlow, ConfigFlowResult f...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/essent/config_flow.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/essent/const.py
"""Constants for the Essent integration.""" from __future__ import annotations from datetime import timedelta from enum import StrEnum from typing import Final DOMAIN: Final = "essent" UPDATE_INTERVAL: Final = timedelta(hours=1) ATTRIBUTION: Final = "Data provided by Essent" class EnergyType(StrEnum): """Suppo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/essent/const.py", "license": "Apache License 2.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/essent/coordinator.py
"""DataUpdateCoordinator for Essent integration.""" from __future__ import annotations from collections.abc import Callable from datetime import datetime, timedelta import logging from essent_dynamic_pricing import ( EssentClient, EssentConnectionError, EssentDataError, EssentError, EssentPrices,...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/essent/coordinator.py", "license": "Apache License 2.0", "lines": 90, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/essent/entity.py
"""Base entity for Essent integration.""" from essent_dynamic_pricing.models import EnergyData from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import ATTRIBUTION, DOMAIN, EnergyType from .coordinator impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/essent/entity.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/fan/trigger.py
"""Provides triggers for fans.""" 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_off": make_entity_target_state...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/fan/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/go2rtc/util.py
"""Go2rtc utility functions.""" from pathlib import Path _HA_MANAGED_UNIX_SOCKET_FILE = "go2rtc.sock" def get_go2rtc_unix_socket_path(path: str | Path) -> str: """Get the Go2rtc unix socket path.""" if not isinstance(path, Path): path = Path(path) return str(path / _HA_MANAGED_UNIX_SOCKET_FILE)
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/go2rtc/util.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/google_air_quality/config_flow.py
"""Config flow for the Google Air Quality integration.""" from __future__ import annotations import logging from typing import Any from google_air_quality_api.api import GoogleAirQualityApi from google_air_quality_api.auth import Auth from google_air_quality_api.exceptions import GoogleAirQualityApiError import volu...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_air_quality/config_flow.py", "license": "Apache License 2.0", "lines": 194, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/google_air_quality/const.py
"""Constants for the Google Air Quality integration.""" from typing import Final DOMAIN = "google_air_quality" SECTION_API_KEY_OPTIONS: Final = "api_key_options" CONF_REFERRER: Final = "referrer"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_air_quality/const.py", "license": "Apache License 2.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_air_quality/coordinator.py
"""Coordinator for fetching data from Google Air Quality API.""" from dataclasses import dataclass from datetime import timedelta import logging from typing import Final from google_air_quality_api.api import GoogleAirQualityApi from google_air_quality_api.exceptions import GoogleAirQualityApiError from google_air_qu...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_air_quality/coordinator.py", "license": "Apache License 2.0", "lines": 55, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_air_quality/sensor.py
"""Creates the sensor entities for Google Air Quality.""" from collections.abc import Callable from dataclasses import dataclass import logging from typing import TYPE_CHECKING from google_air_quality_api.model import AirQualityCurrentConditionsData, Index from homeassistant.components.sensor import ( SensorDevi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_air_quality/sensor.py", "license": "Apache License 2.0", "lines": 241, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/google_weather/config_flow.py
"""Config flow for the Google Weather integration.""" from __future__ import annotations import logging from typing import Any from google_weather_api import GoogleWeatherApi, GoogleWeatherApiError import voluptuous as vol from homeassistant.config_entries import ( ConfigEntry, ConfigEntryState, ConfigF...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/config_flow.py", "license": "Apache License 2.0", "lines": 175, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/google_weather/const.py
"""Constants for the Google Weather integration.""" from typing import Final DOMAIN = "google_weather" SECTION_API_KEY_OPTIONS: Final = "api_key_options" CONF_REFERRER: Final = "referrer"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/const.py", "license": "Apache License 2.0", "lines": 5, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_weather/coordinator.py
"""The Google Weather coordinator.""" from __future__ import annotations from collections.abc import Awaitable, Callable from dataclasses import dataclass from datetime import timedelta import logging from typing import TypeVar from google_weather_api import ( CurrentConditionsResponse, DailyForecastResponse...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/coordinator.py", "license": "Apache License 2.0", "lines": 141, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_weather/entity.py
"""Base entity for Google Weather.""" from __future__ import annotations from homeassistant.config_entries import ConfigSubentry from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.entity import Entity from .const import DOMAIN from .coordinator import GoogleWeath...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/entity.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_weather/sensor.py
"""Support for Google Weather sensors.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from google_weather_api import CurrentConditionsResponse from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescript...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/sensor.py", "license": "Apache License 2.0", "lines": 215, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/google_weather/weather.py
"""Weather entity.""" from __future__ import annotations from google_weather_api import ( DailyForecastResponse, HourlyForecastResponse, WeatherCondition, ) from homeassistant.components.weather import ( ATTR_CONDITION_CLEAR_NIGHT, ATTR_CONDITION_CLOUDY, ATTR_CONDITION_HAIL, ATTR_CONDITIO...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/google_weather/weather.py", "license": "Apache License 2.0", "lines": 332, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hanna/config_flow.py
"""Config flow for Hanna Instruments integration.""" from __future__ import annotations import logging from typing import Any from hanna_cloud import AuthenticationError, HannaCloudClient from requests.exceptions import ConnectionError as RequestsConnectionError, Timeout import voluptuous as vol from homeassistant....
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hanna/config_flow.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/hanna/coordinator.py
"""Hanna Instruments data coordinator for Home Assistant. This module provides the data coordinator for fetching and managing Hanna Instruments sensor data. """ from datetime import timedelta import logging from typing import Any from hanna_cloud import HannaCloudClient from requests.exceptions import RequestExcepti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hanna/coordinator.py", "license": "Apache License 2.0", "lines": 58, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hanna/entity.py
"""Hanna Instruments entity base class for Home Assistant. This module provides the base entity class for Hanna Instruments entities. """ from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator imp...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hanna/entity.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/hanna/sensor.py
"""Hanna Instruments sensor integration for Home Assistant. This module provides sensor entities for various Hanna Instruments devices, including pH, ORP, temperature, and chemical sensors. It uses the Hanna API to fetch readings and updates them periodically. """ from __future__ import annotations import logging f...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hanna/sensor.py", "license": "Apache License 2.0", "lines": 92, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hue_ble/config_flow.py
"""Config flow for Hue BLE integration.""" from __future__ import annotations from enum import Enum import logging from typing import Any from bleak.backends.scanner import AdvertisementData from HueBLE import ConnectionError, HueBleError, HueBleLight, PairingError import voluptuous as vol from homeassistant.compon...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hue_ble/config_flow.py", "license": "Apache License 2.0", "lines": 159, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/hue_ble/light.py
"""Hue BLE light platform.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any from HueBLE import HueBleLight from homeassistant.components.light import ( ATTR_BRIGHTNESS, ATTR_COLOR_TEMP_KELVIN, ATTR_XY_COLOR, ColorMode, LightEntity, filter_supported_c...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hue_ble/light.py", "license": "Apache License 2.0", "lines": 121, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/labs/const.py
"""Constants for the Home Assistant Labs integration.""" from __future__ import annotations from homeassistant.util.hass_dict import HassKey from .models import LabsData DOMAIN = "labs" STORAGE_KEY = "core.labs" STORAGE_VERSION = 1 LABS_DATA: HassKey[LabsData] = HassKey(DOMAIN)
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/labs/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/labs/models.py
"""Data models for the Home Assistant Labs integration.""" from __future__ import annotations from dataclasses import dataclass, field from typing import TYPE_CHECKING, Self, TypedDict if TYPE_CHECKING: from homeassistant.helpers.storage import Store class EventLabsUpdatedData(TypedDict): """Event data for...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/labs/models.py", "license": "Apache License 2.0", "lines": 71, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/labs/websocket_api.py
"""Websocket API for the Home Assistant Labs integration.""" from __future__ import annotations from typing import Any import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.components.backup import async_get_manager from homeassistant.core import HomeAssistant, callback fro...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/labs/websocket_api.py", "license": "Apache License 2.0", "lines": 128, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/lawn_mower/trigger.py
"""Provides triggers for lawn mowers.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN, LawnMowerActivity TRIGGERS: dict[str, type[Trigger]] = { "docked": make_entity_target_state_trigger(DOMAIN, LawnMowe...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lawn_mower/trigger.py", "license": "Apache License 2.0", "lines": 15, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/light/condition.py
"""Provides conditions for lights.""" 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_stat...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/light/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/light/trigger.py
"""Provides triggers for lights.""" from typing import Any from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import ( EntityNumericalStateAttributeChangedTriggerBase, EntityNumericalStateAttributeCrossedThresholdTriggerBase, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/light/trigger.py", "license": "Apache License 2.0", "lines": 36, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/media_player/trigger.py
"""Provides triggers for media players.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_transition_trigger from . import MediaPlayerState from .const import DOMAIN TRIGGERS: dict[str, type[Trigger]] = { "stopped_playing": make_entity_transition_trigg...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/media_player/trigger.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/miele/select.py
"""Platform for Miele select entity.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from enum import IntEnum import logging from typing import Final from aiohttp import ClientResponseError from homeassistant.components.select import SelectEntity, SelectE...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/miele/select.py", "license": "Apache License 2.0", "lines": 121, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nasweb/alarm_control_panel.py
"""Platform for NASweb alarms.""" from __future__ import annotations import logging import time from webio_api import Zone as NASwebZone from webio_api.const import STATE_ZONE_ALARM, STATE_ZONE_ARMED, STATE_ZONE_DISARMED from homeassistant.components.alarm_control_panel import ( DOMAIN as ALARM_CONTROL_PANEL_DO...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nasweb/alarm_control_panel.py", "license": "Apache License 2.0", "lines": 130, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nederlandse_spoorwegen/binary_sensor.py
"""Support for Nederlandse Spoorwegen public transport.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from datetime import datetime import logging from ns_api import Trip from homeassistant.components.binary_sensor import ( BinarySensorEntity, B...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nederlandse_spoorwegen/binary_sensor.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/niko_home_control/climate.py
"""Support for Niko Home Control thermostats.""" from typing import Any from nhc.const import THERMOSTAT_MODES, THERMOSTAT_MODES_REVERSE from nhc.thermostat import NHCThermostat from homeassistant.components.climate import ( PRESET_ECO, ClimateEntity, ClimateEntityFeature, HVACMode, ) from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/niko_home_control/climate.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/noaa_tides/const.py
"""Constants for the NOAA Tides integration.""" from datetime import timedelta CONF_STATION_ID = "station_id" DEFAULT_NAME = "NOAA Tides" DEFAULT_PREDICTION_LENGTH = timedelta(days=2) DEFAULT_TIMEZONE = "lst_ldt" ATTRIBUTION = "Data provided by NOAA"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/noaa_tides/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/pooldose/binary_sensor.py
"""Binary sensors for the Seko PoolDose integration.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, cast from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistant.const impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/pooldose/binary_sensor.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/pooldose/switch.py
"""Switches for the Seko PoolDose integration.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any, cast from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/pooldose/switch.py", "license": "Apache License 2.0", "lines": 81, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/satel_integra/entity.py
"""Satel Integra base entity.""" from __future__ import annotations from typing import TYPE_CHECKING from satel_integra.satel_integra import AsyncSatel from homeassistant.config_entries import ConfigSubentry from homeassistant.const import CONF_NAME from homeassistant.helpers.device_registry import DeviceInfo from ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/satel_integra/entity.py", "license": "Apache License 2.0", "lines": 50, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/saunum/climate.py
"""Climate platform for Saunum Leil Sauna Control Unit.""" from __future__ import annotations import asyncio from datetime import timedelta from typing import Any from pysaunum import MAX_TEMPERATURE, MIN_TEMPERATURE, SaunumException from homeassistant.components.climate import ( FAN_HIGH, FAN_LOW, FAN_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/climate.py", "license": "Apache License 2.0", "lines": 236, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/saunum/config_flow.py
"""Config flow for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations import logging from typing import Any from pysaunum import SaunumClient, SaunumException import voluptuous as vol from homeassistant.config_entries import ( SOURCE_USER, ConfigFlow, ConfigFlowResult, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/config_flow.py", "license": "Apache License 2.0", "lines": 120, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/saunum/const.py
"""Constants for the Saunum Leil Sauna Control Unit integration.""" from datetime import timedelta from typing import Final DOMAIN: Final = "saunum" DEFAULT_SCAN_INTERVAL: Final = timedelta(seconds=60) DELAYED_REFRESH_SECONDS: Final = timedelta(seconds=3) # Option keys for preset names OPT_PRESET_NAME_TYPE_1: Final...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/const.py", "license": "Apache License 2.0", "lines": 14, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/saunum/coordinator.py
"""Coordinator for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations import logging from typing import TYPE_CHECKING from pysaunum import SaunumClient, SaunumData, SaunumException from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUp...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/coordinator.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/diagnostics.py
"""Diagnostics support for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations from dataclasses import asdict from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/diagnostics.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/saunum/entity.py
"""Base entity for Saunum Leil Sauna Control Unit integration.""" from __future__ import annotations from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import LeilSaunaCoordinator class Leil...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/entity.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/saunum/light.py
"""Light platform for Saunum Leil Sauna Control Unit.""" from __future__ import annotations from typing import TYPE_CHECKING, Any from pysaunum import SaunumException from homeassistant.components.light import ColorMode, LightEntity from homeassistant.core import HomeAssistant from homeassistant.exceptions import H...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/light.py", "license": "Apache License 2.0", "lines": 56, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/senz/diagnostics.py
"""Diagnostics platform for Senz integration.""" from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.core import HomeAssistant from . import SENZConfigEntry TO_REDACT = [ "access_token", "refresh_token", ] async def async_get_config_entry_diagnostic...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/senz/diagnostics.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/senz/sensor.py
"""nVent RAYCHEM SENZ sensor platform.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from pysenz import Thermostat from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/senz/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/shelly/ble_provisioning.py
"""BLE provisioning helpers for Shelly integration.""" from __future__ import annotations import asyncio from dataclasses import dataclass, field import logging from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.device_registry import format_mac from homeassistant.util.hass_dict import...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/shelly/ble_provisioning.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/switchbot/climate.py
"""Support for Switchbot Climate devices.""" from __future__ import annotations import logging from typing import Any import switchbot from switchbot import ( ClimateAction as SwitchBotClimateAction, ClimateMode as SwitchBotClimateMode, ) from homeassistant.components.climate import ( ClimateEntity, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switchbot/climate.py", "license": "Apache License 2.0", "lines": 114, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/tesla_fleet/update.py
"""Update platform for Tesla Fleet integration.""" from __future__ import annotations import time from typing import Any from tesla_fleet_api.const import Scope from tesla_fleet_api.tesla.vehicle.fleet import VehicleFleet from homeassistant.components.update import UpdateEntity, UpdateEntityFeature from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/tesla_fleet/update.py", "license": "Apache License 2.0", "lines": 98, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/text/trigger.py
"""Provides triggers for texts.""" 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 .const import DOMAIN class TextChangedTrigge...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/text/trigger.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/transmission/entity.py
"""Base class for Transmission entities.""" from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import EntityDescription from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import TransmissionDataUpdateCoordinato...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/transmission/entity.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/transmission/services.py
"""Define services for the Transmission integration.""" from enum import StrEnum from functools import partial import logging from typing import Any from transmission_rpc import Torrent import voluptuous as vol from homeassistant.const import CONF_ID from homeassistant.core import HomeAssistant, ServiceCall, Support...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/transmission/services.py", "license": "Apache License 2.0", "lines": 182, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/vacuum/trigger.py
"""Provides triggers for vacuum cleaners.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import Trigger, make_entity_target_state_trigger from .const import DOMAIN, VacuumActivity TRIGGERS: dict[str, type[Trigger]] = { "docked": make_entity_target_state_trigger(DOMAIN, VacuumA...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vacuum/trigger.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple