repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/unit_system.py | homeassistant/util/unit_system.py | """Unit system helper class and methods."""
from __future__ import annotations
from dataclasses import dataclass
from numbers import Number
from typing import TYPE_CHECKING, Final
import voluptuous as vol
from homeassistant.const import (
ACCUMULATED_PRECIPITATION,
AREA,
LENGTH,
MASS,
PRESSURE,
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/loop.py | homeassistant/util/loop.py | """asyncio loop utilities."""
from __future__ import annotations
from collections.abc import Callable
import functools
from functools import cache
import linecache
import logging
import threading
import traceback
from typing import Any
from homeassistant.core import async_get_hass_or_none
from homeassistant.helpers.... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/event_type.py | homeassistant/util/event_type.py | """Implementation for EventType.
Custom for type checking. See stub file.
"""
from __future__ import annotations
from collections.abc import Mapping
from typing import Any
class EventType[_DataT: Mapping[str, Any] = Mapping[str, Any]](str):
"""Custom type for Event.event_type.
At runtime this is a generic... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/yaml/objects.py | homeassistant/util/yaml/objects.py | """Custom yaml object types."""
from __future__ import annotations
from annotatedyaml import Input, NodeDictClass, NodeListClass, NodeStrClass
__all__ = ["Input", "NodeDictClass", "NodeListClass", "NodeStrClass"]
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/yaml/loader.py | homeassistant/util/yaml/loader.py | """Custom loader."""
from __future__ import annotations
from io import StringIO
import os
from typing import TextIO
import annotatedyaml
from annotatedyaml.loader import (
HAS_C_LOADER,
JSON_TYPE,
LoaderType,
Secrets,
add_constructor,
load_yaml as load_annotated_yaml,
load_yaml_dict as lo... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/yaml/dumper.py | homeassistant/util/yaml/dumper.py | """Custom dumper and representers."""
from annotatedyaml.dumper import add_representer, dump, represent_odict, save_yaml
__all__ = ["add_representer", "dump", "represent_odict", "save_yaml"]
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/yaml/input.py | homeassistant/util/yaml/input.py | """Deal with YAML input."""
from __future__ import annotations
from annotatedyaml.input import UndefinedSubstitution, extract_inputs, substitute
from .objects import Input
__all__ = ["Input", "UndefinedSubstitution", "extract_inputs", "substitute"]
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/util/yaml/__init__.py | homeassistant/util/yaml/__init__.py | """YAML utility functions."""
from annotatedyaml import SECRET_YAML, Input, YamlTypeError
from annotatedyaml.input import UndefinedSubstitution, extract_inputs, substitute
from .dumper import dump, save_yaml
from .loader import Secrets, load_yaml, load_yaml_dict, parse_yaml, secret_yaml
__all__ = [
"SECRET_YAML"... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/auth_store.py | homeassistant/auth/auth_store.py | """Storage for auth models."""
from __future__ import annotations
from datetime import timedelta
import hmac
import itertools
from logging import getLogger
from typing import Any
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers import device_registry as dr, entity_registry as er
from... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/models.py | homeassistant/auth/models.py | """Auth models."""
from __future__ import annotations
from datetime import datetime, timedelta
from ipaddress import IPv4Address, IPv6Address
import secrets
from typing import Any, NamedTuple
import uuid
import attr
from attr import Attribute
from attr.setters import validate
from propcache.api import cached_propert... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/const.py | homeassistant/auth/const.py | """Constants for the auth module."""
from datetime import timedelta
ACCESS_TOKEN_EXPIRATION = timedelta(minutes=30)
MFA_SESSION_EXPIRATION = timedelta(minutes=5)
REFRESH_TOKEN_EXPIRATION = timedelta(days=90).total_seconds()
GROUP_ID_ADMIN = "system-admin"
GROUP_ID_USER = "system-users"
GROUP_ID_READ_ONLY = "system-r... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/jwt_wrapper.py | homeassistant/auth/jwt_wrapper.py | """Provide a wrapper around JWT that caches decoding tokens.
Since we decode the same tokens over and over again
we can cache the result of the decode of valid tokens
to speed up the process.
"""
from __future__ import annotations
from datetime import timedelta
from functools import lru_cache, partial
from typing im... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/__init__.py | homeassistant/auth/__init__.py | """Provide an authentication layer for Home Assistant."""
from __future__ import annotations
import asyncio
from collections import OrderedDict
from collections.abc import Mapping
from datetime import datetime, timedelta
from functools import partial
import time
from typing import Any, cast
import jwt
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/entities.py | homeassistant/auth/permissions/entities.py | """Entity permissions."""
from __future__ import annotations
from collections import OrderedDict
from collections.abc import Callable
import voluptuous as vol
from .const import POLICY_CONTROL, POLICY_EDIT, POLICY_READ, SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/util.py | homeassistant/auth/permissions/util.py | """Helpers to deal with permissions."""
from __future__ import annotations
from collections.abc import Callable
from functools import wraps
from typing import cast
from .const import SUBCAT_ALL
from .models import PermissionLookup
from .types import CategoryType, SubCategoryDict, ValueType
type LookupFunc = Callabl... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/models.py | homeassistant/auth/permissions/models.py | """Models for permissions."""
from __future__ import annotations
from typing import TYPE_CHECKING
import attr
if TYPE_CHECKING:
from homeassistant.helpers import device_registry as dr, entity_registry as er
@attr.s(slots=True)
class PermissionLookup:
"""Class to hold data for permission lookups."""
e... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/system_policies.py | homeassistant/auth/permissions/system_policies.py | """System policies."""
from .const import CAT_ENTITIES, POLICY_READ, SUBCAT_ALL
ADMIN_POLICY = {CAT_ENTITIES: True}
USER_POLICY = {CAT_ENTITIES: True}
READ_ONLY_POLICY = {CAT_ENTITIES: {SUBCAT_ALL: {POLICY_READ: True}}}
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/events.py | homeassistant/auth/permissions/events.py | """Permission for events."""
from __future__ import annotations
from typing import Any, Final
from homeassistant.const import (
EVENT_COMPONENT_LOADED,
EVENT_CORE_CONFIG_UPDATE,
EVENT_LABS_UPDATED,
EVENT_LOVELACE_UPDATED,
EVENT_PANELS_UPDATED,
EVENT_RECORDER_5MIN_STATISTICS_GENERATED,
EVE... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/const.py | homeassistant/auth/permissions/const.py | """Permission constants."""
CAT_ENTITIES = "entities"
CAT_CONFIG_ENTRIES = "config_entries"
SUBCAT_ALL = "all"
POLICY_READ = "read"
POLICY_CONTROL = "control"
POLICY_EDIT = "edit"
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/merge.py | homeassistant/auth/permissions/merge.py | """Merging of policies."""
from __future__ import annotations
from typing import cast
from .types import CategoryType, PolicyType
def merge_policies(policies: list[PolicyType]) -> PolicyType:
"""Merge policies."""
new_policy: dict[str, CategoryType] = {}
seen: set[str] = set()
for policy in policie... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/__init__.py | homeassistant/auth/permissions/__init__.py | """Permissions for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable
import voluptuous as vol
from .const import CAT_ENTITIES
from .entities import ENTITY_POLICY_SCHEMA, compile_entities
from .merge import merge_policies
from .models import PermissionLookup
from .types impor... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/permissions/types.py | homeassistant/auth/permissions/types.py | """Common code for permissions."""
from collections.abc import Mapping
# MyPy doesn't support recursion yet. So writing it out as far as we need.
type ValueType = (
# Example: entities.all = { read: true, control: true }
Mapping[str, bool] | bool | None
)
# Example: entities.domains = { light: … }
type SubC... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/providers/trusted_networks.py | homeassistant/auth/providers/trusted_networks.py | """Trusted Networks auth provider.
It shows list of users if access from trusted network.
Abort login flow if not access from trusted network.
"""
from __future__ import annotations
from collections.abc import Mapping
from ipaddress import (
IPv4Address,
IPv4Network,
IPv6Address,
IPv6Network,
ip_... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/providers/homeassistant.py | homeassistant/auth/providers/homeassistant.py | """Home Assistant auth provider."""
from __future__ import annotations
import asyncio
import base64
from collections.abc import Mapping
import logging
from typing import Any, cast
import bcrypt
import voluptuous as vol
from homeassistant.const import CONF_ID
from homeassistant.core import HomeAssistant, callback
fr... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/providers/insecure_example.py | homeassistant/auth/providers/insecure_example.py | """Example auth provider."""
from __future__ import annotations
from collections.abc import Mapping
import hmac
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
from ..models import AuthFlowContext, AuthFlowResult, Credentials, UserMeta
from .... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/providers/command_line.py | homeassistant/auth/providers/command_line.py | """Auth provider that validates credentials via an external command."""
from __future__ import annotations
import asyncio
from collections.abc import Mapping
import logging
import os
from typing import Any
import voluptuous as vol
from homeassistant.const import CONF_COMMAND
from homeassistant.exceptions import Hom... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/providers/__init__.py | homeassistant/auth/providers/__init__.py | """Auth providers for Home Assistant."""
from __future__ import annotations
from collections.abc import Mapping
import logging
import types
from typing import Any
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import requirements
from homeassistant.const import CONF_ID, C... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/mfa_modules/insecure_example.py | homeassistant/auth/mfa_modules/insecure_example.py | """Example auth module."""
from __future__ import annotations
from typing import Any
import voluptuous as vol
from homeassistant.core import HomeAssistant
from . import (
MULTI_FACTOR_AUTH_MODULE_SCHEMA,
MULTI_FACTOR_AUTH_MODULES,
MultiFactorAuthModule,
SetupFlow,
)
CONFIG_SCHEMA = MULTI_FACTOR_AU... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/mfa_modules/totp.py | homeassistant/auth/mfa_modules/totp.py | """Time-based One Time Password auth module."""
from __future__ import annotations
import asyncio
from io import BytesIO
from typing import Any, cast
import voluptuous as vol
from homeassistant.auth.models import User
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import FlowResult
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/mfa_modules/__init__.py | homeassistant/auth/mfa_modules/__init__.py | """Pluggable auth modules for Home Assistant."""
from __future__ import annotations
import logging
import types
from typing import Any
import voluptuous as vol
from voluptuous.humanize import humanize_error
from homeassistant import data_entry_flow, requirements
from homeassistant.const import CONF_ID, CONF_NAME, C... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/auth/mfa_modules/notify.py | homeassistant/auth/mfa_modules/notify.py | """HMAC-based One-time Password auth module.
Sending HOTP through notify service
"""
from __future__ import annotations
import asyncio
import logging
from typing import Any, cast
import attr
import voluptuous as vol
from homeassistant.const import CONF_EXCLUDE, CONF_INCLUDE
from homeassistant.core import HomeAssis... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/restore_state.py | homeassistant/helpers/restore_state.py | """Support for restoring entity states on startup."""
from __future__ import annotations
from abc import ABC, abstractmethod
from datetime import datetime, timedelta
import logging
from typing import Any, Self, cast
from homeassistant.const import ATTR_RESTORED, EVENT_HOMEASSISTANT_STOP
from homeassistant.core impor... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/typing.py | homeassistant/helpers/typing.py | """Typing Helpers for Home Assistant."""
from collections.abc import Mapping
from enum import Enum
from typing import Any, Never
import voluptuous as vol
type GPSType = tuple[float, float]
type ConfigType = dict[str, Any]
type DiscoveryInfoType = dict[str, Any]
type ServiceDataType = dict[str, Any]
type StateType = ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/trigger_template_entity.py | homeassistant/helpers/trigger_template_entity.py | """TemplateEntity utility class."""
from __future__ import annotations
import itertools
import logging
from typing import Any
import jinja2
import voluptuous as vol
from homeassistant.components.sensor import (
CONF_STATE_CLASS,
DEVICE_CLASSES_SCHEMA,
STATE_CLASSES_SCHEMA,
SensorDeviceClass,
Sen... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/script_variables.py | homeassistant/helpers/script_variables.py | """Script variables."""
from __future__ import annotations
from collections import ChainMap, UserDict
from collections.abc import Mapping
from dataclasses import dataclass, field
from typing import Any, cast
from homeassistant.core import HomeAssistant, callback
from . import template
class ScriptVariables:
"... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/httpx_client.py | homeassistant/helpers/httpx_client.py | """Helper for httpx."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
import sys
from types import TracebackType
from typing import Any, Self
# httpx dynamically imports httpcore, so we need to import it
# to avoid it being imported later when the event loop is running
import htt... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/issue_registry.py | homeassistant/helpers/issue_registry.py | """Persistently store issues raised by integrations."""
from __future__ import annotations
import dataclasses
from datetime import datetime
from enum import StrEnum
import functools as ft
from typing import Any, Literal, TypedDict, cast
from awesomeversion import AwesomeVersion, AwesomeVersionStrategy
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/icon.py | homeassistant/helpers/icon.py | """Icon helper methods."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
from functools import lru_cache
import logging
import pathlib
from typing import Any, cast
from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import Integration, async_get_i... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/event.py | homeassistant/helpers/event.py | """Helpers for listening to events."""
from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import Callable, Coroutine, Iterable, Mapping, Sequence
import copy
from dataclasses import dataclass
from datetime import datetime, timedelta
from functools import partial... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/config_validation.py | homeassistant/helpers/config_validation.py | """Helpers for config validation using voluptuous."""
from __future__ import annotations
from collections.abc import Callable, Hashable, Mapping
import contextlib
from contextvars import ContextVar
from datetime import (
date as date_sys,
datetime as datetime_sys,
time as time_sys,
timedelta,
)
from e... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/check_config.py | homeassistant/helpers/check_config.py | """Helper to check the configuration file."""
from __future__ import annotations
from collections import OrderedDict
import logging
import os
from pathlib import Path
from typing import NamedTuple, Self
from annotatedyaml import loader as yaml_loader
import voluptuous as vol
from homeassistant import loader
from ho... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/entity_registry.py | homeassistant/helpers/entity_registry.py | """Provide a registry to track entity IDs.
The Entity Registry keeps a registry of entities. Entities are uniquely
identified by their domain, platform and a unique id provided by that platform.
The Entity Registry will persist itself 10 seconds after a new entity is
registered. Registering a new entity while a timer... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/automation.py | homeassistant/helpers/automation.py | """Helpers for automation."""
from typing import Any
import voluptuous as vol
from homeassistant.const import CONF_OPTIONS
from .typing import ConfigType
def get_absolute_description_key(domain: str, key: str) -> str:
"""Return the absolute description key."""
if not key.startswith("_"):
return f"... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/http.py | homeassistant/helpers/http.py | """Helper to track the current http request."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
from contextvars import ContextVar
from http import HTTPStatus
import inspect
import logging
from typing import Any, Final
from aiohttp import web
from aiohttp.typedefs import LooseHeade... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/category_registry.py | homeassistant/helpers/category_registry.py | """Provide a way to categorize things within a defined scope."""
from __future__ import annotations
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass, field
from datetime import datetime
from typing import Any, Literal, TypedDict
from homeassistant.core import Event, HomeAssis... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/config_entry_flow.py | homeassistant/helpers/config_entry_flow.py | """Helpers for data entry flows for config entries."""
from __future__ import annotations
from collections.abc import Awaitable, Callable
import logging
from typing import TYPE_CHECKING, Any, cast
from homeassistant import config_entries
from homeassistant.components import onboarding
from homeassistant.core import ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/registry.py | homeassistant/helpers/registry.py | """Provide a base implementation for registries."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections import UserDict, defaultdict
from collections.abc import Mapping, Sequence, ValuesView
from typing import TYPE_CHECKING, Any, Literal
from homeassistant.core import CoreState, H... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/reload.py | homeassistant/helpers/reload.py | """Class to reload platforms."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable
import logging
from typing import Any, Literal, overload
from homeassistant import config as conf_util
from homeassistant.const import SERVICE_RELOAD
from homeassistant.core import HomeAssistant, S... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/system_info.py | homeassistant/helpers/system_info.py | """Helper to gather system info."""
from __future__ import annotations
from functools import cache
from getpass import getuser
import logging
import platform
from typing import TYPE_CHECKING, Any
from homeassistant.const import __version__ as current_version
from homeassistant.core import HomeAssistant
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/singleton.py | homeassistant/helpers/singleton.py | """Helper to help coordinating calls."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine
import functools
import inspect
from typing import Any, Literal, assert_type, cast, overload
from homeassistant.core import HomeAssistant
from homeassistant.loader import bind_ha... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/entity_values.py | homeassistant/helpers/entity_values.py | """A class to hold entity values."""
from __future__ import annotations
import fnmatch
from functools import lru_cache
import re
from typing import Any
from homeassistant.const import MAX_EXPECTED_ENTITY_IDS
from homeassistant.core import split_entity_id
class EntityValues:
"""Class to store entity id based va... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/redact.py | homeassistant/helpers/redact.py | """Helpers to redact sensitive data."""
from __future__ import annotations
from collections.abc import Callable, Iterable, Mapping
from typing import Any, cast, overload
from homeassistant.core import callback
REDACTED = "**REDACTED**"
def partial_redact(
x: str | Any, unmasked_prefix: int = 4, unmasked_suffi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/discovery.py | homeassistant/helpers/discovery.py | """Helper methods to help with platform discovery.
There are two different types of discoveries that can be fired/listened for.
- listen/discover is for services. These are targeted at a component.
- listen_platform/discover_platform is for platforms. These are used by
components to allow discovery of their platf... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/state.py | homeassistant/helpers/state.py | """Helpers that help with state related things."""
from __future__ import annotations
import asyncio
from collections import defaultdict
from collections.abc import Iterable
import logging
from types import ModuleType
from typing import Any
from homeassistant.components.lock import LockState
from homeassistant.compo... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/storage.py | homeassistant/helpers/storage.py | """Helper to help store data."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Iterable, Mapping, Sequence
from contextlib import suppress
from copy import deepcopy
import inspect
from json import JSONDecodeError, JSONEncoder
import logging
import os
from pathlib import Path
... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/network.py | homeassistant/helpers/network.py | """Network helpers."""
from __future__ import annotations
from collections.abc import Callable
from contextlib import suppress
from ipaddress import ip_address
from aiohttp import hdrs
from hass_nabucasa import remote
import yarl
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import Home... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/device_registry.py | homeassistant/helpers/device_registry.py | """Provide a way to connect entities belonging to one device."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable, Mapping
from datetime import datetime
from enum import StrEnum
from functools import lru_cache
import logging
import time
from typing import TYP... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/condition.py | homeassistant/helpers/condition.py | """Offer reusable conditions."""
from __future__ import annotations
import abc
from collections import deque
from collections.abc import Callable, Container, Coroutine, Generator, Iterable
from contextlib import contextmanager
from dataclasses import dataclass
from datetime import datetime, time as dt_time, timedelta... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/normalized_name_base_registry.py | homeassistant/helpers/normalized_name_base_registry.py | """Provide a base class for registries that use a normalized name index."""
from dataclasses import dataclass, field
from datetime import datetime
from functools import lru_cache
from homeassistant.util import dt as dt_util, slugify
from .registry import BaseRegistryItems
@dataclass(slots=True, frozen=True, kw_onl... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/update_coordinator.py | homeassistant/helpers/update_coordinator.py | """Helpers to help coordinate updates."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Generator
from datetime import datetime, timedelta
from functools import partial
import logging
from random import randint
from time im... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/llm.py | homeassistant/helpers/llm.py | """Module to coordinate llm tools."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Callable
from dataclasses import dataclass, field as dc_field
from datetime import timedelta
from decimal import Decimal
from enum import Enum
from functools import cache, partial
f... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/entity_component.py | homeassistant/helpers/entity_component.py | """Helpers for components that manage entities."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Iterable, Mapping
from datetime import timedelta
import logging
from types import ModuleType
from typing import Any
from homeassistant import config as conf_util
from homeassista... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/helper_integration.py | 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... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/ratelimit.py | homeassistant/helpers/ratelimit.py | """Ratelimit helper."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Hashable
import logging
import time
from homeassistant.core import HomeAssistant, callback
_LOGGER = logging.getLogger(__name__)
class KeyedRateLimit:
"""Class to track rate limits."""
def __in... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/importlib.py | homeassistant/helpers/importlib.py | """Helper to import modules from asyncio."""
from __future__ import annotations
import asyncio
from contextlib import suppress
import importlib
import logging
import sys
from types import ModuleType
from homeassistant.core import HomeAssistant
from homeassistant.util.hass_dict import HassKey
_LOGGER = logging.getLo... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/significant_change.py | homeassistant/helpers/significant_change.py | """Helpers to help find if an entity has changed significantly.
Does this with help of the integration. Looks at significant_change.py
platform for a function `async_check_significant_change`:
```python
from typing import Optional
from homeassistant.core import HomeAssistant
async def async_check_significant_change(... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/service.py | homeassistant/helpers/service.py | """Service calling related helpers."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Coroutine, Iterable, Mapping
import dataclasses
from enum import Enum
from functools import cache, partial
import inspect
import logging
from types import ModuleType
from typing import TYPE_C... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/trace.py | homeassistant/helpers/trace.py | """Helpers for script and condition tracing."""
from __future__ import annotations
from collections import deque
from collections.abc import Callable, Coroutine, Generator
from contextlib import contextmanager
from contextvars import ContextVar
from functools import wraps
from typing import Any
from homeassistant.co... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/hassio.py | homeassistant/helpers/hassio.py | """Hass.io helper."""
import os
from homeassistant.core import HomeAssistant, callback
@callback
def is_hassio(hass: HomeAssistant) -> bool:
"""Return true if Hass.io is loaded.
Async friendly.
"""
return "hassio" in hass.config.components
@callback
def get_supervisor_ip() -> str | None:
"""R... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/deprecation.py | homeassistant/helpers/deprecation.py | """Deprecation helpers for Home Assistant."""
from __future__ import annotations
from collections.abc import Callable
from contextlib import suppress
from enum import EnumType, IntEnum, IntFlag, StrEnum, _EnumDict
import functools
import inspect
import logging
from typing import Any, NamedTuple
def deprecated_subst... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/signal.py | homeassistant/helpers/signal.py | """Signal handling related helpers."""
import asyncio
import logging
import signal
from homeassistant.const import RESTART_EXIT_CODE
from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import bind_hass
from homeassistant.util.hass_dict import HassKey
_LOGGER = logging.getLogger(__name__)... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/floor_registry.py | homeassistant/helpers/floor_registry.py | """Provide a way to assign areas to floors in one's home."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass
from datetime import datetime
import math
from typing import Any, Literal, TypedDict
from homea... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/start.py | homeassistant/helpers/start.py | """Helpers to help during startup."""
from __future__ import annotations
from collections.abc import Callable, Coroutine
from typing import Any
from homeassistant.const import EVENT_HOMEASSISTANT_START, EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import (
CALLBACK_TYPE,
CoreState,
Event,
Hass... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/schema_config_entry_flow.py | homeassistant/helpers/schema_config_entry_flow.py | """Helpers for creating schema based data entry flows."""
from __future__ import annotations
from abc import ABC, abstractmethod
from collections.abc import Callable, Container, Coroutine, Mapping
import copy
from dataclasses import dataclass
import types
from typing import Any, cast
import voluptuous as vol
from h... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/temperature.py | homeassistant/helpers/temperature.py | """Temperature helpers for Home Assistant."""
from __future__ import annotations
from numbers import Number
from homeassistant.const import PRECISION_HALVES, PRECISION_TENTHS
from homeassistant.core import HomeAssistant
from homeassistant.util.unit_conversion import TemperatureConverter
def display_temp(
hass:... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/recorder.py | homeassistant/helpers/recorder.py | """Helpers to check recorder."""
from __future__ import annotations
import asyncio
from collections.abc import Callable, Generator
from contextlib import contextmanager
from dataclasses import dataclass, field
import functools
import logging
from typing import TYPE_CHECKING, Any
from homeassistant.core import HomeAs... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/location.py | homeassistant/helpers/location.py | """Location helpers for Home Assistant."""
from __future__ import annotations
from collections.abc import Iterable
import logging
from homeassistant.const import ATTR_LATITUDE, ATTR_LONGITUDE
from homeassistant.core import HomeAssistant, State
from homeassistant.util import location as location_util
_LOGGER = loggi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/sun.py | homeassistant/helpers/sun.py | """Helpers for sun events."""
from __future__ import annotations
from collections.abc import Callable
import datetime
from typing import TYPE_CHECKING, Any, cast
from homeassistant.const import SUN_EVENT_SUNRISE, SUN_EVENT_SUNSET
from homeassistant.core import HomeAssistant, callback
from homeassistant.loader import... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/area_registry.py | homeassistant/helpers/area_registry.py | """Provide a way to connect devices to one physical location."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass, field
from datetime import datetime
from typing import TYPE_CHECKING, Any, Literal, TypedDi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/debounce.py | homeassistant/helpers/debounce.py | """Debounce helper."""
from __future__ import annotations
import asyncio
from collections.abc import AsyncGenerator, Callable
from contextlib import asynccontextmanager
from logging import Logger
from typing import Any
from homeassistant.core import HassJob, HomeAssistant, callback
class Debouncer[_R_co]:
"""C... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/intent.py | homeassistant/helpers/intent.py | """Module to coordinate user intentions."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Callable, Collection, Coroutine, Iterable
import dataclasses
from dataclasses import dataclass, field
from enum import Enum, StrEnum, auto
from itertools import grou... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/chat_session.py | homeassistant/helpers/chat_session.py | """Helper to organize chat sessions between integrations."""
from __future__ import annotations
from collections.abc import Generator
from contextlib import contextmanager
from contextvars import ContextVar
from dataclasses import dataclass, field
from datetime import datetime, timedelta
import logging
from homeassi... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/translation.py | homeassistant/helpers/translation.py | """Translation string lookup helpers."""
from __future__ import annotations
import asyncio
from collections.abc import Iterable, Mapping
from contextlib import suppress
from dataclasses import dataclass
import logging
import pathlib
import string
from typing import Any
from homeassistant.const import (
EVENT_COR... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/discovery_flow.py | homeassistant/helpers/discovery_flow.py | """The discovery flow helper."""
from __future__ import annotations
from collections.abc import Coroutine
import dataclasses
from typing import TYPE_CHECKING, Any, NamedTuple, Self
from homeassistant.const import EVENT_HOMEASSISTANT_STARTED
from homeassistant.core import CoreState, Event, HomeAssistant, callback
fro... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/aiohttp_client.py | homeassistant/helpers/aiohttp_client.py | """Helper for aiohttp webclient stuff."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable
from contextlib import suppress
import socket
from ssl import SSLContext
import sys
from types import MappingProxyType
from typing import TYPE_CHECKING, Any, Self
import aiohttp... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/sensor.py | homeassistant/helpers/sensor.py | """Common functions related to sensor device management."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant import const
from .device_registry import DeviceInfo
if TYPE_CHECKING:
# `sensor_state_data` is a second-party library (i.e. maintained by Home Assistant
# core... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/group.py | homeassistant/helpers/group.py | """Helper for groups."""
from __future__ import annotations
from collections.abc import Iterable
from typing import Any
from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL, ENTITY_MATCH_NONE
from homeassistant.core import HomeAssistant
ENTITY_PREFIX = "group."
def expand_entity_ids(hass: HomeAssistan... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/data_entry_flow.py | homeassistant/helpers/data_entry_flow.py | """Helpers for the data entry flow."""
from __future__ import annotations
from http import HTTPStatus
from typing import Any, Generic, TypeVar
from aiohttp import web
import voluptuous as vol
import voluptuous_serialize
from homeassistant import data_entry_flow
from homeassistant.components.http import HomeAssistan... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/__init__.py | homeassistant/helpers/__init__.py | """Helper methods for components within Home Assistant."""
| python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/instance_id.py | homeassistant/helpers/instance_id.py | """Helper to create a unique instance ID."""
from __future__ import annotations
import logging
import uuid
from homeassistant.core import HomeAssistant
from . import singleton, storage
DATA_KEY = "core.uuid"
DATA_VERSION = 1
LEGACY_UUID_FILE = ".uuid"
_LOGGER = logging.getLogger(__name__)
@singleton.singleton(... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/collection.py | homeassistant/helpers/collection.py | """Helper to deal with YAML + storage."""
from __future__ import annotations
from abc import abstractmethod
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable
from dataclasses import dataclass
from functools import partial
from hashlib import md5
from itertools import groupby
import l... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/entity.py | homeassistant/helpers/entity.py | """An abstract class for entities."""
from __future__ import annotations
from abc import ABCMeta
import asyncio
from collections import deque
from collections.abc import Callable, Coroutine, Iterable, Mapping
import dataclasses
from enum import Enum, auto
import functools as ft
import logging
import math
from operato... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/target.py | homeassistant/helpers/target.py | """Helpers for dealing with entity targets."""
from __future__ import annotations
from collections.abc import Callable
import dataclasses
import logging
from logging import Logger
from typing import Any, TypeGuard
from homeassistant.const import (
ATTR_AREA_ID,
ATTR_DEVICE_ID,
ATTR_ENTITY_ID,
ATTR_FL... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/json.py | homeassistant/helpers/json.py | """Helpers to help with encoding Home Assistant objects in JSON."""
from collections import deque
from collections.abc import Callable
import datetime
from functools import partial
import json
import logging
from pathlib import Path
from typing import TYPE_CHECKING, Any, Final
import orjson
from homeassistant.util.f... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/trigger.py | homeassistant/helpers/trigger.py | """Triggers."""
from __future__ import annotations
import abc
import asyncio
from collections import defaultdict
from collections.abc import Callable, Coroutine, Iterable
from dataclasses import dataclass, field
from enum import StrEnum
import functools
import inspect
import logging
from typing import TYPE_CHECKING, ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/dispatcher.py | homeassistant/helpers/dispatcher.py | """Helpers for Home Assistant dispatcher & internal component/platform."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Callable, Coroutine
from functools import partial
import logging
from typing import Any, overload
from homeassistant.core import (
HassJob,... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/entity_platform.py | homeassistant/helpers/entity_platform.py | """Class to manage the entities for a single platform."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Callable, Coroutine, Iterable, Mapping
from contextvars import ContextVar
from datetime import timedelta
from logging import Logger, getLogger
from typing import TYPE_CHEC... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | true |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/config_entry_oauth2_flow.py | homeassistant/helpers/config_entry_oauth2_flow.py | """Config Flow using OAuth2.
This module exists of the following parts:
- OAuth2 config flow which supports multiple OAuth2 implementations
- OAuth2 implementation that works with local provided client ID/secret
"""
from __future__ import annotations
from abc import ABC, ABCMeta, abstractmethod
import asyncio
fro... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/device.py | homeassistant/helpers/device.py | """Provides useful helpers for handling devices."""
from homeassistant.core import HomeAssistant, callback
from . import device_registry as dr, entity_registry as er
@callback
def async_entity_id_to_device_id(
hass: HomeAssistant,
entity_id_or_uuid: str,
) -> str | None:
"""Resolve the device id to the ... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
home-assistant/core | https://github.com/home-assistant/core/blob/6cae1821fb77e785a8aebb48dfc72ea5081b8975/homeassistant/helpers/label_registry.py | homeassistant/helpers/label_registry.py | """Provide a way to label and group anything."""
from __future__ import annotations
from collections.abc import Iterable
import dataclasses
from dataclasses import dataclass
from datetime import datetime
from typing import Any, Literal, TypedDict
from homeassistant.core import Event, HomeAssistant, callback
from hom... | python | Apache-2.0 | 6cae1821fb77e785a8aebb48dfc72ea5081b8975 | 2026-01-04T14:38:15.504802Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.