Skip to content
Merged
Changes from all commits
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
14 changes: 13 additions & 1 deletion homeassistant/components/remote/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from collections.abc import Iterable
from dataclasses import dataclass
from datetime import timedelta
from enum import IntEnum
import functools as ft
import logging
from typing import Any, cast, final
Expand Down Expand Up @@ -61,6 +62,17 @@
DEFAULT_DELAY_SECS = 0.4
DEFAULT_HOLD_SECS = 0


class RemoteEntityFeature(IntEnum):
"""Supported features of the remote entity."""

LEARN_COMMAND = 1
DELETE_COMMAND = 2
ACTIVITY = 4


# These SUPPORT_* constants are deprecated as of Home Assistant 2022.5.
# Please use the RemoteEntityFeature enum instead.
SUPPORT_LEARN_COMMAND = 1
SUPPORT_DELETE_COMMAND = 2
SUPPORT_ACTIVITY = 4
Expand Down Expand Up @@ -175,7 +187,7 @@ def activity_list(self) -> list[str] | None:
@property
def state_attributes(self) -> dict[str, Any] | None:
"""Return optional state attributes."""
if not self.supported_features & SUPPORT_ACTIVITY:
if not self.supported_features & RemoteEntityFeature.ACTIVITY:
return None

return {
Expand Down