Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions homeassistant/helpers/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import functools as ft
import logging
from timeit import default_timer as timer
from typing import Any, Awaitable, Iterable
from typing import Any, Awaitable, Iterable, Mapping

from homeassistant.config import DATA_CUSTOMIZE
from homeassistant.const import (
Expand Down Expand Up @@ -151,7 +151,7 @@ def state(self) -> StateType:
return STATE_UNKNOWN

@property
def capability_attributes(self) -> dict[str, Any] | None:
def capability_attributes(self) -> Mapping[str, Any] | None:
"""Return the capability attributes.

Attributes that explain the capabilities of an entity.
Expand All @@ -162,7 +162,7 @@ def capability_attributes(self) -> dict[str, Any] | None:
return None

@property
def state_attributes(self) -> dict[str, Any] | None:
def state_attributes(self) -> Mapping[str, Any] | None:
Comment thread
KapJI marked this conversation as resolved.
Outdated
"""Return the state attributes.

Implemented by component base class, should not be extended by integrations.
Expand All @@ -171,7 +171,7 @@ def state_attributes(self) -> dict[str, Any] | None:
return None

@property
def device_state_attributes(self) -> dict[str, Any] | None:
def device_state_attributes(self) -> Mapping[str, Any] | None:
"""Return entity specific state attributes.

This method is deprecated, platform classes should implement
Expand All @@ -180,7 +180,7 @@ def device_state_attributes(self) -> dict[str, Any] | None:
return None

@property
def extra_state_attributes(self) -> dict[str, Any] | None:
def extra_state_attributes(self) -> Mapping[str, Any] | None:
"""Return entity specific state attributes.

Implemented by platform classes. Convention for attribute names
Expand All @@ -189,7 +189,7 @@ def extra_state_attributes(self) -> dict[str, Any] | None:
return None

@property
def device_info(self) -> dict[str, Any] | None:
def device_info(self) -> Mapping[str, Any] | None:
"""Return device specific attributes.

Implemented by platform classes.
Expand Down