sample_id stringlengths 21 196 | text stringlengths 105 936k | metadata dict | category stringclasses 6
values |
|---|---|---|---|
home-assistant/core:tests/components/vesync/test_update.py | """Tests for the update module."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.update import DOMAIN as UPDATE_DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from .common import ALL_DEVIC... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/vesync/test_update.py",
"license": "Apache License 2.0",
"lines": 40,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/victron_ble/fixtures.py | """Fixtures for testing victron_ble."""
from home_assistant_bluetooth import BluetoothServiceInfo
NOT_VICTRON_SERVICE_INFO = BluetoothServiceInfo(
name="Not it",
address="61DE521B-F0BF-9F44-64D4-75BBE1738105",
rssi=-63,
manufacturer_data={3234: b"\x00\x01"},
service_data={},
service_uuids=[],
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_ble/fixtures.py",
"license": "Apache License 2.0",
"lines": 127,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/victron_ble/test_config_flow.py | """Test the Victron Bluetooth Low Energy config flow."""
from unittest.mock import AsyncMock
from home_assistant_bluetooth import BluetoothServiceInfo
import pytest
from homeassistant import config_entries
from homeassistant.components.victron_ble.const import DOMAIN
from homeassistant.config_entries import SOURCE_B... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_ble/test_config_flow.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/victron_ble/test_sensor.py | """Test updating sensors in the victron_ble integration."""
from home_assistant_bluetooth import BluetoothServiceInfo
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from .fixtures import (
VICTRON_B... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/victron_ble/test_sensor.py",
"license": "Apache License 2.0",
"lines": 51,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/volvo/test_lock.py | """Test Volvo locks."""
from collections.abc import Awaitable, Callable
from unittest.mock import patch
import pytest
from syrupy.assertion import SnapshotAssertion
from volvocarsapi.api import VolvoCarsApi
from volvocarsapi.models import VolvoApiException, VolvoCarsCommandResult
from homeassistant.components.lock i... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/volvo/test_lock.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/waqi/test_diagnostics.py | """Tests for the diagnostics data provided by the WAQI integration."""
from unittest.mock import AsyncMock
from syrupy.assertion import SnapshotAssertion
from homeassistant.core import HomeAssistant
from . import setup_integration
from tests.common import MockConfigEntry
from tests.components.diagnostics import ge... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/waqi/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 21,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_diagnostics.py | """Test for diagnostics platform of the Xbox integration."""
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
from tests.common import MockConfigEntry
from tests.components.diagnostics import get_diagno... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_diagnostics.py",
"license": "Apache License 2.0",
"lines": 24,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/xbox/test_media_source.py | """Tests for the Xbox media source platform."""
from httpx import HTTPStatusError, RequestError, Response, TimeoutException
import pytest
from pythonxbox.api.provider.people.models import PeopleResponse
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.media_player import BrowseError
from h... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/xbox/test_media_source.py",
"license": "Apache License 2.0",
"lines": 432,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_areas.py | """Test area template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
)
from tests.common import MockConfigEntry
from tests.helpers.template.helpers import ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_areas.py",
"license": "Apache License 2.0",
"lines": 257,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_base.py | """Test base template extension."""
from __future__ import annotations
import pytest
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.template import TemplateEnvironment
from homeassistant.helpers.template.extensions.base import (
BaseTemplateExtension,
TemplateFunction,
)
def ... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_base.py",
"license": "Apache License 2.0",
"lines": 238,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_datetime.py | """Test datetime template functions."""
from __future__ import annotations
from datetime import datetime
from types import MappingProxyType
from typing import Any
from unittest.mock import patch
from freezegun import freeze_time
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.exception... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_datetime.py",
"license": "Apache License 2.0",
"lines": 688,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_devices.py | """Test device template functions."""
from __future__ import annotations
import pytest
from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr, entity_registry as er
from homeassistant.helpers.template import TemplateError
from tests.common import MockConfigEntry
from te... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_devices.py",
"license": "Apache License 2.0",
"lines": 279,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_floors.py | """Test floor template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
floor_registry as fr,
)
from tests.common import MockConfigEntry
from tests.helpe... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_floors.py",
"license": "Apache License 2.0",
"lines": 240,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_issues.py | """Test issue template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from homeassistant.util import dt as dt_util
from tests.helpers.template.helpers import assert_result_info, render_to_info
async def test_issue... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_issues.py",
"license": "Apache License 2.0",
"lines": 107,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/helpers/template/extensions/test_labels.py | """Test label template functions."""
from __future__ import annotations
from homeassistant.core import HomeAssistant
from homeassistant.helpers import (
area_registry as ar,
device_registry as dr,
entity_registry as er,
label_registry as lr,
)
from tests.common import MockConfigEntry
from tests.helpe... | {
"repo_id": "home-assistant/core",
"file_path": "tests/helpers/template/extensions/test_labels.py",
"license": "Apache License 2.0",
"lines": 324,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/icloud/test_account.py | """Tests for the iCloud account."""
from unittest.mock import MagicMock, Mock, patch
import pytest
from homeassistant.components.icloud.account import IcloudAccount
from homeassistant.components.icloud.const import (
CONF_GPS_ACCURACY_THRESHOLD,
CONF_MAX_INTERVAL,
CONF_WITH_FAMILY,
DOMAIN,
)
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/icloud/test_account.py",
"license": "Apache License 2.0",
"lines": 130,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/recorder/db_schema_51.py | """Models for SQLAlchemy.
This file contains the model definitions for schema version 51.
It is used to test the schema migration logic.
"""
from __future__ import annotations
from collections.abc import Callable
from datetime import datetime, timedelta
import logging
import time
from typing import Any, Final, Proto... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/recorder/db_schema_51.py",
"license": "Apache License 2.0",
"lines": 756,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/recorder/test_migration_from_schema_51.py | """Test for migration from DB schema version 51."""
import importlib
import sys
import threading
from unittest.mock import patch
import pytest
from pytest_unordered import unordered
from sqlalchemy import create_engine, inspect
from sqlalchemy.orm import Session
from homeassistant.components import recorder
from hom... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/recorder/test_migration_from_schema_51.py",
"license": "Apache License 2.0",
"lines": 424,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/ukraine_alarm/test_init.py | """Test the Ukraine Alarm integration initialization."""
from unittest.mock import patch
from homeassistant.components.ukraine_alarm.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.helpers import issue_registry as ir
from . import REGIONS
from tests.common import MockConfigEntry
... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/ukraine_alarm/test_init.py",
"license": "Apache License 2.0",
"lines": 58,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:tests/components/airthings_ble/test_init.py | """Test the Airthings BLE integration init."""
from copy import deepcopy
from airthings_ble import AirthingsDeviceType
from freezegun.api import FrozenDateTimeFactory
import pytest
from homeassistant.components.airthings_ble.const import (
DEFAULT_SCAN_INTERVAL,
DEVICE_MODEL,
DEVICE_SPECIFIC_SCAN_INTERVA... | {
"repo_id": "home-assistant/core",
"file_path": "tests/components/airthings_ble/test_init.py",
"license": "Apache License 2.0",
"lines": 158,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | test |
home-assistant/core:homeassistant/components/actron_air/climate.py | """Climate platform for Actron Air integration."""
from typing import Any
from actron_neo_api import ActronAirStatus, ActronAirZone
from homeassistant.components.climate import (
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
ClimateEntity,
ClimateEntityFeature,
HVACMode,
)
from homeassistant.c... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/actron_air/climate.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/actron_air/config_flow.py | """Setup config flow for Actron Air integration."""
import asyncio
from collections.abc import Mapping
from typing import Any
from actron_neo_api import ActronAirAPI, ActronAirAuthError
from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_API_TOKEN... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/actron_air/config_flow.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/actron_air/coordinator.py | """Coordinator for Actron Air integration."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
from actron_neo_api import (
ActronAirACSystem,
ActronAirAPI,
ActronAirAPIError,
ActronAirAuthError,
ActronAirStatus,
)
from homeassistant.config_entr... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/actron_air/coordinator.py",
"license": "Apache License 2.0",
"lines": 70,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/control4/climate.py | """Platform for Control4 Climate/Thermostat."""
from __future__ import annotations
from datetime import timedelta
import logging
from typing import Any
from pyControl4.climate import C4Climate
from pyControl4.error_handling import C4Exception
from homeassistant.components.climate import (
ATTR_TARGET_TEMP_HIGH,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/control4/climate.py",
"license": "Apache License 2.0",
"lines": 348,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/elevenlabs/stt.py | """Support for the ElevenLabs speech-to-text service."""
from __future__ import annotations
from collections.abc import AsyncIterable
from io import BytesIO
import logging
from typing import Any
from elevenlabs import AsyncElevenLabs
from elevenlabs.core import ApiError
from elevenlabs.types import Model
from homea... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/elevenlabs/stt.py",
"license": "Apache License 2.0",
"lines": 179,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/fing/config_flow.py | """Config flow file."""
from contextlib import suppress
import logging
from typing import Any
from fing_agent_api import FingAgent
import httpx
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_API_KEY, CONF_IP_ADDRESS, CONF_PORT
from... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/fing/config_flow.py",
"license": "Apache License 2.0",
"lines": 95,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/fing/coordinator.py | """DataUpdateCoordinator for Fing integration."""
from dataclasses import dataclass, field
from datetime import timedelta
import logging
from fing_agent_api import FingAgent
from fing_agent_api.models import AgentInfoResponse, Device
import httpx
from homeassistant.config_entries import ConfigEntry
from homeassistan... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/fing/coordinator.py",
"license": "Apache License 2.0",
"lines": 70,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/fing/device_tracker.py | """Platform for Device tracker integration."""
from fing_agent_api.models import Device
from homeassistant.components.device_tracker import ScannerEntity
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.entity_platform import Add... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/fing/device_tracker.py",
"license": "Apache License 2.0",
"lines": 102,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/fing/utils.py | """Utils functions."""
from enum import Enum
class DeviceType(Enum):
"""Device types enum."""
GENERIC = "mdi:lan-connect"
MOBILE = PHONE = "mdi:cellphone"
TABLET = IPOD = EREADER = "mdi:tablet"
WATCH = WEARABLE = "mdi:watch"
CAR = AUTOMOTIVE = "mdi:car-back"
MEDIA_PLAYER = "mdi:volume-hi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/fing/utils.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/firefly_iii/config_flow.py | """Config flow for the Firefly III integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import Any
from pyfirefly import (
Firefly,
FireflyAuthenticationError,
FireflyConnectionError,
FireflyTimeoutError,
)
import voluptuous as vol
from ho... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/firefly_iii/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/firefly_iii/coordinator.py | """Data Update Coordinator for Firefly III integration."""
from __future__ import annotations
import asyncio
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
from aiohttp import CookieJar
from pyfirefly import (
Firefly,
FireflyAuthenticationError,
FireflyConnecti... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/firefly_iii/coordinator.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/firefly_iii/diagnostics.py | """Diagnostics for the Firefly III integration."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_API_KEY, CONF_URL
from homeassistant.core import HomeAssistant
from . import FireflyConfigEntry
from .c... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/firefly_iii/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/firefly_iii/entity.py | """Base entity for Firefly III integration."""
from __future__ import annotations
from pyfirefly.models import Account, Budget, Category
from yarl import URL
from homeassistant.const import CONF_URL
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.update_coordi... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/firefly_iii/entity.py",
"license": "Apache License 2.0",
"lines": 94,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/firefly_iii/sensor.py | """Sensor platform for Firefly III integration."""
from __future__ import annotations
from pyfirefly.models import Account, Budget, Category
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorStateClass,
StateType,
)
from homeassistant.const import EntityCategory
fro... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/firefly_iii/sensor.py",
"license": "Apache License 2.0",
"lines": 178,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/group/valve.py | """Platform allowing several valves to be grouped into one valve."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.components.valve import (
ATTR_CURRENT_POSITION,
ATTR_POSITION,
DOMAIN as VALVE_DOMAIN,
PLATFORM_SCHEMA as VALVE_PLATFORM_SCHEMA,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/group/valve.py",
"license": "Apache License 2.0",
"lines": 224,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/growatt_server/number.py | """Number platform for Growatt."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from growattServer import GrowattV1ApiError
from homeassistant.components.number import NumberEntity, NumberEntityDescription
from homeassistant.const import PERCENTAGE, EntityCategory
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/growatt_server/number.py",
"license": "Apache License 2.0",
"lines": 147,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/growatt_server/switch.py | """Switch platform for Growatt."""
from __future__ import annotations
from dataclasses import dataclass
import logging
from typing import Any
from growattServer import GrowattV1ApiError
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.const import EntityCategory
f... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/growatt_server/switch.py",
"license": "Apache License 2.0",
"lines": 110,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/habitica/notify.py | """Notify platform for the Habitica integration."""
from __future__ import annotations
from abc import abstractmethod
from enum import StrEnum
from typing import TYPE_CHECKING
from uuid import UUID
from aiohttp import ClientError
from habiticalib import (
GroupData,
HabiticaException,
NotAuthorizedError,... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/habitica/notify.py",
"license": "Apache License 2.0",
"lines": 169,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/hassio/jobs.py | """Track Supervisor job data and allow subscription to updates."""
from collections.abc import Callable
from dataclasses import dataclass, replace
from functools import partial
import logging
from typing import Any
from uuid import UUID
from aiohasupervisor.models import Job
from homeassistant.core import (
CALL... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/hassio/jobs.py",
"license": "Apache License 2.0",
"lines": 147,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/homeassistant_connect_zbt2/switch.py | """Home Assistant Connect ZBT-2 switch entities."""
from __future__ import annotations
import logging
from homeassistant.components.homeassistant_hardware.coordinator import (
FirmwareUpdateCoordinator,
)
from homeassistant.components.homeassistant_hardware.switch import (
BaseBetaFirmwareSwitch,
)
from home... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homeassistant_connect_zbt2/switch.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/homeassistant_hardware/switch.py | """Home Assistant Hardware base beta firmware switch entity."""
from __future__ import annotations
import logging
from typing import Any
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import EntityCategory
from homeassistant.help... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homeassistant_hardware/switch.py",
"license": "Apache License 2.0",
"lines": 49,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/homeassistant_sky_connect/switch.py | """Home Assistant SkyConnect switch entities."""
from __future__ import annotations
import logging
from homeassistant.components.homeassistant_hardware.coordinator import (
FirmwareUpdateCoordinator,
)
from homeassistant.components.homeassistant_hardware.switch import (
BaseBetaFirmwareSwitch,
)
from homeass... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homeassistant_sky_connect/switch.py",
"license": "Apache License 2.0",
"lines": 45,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/homeassistant_yellow/switch.py | """Home Assistant Yellow switch entities."""
from __future__ import annotations
import logging
from homeassistant.components.homeassistant_hardware.coordinator import (
FirmwareUpdateCoordinator,
)
from homeassistant.components.homeassistant_hardware.switch import (
BaseBetaFirmwareSwitch,
)
from homeassista... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/homeassistant_yellow/switch.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/inels/config_flow.py | """Config flow for iNELS."""
from __future__ import annotations
from typing import Any
from homeassistant.components import mqtt
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.helpers.service_info.mqtt import MqttServiceInfo
from .const import DOMAIN, TITLE
class INelsCon... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/inels/config_flow.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/inels/const.py | """Constants for the iNELS integration."""
import logging
from homeassistant.const import Platform
DOMAIN = "inels"
TITLE = "iNELS"
PLATFORMS: list[Platform] = [
Platform.SWITCH,
]
LOGGER = logging.getLogger(__package__)
| {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/inels/const.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/inels/entity.py | """Base class for iNELS components."""
from __future__ import annotations
from inelsmqtt.devices import Device
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import Entity
from .const import DOMAIN
class InelsBaseEntity(Entity):
"""Base iNELS entity."""
_at... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/inels/entity.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/inels/switch.py | """iNELS switch entity."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from typing import Any
from inelsmqtt.devices import Device
from inelsmqtt.utils.common import Bit, Relay, SimpleRelay
from homeassistant.components.switch import SwitchEntity, Switch... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/inels/switch.py",
"license": "Apache License 2.0",
"lines": 112,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/london_underground/config_flow.py | """Config flow for London Underground integration."""
from __future__ import annotations
import asyncio
import logging
from typing import Any
from london_tube_status import TubeData
import voluptuous as vol
from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow,
ConfigFlowResult,
Options... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/london_underground/config_flow.py",
"license": "Apache License 2.0",
"lines": 133,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/lunatone/config_flow.py | """Config flow for Lunatone."""
from typing import Any, Final
import aiohttp
from lunatone_rest_api_client import Auth, Info
import voluptuous as vol
from homeassistant.config_entries import (
SOURCE_RECONFIGURE,
ConfigFlow,
ConfigFlowResult,
)
from homeassistant.const import CONF_URL
from homeassistant.... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/lunatone/config_flow.py",
"license": "Apache License 2.0",
"lines": 63,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/lunatone/coordinator.py | """Coordinator for handling data fetching and updates."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
import logging
import aiohttp
from lunatone_rest_api_client import DALIBroadcast, Device, Devices, Info
from lunatone_rest_api_client.models import InfoData
f... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/lunatone/coordinator.py",
"license": "Apache License 2.0",
"lines": 79,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/lunatone/light.py | """Platform for Lunatone light integration."""
from __future__ import annotations
import asyncio
from typing import Any
from lunatone_rest_api_client import DALIBroadcast
from lunatone_rest_api_client.models import LineStatus
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ColorMode,
Light... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/lunatone/light.py",
"license": "Apache License 2.0",
"lines": 188,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/matter/services.py | """Services for Matter devices."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.lock import DOMAIN as LOCK_DOMAIN
from homeassistant.components.water_heater import DOMAIN as WATER_HEATER_DOMAIN
from homeassistant.core import HomeAssistant, SupportsResponse, callback
from ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/matter/services.py",
"license": "Apache License 2.0",
"lines": 143,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/meteo_lt/config_flow.py | """Config flow for Meteo.lt integration."""
from __future__ import annotations
import logging
from typing import Any
import aiohttp
from meteo_lt import MeteoLtAPI, Place
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from .const import CONF_PLACE_CODE, DOMAIN
_LOGG... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/meteo_lt/config_flow.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/meteo_lt/const.py | """Constants for the Meteo.lt integration."""
from datetime import timedelta
from homeassistant.const import Platform
DOMAIN = "meteo_lt"
PLATFORMS = [Platform.WEATHER]
MANUFACTURER = "Lithuanian Hydrometeorological Service"
MODEL = "Weather Station"
DEFAULT_UPDATE_INTERVAL = timedelta(minutes=30)
CONF_PLACE_CODE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/meteo_lt/const.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/meteo_lt/coordinator.py | """DataUpdateCoordinator for Meteo.lt integration."""
from __future__ import annotations
import logging
import aiohttp
from meteo_lt import Forecast as MeteoLtForecast, MeteoLtAPI
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.update_coor... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/meteo_lt/coordinator.py",
"license": "Apache License 2.0",
"lines": 47,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/meteo_lt/weather.py | """Weather platform for Meteo.lt integration."""
from __future__ import annotations
from collections import defaultdict
from datetime import datetime
from typing import Any
from homeassistant.components.weather import (
Forecast,
WeatherEntity,
WeatherEntityFeature,
)
from homeassistant.const import (
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/meteo_lt/weather.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/nederlandse_spoorwegen/coordinator.py | """DataUpdateCoordinator for Nederlandse Spoorwegen."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import datetime, timedelta
import logging
from ns_api import NSAPI, Trip
from requests.exceptions import ConnectionError, HTTPError, Timeout
from homeassistant.config_entries im... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nederlandse_spoorwegen/coordinator.py",
"license": "Apache License 2.0",
"lines": 231,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/niko_home_control/scene.py | """Scene Platform for Niko Home Control."""
from __future__ import annotations
from typing import Any
from homeassistant.components.scene import BaseScene
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback
from . import NikoHomeControlConfig... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/niko_home_control/scene.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/nintendo_parental_controls/config_flow.py | """Config flow for the Nintendo Switch parental controls integration."""
from __future__ import annotations
from collections.abc import Mapping
import logging
from typing import TYPE_CHECKING, Any
from pynintendoauth.exceptions import HttpException, InvalidSessionTokenException
from pynintendoparental import Authent... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/config_flow.py",
"license": "Apache License 2.0",
"lines": 95,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/nintendo_parental_controls/const.py | """Constants for the Nintendo Switch parental controls integration."""
DOMAIN = "nintendo_parental_controls"
CONF_UPDATE_INTERVAL = "update_interval"
CONF_SESSION_TOKEN = "session_token"
BEDTIME_ALARM_MIN = "16:00"
BEDTIME_ALARM_MAX = "23:00"
BEDTIME_ALARM_DISABLE = "00:00"
BEDTIME_END_TIME_MIN = "05:00"
BEDTIME_END... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/const.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/nintendo_parental_controls/coordinator.py | """Nintendo parental controls data coordinator."""
from __future__ import annotations
from datetime import timedelta
import logging
from pynintendoauth.exceptions import (
HttpException,
InvalidOAuthConfigurationException,
InvalidSessionTokenException,
)
from pynintendoparental import Authenticator, Nint... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/coordinator.py",
"license": "Apache License 2.0",
"lines": 62,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/nintendo_parental_controls/entity.py | """Base entity definition for Nintendo parental controls."""
from __future__ import annotations
from pynintendoparental.device import Device
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const import DOMAIN
from .coordinator... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/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/nintendo_parental_controls/number.py | """Number platform for Nintendo Parental controls."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from enum import StrEnum
from typing import Any
from homeassistant.components.number import (
NumberEntity,
NumberEntityDescription,
N... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/number.py",
"license": "Apache License 2.0",
"lines": 70,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/nintendo_parental_controls/sensor.py | """Sensor platform for Nintendo parental controls."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from datetime import datetime
from enum import StrEnum
from homeassistant.components.sensor import (
SensorDeviceClass,
SensorEntity,
SensorEntit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/sensor.py",
"license": "Apache License 2.0",
"lines": 87,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/nintendo_parental_controls/services.py | """Services for Nintendo Parental integration."""
from enum import StrEnum
import logging
import voluptuous as vol
from homeassistant.const import ATTR_DEVICE_ID
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/services.py",
"license": "Apache License 2.0",
"lines": 61,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/nintendo_parental_controls/switch.py | """Switch platform for Nintendo Parental."""
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 RestrictionMode
from homeassistant.components.switch import (
Swit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/switch.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/nintendo_parental_controls/time.py | """Time platform for Nintendo parental controls."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from datetime import time
from enum import StrEnum
import logging
from typing import Any
from pynintendoparental.exceptions import BedtimeOutOfRange... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/nintendo_parental_controls/time.py",
"license": "Apache License 2.0",
"lines": 105,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/octoprint/number.py | """Support for OctoPrint number entities."""
from __future__ import annotations
import logging
from pyoctoprintapi import OctoprintClient
from homeassistant.components.number import NumberDeviceClass, NumberEntity, NumberMode
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import UnitO... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/octoprint/number.py",
"license": "Apache License 2.0",
"lines": 117,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/openrgb/config_flow.py | """Config flow for the OpenRGB integration."""
from __future__ import annotations
import logging
from typing import Any
from openrgb import OpenRGBClient
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
fro... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openrgb/config_flow.py",
"license": "Apache License 2.0",
"lines": 107,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/openrgb/const.py | """Constants for the OpenRGB integration."""
from datetime import timedelta
from enum import StrEnum
import socket
from openrgb.utils import (
ControllerParsingError,
DeviceType,
OpenRGBDisconnected,
SDKVersionError,
)
DOMAIN = "openrgb"
UID_SEPARATOR = "||"
# Defaults
DEFAULT_PORT = 6742
DEFAULT_C... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openrgb/const.py",
"license": "Apache License 2.0",
"lines": 53,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/openrgb/coordinator.py | """DataUpdateCoordinator for OpenRGB."""
from __future__ import annotations
import asyncio
import logging
from openrgb import OpenRGBClient
from openrgb.orgb import Device
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF_PORT
from homeassistant.core import HomeAss... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openrgb/coordinator.py",
"license": "Apache License 2.0",
"lines": 129,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/openrgb/light.py | """OpenRGB light platform."""
from __future__ import annotations
import asyncio
from typing import Any
from openrgb.orgb import Device
from openrgb.utils import ModeColors, ModeData, RGBColor
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_EFFECT,
ATTR_RGB_COLOR,
EFFECT_OFF,
C... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/openrgb/light.py",
"license": "Apache License 2.0",
"lines": 351,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/portainer/button.py | """Support for Portainer buttons."""
from __future__ import annotations
from abc import abstractmethod
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from datetime import timedelta
from typing import Any
from pyportainer import Portainer
from pyportainer.exceptions import (
Por... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/portainer/button.py",
"license": "Apache License 2.0",
"lines": 157,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/portainer/diagnostics.py | """Diagnostics for the Portainer integration."""
from __future__ import annotations
from typing import Any
from homeassistant.components.diagnostics import async_redact_data
from homeassistant.const import CONF_API_TOKEN, CONF_URL
from homeassistant.core import HomeAssistant
from . import PortainerConfigEntry
from ... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/portainer/diagnostics.py",
"license": "Apache License 2.0",
"lines": 43,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/portainer/sensor.py | """Sensor platform for Portainer integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from homeassistant.components.sensor import (
EntityCategory,
SensorDeviceClass,
SensorEntity,
SensorEntityDescription,
SensorStateClass,
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/portainer/sensor.py",
"license": "Apache License 2.0",
"lines": 390,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/portainer/switch.py | """Switch platform for Portainer containers."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import Any
from pyportainer import Portainer
from pyportainer.exceptions import (
PortainerAuthenticationError,
PortainerConnectionE... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/portainer/switch.py",
"license": "Apache License 2.0",
"lines": 185,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/prowl/config_flow.py | """The config flow for the Prowl component."""
from __future__ import annotations
import logging
from typing import Any
import prowlpy
import voluptuous as vol
from homeassistant.config_entries import ConfigFlow, ConfigFlowResult
from homeassistant.const import CONF_API_KEY, CONF_NAME
from .const import DOMAIN
fro... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/prowl/config_flow.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/prowl/helpers.py | """Helper functions for Prowl."""
import asyncio
import prowlpy
from homeassistant.core import HomeAssistant
from homeassistant.helpers.httpx_client import get_async_client
async def async_verify_key(hass: HomeAssistant, api_key: str) -> bool:
"""Validate API key."""
prowl = prowlpy.AsyncProwl(api_key, cli... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/prowl/helpers.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/sensibo/services.py | """Sensibo services."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.climate import (
ATTR_FAN_MODE,
ATTR_HVAC_MODE,
ATTR_SWING_MODE,
DOMAIN as CLIMATE_DOMAIN,
HVACMode,
)
from homeassistant.const import ATTR_MODE, ATTR_STATE
from homeassistant.core im... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sensibo/services.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sfr_box/entity.py | """SFR Box base entity."""
from __future__ import annotations
from sfrbox_api.models import SystemInfo
from homeassistant.helpers.device_registry import DeviceInfo
from homeassistant.helpers.entity import Entity, EntityDescription
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from .const im... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sfr_box/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/sma/coordinator.py | """Coordinator for the SMA integration."""
from __future__ import annotations
from dataclasses import dataclass
from datetime import timedelta
import logging
from pysma import (
SmaAuthenticationException,
SmaConnectionException,
SmaReadException,
SMAWebConnect,
)
from pysma.helpers import DeviceInfo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sma/coordinator.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/snoo/button.py | """Support for Snoo Buttons."""
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from python_snoo.containers import SnooDevice
from python_snoo.exceptions import SnooCommandException
from python_snoo.snoo import Snoo
from homeassistant.components.button import ButtonEntity, ButtonEnt... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/snoo/button.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/sql/services.py | """Services for the SQL integration."""
from __future__ import annotations
import logging
from sqlalchemy.engine import Result
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm import Session
import voluptuous as vol
from homeassistant.components.recorder import CONF_DB_URL, get_instance
from homeassis... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sql/services.py",
"license": "Apache License 2.0",
"lines": 113,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/squeezebox/util.py | """Utility functions for Squeezebox integration."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from typing import Any
from homeassistant.exceptions import HomeAssistantError
from .const import DOMAIN
async def safe_library_call(
method: Callable[..., Awaitable[Any]],
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/squeezebox/util.py",
"license": "Apache License 2.0",
"lines": 25,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/sunricher_dali/config_flow.py | """Config flow for the Sunricher DALI integration."""
from __future__ import annotations
import logging
from typing import Any
from PySrDaliGateway import DaliGateway
from PySrDaliGateway.discovery import DaliGatewayDiscovery
from PySrDaliGateway.exceptions import DaliGatewayError
import voluptuous as vol
from home... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/config_flow.py",
"license": "Apache License 2.0",
"lines": 124,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/sunricher_dali/light.py | """Platform for light integration."""
from __future__ import annotations
import logging
from typing import Any
from PySrDaliGateway import CallbackEventType, Device
from PySrDaliGateway.helper import is_light_device
from PySrDaliGateway.types import LightStatus
from homeassistant.components.light import (
ATTR_... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/light.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/sunricher_dali/types.py | """Type definitions for the Sunricher DALI integration."""
from dataclasses import dataclass
from PySrDaliGateway import DaliGateway, Device, Scene
from homeassistant.config_entries import ConfigEntry
@dataclass
class DaliCenterData:
"""Runtime data for the Sunricher DALI integration."""
gateway: DaliGate... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/sunricher_dali/types.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/telegram_bot/diagnostics.py | """Diagnostics platform for Telegram bot integration."""
from __future__ import annotations
from typing import Any
from yarl import URL
from homeassistant.components.diagnostics import REDACTED, async_redact_data
from homeassistant.const import CONF_API_KEY, CONF_URL
from homeassistant.core import HomeAssistant
fr... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/telegram_bot/diagnostics.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/telegram_bot/entity.py | """Base entity for Telegram bot integration."""
import telegram
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity import Entity, EntityDescription
from . import TelegramBotConfigEntry
from .const import DOMAIN... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/telegram_bot/entity.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/telegram_bot/event.py | """Event platform for Telegram bot integration."""
from typing import Any
from homeassistant.components.event import EventEntity, EventEntityDescription
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platfo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/telegram_bot/event.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/telegram_bot/helpers.py | """Helper functions for Telegram bot integration."""
from telegram import Bot
from .const import SIGNAL_UPDATE_EVENT
def signal(bot: Bot) -> str:
"""Define signal name."""
return f"{SIGNAL_UPDATE_EVENT}_{bot.id}"
def get_base_url(bot: Bot) -> str:
"""Return the base URL for the bot."""
return bot.... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/telegram_bot/helpers.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/unifi/light.py | """Light platform for UniFi Network integration."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, cast
from aiounifi.interfaces.api_handlers import APIHandler, ItemEvent
from aiounifi.interfaces.devices impo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/unifi/light.py",
"license": "Apache License 2.0",
"lines": 166,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_complex |
home-assistant/core:homeassistant/components/uptimerobot/utils.py | """Utility functions for the UptimeRobot integration."""
from __future__ import annotations
from collections.abc import Callable
from pyuptimerobot import UptimeRobotMonitor
from .coordinator import UptimeRobotDataUpdateCoordinator
def new_device_listener(
coordinator: UptimeRobotDataUpdateCoordinator,
ne... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/uptimerobot/utils.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/vegehub/switch.py | """Switch configuration for VegeHub integration."""
from typing import Any
from homeassistant.components.switch import (
SwitchDeviceClass,
SwitchEntity,
SwitchEntityDescription,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/vegehub/switch.py",
"license": "Apache License 2.0",
"lines": 66,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/victron_remote_monitoring/energy.py | """Victron Remote Monitoring energy platform."""
from __future__ import annotations
from homeassistant.config_entries import ConfigEntryState
from homeassistant.core import HomeAssistant
async def async_get_solar_forecast(
hass: HomeAssistant, config_entry_id: str
) -> dict[str, dict[str, float | int]] | None:
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/victron_remote_monitoring/energy.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/voip/store.py | """VOIP contact storage."""
from dataclasses import dataclass
import logging
from homeassistant.core import HomeAssistant
from homeassistant.helpers.storage import Store
from .const import STORAGE_VER
_LOGGER = logging.getLogger(__name__)
@dataclass
class DeviceContact:
"""Device contact data."""
contact... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/voip/store.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/volvo/button.py | """Volvo buttons."""
from dataclasses import dataclass
import logging
from volvocarsapi.models import VolvoApiException
from homeassistant.components.button import ButtonEntity, ButtonEntityDescription
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassis... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/button.py",
"license": "Apache License 2.0",
"lines": 115,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
home-assistant/core:homeassistant/components/volvo/device_tracker.py | """Volvo device tracker."""
from dataclasses import dataclass
from volvocarsapi.models import VolvoCarsApiBaseModel, VolvoCarsLocation
from homeassistant.components.device_tracker import (
TrackerEntity,
TrackerEntityDescription,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entit... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/device_tracker.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/volvo/diagnostics.py | """Volvo diagnostics."""
from dataclasses import asdict
from typing import Any
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_API_KEY
from homeassistant.core import HomeAssistant
from homeassistant.helpers.redact import async_redact_data
from .const import CONF_VIN
from .coordinator import VolvoConfigEntry
... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/volvo/diagnostics.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/xbox/image.py | """Image platform for the Xbox integration."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from enum import StrEnum
from typing import TYPE_CHECKING
from pythonxbox.api.provider.people.models import Person
from pythonxbox.api.provider.titlehub.models impo... | {
"repo_id": "home-assistant/core",
"file_path": "homeassistant/components/xbox/image.py",
"license": "Apache License 2.0",
"lines": 97,
"canary_id": -1,
"canary_value": "",
"pii_type": "",
"provider": "",
"regex_pattern": "",
"repetition": -1,
"template": ""
} | function_simple |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.