sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:tests/components/velux/test_diagnostics.py
"""Tests for the diagnostics data provided by the Velux integration.""" from unittest.mock import MagicMock, patch import pytest from pyvlx.const import GatewayState, GatewaySubState from pyvlx.dataobjects import DtoState from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from ho...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_diagnostics.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/openai_conversation/stt.py
"""Speech to text support for OpenAI.""" from __future__ import annotations from collections.abc import AsyncIterable import io import logging from typing import TYPE_CHECKING import wave from openai import OpenAIError from homeassistant.components import stt from homeassistant.core import HomeAssistant from homeas...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/openai_conversation/stt.py", "license": "Apache License 2.0", "lines": 172, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/openai_conversation/test_stt.py
"""Test STT platform of OpenAI Conversation integration.""" from collections.abc import AsyncIterable from unittest.mock import AsyncMock, MagicMock, patch import httpx from openai import RateLimitError import pytest from homeassistant.components import stt from homeassistant.core import HomeAssistant from tests.co...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/openai_conversation/test_stt.py", "license": "Apache License 2.0", "lines": 175, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/compit/binary_sensor.py
"""Binary sensor platform for Compit integration.""" from dataclasses import dataclass from compit_inext_api.consts import CompitParameter from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEntityDescription, ) from homeassistant.const import Ent...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/compit/binary_sensor.py", "license": "Apache License 2.0", "lines": 167, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/compit/test_binary_sensor.py
"""Tests for the Compit binary sensor platform.""" from typing import Any from unittest.mock import MagicMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/compit/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 62, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/bsblan/button.py
"""Button platform for BSB-Lan integration.""" from __future__ import annotations from homeassistant.components.button import ButtonEntity, ButtonEntityDescription from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEnt...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/bsblan/button.py", "license": "Apache License 2.0", "lines": 46, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/bsblan/helpers.py
"""Helper functions for BSB-Lan integration.""" from __future__ import annotations from bsblan import BSBLAN, BSBLANError from homeassistant.exceptions import HomeAssistantError from homeassistant.util import dt as dt_util from .const import DOMAIN async def async_sync_device_time(client: BSBLAN, device_name: str...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/bsblan/helpers.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/bsblan/test_button.py
"""Tests for the BSB-Lan button platform.""" from unittest.mock import MagicMock from bsblan import BSBLANError, DeviceTime from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bsblan/test_button.py", "license": "Apache License 2.0", "lines": 111, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/homematicip_cloud/diagnostics.py
"""Diagnostics support for HomematicIP Cloud.""" from __future__ import annotations import json from typing import Any from homematicip.base.helpers import handle_config from homeassistant.components.diagnostics import async_redact_data from homeassistant.core import HomeAssistant from .hap import HomematicIPConfi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/homematicip_cloud/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:tests/components/homematicip_cloud/test_diagnostics.py
"""Tests for HomematicIP Cloud diagnostics.""" from syrupy.assertion import SnapshotAssertion from homeassistant.components.homematicip_cloud.const import DOMAIN from homeassistant.core import HomeAssistant from tests.common import async_load_json_object_fixture from tests.components.diagnostics import get_diagnosti...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homematicip_cloud/test_diagnostics.py", "license": "Apache License 2.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/econet/select.py
"""Support for Rheem EcoNet thermostats with variable fan speeds and fan modes.""" from __future__ import annotations from pyeconet.equipment import EquipmentType from pyeconet.equipment.thermostat import Thermostat, ThermostatFanMode from homeassistant.components.select import SelectEntity from homeassistant.core i...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/econet/select.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/proxmoxve/button.py
"""Button platform for Proxmox VE.""" from __future__ import annotations from abc import abstractmethod from collections.abc import Callable from dataclasses import dataclass from typing import Any from proxmoxer import AuthenticationError from proxmoxer.core import ResourceException import requests from requests.ex...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/proxmoxve/button.py", "license": "Apache License 2.0", "lines": 259, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/proxmoxve/test_button.py
"""Tests for the ProxmoxVE button platform.""" from __future__ import annotations from unittest.mock import MagicMock, patch from proxmoxer import AuthenticationError from proxmoxer.core import ResourceException import pytest from requests.exceptions import ConnectTimeout, SSLError from syrupy.assertion import Snaps...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/proxmoxve/test_button.py", "license": "Apache License 2.0", "lines": 272, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/ecovacs/test_vacuum.py
"""Tests for Ecovacs vacuum entities.""" from dataclasses import asdict import logging from deebot_client.events import CachedMapInfoEvent, Event, RoomsEvent from deebot_client.events.map import Map from deebot_client.models import CleanMode, Room from deebot_client.rs.map import RotationAngle # pylint: disable=no-n...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ecovacs/test_vacuum.py", "license": "Apache License 2.0", "lines": 448, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/liebherr/select.py
"""Select platform for Liebherr integration.""" from __future__ import annotations from collections.abc import Callable, Coroutine from dataclasses import dataclass from enum import StrEnum from typing import TYPE_CHECKING, Any from pyliebherrhomeapi import ( BioFreshPlusControl, BioFreshPlusMode, HydroB...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/liebherr/select.py", "license": "Apache License 2.0", "lines": 201, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/liebherr/test_select.py
"""Test the Liebherr select platform.""" import copy from datetime import timedelta from typing import Any from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory from pyliebherrhomeapi import ( BioFreshPlusMode, Device, DeviceState, DeviceType, HydroBreezeContro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/liebherr/test_select.py", "license": "Apache License 2.0", "lines": 264, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/homevolt/entity.py
"""Shared entity helpers for Homevolt.""" from __future__ import annotations from collections.abc import Callable, Coroutine from typing import Any, Concatenate from homevolt import HomevoltAuthenticationError, HomevoltConnectionError, HomevoltError from homeassistant.exceptions import ConfigEntryAuthFailed, HomeAs...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/homevolt/entity.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/homevolt/switch.py
"""Support for Homevolt switch entities.""" from __future__ import annotations from typing import Any from homeassistant.components.switch import SwitchEntity from homeassistant.const import EntityCategory from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEn...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/homevolt/switch.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:tests/components/homevolt/test_entity.py
"""Tests for the Homevolt entity.""" from __future__ import annotations from unittest.mock import MagicMock from homevolt import DeviceMetadata from homeassistant.components.homevolt.const import DOMAIN, MANUFACTURER from homeassistant.components.homevolt.switch import HomevoltLocalModeSwitch from homeassistant.cor...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homevolt/test_entity.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/homevolt/test_switch.py
"""Tests for the Homevolt switch platform.""" from __future__ import annotations from unittest.mock import MagicMock from homevolt import HomevoltAuthenticationError, HomevoltConnectionError, HomevoltError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import ( ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homevolt/test_switch.py", "license": "Apache License 2.0", "lines": 128, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/intelliclima/select.py
"""Select platform for IntelliClima VMC.""" from pyintelliclima.const import FanMode, FanSpeed from pyintelliclima.intelliclima_types import IntelliClimaECO from homeassistant.components.select import SelectEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfig...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/intelliclima/select.py", "license": "Apache License 2.0", "lines": 73, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/intelliclima/test_select.py
"""Test IntelliClima Select.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch from pyintelliclima.const import FanMode, FanSpeed import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.select import ( ATTR_OPTION, DOMAIN as SELECT_DOM...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/intelliclima/test_select.py", "license": "Apache License 2.0", "lines": 142, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/proxmoxve/diagnostics.py
"""Diagnostics support for Proxmox VE.""" from __future__ import annotations from dataclasses import asdict from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME from homeassistant.core import HomeAssistant f...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/proxmoxve/diagnostics.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:tests/components/proxmoxve/test_diagnostics.py
"""Test the Proxmox VE component diagnostics.""" from unittest.mock import MagicMock from syrupy.assertion import SnapshotAssertion from syrupy.filters import props from homeassistant.core import HomeAssistant from . import setup_integration from tests.common import MockConfigEntry from tests.components.diagnostic...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/proxmoxve/test_diagnostics.py", "license": "Apache License 2.0", "lines": 27, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/trane/climate.py
"""Climate platform for the Trane Local integration.""" from __future__ import annotations from typing import Any from steamloop import FanMode, HoldType, ThermostatConnection, ZoneMode from homeassistant.components.climate import ( ATTR_TARGET_TEMP_HIGH, ATTR_TARGET_TEMP_LOW, ClimateEntity, Climate...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/trane/climate.py", "license": "Apache License 2.0", "lines": 168, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/trane/test_climate.py
"""Tests for the Trane Local climate platform.""" from unittest.mock import MagicMock import pytest from steamloop import FanMode, HoldType, ZoneMode from syrupy.assertion import SnapshotAssertion from homeassistant.components.climate import ( ATTR_FAN_MODE, ATTR_HVAC_MODE, ATTR_TARGET_TEMP_HIGH, ATT...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/trane/test_climate.py", "license": "Apache License 2.0", "lines": 281, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/whirlpool/select.py
"""The select platform for Whirlpool Appliances.""" from __future__ import annotations from collections.abc import Awaitable, Callable from dataclasses import dataclass from typing import Final, override from whirlpool.appliance import Appliance from homeassistant.components.select import SelectEntity, SelectEntity...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/whirlpool/select.py", "license": "Apache License 2.0", "lines": 69, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/whirlpool/test_select.py
"""Test the Whirlpool select domain.""" from unittest.mock import MagicMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.select import ATTR_OPTION, DOMAIN as SELECT_DOMAIN from homeassistant.const import ATTR_ENTITY_ID, SERVICE_SELECT_OPTION, Platform from homeassistant....
{ "repo_id": "home-assistant/core", "file_path": "tests/components/whirlpool/test_select.py", "license": "Apache License 2.0", "lines": 82, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/airos/button.py
"""AirOS button component for Home Assistant.""" from __future__ import annotations from airos.exceptions import AirOSException from homeassistant.components.button import ( ButtonDeviceClass, ButtonEntity, ButtonEntityDescription, ) from homeassistant.core import HomeAssistant from homeassistant.excepti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/airos/button.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:tests/components/airos/test_button.py
"""Test the Ubiquiti airOS buttons.""" from unittest.mock import AsyncMock from airos.exceptions import AirOSDataMissingError, AirOSDeviceConnectionError import pytest from homeassistant.const import ATTR_ENTITY_ID, Platform from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssist...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/airos/test_button.py", "license": "Apache License 2.0", "lines": 93, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/myneomitis/config_flow.py
"""Config flow for MyNeomitis integration.""" import logging from typing import Any import aiohttp from pyaxencoapi import PyAxencoAPI import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from homeassistant.helpers.ai...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/myneomitis/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/myneomitis/select.py
"""Select entities for MyNeomitis integration. This module defines and sets up the select entities for the MyNeomitis integration. """ from __future__ import annotations from dataclasses import dataclass import logging from typing import Any from pyaxencoapi import PyAxencoAPI from homeassistant.components.select ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/myneomitis/select.py", "license": "Apache License 2.0", "lines": 171, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/myneomitis/test_config_flow.py
"""Test the configuration flow for MyNeomitis integration.""" from unittest.mock import AsyncMock from aiohttp import ClientConnectionError, ClientError, ClientResponseError, RequestInfo import pytest from yarl import URL from homeassistant.components.myneomitis.const import CONF_USER_ID, DOMAIN from homeassistant.c...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/myneomitis/test_config_flow.py", "license": "Apache License 2.0", "lines": 104, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/myneomitis/test_init.py
"""Tests for the MyNeomitis integration.""" from unittest.mock import AsyncMock import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_mini...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/myneomitis/test_init.py", "license": "Apache License 2.0", "lines": 86, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/myneomitis/test_select.py
"""Tests for the MyNeomitis select component.""" from unittest.mock import AsyncMock from syrupy.assertion import SnapshotAssertion from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from tests.common import MockConfigE...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/myneomitis/test_select.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:homeassistant/components/zinvolt/config_flow.py
"""Config flow for the Zinvolt integration.""" from __future__ import annotations import logging from typing import Any import jwt import voluptuous as vol from zinvolt import ZinvoltClient from zinvolt.exceptions import ZinvoltAuthenticationError, ZinvoltError from homeassistant.config_entries import ConfigFlow, C...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zinvolt/config_flow.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/zinvolt/coordinator.py
"""Coordinator for Zinvolt.""" from datetime import timedelta import logging from zinvolt import ZinvoltClient from zinvolt.exceptions import ZinvoltError from zinvolt.models import Battery, BatteryState from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zinvolt/coordinator.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/zinvolt/sensor.py
"""Sensor platform for Zinvolt integration.""" from collections.abc import Callable from dataclasses import dataclass from zinvolt.models import BatteryState from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ) from homeassistant....
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zinvolt/sensor.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:tests/components/zinvolt/test_config_flow.py
"""Test the Zinvolt config flow.""" from unittest.mock import AsyncMock import pytest from zinvolt.exceptions import ZinvoltAuthenticationError, ZinvoltError from homeassistant.components.zinvolt.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CONF_ACCESS_TOKE...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/zinvolt/test_config_flow.py", "license": "Apache License 2.0", "lines": 88, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/zinvolt/test_init.py
"""Test the Zinvolt initialization.""" from unittest.mock import AsyncMock from syrupy.assertion import SnapshotAssertion from homeassistant.components.zinvolt.const import DOMAIN from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr from . import setup_integration fr...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/zinvolt/test_init.py", "license": "Apache License 2.0", "lines": 20, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/zinvolt/test_sensor.py
"""Tests for the Zinvolt sensor.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from . import setup_integration from tests.comm...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/zinvolt/test_sensor.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/touchline_sl/test_climate.py
"""Tests for the Roth Touchline SL climate platform.""" from unittest.mock import AsyncMock, MagicMock import pytest from homeassistant.components.climate import HVACMode from homeassistant.const import STATE_UNAVAILABLE from homeassistant.core import HomeAssistant from .conftest import make_mock_module, make_mock_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/touchline_sl/test_climate.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/velux/number.py
"""Support for Velux exterior heating number entities.""" from __future__ import annotations from pyvlx import ExteriorHeating, Intensity from homeassistant.components.number import NumberEntity from homeassistant.const import PERCENTAGE from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/velux/number.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:tests/components/velux/test_number.py
"""Test Velux number entities.""" from __future__ import annotations from unittest.mock import AsyncMock import pytest from pyvlx import Intensity from homeassistant.components.number import ( ATTR_VALUE, DOMAIN as NUMBER_DOMAIN, SERVICE_SET_VALUE, ) from homeassistant.components.velux.const import DOMA...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/velux/test_number.py", "license": "Apache License 2.0", "lines": 101, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/trane/config_flow.py
"""Config flow for the Trane Local integration.""" from __future__ import annotations import logging from typing import Any from steamloop import PairingError, SteamloopConnectionError, ThermostatConnection import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/trane/config_flow.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/trane/entity.py
"""Base entity for the Trane Local integration.""" from __future__ import annotations from typing import Any from steamloop import ThermostatConnection, Zone from homeassistant.core import callback from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity from .co...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/trane/entity.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/trane/switch.py
"""Switch platform for the Trane Local integration.""" from __future__ import annotations from typing import Any from steamloop import HoldType, ThermostatConnection from homeassistant.components.switch import SwitchEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/trane/switch.py", "license": "Apache License 2.0", "lines": 37, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/trane/test_config_flow.py
"""Tests for the Trane Local config flow.""" from unittest.mock import MagicMock import pytest from steamloop import PairingError, SteamloopConnectionError from homeassistant.components.trane.const import CONF_SECRET_KEY, DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const import CON...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/trane/test_config_flow.py", "license": "Apache License 2.0", "lines": 87, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/trane/test_init.py
"""Tests for the Trane Local integration setup.""" from unittest.mock import MagicMock from steamloop import AuthenticationError, SteamloopConnectionError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/trane/test_init.py", "license": "Apache License 2.0", "lines": 49, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/trane/test_switch.py
"""Tests for the Trane Local switch platform.""" from unittest.mock import MagicMock import pytest from steamloop import HoldType from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_O...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/trane/test_switch.py", "license": "Apache License 2.0", "lines": 66, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/cambridge_audio/number.py
"""Support for Cambridge Audio number entities.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from typing import TYPE_CHECKING from aiostreammagic import StreamMagicClient from homeassistant.components.number import NumberEntity, NumberEntityDescription from homeassistant.const...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/cambridge_audio/number.py", "license": "Apache License 2.0", "lines": 68, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/cambridge_audio/test_number.py
"""Tests for the Cambridge Audio number platform.""" from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.number import ( ATTR_VALUE, DOMAIN as NUMBER_DOMAIN, SERVICE_SET_VALUE, ) from homeassistant.const import ATTR_ENTITY_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/cambridge_audio/test_number.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/enocean/test_init.py
"""Test the EnOcean integration.""" from unittest.mock import patch from serial import SerialException from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_device_not_connected( hass: HomeAssistant, mock_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/enocean/test_init.py", "license": "Apache License 2.0", "lines": 18, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/energy/test_validate_flow_rate.py
"""Test flow rate (stat_rate) validation for gas and water sources.""" import pytest from homeassistant.components.energy import validate from homeassistant.components.energy.data import EnergyManager from homeassistant.const import UnitOfVolumeFlowRate from homeassistant.core import HomeAssistant FLOW_RATE_UNITS_ST...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/energy/test_validate_flow_rate.py", "license": "Apache License 2.0", "lines": 571, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/indevolt/switch.py
"""Switch platform for Indevolt integration.""" from __future__ import annotations from dataclasses import dataclass, field from typing import Any, Final from homeassistant.components.switch import ( SwitchDeviceClass, SwitchEntity, SwitchEntityDescription, ) from homeassistant.core import HomeAssistant ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/indevolt/switch.py", "license": "Apache License 2.0", "lines": 104, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/indevolt/test_switch.py
"""Tests for the Indevolt 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.indevolt.coordinator import SCAN_INTERVAL from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/indevolt/test_switch.py", "license": "Apache License 2.0", "lines": 183, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/indevolt/number.py
"""Number platform for Indevolt integration.""" from __future__ import annotations from dataclasses import dataclass, field from typing import Final from homeassistant.components.number import ( NumberDeviceClass, NumberEntity, NumberEntityDescription, NumberMode, ) from homeassistant.const import PE...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/indevolt/number.py", "license": "Apache License 2.0", "lines": 118, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/indevolt/test_number.py
"""Tests for the Indevolt number 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.indevolt.coordinator import SCAN_INTERVAL from homeassista...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/indevolt/test_number.py", "license": "Apache License 2.0", "lines": 138, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/splunk/diagnostics.py
"""Diagnostics support for Splunk.""" from __future__ import annotations from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_TOKEN from homeassistant.core import HomeAssistant from . impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/splunk/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:tests/components/splunk/test_diagnostics.py
"""Test Splunk diagnostics.""" from syrupy.assertion import SnapshotAssertion from syrupy.filters import props from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_config_entry from tests.typing import ClientSessionGenerato...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/splunk/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/systemnexa2/config_flow.py
"""Config flow for the SystemNexa2 integration.""" from dataclasses import dataclass import logging import socket from typing import Any import aiohttp from sn2.device import Device import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.const import ( AT...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/systemnexa2/config_flow.py", "license": "Apache License 2.0", "lines": 170, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/systemnexa2/const.py
"""Constants for the systemnexa2 integration.""" from typing import Final from homeassistant.const import Platform DOMAIN = "systemnexa2" MANUFACTURER = "NEXA" PLATFORMS: Final = [Platform.LIGHT, Platform.SENSOR, Platform.SWITCH]
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/systemnexa2/const.py", "license": "Apache License 2.0", "lines": 6, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/systemnexa2/coordinator.py
"""Data coordinator for System Nexa 2 integration.""" from collections.abc import Awaitable import logging import aiohttp from sn2 import ( ConnectionStatus, Device, DeviceInitializationError, InformationData, NotConnectedError, OnOffSetting, SettingsUpdate, StateChange, ) from sn2.dev...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/systemnexa2/coordinator.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:homeassistant/components/systemnexa2/entity.py
"""Base entity for SystemNexa2 integration.""" from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN, MANUFACTURER from .coordinator import SystemNexa2DataUpdateCoordinator class SystemNexa2Entity(CoordinatorEnti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/systemnexa2/entity.py", "license": "Apache License 2.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/systemnexa2/switch.py
"""Switch entity for the SystemNexa2 integration.""" from dataclasses import dataclass from typing import Any, Final from sn2.device import OnOffSetting from homeassistant.components.switch import ( SwitchDeviceClass, SwitchEntity, SwitchEntityDescription, ) from homeassistant.const import EntityCategory...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/systemnexa2/switch.py", "license": "Apache License 2.0", "lines": 113, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/systemnexa2/test_config_flow.py
"""Test the SystemNexa2 config flow.""" from ipaddress import ip_address import socket from unittest.mock import AsyncMock, MagicMock, patch import pytest from sn2 import InformationData, InformationUpdate from homeassistant.components.systemnexa2 import DOMAIN from homeassistant.config_entries import SOURCE_USER, S...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/systemnexa2/test_config_flow.py", "license": "Apache License 2.0", "lines": 245, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/systemnexa2/test_init.py
"""Test the System Nexa 2 integration setup and unload.""" from unittest.mock import AsyncMock, MagicMock from sn2 import DeviceInitializationError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry async def test_load_un...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/systemnexa2/test_init.py", "license": "Apache License 2.0", "lines": 36, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/systemnexa2/test_switch.py
"""Test the System Nexa 2 switch platform.""" from unittest.mock import MagicMock, patch import pytest from sn2 import ConnectionStatus, SettingsUpdate, StateChange from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/systemnexa2/test_switch.py", "license": "Apache License 2.0", "lines": 218, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/influxdb/config_flow.py
"""Config flow for InfluxDB integration.""" import logging from pathlib import Path import shutil from typing import Any import voluptuous as vol from yarl import URL from homeassistant.components.file_upload import process_uploaded_file from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from home...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/influxdb/config_flow.py", "license": "Apache License 2.0", "lines": 246, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/influxdb/test_config_flow.py
"""Test the influxdb config flow.""" from collections.abc import Generator from contextlib import contextmanager from pathlib import Path from typing import Any from unittest.mock import AsyncMock, MagicMock, patch from influxdb.exceptions import InfluxDBClientError, InfluxDBServerError import pytest from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/influxdb/test_config_flow.py", "license": "Apache License 2.0", "lines": 643, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/nrgkick/number.py
"""Number platform for NRGkick.""" from __future__ import annotations from collections.abc import Awaitable, Callable from dataclasses import dataclass from typing import TYPE_CHECKING, Any from nrgkick_api.const import ( CONTROL_KEY_CURRENT_SET, CONTROL_KEY_ENERGY_LIMIT, CONTROL_KEY_PHASE_COUNT, ) from...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/nrgkick/number.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:tests/components/nrgkick/test_number.py
"""Tests for the NRGkick number platform.""" from __future__ import annotations from unittest.mock import AsyncMock from nrgkick_api import NRGkickCommandRejectedError from nrgkick_api.const import ( CONTROL_KEY_CURRENT_SET, CONTROL_KEY_ENERGY_LIMIT, CONTROL_KEY_PHASE_COUNT, ) import pytest from syrupy.a...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/nrgkick/test_number.py", "license": "Apache License 2.0", "lines": 140, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/aws_s3/coordinator.py
"""DataUpdateCoordinator for AWS S3.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta import logging from aiobotocore.client import AioBaseClient as S3Client from botocore.exceptions import BotoCoreError from homeassistant.config_entries import ConfigEntry from ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/coordinator.py", "license": "Apache License 2.0", "lines": 56, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/aws_s3/entity.py
"""Define the AWS S3 entity.""" from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.entity import EntityDescription from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import CONF_BUCKET, DOMAIN from .coordinator import S3DataUpdateCo...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/entity.py", "license": "Apache License 2.0", "lines": 26, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/aws_s3/helpers.py
"""Helpers for the AWS S3 integration.""" from __future__ import annotations import json import logging from typing import Any from aiobotocore.client import AioBaseClient as S3Client from botocore.exceptions import BotoCoreError from homeassistant.components.backup import AgentBackup _LOGGER = logging.getLogger(_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/helpers.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/aws_s3/sensor.py
"""Support for AWS S3 sensors.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, ) from homeassistant.const import EntityCategory, UnitOfInfor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/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:tests/components/aws_s3/test_sensor.py
"""Tests for the AWS S3 sensor platform.""" from __future__ import annotations import json from unittest.mock import AsyncMock from botocore.exceptions import BotoCoreError from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.aws_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/aws_s3/test_sensor.py", "license": "Apache License 2.0", "lines": 105, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/iometer/test_sensor.py
"""Test the sensors provided by the Powerfox integration.""" from __future__ import annotations import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_registry as er from . import set...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/iometer/test_sensor.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:homeassistant/components/ness_alarm/config_flow.py
"""Config flow for Ness Alarm integration.""" from __future__ import annotations import asyncio import logging from types import MappingProxyType from typing import Any from nessclient import Client import voluptuous as vol from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistan...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ness_alarm/config_flow.py", "license": "Apache License 2.0", "lines": 249, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/ness_alarm/const.py
"""Constants for the Ness Alarm integration.""" from datetime import timedelta from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.const import Platform DOMAIN = "ness_alarm" # Platforms PLATFORMS = [Platform.ALARM_CONTROL_PANEL, Platform.BINARY_SENSOR] # Configuration con...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ness_alarm/const.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/ness_alarm/services.py
"""Services for the Ness Alarm integration.""" from __future__ import annotations import voluptuous as vol from homeassistant.const import ATTR_CODE, ATTR_STATE from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import ServiceValidationError from homeassistant.helpers import conf...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ness_alarm/services.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:tests/components/ness_alarm/test_config_flow.py
"""Test the Ness Alarm config flow.""" from types import MappingProxyType from unittest.mock import AsyncMock import pytest from homeassistant.components.binary_sensor import BinarySensorDeviceClass from homeassistant.components.ness_alarm.const import ( CONF_INFER_ARMING_STATE, CONF_SHOW_HOME_MODE, CONF...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/ness_alarm/test_config_flow.py", "license": "Apache License 2.0", "lines": 386, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/powerfox_local/config_flow.py
"""Config flow for Powerfox Local integration.""" from __future__ import annotations from collections.abc import Mapping from typing import Any from powerfox import PowerfoxAuthenticationError, PowerfoxConnectionError, PowerfoxLocal import voluptuous as vol from homeassistant.config_entries import ( SOURCE_RECO...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/powerfox_local/config_flow.py", "license": "Apache License 2.0", "lines": 148, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/powerfox_local/const.py
"""Constants for the Powerfox Local integration.""" from __future__ import annotations from datetime import timedelta import logging from typing import Final DOMAIN: Final = "powerfox_local" LOGGER = logging.getLogger(__package__) SCAN_INTERVAL = timedelta(seconds=5)
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/powerfox_local/const.py", "license": "Apache License 2.0", "lines": 8, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/powerfox_local/coordinator.py
"""Coordinator for Powerfox Local integration.""" from __future__ import annotations from powerfox import ( LocalResponse, PowerfoxAuthenticationError, PowerfoxConnectionError, PowerfoxLocal, ) from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_API_KEY, CONF_HOS...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/powerfox_local/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/powerfox_local/entity.py
"""Base entity for Powerfox Local.""" from __future__ import annotations from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.update_coordinator import CoordinatorEntity from .const import DOMAIN from .coordinator import PowerfoxLocalDataUpdateCoordinator class PowerfoxLocalEntit...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/powerfox_local/entity.py", "license": "Apache License 2.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/powerfox_local/sensor.py
"""Sensors for Powerfox Local integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from powerfox import LocalResponse from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorSta...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/powerfox_local/sensor.py", "license": "Apache License 2.0", "lines": 93, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/powerfox_local/test_config_flow.py
"""Test the Powerfox Local config flow.""" from datetime import UTC, datetime from unittest.mock import AsyncMock from powerfox import LocalResponse, PowerfoxAuthenticationError, PowerfoxConnectionError import pytest from homeassistant.components.powerfox_local.const import DOMAIN from homeassistant.config_entries i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/powerfox_local/test_config_flow.py", "license": "Apache License 2.0", "lines": 291, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/powerfox_local/test_init.py
"""Test the Powerfox Local init module.""" from __future__ import annotations from unittest.mock import AsyncMock from powerfox import PowerfoxAuthenticationError, PowerfoxConnectionError from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from . import setup_inte...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/powerfox_local/test_init.py", "license": "Apache License 2.0", "lines": 43, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/powerfox_local/test_sensor.py
"""Test the sensors provided by the Powerfox Local integration.""" from __future__ import annotations from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory from powerfox import PowerfoxConnectionError import pytest from syrupy.assertion import Snaps...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/powerfox_local/test_sensor.py", "license": "Apache License 2.0", "lines": 42, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/onkyo/coordinator.py
"""Onkyo coordinators.""" from __future__ import annotations import asyncio from enum import StrEnum import logging from typing import TYPE_CHECKING, cast from aioonkyo import Kind, Status, Zone, command, query, status from homeassistant.core import HomeAssistant from homeassistant.helpers.dispatcher import async_d...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/onkyo/coordinator.py", "license": "Apache License 2.0", "lines": 132, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/onkyo/switch.py
"""Switch platform.""" from __future__ import annotations import logging from typing import TYPE_CHECKING, Any from aioonkyo import command, status from homeassistant.components.switch import SwitchEntity from homeassistant.core import HomeAssistant, callback from homeassistant.helpers.dispatcher import async_dispa...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/onkyo/switch.py", "license": "Apache License 2.0", "lines": 75, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/onkyo/test_switch.py
"""Test Onkyo switch platform.""" import asyncio from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch from aioonkyo import Code, Instruction, Kind, Zone, command, query, status import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.homeassistant im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/onkyo/test_switch.py", "license": "Apache License 2.0", "lines": 185, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/hdfury/number.py
"""Number platform for HDFury Integration.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from hdfury import HDFuryAPI, HDFuryError from homeassistant.components.number import ( NumberDeviceClass, NumberEntity, NumberEntityDescription, NumberMode, ) from homeassi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/hdfury/number.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:tests/components/hdfury/test_number.py
"""Tests for the HDFury number platform.""" from datetime import timedelta from unittest.mock import AsyncMock from freezegun.api import FrozenDateTimeFactory from hdfury import HDFuryError import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.number import ( ATTR_VALUE, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/hdfury/test_number.py", "license": "Apache License 2.0", "lines": 108, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/onedrive_for_business/diagnostics.py
"""Diagnostics support for OneDrive for Business.""" from __future__ import annotations from dataclasses import asdict from typing import Any from homeassistant.components.diagnostics import async_redact_data from homeassistant.const import CONF_ACCESS_TOKEN, CONF_TOKEN from homeassistant.core import HomeAssistant ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/onedrive_for_business/diagnostics.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:tests/components/onedrive_for_business/test_diagnostics.py
"""Tests for the diagnostics data provided by the OneDrive for Business integration.""" 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_co...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/onedrive_for_business/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/vacuum/websocket.py
"""Websocket commands for the Vacuum integration.""" from __future__ import annotations from typing import Any import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.components.websocket_api import ERR_NOT_FOUND, ERR_NOT_SUPPORTED from homeassistant.core import HomeAssistant,...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/vacuum/websocket.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:tests/components/vacuum/test_websocket.py
"""Tests for vacuum websocket API.""" from __future__ import annotations from dataclasses import asdict import pytest from homeassistant.components.vacuum import ( DOMAIN, Segment, StateVacuumEntity, VacuumActivity, VacuumEntityFeature, ) from homeassistant.components.websocket_api import ERR_NO...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/vacuum/test_websocket.py", "license": "Apache License 2.0", "lines": 106, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/proxmoxve/coordinator.py
"""Data Update Coordinator for Proxmox VE integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass, field from datetime import timedelta import logging from typing import Any from proxmoxer import AuthenticationError, ProxmoxAPI from proxmoxer.core imp...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/proxmoxve/coordinator.py", "license": "Apache License 2.0", "lines": 203, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex