sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:homeassistant/components/watts/switch.py
"""Switch platform for Watts Vision integration.""" from __future__ import annotations import logging from typing import Any from visionpluspython.models import SwitchDevice from homeassistant.components.switch import SwitchEntity from homeassistant.core import HomeAssistant, callback from homeassistant.exceptions ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/watts/switch.py", "license": "Apache License 2.0", "lines": 100, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/watts/test_switch.py
"""Tests for the Watts Vision switch platform.""" from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/watts/test_switch.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:homeassistant/components/intelliclima/config_flow.py
"""Config flow for IntelliClima integration.""" from typing import Any from pyintelliclima import IntelliClimaAPI, IntelliClimaAPIError, IntelliClimaAuthError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_PASSWORD, CONF_USERNAME fr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/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/intelliclima/const.py
"""Constants for the IntelliClima integration.""" from datetime import timedelta import logging LOGGER = logging.getLogger(__package__) DOMAIN = "intelliclima" # Update interval DEFAULT_SCAN_INTERVAL = timedelta(minutes=1)
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/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/intelliclima/coordinator.py
"""DataUpdateCoordinator for IntelliClima.""" from pyintelliclima import IntelliClimaAPI, IntelliClimaAPIError, IntelliClimaDevices from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/coordinator.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/intelliclima/entity.py
"""Platform for shared base classes for sensors.""" from pyintelliclima.intelliclima_types import IntelliClimaC800, IntelliClimaECO from homeassistant.const import ATTR_CONNECTIONS, ATTR_MODEL, ATTR_SW_VERSION from homeassistant.helpers.device_registry import ( CONNECTION_BLUETOOTH, CONNECTION_NETWORK_MAC, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/entity.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/intelliclima/fan.py
"""Fan platform for IntelliClima VMC.""" import math from typing import Any from pyintelliclima.const import FanMode, FanSpeed from pyintelliclima.intelliclima_types import IntelliClimaECO from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.core import HomeAssistant from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/fan.py", "license": "Apache License 2.0", "lines": 141, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/intelliclima/test_config_flow.py
"""Test the IntelliClima config flow.""" from unittest.mock import AsyncMock from pyintelliclima.api import ( IntelliClimaAPIError, IntelliClimaAuthError, IntelliClimaDevices, ) import pytest from homeassistant.components.intelliclima.const import DOMAIN from homeassistant.config_entries import SOURCE_US...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/intelliclima/test_config_flow.py", "license": "Apache License 2.0", "lines": 113, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/intelliclima/test_fan.py
"""Test IntelliClima Fans.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.fan import ( ATTR_PERCENTAGE, ATTR_PRESET_MODE, DOMAIN as FAN_DOMAIN, SERVICE_SET_PERCENTAGE, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/intelliclima/test_fan.py", "license": "Apache License 2.0", "lines": 177, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/hegel/config_flow.py
"""Config flow for Hegel integration.""" from __future__ import annotations import logging from typing import Any from hegel_ip_client import HegelClient from hegel_ip_client.exceptions import HegelConnectionError import voluptuous as vol from yarl import URL from homeassistant.config_entries import ConfigFlow, Con...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hegel/config_flow.py", "license": "Apache License 2.0", "lines": 125, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/hegel/const.py
"""Constants for the Hegel integration.""" DOMAIN = "hegel" DEFAULT_PORT = 50001 CONF_MODEL = "model" CONF_MAX_VOLUME = "max_volume" # 1.0 means amp's internal max HEARTBEAT_TIMEOUT_MINUTES = 3 MODEL_INPUTS = { "Röst": [ "Balanced", "Analog 1", "Analog 2", "Coaxial", "Op...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hegel/const.py", "license": "Apache License 2.0", "lines": 88, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hegel/media_player.py
"""Hegel media player platform.""" from __future__ import annotations import asyncio from collections.abc import Callable import contextlib from datetime import timedelta import logging from typing import Any from hegel_ip_client import ( COMMANDS, HegelClient, apply_state_changes, parse_reply_messag...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hegel/media_player.py", "license": "Apache License 2.0", "lines": 288, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/hegel/test_config_flow.py
"""Test the Hegel config flow.""" from unittest.mock import MagicMock from homeassistant.components.hegel.const import CONF_MODEL, DOMAIN from homeassistant.config_entries import SOURCE_SSDP, SOURCE_USER from homeassistant.const import CONF_HOST from homeassistant.core import HomeAssistant from homeassistant.data_ent...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hegel/test_config_flow.py", "license": "Apache License 2.0", "lines": 315, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/lunatone/diagnostics.py
"""Diagnostics support for Lunatone integration.""" from typing import Any from homeassistant.core import HomeAssistant from .coordinator import LunatoneConfigEntry async def async_get_config_entry_diagnostics( hass: HomeAssistant, entry: LunatoneConfigEntry ) -> dict[str, Any]: """Return diagnostics for a...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lunatone/diagnostics.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:tests/components/lunatone/test_diagnostics.py
"""Define tests for Lunatone diagnostics.""" 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 get_diagnostics_for_config_e...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/lunatone/test_diagnostics.py", "license": "Apache License 2.0", "lines": 22, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/waterfurnace/coordinator.py
"""Data update coordinator for WaterFurnace.""" import logging from typing import TYPE_CHECKING from waterfurnace.waterfurnace import WaterFurnace, WFException, WFGateway, WFReading from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/waterfurnace/coordinator.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:tests/components/waterfurnace/test_init.py
"""Tests for WaterFurnace integration setup.""" from unittest.mock import Mock from waterfurnace.waterfurnace import WFCredentialError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_setup_auth_failure( ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/waterfurnace/test_init.py", "license": "Apache License 2.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/waterfurnace/test_sensor.py
"""Test sensor of WaterFurnace integration.""" import asyncio from unittest.mock import Mock from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from waterfurnace.waterfurnace import WFException from homeassistant.components.waterfurnace.const import UPDATE_IN...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/waterfurnace/test_sensor.py", "license": "Apache License 2.0", "lines": 72, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/liebherr/diagnostics.py
"""Diagnostics support for Liebherr.""" from __future__ import annotations from dataclasses import asdict from typing import Any from homeassistant.const import CONF_API_KEY from homeassistant.core import HomeAssistant from .coordinator import LiebherrConfigEntry TO_REDACT = {CONF_API_KEY} async def async_get_co...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/liebherr/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:tests/components/liebherr/test_diagnostics.py
"""Tests for the diagnostics data provided by the Liebherr integration.""" from unittest.mock import MagicMock from syrupy.assertion import SnapshotAssertion from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entr...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/liebherr/test_diagnostics.py", "license": "Apache License 2.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/saunum/services.py
"""Define services for the Saunum integration.""" from __future__ import annotations from datetime import timedelta from pysaunum import MAX_DURATION, MAX_FAN_DURATION, MAX_TEMPERATURE, MIN_TEMPERATURE import voluptuous as vol from homeassistant.components.climate import DOMAIN as CLIMATE_DOMAIN from homeassistant....
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/saunum/services.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:tests/components/saunum/test_services.py
"""Tests for Saunum services.""" from dataclasses import replace from unittest.mock import MagicMock from pysaunum import SaunumException import pytest from homeassistant.components.saunum.const import DOMAIN from homeassistant.components.saunum.services import ( ATTR_DURATION, ATTR_FAN_DURATION, ATTR_TA...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/saunum/test_services.py", "license": "Apache License 2.0", "lines": 95, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/ghost/config_flow.py
"""Config flow for Ghost integration.""" from __future__ import annotations import logging from typing import Any from aioghost import GhostAdminAPI from aioghost.exceptions import GhostAuthError, GhostError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ghost/config_flow.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/ghost/const.py
"""Constants for the Ghost integration.""" DOMAIN: str = "ghost" CONF_ADMIN_API_KEY: str = "admin_api_key" CONF_API_URL: str = "api_url" DEFAULT_SCAN_INTERVAL: int = 300 # 5 minutes # Device info. CURRENCY: str = "USD" MANUFACTURER: str = "Ghost Foundation" MODEL: str = "Ghost"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ghost/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/ghost/coordinator.py
"""DataUpdateCoordinator for Ghost.""" from __future__ import annotations import asyncio from dataclasses import dataclass from datetime import timedelta import logging from typing import TYPE_CHECKING, Any from aioghost import GhostAdminAPI from aioghost.exceptions import GhostAuthError, GhostError from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ghost/coordinator.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/ghost/sensor.py
"""Sensor platform for Ghost.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from typing import TYPE_CHECKING, Any from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ) ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ghost/sensor.py", "license": "Apache License 2.0", "lines": 285, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/ghost/test_config_flow.py
"""Tests for Ghost config flow.""" from unittest.mock import AsyncMock from aioghost.exceptions import GhostAuthError, GhostConnectionError import pytest from homeassistant.components.ghost.const import ( CONF_ADMIN_API_KEY, CONF_API_URL, DOMAIN, ) from homeassistant.config_entries import SOURCE_USER fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ghost/test_config_flow.py", "license": "Apache License 2.0", "lines": 115, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/ghost/test_init.py
"""Tests for Ghost integration setup.""" from unittest.mock import AsyncMock from aioghost.exceptions import GhostAuthError, GhostConnectionError import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from . import setup_integration @pytest.mark.parame...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ghost/test_init.py", "license": "Apache License 2.0", "lines": 34, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/ghost/test_sensor.py
"""Tests for Ghost sensors.""" from datetime import timedelta from unittest.mock import AsyncMock from aioghost.exceptions import GhostError from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_UNAVAILABLE from homeassistan...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ghost/test_sensor.py", "license": "Apache License 2.0", "lines": 97, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/redgtech/config_flow.py
"""Config flow for the Redgtech integration.""" from __future__ import annotations import logging from typing import Any from redgtech_api.api import RedgtechAPI, RedgtechAuthError, RedgtechConnectionError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/redgtech/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/redgtech/coordinator.py
"""Coordinator for Redgtech integration.""" from __future__ import annotations from collections.abc import Callable, Coroutine from dataclasses import dataclass from datetime import timedelta import logging from typing import Any from redgtech_api.api import RedgtechAPI, RedgtechAuthError, RedgtechConnectionError f...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/redgtech/coordinator.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/redgtech/switch.py
"""Integration for Redgtech switches.""" from __future__ import annotations from typing import Any from redgtech_api.api import RedgtechAuthError, RedgtechConnectionError from homeassistant.components.switch import SwitchEntity from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAs...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/redgtech/switch.py", "license": "Apache License 2.0", "lines": 78, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/redgtech/test_config_flow.py
"""Tests Config flow for the Redgtech integration.""" from unittest.mock import MagicMock import pytest from redgtech_api.api import RedgtechAuthError, RedgtechConnectionError from homeassistant.components.redgtech.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const impo...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/redgtech/test_config_flow.py", "license": "Apache License 2.0", "lines": 113, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/redgtech/test_switch.py
"""Tests for the Redgtech switch platform.""" from datetime import timedelta from unittest.mock import MagicMock from freezegun import freeze_time from freezegun.api import FrozenDateTimeFactory import pytest from redgtech_api.api import RedgtechAuthError, RedgtechConnectionError from syrupy.assertion import Snapshot...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/redgtech/test_switch.py", "license": "Apache License 2.0", "lines": 215, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/advantage_air/services.py
"""Services for Advantage Air integration.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import config_validation as cv, service from .const import D...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/advantage_air/services.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/airobot/button.py
"""Button platform for Airobot integration.""" from __future__ import annotations from collections.abc import Callable, Coroutine from dataclasses import dataclass from typing import Any from pyairobotrest.exceptions import ( AirobotConnectionError, AirobotError, AirobotTimeoutError, ) from homeassistan...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/button.py", "license": "Apache License 2.0", "lines": 77, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/airobot/switch.py
"""Switch platform for Airobot thermostat.""" from __future__ import annotations from collections.abc import Callable, Coroutine from dataclasses import dataclass from typing import Any from pyairobotrest.exceptions import AirobotError from homeassistant.components.switch import SwitchEntity, SwitchEntityDescriptio...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airobot/switch.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/alarm_control_panel/condition.py
"""Provides conditions for alarm control panels.""" from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.condition import ( Condition, EntityStateConditionBase, make_entity_state_condition, ) from homeassistant.helpers.entity import...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/alarm_control_panel/condition.py", "license": "Apache License 2.0", "lines": 76, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/anthropic/repairs.py
"""Issue repair flow for Anthropic.""" from __future__ import annotations from collections.abc import Iterator from typing import TYPE_CHECKING import voluptuous as vol from homeassistant import data_entry_flow from homeassistant.components.repairs import RepairsFlow from homeassistant.config_entries import ConfigE...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/anthropic/repairs.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/apple_tv/binary_sensor.py
"""Binary sensor support for Apple TV.""" from __future__ import annotations from pyatv.const import FeatureName, FeatureState, KeyboardFocusState from pyatv.interface import AppleTV, KeyboardListener from homeassistant.components.binary_sensor import BinarySensorEntity from homeassistant.const import CONF_NAME from...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/apple_tv/binary_sensor.py", "license": "Apache License 2.0", "lines": 60, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/assist_satellite/condition.py
"""Provides conditions for assist satellites.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import Condition, make_entity_state_condition from .const import DOMAIN from .entity import AssistSatelliteState CONDITIONS: dict[str, type[Condition]] = { "is_idle": make_entity_sta...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/assist_satellite/condition.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/bang_olufsen/binary_sensor.py
"""Binary Sensor entities for the Bang & Olufsen integration.""" from __future__ import annotations from mozart_api.models import BatteryState from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, ) from homeassistant.core import HomeAssistant from homeassistant.he...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/bang_olufsen/binary_sensor.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/bang_olufsen/sensor.py
"""Sensor entities for the Bang & Olufsen integration.""" from __future__ import annotations import contextlib from datetime import timedelta from aiohttp import ClientConnectorError from mozart_api.exceptions import ApiException from mozart_api.models import BatteryState, PairedRemote from homeassistant.components...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/bang_olufsen/sensor.py", "license": "Apache License 2.0", "lines": 110, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/bang_olufsen/services.py
"""Services for Bang & Olufsen integration.""" from __future__ import annotations import voluptuous as vol from homeassistant.components.media_player import DOMAIN as MEDIA_PLAYER_DOMAIN from homeassistant.core import HomeAssistant, callback from homeassistant.helpers import config_validation as cv, service from .c...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/bang_olufsen/services.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/climate/condition.py
"""Provides conditions for climates.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import ( Condition, make_entity_state_attribute_condition, make_entity_state_condition, ) from .const import ATTR_HVAC_ACTION, DOMAIN, HVACAction, HVACMode CONDITIONS: dict[str, type[...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/climate/condition.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/cloudflare_r2/backup.py
"""Backup platform for the Cloudflare R2 integration.""" from collections.abc import AsyncIterator, Callable, Coroutine import functools import json import logging from time import time from typing import Any, cast from botocore.exceptions import BotoCoreError from homeassistant.components.backup import ( AgentB...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloudflare_r2/backup.py", "license": "Apache License 2.0", "lines": 310, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/cloudflare_r2/config_flow.py
"""Config flow for the Cloudflare R2 integration.""" from __future__ import annotations from typing import Any from urllib.parse import urlparse from aiobotocore.session import AioSession from botocore.exceptions import ( ClientError, ConnectionError, EndpointConnectionError, ParamValidationError, ) ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloudflare_r2/config_flow.py", "license": "Apache License 2.0", "lines": 101, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/cloudflare_r2/const.py
"""Constants for the Cloudflare R2 integration.""" from collections.abc import Callable from typing import Final from homeassistant.util.hass_dict import HassKey DOMAIN: Final = "cloudflare_r2" CONF_ACCESS_KEY_ID = "access_key_id" CONF_SECRET_ACCESS_KEY = "secret_access_key" CONF_ENDPOINT_URL = "endpoint_url" CONF_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cloudflare_r2/const.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/compit/select.py
"""Select platform for Compit integration.""" from dataclasses import dataclass from compit_inext_api.consts import CompitParameter from homeassistant.components.select import SelectEntity, SelectEntityDescription from homeassistant.core import HomeAssistant from homeassistant.helpers.device_registry import DeviceIn...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/compit/select.py", "license": "Apache License 2.0", "lines": 405, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/device_tracker/condition.py
"""Provides conditions for device trackers.""" from homeassistant.const import STATE_HOME, STATE_NOT_HOME 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_home":...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/device_tracker/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/digital_ocean/const.py
"""Support for Digital Ocean.""" from __future__ import annotations from datetime import timedelta from typing import TYPE_CHECKING from homeassistant.util.hass_dict import HassKey if TYPE_CHECKING: from . import DigitalOcean ATTR_CREATED_AT = "created_at" ATTR_DROPLET_ID = "droplet_id" ATTR_DROPLET_NAME = "dr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/digital_ocean/const.py", "license": "Apache License 2.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/energy/helpers.py
"""Helpers for the Energy integration.""" from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from .data import PowerConfig def generate_power_sensor_unique_id(source_type: str, config: PowerConfig) -> str: """Generate a unique ID for a power transform sensor.""" if "s...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/energy/helpers.py", "license": "Apache License 2.0", "lines": 35, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/esphome/water_heater.py
"""Support for ESPHome water heaters.""" from __future__ import annotations from functools import partial from typing import Any from aioesphomeapi import EntityInfo, WaterHeaterInfo, WaterHeaterMode, WaterHeaterState from homeassistant.components.water_heater import ( WaterHeaterEntity, WaterHeaterEntityFe...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/esphome/water_heater.py", "license": "Apache License 2.0", "lines": 91, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/fan/condition.py
"""Provides conditions for fans.""" from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import Condition, make_entity_state_condition from . import DOMAIN CONDITIONS: dict[str, type[Condition]] = { "is_off": make_entity_state_condi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/fan/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/fressnapf_tracker/services.py
"""Services and service helpers for fressnapf_tracker.""" from fressnapftracker import FressnapfTrackerError, FressnapfTrackerInvalidTokenError from homeassistant.exceptions import ConfigEntryAuthFailed, HomeAssistantError from .const import DOMAIN def handle_fressnapf_tracker_exception(exception: FressnapfTracker...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/fressnapf_tracker/services.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/green_planet_energy/config_flow.py
"""Config flow for Green Planet Energy integration.""" from __future__ import annotations import logging from typing import Any from greenplanet_energy_api import ( GreenPlanetEnergyAPI, GreenPlanetEnergyAPIError, GreenPlanetEnergyConnectionError, ) from homeassistant.config_entries import ConfigFlow, C...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/green_planet_energy/config_flow.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/green_planet_energy/const.py
"""Constants for the Green Planet Energy integration.""" DOMAIN = "green_planet_energy" # Default values DEFAULT_API_URL = "https://mein.green-planet-energy.de/p2" DEFAULT_SCAN_INTERVAL = 60 # minutes # API constants API_METHOD = "getVerbrauchspreisUndWindsignal" AGGREGATS_ZEITRAUM = "" AGGREGATS_TYP = "" SOURCE = ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/green_planet_energy/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/green_planet_energy/coordinator.py
"""Data update coordinator for Green Planet Energy.""" from __future__ import annotations from datetime import timedelta import logging from typing import Any from greenplanet_energy_api import ( GreenPlanetEnergyAPI, GreenPlanetEnergyAPIError, GreenPlanetEnergyConnectionError, ) from homeassistant.conf...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/green_planet_energy/coordinator.py", "license": "Apache License 2.0", "lines": 47, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/green_planet_energy/sensor.py
"""Green Planet Energy sensor platform.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from datetime import datetime import logging from typing import Any from greenplanet_energy_api import GreenPlanetEnergyAPI from homeassistant.components.sensor import...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/green_planet_energy/sensor.py", "license": "Apache License 2.0", "lines": 146, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/button.py
"""Button platform for HDFury Integration.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from hdfury import HDFuryAPI, HDFuryError from homeassistant.components.button import ( ButtonDeviceClass, ButtonEntity, ButtonEntityDescription, ) from homeassistant.const impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/button.py", "license": "Apache License 2.0", "lines": 57, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/config_flow.py
"""Config flow for HDFury Integration.""" from typing import Any from hdfury import HDFuryAPI, HDFuryError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_HOST from homeassistant.helpers.aiohttp_client import async_get_clientsession ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/config_flow.py", "license": "Apache License 2.0", "lines": 104, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/coordinator.py
"""DataUpdateCoordinator for HDFury Integration.""" from dataclasses import dataclass from datetime import timedelta import logging from typing import Final from hdfury import HDFuryAPI, HDFuryError from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_HOST from homeassistant.core...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/coordinator.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/hdfury/diagnostics.py
"""Diagnostics for HDFury Integration.""" from typing import Any from homeassistant.core import HomeAssistant from .coordinator import HDFuryConfigEntry, HDFuryCoordinator async def async_get_config_entry_diagnostics( hass: HomeAssistant, entry: HDFuryConfigEntry ) -> dict[str, Any]: """Return diagnostics ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/diagnostics.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/hdfury/entity.py
"""Base class for HDFury entities.""" from homeassistant.helpers import device_registry as dr from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import EntityDescription from homeassistant.helpers.update_coordinator import CoordinatorEntity from .coordinator import HDFuryCo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/entity.py", "license": "Apache License 2.0", "lines": 30, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/select.py
"""Select platform for HDFury Integration.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from hdfury import OPERATION_MODES, TX0_INPUT_PORTS, TX1_INPUT_PORTS, HDFuryError from homeassistant.components.select import SelectEntity, SelectEntityDescription from homeassistant.core i...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/select.py", "license": "Apache License 2.0", "lines": 85, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/sensor.py
"""Sensor platform for HDFury Integration.""" from homeassistant.components.sensor import SensorEntity, SensorEntityDescription from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from .coordinator...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/sensor.py", "license": "Apache License 2.0", "lines": 110, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hdfury/switch.py
"""Switch platform for HDFury Integration.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from typing import Any from hdfury import HDFuryAPI, HDFuryError from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription from homeassistant.const import EntityCate...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/switch.py", "license": "Apache License 2.0", "lines": 163, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/hikvision/camera.py
"""Support for Hikvision cameras.""" from __future__ import annotations from pyhik.hikvision import VideoChannel from homeassistant.components.camera import Camera, CameraEntityFeature from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.enti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hikvision/camera.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/hikvision/entity.py
"""Base entity for Hikvision integration.""" from __future__ import annotations from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity from . import HikvisionConfigEntry from .const import DOMAIN class HikvisionEntity(Entity): """Base class for Hikvision en...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hikvision/entity.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/humidifier/condition.py
"""Provides conditions for humidifiers.""" from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import ( Condition, make_entity_state_attribute_condition, make_entity_state_condition, ) from .const import ATTR_ACTION, DOMAIN,...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/humidifier/condition.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/lawn_mower/condition.py
"""Provides conditions for lawn mowers.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import Condition, make_entity_state_condition from .const import DOMAIN, LawnMowerActivity CONDITIONS: dict[str, type[Condition]] = { "is_docked": make_entity_state_condition(DOMAIN, LawnM...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lawn_mower/condition.py", "license": "Apache License 2.0", "lines": 16, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/lg_thinq/humidifier.py
"""Support for humidifier entities.""" from __future__ import annotations from dataclasses import dataclass import logging from typing import Any from thinqconnect import DeviceType from thinqconnect.devices.const import Property as ThinQProperty from thinqconnect.integration import ActiveMode from homeassistant.co...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lg_thinq/humidifier.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/lock/condition.py
"""Provides conditions for locks.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import Condition, make_entity_state_condition from .const import DOMAIN, LockState CONDITIONS: dict[str, type[Condition]] = { "is_jammed": make_entity_state_condition(DOMAIN, LockState.JAMMED), ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/lock/condition.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/mastodon/binary_sensor.py
"""Binary sensor platform for the Mastodon integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from enum import StrEnum from mastodon.Mastodon import Account from homeassistant.components.binary_sensor import ( BinarySensorEntity, BinaryS...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/mastodon/binary_sensor.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/media_player/condition.py
"""Provides conditions for media players.""" from homeassistant.core import HomeAssistant from homeassistant.helpers.condition import Condition, make_entity_state_condition from .const import DOMAIN, MediaPlayerState CONDITIONS: dict[str, type[Condition]] = { "is_off": make_entity_state_condition(DOMAIN, MediaPl...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/media_player/condition.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/melcloud/coordinator.py
"""DataUpdateCoordinator for the MELCloud integration.""" from __future__ import annotations from datetime import timedelta import logging from typing import Any from aiohttp import ClientConnectionError, ClientResponseError from pymelcloud import Device from pymelcloud.atw_device import Zone from homeassistant.con...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/melcloud/coordinator.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/melcloud/entity.py
"""Base entity for MELCloud integration.""" from __future__ import annotations from homeassistant.helpers.update_coordinator import CoordinatorEntity from .coordinator import MelCloudDeviceUpdateCoordinator class MelCloudEntity(CoordinatorEntity[MelCloudDeviceUpdateCoordinator]): """Base class for MELCloud ent...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/melcloud/entity.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/namecheapdns/config_flow.py
"""Config flow for the Namecheap DynamicDNS integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Any from aiohttp import ClientError import voluptuous as vol from homeassistant.config_entries import SOURCE_REAUTH, ConfigFlow, ConfigFlowResult from ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/namecheapdns/config_flow.py", "license": "Apache License 2.0", "lines": 138, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/namecheapdns/coordinator.py
"""Coordinator for the Namecheap DynamicDNS integration.""" from datetime import timedelta import logging from aiohttp import ClientError from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_DOMAIN, CONF_HOST, CONF_PASSWORD from homeassistant.core import HomeAssistant from homeas...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/namecheapdns/coordinator.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/namecheapdns/helpers.py
"""Helpers for the Namecheap DynamicDNS integration.""" import logging from aiohttp import ClientSession from homeassistant.exceptions import HomeAssistantError from .const import UPDATE_URL _LOGGER = logging.getLogger(__name__) async def update_namecheapdns( session: ClientSession, host: str, domain: str, p...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/namecheapdns/helpers.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/namecheapdns/issue.py
"""Issues for Namecheap DynamicDNS 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_suc...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/namecheapdns/issue.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/nasweb/climate.py
"""Platform for NASweb thermostat.""" from __future__ import annotations import time from typing import Any from webio_api import Thermostat as NASwebThermostat from webio_api.const import KEY_THERMOSTAT from homeassistant.components.climate import ( ClimateEntity, ClimateEntityFeature, HVACAction, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nasweb/climate.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/nrgkick/api.py
"""API helpers and Home Assistant exceptions for the NRGkick integration.""" from __future__ import annotations from collections.abc import Awaitable import aiohttp from nrgkick_api import ( NRGkickAPIDisabledError, NRGkickAuthenticationError, NRGkickCommandRejectedError, NRGkickConnectionError, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/api.py", "license": "Apache License 2.0", "lines": 62, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nrgkick/config_flow.py
"""Config flow for NRGkick integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import TYPE_CHECKING, Any from nrgkick_api import NRGkickAPI import voluptuous as vol import yarl from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from ho...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/config_flow.py", "license": "Apache License 2.0", "lines": 401, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nrgkick/const.py
"""Constants for the NRGkick integration.""" from typing import Final from nrgkick_api import ( CellularMode, ChargingStatus, ConnectorType, ErrorCode, RcdTriggerStatus, WarningCode, ) DOMAIN: Final = "nrgkick" # Default polling interval (seconds). DEFAULT_SCAN_INTERVAL: Final = 30 # Note: ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/const.py", "license": "Apache License 2.0", "lines": 109, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/nrgkick/coordinator.py
"""DataUpdateCoordinator for NRGkick integration.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta import logging from typing import Any import aiohttp from nrgkick_api import ( NRGkickAPI, NRGkickAPIDisabledError, NRGkickAuthenticationError, NRGk...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/coordinator.py", "license": "Apache License 2.0", "lines": 78, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/nrgkick/entity.py
"""Base entity for NRGkick integration.""" from __future__ import annotations from collections.abc import Awaitable from typing import Any from homeassistant.const import CONF_HOST from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, DeviceInfo from homeassistant.helpers.update_coordinator impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/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/nrgkick/sensor.py
"""Sensor platform for NRGkick.""" from __future__ import annotations from collections.abc import Callable, Mapping from dataclasses import dataclass from datetime import datetime, timedelta from typing import Any, cast from nrgkick_api import ChargingStatus from homeassistant.components.sensor import ( SensorD...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/sensor.py", "license": "Apache License 2.0", "lines": 770, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/openevse/config_flow.py
"""Config flow for OpenEVSE integration.""" from typing import Any from openevsehttp.__main__ import OpenEVSE from openevsehttp.exceptions import AuthenticationError, MissingSerial import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_HOST...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openevse/config_flow.py", "license": "Apache License 2.0", "lines": 139, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/openevse/const.py
"""Constants for the OpenEVSE integration.""" CONF_ID = "id" CONF_SERIAL = "serial" DOMAIN = "openevse" INTEGRATION_TITLE = "OpenEVSE"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openevse/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/openevse/coordinator.py
"""Data update coordinator for OpenEVSE.""" from __future__ import annotations from datetime import timedelta import logging from openevsehttp.__main__ import OpenEVSE from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.helpers.update_coordinator impo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openevse/coordinator.py", "license": "Apache License 2.0", "lines": 51, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/openevse/number.py
"""Support for OpenEVSE number entities.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from typing import Any from openevsehttp.__main__ import OpenEVSE from homeassistant.components.number import ( NumberDeviceClass, NumberEntity, NumberEntityDescription, ) from ho...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openevse/number.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/person/condition.py
"""Provides conditions for persons.""" from homeassistant.const import STATE_HOME, STATE_NOT_HOME 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_home": make_en...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/person/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/person/trigger.py
"""Provides triggers for persons.""" from homeassistant.const import STATE_HOME from homeassistant.core import HomeAssistant from homeassistant.helpers.trigger import ( Trigger, make_entity_origin_state_trigger, make_entity_target_state_trigger, ) from .const import DOMAIN TRIGGERS: dict[str, type[Trigge...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/person/trigger.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/pooldose/diagnostics.py
"""Diagnostics support for Pooldose.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.core import HomeAssistant from . import PooldoseConfigEntry TO_REDACT = { "IP", "MAC", "WIFI_SSID", "AP_SSID", ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/pooldose/diagnostics.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/prana/config_flow.py
"""Configuration flow for Prana integration.""" import logging from typing import Any from prana_local_api_client.exceptions import PranaApiCommunicationError from prana_local_api_client.models.prana_device_info import PranaDeviceInfo from prana_local_api_client.prana_api_client import PranaLocalApiClient import volu...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/prana/config_flow.py", "license": "Apache License 2.0", "lines": 82, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/prana/coordinator.py
"""Coordinator for Prana integration. Responsible for polling the device REST endpoints and normalizing data for entities. """ from datetime import timedelta import logging from prana_local_api_client.exceptions import ( PranaApiCommunicationError, PranaApiUpdateFailed, ) from prana_local_api_client.models.p...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/prana/coordinator.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/prana/entity.py
"""Defines base Prana entity.""" from dataclasses import dataclass import logging from typing import TYPE_CHECKING from homeassistant.components.switch import StrEnum from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import EntityDescription from homeassistant.helpers.upda...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/prana/entity.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/prana/switch.py
"""Switch platform for Prana integration.""" from collections.abc import Callable from typing import Any from aioesphomeapi import dataclass from homeassistant.components.switch import ( StrEnum, SwitchEntity, SwitchEntityDescription, ) from homeassistant.core import HomeAssistant from homeassistant.help...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/prana/switch.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/proxmoxve/config_flow.py
"""Config flow for Proxmox VE integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Any from proxmoxer import AuthenticationError, ProxmoxAPI from proxmoxer.core import ResourceException import requests from requests.exceptions import ConnectTimeout,...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/proxmoxve/config_flow.py", "license": "Apache License 2.0", "lines": 234, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex