sample_id
stringlengths
21
196
text
stringlengths
105
936k
metadata
dict
category
stringclasses
6 values
home-assistant/core:homeassistant/components/smarla/const.py
"""Constants for the Swing2Sleep Smarla integration.""" from homeassistant.const import Platform DOMAIN = "smarla" HOST = "https://devices.swing2sleep.de" PLATFORMS = [Platform.NUMBER, Platform.SENSOR, Platform.SWITCH, Platform.UPDATE] DEVICE_MODEL_NAME = "Smarla" MANUFACTURER_NAME = "Swing2Sleep"
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/smarla/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/smarla/entity.py
"""Common base for entities.""" from dataclasses import dataclass import logging from typing import Any from pysmarlaapi import Federwiege from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity, EntityDescription from .const import DEVICE_MODEL_NAME, DOMAIN, MAN...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/smarla/entity.py", "license": "Apache License 2.0", "lines": 58, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/smarla/switch.py
"""Support for the Swing2Sleep Smarla switch entities.""" from dataclasses import dataclass from typing import Any from pysmarlaapi.federwiege.services.classes import Property from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription from homeassistant.core import HomeAssistant from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/smarla/switch.py", "license": "Apache License 2.0", "lines": 49, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/smartthings/water_heater.py
"""Support for water heaters through the SmartThings cloud API.""" from __future__ import annotations from typing import Any from pysmartthings import Attribute, Capability, Command, SmartThings from homeassistant.components.water_heater import ( DEFAULT_MAX_TEMP, DEFAULT_MIN_TEMP, STATE_ECO, STATE_...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/smartthings/water_heater.py", "license": "Apache License 2.0", "lines": 204, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/squeezebox/switch.py
"""Switch entity representing a Squeezebox alarm.""" import datetime import logging from typing import Any, cast from pysqueezebox.player import Alarm from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import EntityCategory, Platform...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/squeezebox/switch.py", "license": "Apache License 2.0", "lines": 153, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/squeezebox/update.py
"""Platform for update integration for squeezebox.""" from __future__ import annotations from collections.abc import Callable from datetime import datetime import logging from typing import Any from homeassistant.components.update import ( UpdateEntity, UpdateEntityDescription, UpdateEntityFeature, ) fro...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/squeezebox/update.py", "license": "Apache License 2.0", "lines": 144, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/sun/condition.py
"""Offer sun based automation rules.""" from __future__ import annotations from datetime import datetime, timedelta from typing import Any, Unpack, cast import voluptuous as vol from homeassistant.const import CONF_OPTIONS, SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET from homeassistant.core import HomeAssistant from homeas...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/sun/condition.py", "license": "Apache License 2.0", "lines": 143, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/switchbot/vacuum.py
"""Support for switchbot vacuums.""" from __future__ import annotations from typing import Any import switchbot from switchbot import SwitchbotModel from homeassistant.components.vacuum import ( StateVacuumEntity, VacuumActivity, VacuumEntityFeature, ) from homeassistant.core import HomeAssistant from h...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switchbot/vacuum.py", "license": "Apache License 2.0", "lines": 101, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/switchbot_cloud/binary_sensor.py
"""Support for SwitchBot Cloud binary sensors.""" from collections.abc import Callable from dataclasses import dataclass from typing import Any from switchbot_api import Device, SwitchBotAPI from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, BinarySensorEnti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switchbot_cloud/binary_sensor.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/tuya/event.py
"""Support for Tuya event entities.""" from __future__ import annotations from base64 import b64decode from dataclasses import dataclass from typing import Any from tuya_device_handlers.device_wrapper.base import DeviceWrapper from tuya_device_handlers.device_wrapper.common import ( DPCodeEnumWrapper, DPCode...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/tuya/event.py", "license": "Apache License 2.0", "lines": 202, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/wallbox/select.py
"""Home Assistant component for accessing the Wallbox Portal API. The switch component creates a switch entity.""" from __future__ import annotations from collections.abc import Awaitable, Callable from dataclasses import dataclass from requests import HTTPError from homeassistant.components.select import SelectEnt...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/wallbox/select.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/wmspro/button.py
"""Identify support for WMS WebControl pro.""" from __future__ import annotations from wmspro.const import WMS_WebControl_pro_API_actionDescription from homeassistant.components.button import ButtonDeviceClass, ButtonEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/wmspro/button.py", "license": "Apache License 2.0", "lines": 28, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/config_flow.py
"""Config flow for zcc integration.""" from __future__ import annotations import logging from typing import Any import voluptuous as vol from zcc import ( ControlPoint, ControlPointCannotConnectError, ControlPointConnectionRefusedError, ControlPointDescription, ControlPointDiscoveryService, C...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/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/zimi/cover.py
"""Platform for cover integration.""" from __future__ import annotations import logging from typing import Any from homeassistant.components.cover import ( CoverDeviceClass, CoverEntity, CoverEntityFeature, ) from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import A...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/cover.py", "license": "Apache License 2.0", "lines": 72, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/entity.py
"""Base entity for zimi integrations.""" from __future__ import annotations import logging from zcc import ControlPoint from zcc.device import ControlPointDevice from homeassistant.helpers.device_registry import DeviceInfo from homeassistant.helpers.entity import Entity from .const import DOMAIN _LOGGER = logging...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/entity.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/zimi/fan.py
"""Platform for fan integration.""" from __future__ import annotations import logging import math from typing import Any from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback f...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/fan.py", "license": "Apache License 2.0", "lines": 69, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/helpers.py
"""The zcc integration helpers.""" from __future__ import annotations import logging from zcc import ControlPoint, ControlPointDescription from homeassistant.exceptions import ConfigEntryNotReady _LOGGER = logging.getLogger(__name__) async def async_connect_to_controller( host: str, port: int, fast: bool = F...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/helpers.py", "license": "Apache License 2.0", "lines": 25, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/light.py
"""Light platform for zcc integration.""" from __future__ import annotations import logging from typing import Any from zcc import ControlPoint from zcc.device import ControlPointDevice from homeassistant.components.light import ATTR_BRIGHTNESS, ColorMode, LightEntity from homeassistant.core import HomeAssistant fr...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/light.py", "license": "Apache License 2.0", "lines": 70, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/sensor.py
"""Platform for sensor integration.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass import logging from zcc import ControlPoint from zcc.device import ControlPointDevice from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/sensor.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/zimi/switch.py
"""Switch platform for zcc integration.""" from __future__ import annotations import logging from typing import Any from homeassistant.components.switch import SwitchEntity from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddConfigEntryEntitiesCallback from . import Zim...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/zimi/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:homeassistant/helpers/helper_integration.py
"""Helpers for helper integrations.""" from __future__ import annotations from collections.abc import Callable, Coroutine from typing import Any from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, valid_entity_id from . import device_registry as dr, entity_registry as er from .event import async_tra...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/helpers/helper_integration.py", "license": "Apache License 2.0", "lines": 146, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:tests/components/alexa_devices/const.py
"""Alexa Devices tests const.""" from datetime import UTC, datetime from aioamazondevices.const.schedules import ( NOTIFICATION_ALARM, NOTIFICATION_REMINDER, NOTIFICATION_TIMER, ) from aioamazondevices.structures import AmazonDevice, AmazonDeviceSensor, AmazonSchedule TEST_CODE = "023123" TEST_PASSWORD =...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/const.py", "license": "Apache License 2.0", "lines": 94, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_binary_sensor.py
"""Tests for the Alexa Devices binary sensor platform.""" from unittest.mock import AsyncMock, patch from aioamazondevices.exceptions import ( CannotAuthenticate, CannotConnect, CannotRetrieveData, ) from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAsserti...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 148, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_config_flow.py
"""Tests for the Alexa Devices config flow.""" from unittest.mock import AsyncMock from aioamazondevices.exceptions import ( CannotAuthenticate, CannotConnect, CannotRetrieveData, ) import pytest from homeassistant.components.alexa_devices.const import ( CONF_LOGIN_DATA, CONF_SITE, DOMAIN, ) ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_config_flow.py", "license": "Apache License 2.0", "lines": 282, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_diagnostics.py
"""Tests for Alexa Devices diagnostics platform.""" from __future__ import annotations from unittest.mock import AsyncMock from syrupy.assertion import SnapshotAssertion from syrupy.filters import props from homeassistant.components.alexa_devices.const import DOMAIN from homeassistant.core import HomeAssistant from...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_diagnostics.py", "license": "Apache License 2.0", "lines": 55, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_init.py
"""Tests for the Alexa Devices integration.""" from unittest.mock import AsyncMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.alexa_devices.const import ( CONF_LOGIN_DATA, CONF_SITE, DOMAIN, ) from homeassistant.config_entries import ConfigEntryState from h...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_init.py", "license": "Apache License 2.0", "lines": 112, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_notify.py
"""Tests for the Alexa Devices notify platform.""" from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.alexa_devices.coordinator import SCAN_INTERVAL from homeassistant.components.notify ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_notify.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/alexa_devices/test_switch.py
"""Tests for the Alexa Devices switch platform.""" from copy import deepcopy from unittest.mock import AsyncMock, patch from aioamazondevices.api import AmazonDeviceSensor from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.alexa_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/alexa_devices/test_switch.py", "license": "Apache License 2.0", "lines": 136, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/backup/test_event.py
"""The tests for the Backup event entity.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.components.backup.const import DOMAIN from homeassistant.components.backup.event import ATTR_BACKUP_STAGE, ATTR_FAILED_REASON from homeassistant.components.event i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/backup/test_event.py", "license": "Apache License 2.0", "lines": 71, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/blue_current/test_button.py
"""The tests for Blue Current buttons.""" import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.const import ATTR_ENTITY_ID, STATE_UNKNOWN, Platform from homeassistant.core import HomeAssistant from homeassist...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/blue_current/test_button.py", "license": "Apache License 2.0", "lines": 38, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/bluesound/test_button.py
"""Test for bluesound buttons.""" from unittest.mock import call import pytest from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant from .conftest import PlayerMocks @pytest.mark.usefixtures("...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bluesound/test_button.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/bosch_alarm/test_binary_sensor.py
"""Tests for Bosch Alarm component.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch from bosch_alarm_mode2.const import ALARM_PANEL_FAULTS import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.const import STATE_OFF, STATE_ON, Platform from homeassis...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bosch_alarm/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 64, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/bosch_alarm/test_services.py
"""Tests for Bosch Alarm component.""" import asyncio from collections.abc import AsyncGenerator import datetime as dt from unittest.mock import AsyncMock, patch import pytest import voluptuous as vol from homeassistant.components.bosch_alarm.const import ( ATTR_DATETIME, DOMAIN, SERVICE_SET_DATE_TIME, )...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bosch_alarm/test_services.py", "license": "Apache License 2.0", "lines": 169, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/bosch_alarm/test_switch.py
"""Tests for Bosch Alarm component.""" from collections.abc import AsyncGenerator from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVI...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/bosch_alarm/test_switch.py", "license": "Apache License 2.0", "lines": 129, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/comelit/test_utils.py
"""Tests for Comelit SimpleHome utils.""" from unittest.mock import AsyncMock from aiocomelit.api import ComelitSerialBridgeObject from aiocomelit.const import CLIMATE, WATT from aiocomelit.exceptions import CannotAuthenticate, CannotConnect, CannotRetrieveData import pytest from homeassistant.components.climate imp...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/comelit/test_utils.py", "license": "Apache License 2.0", "lines": 116, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/eheimdigital/test_diagnostics.py
"""Tests for the diagnostics module.""" from unittest.mock import MagicMock from syrupy.assertion import SnapshotAssertion from syrupy.filters import props from homeassistant.core import HomeAssistant from .conftest import init_integration from tests.common import MockConfigEntry from tests.components.diagnostics ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/eheimdigital/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:tests/components/eheimdigital/test_select.py
"""Tests for the select module.""" from unittest.mock import AsyncMock, MagicMock, patch from eheimdigital.types import FilterMode, FilterModeProf import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.select import ( ATTR_OPTION, DOMAIN as SELECT_DOMAIN, SERVICE_SELEC...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/eheimdigital/test_select.py", "license": "Apache License 2.0", "lines": 192, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/google_travel_time/test_helpers.py
"""Tests for google_travel_time.helpers.""" from google.maps.routing_v2 import Location, Waypoint from google.type import latlng_pb2 import pytest from homeassistant.components.google_travel_time import helpers from homeassistant.core import HomeAssistant @pytest.mark.parametrize( ("location", "expected_result"...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/google_travel_time/test_helpers.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/homee/test_alarm_control_panel.py
"""Test Homee alarm control panels.""" from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.alarm_control_panel import ( DOMAIN as ALARM_CONTROL_PANEL_DOMAIN, SERVICE_ALARM_ARM_AWAY, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homee/test_alarm_control_panel.py", "license": "Apache License 2.0", "lines": 80, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/homee/test_event.py
"""Test homee events.""" from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.event import ATTR_EVENT_TYPE from homeassistant.const import Platform from homeassistant.core import HomeAssistant from homeassistant.helpers import entity_re...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homee/test_event.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:tests/components/homee/test_fan.py
"""Test Homee fans.""" from unittest.mock import MagicMock, call, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.fan import ( ATTR_PERCENTAGE, ATTR_PRESET_MODE, DOMAIN as FAN_DOMAIN, SERVICE_DECREASE_SPEED, SERVICE_INCREASE_SPEED, SERVICE_SET_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/homee/test_fan.py", "license": "Apache License 2.0", "lines": 165, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/immich/const.py
"""Constants for the Immich integration tests.""" from aioimmich.albums.models import ImmichAlbum from aioimmich.assets.models import ImmichAsset from homeassistant.const import ( CONF_API_KEY, CONF_HOST, CONF_PORT, CONF_SSL, CONF_URL, CONF_VERIFY_SSL, ) MOCK_USER_DATA = { CONF_URL: "http...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/immich/const.py", "license": "Apache License 2.0", "lines": 235, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/immich/test_config_flow.py
"""Test the Immich config flow.""" from unittest.mock import AsyncMock, Mock from aiohttp import ClientError from aioimmich.exceptions import ImmichUnauthorizedError import pytest from homeassistant.components.immich.const import DOMAIN from homeassistant.config_entries import SOURCE_USER from homeassistant.const im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/immich/test_config_flow.py", "license": "Apache License 2.0", "lines": 302, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/immich/test_diagnostics.py
"""Tests for the Immich integration.""" from __future__ import annotations from unittest.mock import Mock 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...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/immich/test_diagnostics.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/immich/test_media_source.py
"""Tests for Immich media source.""" from pathlib import Path import tempfile from unittest.mock import Mock, patch from aiohttp import web from aioimmich.exceptions import ImmichError import pytest from homeassistant.components.immich.const import DOMAIN from homeassistant.components.immich.media_source import ( ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/immich/test_media_source.py", "license": "Apache License 2.0", "lines": 487, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/immich/test_sensor.py
"""Test the Immich sensor platform.""" from unittest.mock import Mock, patch 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 setup_integration fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/immich/test_sensor.py", "license": "Apache License 2.0", "lines": 32, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/jewish_calendar/test_diagnostics.py
"""Tests for the diagnostics data provided by the Jewish Calendar integration.""" import datetime as dt import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry from tests.components.diagnostics import get_diagnostics_for_conf...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/jewish_calendar/test_diagnostics.py", "license": "Apache License 2.0", "lines": 24, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/miele/test_vacuum.py
"""Tests for miele vacuum module.""" from unittest.mock import MagicMock, Mock from aiohttp import ClientResponseError from pymiele import MieleDevices import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.miele.const import DOMAIN, PROCESS_ACTION, PROGRAM_ID from homeassistant.c...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/miele/test_vacuum.py", "license": "Apache License 2.0", "lines": 129, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/nanoleaf/test_light.py
"""Tests for the Nanoleaf light platform.""" from unittest.mock import AsyncMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.light import ATTR_EFFECT_LIST, DOMAIN as LIGHT_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERV...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/nanoleaf/test_light.py", "license": "Apache License 2.0", "lines": 55, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/openweathermap/test_sensor.py
"""Tests for OpenWeatherMap sensors.""" from unittest.mock import MagicMock import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.openweathermap.const import ( OWM_MODE_AIRPOLLUTION, OWM_MODE_FREE_CURRENT, OWM_MODE_FREE_FORECAST, OWM_MODE_V30, ) from homeassistant...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/openweathermap/test_sensor.py", "license": "Apache License 2.0", "lines": 41, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/paperless_ngx/const.py
"""Constants for the Paperless NGX integration tests.""" from homeassistant.const import CONF_API_KEY, CONF_URL, CONF_VERIFY_SSL USER_INPUT_ONE = { CONF_URL: "https://192.168.69.16:8000", CONF_API_KEY: "12345678", CONF_VERIFY_SSL: True, } USER_INPUT_TWO = { CONF_URL: "https://paperless.example.de", ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/paperless_ngx/const.py", "license": "Apache License 2.0", "lines": 13, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/paperless_ngx/test_config_flow.py
"""Tests for the Paperless-ngx config flow.""" from collections.abc import Generator from unittest.mock import AsyncMock from pypaperless.exceptions import ( InitializationError, PaperlessConnectionError, PaperlessForbiddenError, PaperlessInactiveOrDeletedError, PaperlessInvalidTokenError, ) impor...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/paperless_ngx/test_config_flow.py", "license": "Apache License 2.0", "lines": 206, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/paperless_ngx/test_diagnostics.py
"""Tests for Paperless-ngx sensor platform.""" 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...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/paperless_ngx/test_diagnostics.py", "license": "Apache License 2.0", "lines": 21, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/paperless_ngx/test_init.py
"""Test the Paperless-ngx integration initialization.""" from unittest.mock import AsyncMock from pypaperless.exceptions import ( InitializationError, PaperlessConnectionError, PaperlessForbiddenError, PaperlessInactiveOrDeletedError, PaperlessInvalidTokenError, ) import pytest from homeassistant...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/paperless_ngx/test_init.py", "license": "Apache License 2.0", "lines": 63, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/paperless_ngx/test_sensor.py
"""Tests for Paperless-ngx sensor platform.""" from freezegun.api import FrozenDateTimeFactory from pypaperless.exceptions import ( PaperlessConnectionError, PaperlessForbiddenError, PaperlessInactiveOrDeletedError, PaperlessInvalidTokenError, ) from pypaperless.models import Statistic import pytest f...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/paperless_ngx/test_sensor.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:tests/components/probe_plus/test_config_flow.py
"""Test the config flow for the Probe Plus.""" from collections.abc import Generator from unittest.mock import AsyncMock, patch import pytest from homeassistant.components.probe_plus.const import DOMAIN from homeassistant.config_entries import SOURCE_BLUETOOTH, SOURCE_IGNORE, SOURCE_USER from homeassistant.const imp...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/probe_plus/test_config_flow.py", "license": "Apache License 2.0", "lines": 135, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pterodactyl/const.py
"""Constants for Pterodactyl tests.""" from homeassistant.const import CONF_API_KEY, CONF_URL TEST_URL = "https://192.168.0.1:8080/" TEST_API_KEY = "TestClientApiKey" TEST_USER_INPUT = { CONF_URL: TEST_URL, CONF_API_KEY: TEST_API_KEY, }
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pterodactyl/const.py", "license": "Apache License 2.0", "lines": 8, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/pterodactyl/test_binary_sensor.py
"""Tests for the binary sensor platform of the Pterodactyl integration.""" from collections.abc import Generator from datetime import timedelta from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from requests.exceptions import ConnectionError from syrupy.assertion...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/pterodactyl/test_binary_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:tests/components/qbus/test_scene.py
"""Test Qbus scene entities.""" from homeassistant.components.scene import DOMAIN as SCENE_DOMAIN, SERVICE_TURN_ON from homeassistant.const import ATTR_ENTITY_ID, STATE_UNKNOWN from homeassistant.core import HomeAssistant from tests.common import async_fire_mqtt_message from tests.typing import MqttMockHAClient _PAY...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/qbus/test_scene.py", "license": "Apache License 2.0", "lines": 33, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/quantum_gateway/test_device_tracker.py
"""Tests for the quantum_gateway device tracker.""" from unittest.mock import AsyncMock import pytest from requests import RequestException from homeassistant.const import STATE_HOME from homeassistant.core import HomeAssistant from . import setup_platform from tests.components.device_tracker.test_init import mock...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/quantum_gateway/test_device_tracker.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/rehlko/test_binary_sensor.py
"""Tests for the Rehlko binary sensors.""" from __future__ import annotations import logging from typing import Any from unittest.mock import AsyncMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.rehlko.const impor...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/rehlko/test_binary_sensor.py", "license": "Apache License 2.0", "lines": 77, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/shelly/test_devices.py
"""Test real devices.""" from unittest.mock import Mock from aioshelly.const import MODEL_2PM_G3, MODEL_BLU_GATEWAY_G3, MODEL_PRO_EM3 from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.shelly.const import ( DOMAIN, MODEL_...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/shelly/test_devices.py", "license": "Apache License 2.0", "lines": 466, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/smarla/const.py
"""Constants for the Smarla integration tests.""" import base64 import json from homeassistant.const import CONF_ACCESS_TOKEN def _make_mock_user_input(token_json): access_token = base64.b64encode(json.dumps(token_json).encode()).decode() return {CONF_ACCESS_TOKEN: access_token} MOCK_ACCESS_TOKEN_JSON = {...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/smarla/const.py", "license": "Apache License 2.0", "lines": 23, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/smarla/test_config_flow.py
"""Test config flow for Swing2Sleep Smarla integration.""" from unittest.mock import MagicMock, patch from pysmarlaapi.connection.exceptions import ( AuthenticationException, ConnectionException, ) import pytest from homeassistant.components.smarla.const import DOMAIN from homeassistant.config_entries import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/smarla/test_config_flow.py", "license": "Apache License 2.0", "lines": 136, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/smarla/test_init.py
"""Test switch platform for Swing2Sleep Smarla integration.""" from collections.abc import Awaitable, Callable from unittest.mock import MagicMock from pysmarlaapi.connection.exceptions import ( AuthenticationException, ConnectionException, ) import pytest from homeassistant.config_entries import ConfigEntry...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/smarla/test_init.py", "license": "Apache License 2.0", "lines": 54, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/smarla/test_switch.py
"""Test switch platform for Swing2Sleep Smarla integration.""" from unittest.mock import MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SE...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/smarla/test_switch.py", "license": "Apache License 2.0", "lines": 96, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/smartthings/test_water_heater.py
"""Test for the SmartThings water heater platform.""" from unittest.mock import AsyncMock, call from pysmartthings import Attribute, Capability, Command from pysmartthings.models import HealthStatus import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.smartthings import MAIN fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/smartthings/test_water_heater.py", "license": "Apache License 2.0", "lines": 471, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/squeezebox/test_switch.py
"""Tests for the Squeezebox alarm switch platform.""" from datetime import timedelta from unittest.mock import MagicMock, patch from freezegun.api import FrozenDateTimeFactory import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.squeezebox.const import PLAYER_UPDATE_INTERVAL fro...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/squeezebox/test_switch.py", "license": "Apache License 2.0", "lines": 143, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/squeezebox/test_update.py
"""Test squeezebox update platform.""" import copy from datetime import timedelta from unittest.mock import patch import pytest from homeassistant.components.squeezebox.const import ( SENSOR_UPDATE_INTERVAL, STATUS_UPDATE_NEWPLUGINS, ) from homeassistant.components.update import ( ATTR_IN_PROGRESS, D...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/squeezebox/test_update.py", "license": "Apache License 2.0", "lines": 200, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/sun/test_condition.py
"""The tests for sun conditions.""" from datetime import datetime from freezegun import freeze_time import pytest from homeassistant.components import automation from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.helpers im...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/sun/test_condition.py", "license": "Apache License 2.0", "lines": 1134, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/switchbot/test_init.py
"""Test the switchbot init.""" from collections.abc import Callable from unittest.mock import AsyncMock, patch import pytest from homeassistant.components.switchbot.const import ( CONF_CURTAIN_SPEED, CONF_RETRY_COUNT, DEFAULT_CURTAIN_SPEED, DEFAULT_RETRY_COUNT, DOMAIN, ) from homeassistant.const ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/switchbot/test_init.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:tests/components/switchbot/test_vacuum.py
"""Tests for switchbot vacuum.""" from collections.abc import Callable from unittest.mock import AsyncMock, MagicMock, patch import pytest from homeassistant.components.bluetooth import BluetoothServiceInfoBleak from homeassistant.components.vacuum import ( DOMAIN as VACUUM_DOMAIN, SERVICE_RETURN_TO_BASE, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/switchbot/test_vacuum.py", "license": "Apache License 2.0", "lines": 67, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/wallbox/test_select.py
"""Test Wallbox Select component.""" from unittest.mock import patch import pytest from homeassistant.components.select import ( ATTR_OPTION, DOMAIN as SELECT_DOMAIN, SERVICE_SELECT_OPTION, ) from homeassistant.components.wallbox.const import EcoSmartMode from homeassistant.const import ATTR_ENTITY_ID fr...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/wallbox/test_select.py", "license": "Apache License 2.0", "lines": 130, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/wmspro/test_button.py
"""Test the wmspro button support.""" from unittest.mock import AsyncMock, patch from syrupy.assertion import SnapshotAssertion from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS from homeassistant.const import ATTR_ENTITY_ID from homeassistant.core import HomeAssistant from . import...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/wmspro/test_button.py", "license": "Apache License 2.0", "lines": 52, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/helpers/test_helper_integration.py
"""Tests for the helper entity helpers.""" from collections.abc import Generator from unittest.mock import AsyncMock, Mock import pytest from homeassistant.config_entries import ConfigEntry from homeassistant.core import Event, HomeAssistant, callback from homeassistant.helpers import device_registry as dr, entity_r...
{ "repo_id": "home-assistant/core", "file_path": "tests/helpers/test_helper_integration.py", "license": "Apache License 2.0", "lines": 488, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:homeassistant/components/adax/coordinator.py
"""DataUpdateCoordinator for the Adax component.""" import logging from typing import Any, cast from adax import Adax from adax_local import Adax as AdaxLocal from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_IP_ADDRESS, CONF_PASSWORD, CONF_TOKEN from homeassistant.core import...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/adax/coordinator.py", "license": "Apache License 2.0", "lines": 72, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/aws_s3/backup.py
"""Backup platform for the AWS S3 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 ( AgentBackup, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/backup.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:homeassistant/components/aws_s3/config_flow.py
"""Config flow for the AWS S3 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, ParamValidationError import voluptuous as vol from homeassistant.config_e...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/config_flow.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/aws_s3/const.py
"""Constants for the AWS S3 integration.""" from collections.abc import Callable from typing import Final from homeassistant.util.hass_dict import HassKey DOMAIN: Final = "aws_s3" CONF_ACCESS_KEY_ID = "access_key_id" CONF_SECRET_ACCESS_KEY = "secret_access_key" CONF_ENDPOINT_URL = "endpoint_url" CONF_BUCKET = "buck...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/aws_s3/const.py", "license": "Apache License 2.0", "lines": 17, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/eheimdigital/switch.py
"""EHEIM Digital switches.""" from typing import Any, override from eheimdigital.classic_vario import EheimDigitalClassicVario from eheimdigital.device import EheimDigitalDevice from eheimdigital.filter import EheimDigitalFilter from homeassistant.components.switch import SwitchEntity from homeassistant.core import ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/eheimdigital/switch.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/eheimdigital/time.py
"""EHEIM Digital time entities.""" from collections.abc import Awaitable, Callable from dataclasses import dataclass from datetime import time from typing import Any, final, override from eheimdigital.classic_vario import EheimDigitalClassicVario from eheimdigital.device import EheimDigitalDevice from eheimdigital.fi...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/eheimdigital/time.py", "license": "Apache License 2.0", "lines": 133, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/miele/fan.py
"""Platform for Miele fan entity.""" from __future__ import annotations from dataclasses import dataclass import logging import math from typing import Any, Final from aiohttp import ClientResponseError from homeassistant.components.fan import ( FanEntity, FanEntityDescription, FanEntityFeature, ) from ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/miele/fan.py", "license": "Apache License 2.0", "lines": 167, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/rehlko/config_flow.py
"""Config flow for Rehlko integration.""" from __future__ import annotations from collections.abc import Mapping import logging from typing import Any from aiokem import AioKem, AuthenticationError import voluptuous as vol from homeassistant.config_entries import ConfigFlow, ConfigFlowResult from homeassistant.cons...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/rehlko/config_flow.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/rehlko/const.py
"""Constants for the Rehlko integration.""" from aiokem import CommunicationError DOMAIN = "rehlko" CONF_REFRESH_TOKEN = "refresh_token" DEVICE_DATA_DEVICES = "devices" DEVICE_DATA_PRODUCT = "product" DEVICE_DATA_FIRMWARE_VERSION = "firmwareVersion" DEVICE_DATA_MODEL_NAME = "modelDisplayName" DEVICE_DATA_ID = "id" ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/rehlko/const.py", "license": "Apache License 2.0", "lines": 19, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/rehlko/coordinator.py
"""The Rehlko coordinator.""" from __future__ import annotations from dataclasses import dataclass from datetime import timedelta import logging from typing import Any from aiokem import AioKem, CommunicationError from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/rehlko/coordinator.py", "license": "Apache License 2.0", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/rehlko/entity.py
"""Base class for Rehlko entities.""" from __future__ import annotations from typing import Any 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...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/rehlko/entity.py", "license": "Apache License 2.0", "lines": 74, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/rehlko/sensor.py
"""Support for Rehlko sensors.""" from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass from datetime import datetime from homeassistant.components.sensor import ( SensorDeviceClass, SensorEntity, SensorEntityDescription, SensorStateClass, ) from ho...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/rehlko/sensor.py", "license": "Apache License 2.0", "lines": 249, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/remote_calendar/ics.py
"""Module for parsing ICS content. This module exists to fix known issues where calendar providers return calendars that do not follow rfcc5545. This module will attempt to fix the calendar and return a valid calendar object. """ import logging from ical.calendar import Calendar from ical.calendar_stream import IcsC...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/remote_calendar/ics.py", "license": "Apache License 2.0", "lines": 31, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
documentation
home-assistant/core:homeassistant/components/shelly/repairs.py
"""Repairs flow for Shelly.""" from __future__ import annotations from typing import TYPE_CHECKING from aioshelly.block_device import BlockDevice from aioshelly.const import MODEL_OUT_PLUG_S_G3, MODEL_PLUG_S_G3, RPC_GENERATIONS from aioshelly.exceptions import DeviceConnectionError, RpcCallError from aioshelly.rpc_d...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/shelly/repairs.py", "license": "Apache License 2.0", "lines": 327, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_complex
home-assistant/core:homeassistant/components/ssdp/websocket_api.py
"""The ssdp integration websocket apis.""" from __future__ import annotations from dataclasses import asdict from typing import Any, Final import voluptuous as vol from homeassistant.components import websocket_api from homeassistant.core import HassJob, HomeAssistant, callback from homeassistant.helpers.json impor...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/ssdp/websocket_api.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/stiebel_eltron/config_flow.py
"""Config flow for the STIEBEL ELTRON integration.""" from __future__ import annotations import logging from typing import Any from pymodbus.client import ModbusTcpClient from pystiebeleltron.pystiebeleltron import StiebelEltronAPI import voluptuous as vol from homeassistant.config_entries import ConfigFlow, Config...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/stiebel_eltron/config_flow.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:homeassistant/components/stiebel_eltron/const.py
"""Constants for the STIEBEL ELTRON integration.""" DOMAIN = "stiebel_eltron" CONF_HUB = "hub" DEFAULT_HUB = "modbus_hub" DEFAULT_PORT = 502
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/stiebel_eltron/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/switchbot/fan.py
"""Support for SwitchBot Fans.""" from __future__ import annotations import logging from typing import Any import switchbot from switchbot import AirPurifierMode, FanMode from homeassistant.components.fan import FanEntity, FanEntityFeature from homeassistant.core import HomeAssistant from homeassistant.helpers.enti...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/switchbot/fan.py", "license": "Apache License 2.0", "lines": 150, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
function_simple
home-assistant/core:homeassistant/components/whirlpool/binary_sensor.py
"""Binary sensors for the Whirlpool Appliances integration.""" from collections.abc import Callable from dataclasses import dataclass from datetime import timedelta from whirlpool.appliance import Appliance from homeassistant.components.binary_sensor import ( BinarySensorDeviceClass, BinarySensorEntity, ...
{ "repo_id": "home-assistant/core", "file_path": "homeassistant/components/whirlpool/binary_sensor.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:tests/components/adax/test_climate.py
"""Test Adax climate entity.""" from homeassistant.components.adax.const import SCAN_INTERVAL from homeassistant.components.climate import ATTR_CURRENT_TEMPERATURE, HVACMode from homeassistant.const import ATTR_TEMPERATURE, STATE_UNAVAILABLE, Platform from homeassistant.core import HomeAssistant from . import setup_i...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/adax/test_climate.py", "license": "Apache License 2.0", "lines": 68, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/aws_s3/const.py
"""Consts for AWS S3 tests.""" from homeassistant.components.aws_s3.const import ( CONF_ACCESS_KEY_ID, CONF_BUCKET, CONF_ENDPOINT_URL, CONF_PREFIX, CONF_SECRET_ACCESS_KEY, ) # What gets persisted in the config entry (empty prefix is not stored) CONFIG_ENTRY_DATA = { CONF_ACCESS_KEY_ID: "TestTe...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/aws_s3/const.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/aws_s3/test_backup.py
"""Test the AWS S3 backup platform.""" from collections.abc import AsyncGenerator from io import StringIO import json from time import time from unittest.mock import ANY, AsyncMock, Mock, patch from botocore.exceptions import ConnectTimeoutError import pytest from homeassistant.components.aws_s3.backup import ( ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/aws_s3/test_backup.py", "license": "Apache License 2.0", "lines": 654, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/aws_s3/test_config_flow.py
"""Test the AWS S3 config flow.""" from unittest.mock import AsyncMock, patch from botocore.exceptions import ( ClientError, EndpointConnectionError, ParamValidationError, ) import pytest from homeassistant import config_entries from homeassistant.components.aws_s3.const import ( CONF_BUCKET, CON...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/aws_s3/test_config_flow.py", "license": "Apache License 2.0", "lines": 204, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/aws_s3/test_init.py
"""Test the AWS S3 storage integration.""" from unittest.mock import AsyncMock, patch from botocore.exceptions import ( ClientError, EndpointConnectionError, ParamValidationError, ) import pytest from homeassistant.config_entries import ConfigEntryState from homeassistant.core import HomeAssistant from ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/aws_s3/test_init.py", "license": "Apache License 2.0", "lines": 61, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test
home-assistant/core:tests/components/eheimdigital/test_switch.py
"""Tests for the switch module.""" from unittest.mock import AsyncMock, MagicMock, patch import pytest from syrupy.assertion import SnapshotAssertion from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, ...
{ "repo_id": "home-assistant/core", "file_path": "tests/components/eheimdigital/test_switch.py", "license": "Apache License 2.0", "lines": 138, "canary_id": -1, "canary_value": "", "pii_type": "", "provider": "", "regex_pattern": "", "repetition": -1, "template": "" }
test