mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Allow to set icon based on state
This commit is contained in:
parent
9614a8d1ca
commit
71f89dd759
@ -163,7 +163,16 @@ def websocket_get_entities(
|
||||
# remove the entity from the category.
|
||||
vol.Optional("categories"): cv.schema_with_slug_keys(vol.Any(str, None)),
|
||||
vol.Optional("device_class"): vol.Any(str, None),
|
||||
vol.Optional("icon"): vol.Any(str, None),
|
||||
vol.Optional("icon"): vol.Any(
|
||||
vol.Schema(
|
||||
{
|
||||
vol.Required("default"): str,
|
||||
vol.Optional("state"): dict,
|
||||
}
|
||||
),
|
||||
str,
|
||||
None,
|
||||
),
|
||||
vol.Optional("labels"): [str],
|
||||
vol.Optional("name"): vol.Any(str, None),
|
||||
vol.Optional("new_entity_id"): str,
|
||||
|
@ -138,6 +138,13 @@ class _EventEntityRegistryUpdatedData_Update(TypedDict):
|
||||
old_entity_id: NotRequired[str]
|
||||
|
||||
|
||||
class EntityRegistryEntryIcon(TypedDict):
|
||||
"""Icon state definition for entity registry."""
|
||||
|
||||
default: str
|
||||
state: dict[str, str] | None
|
||||
|
||||
|
||||
type EventEntityRegistryUpdatedData = (
|
||||
_EventEntityRegistryUpdatedData_CreateRemove
|
||||
| _EventEntityRegistryUpdatedData_Update
|
||||
@ -1035,7 +1042,7 @@ class EntityRegistry(BaseRegistry):
|
||||
disabled_by: RegistryEntryDisabler | None | UndefinedType = UNDEFINED,
|
||||
entity_category: EntityCategory | None | UndefinedType = UNDEFINED,
|
||||
hidden_by: RegistryEntryHider | None | UndefinedType = UNDEFINED,
|
||||
icon: str | None | UndefinedType = UNDEFINED,
|
||||
icon: str | EntityRegistryEntryIcon | None | UndefinedType = UNDEFINED,
|
||||
has_entity_name: bool | UndefinedType = UNDEFINED,
|
||||
labels: set[str] | UndefinedType = UNDEFINED,
|
||||
name: str | None | UndefinedType = UNDEFINED,
|
||||
@ -1162,7 +1169,7 @@ class EntityRegistry(BaseRegistry):
|
||||
disabled_by: RegistryEntryDisabler | None | UndefinedType = UNDEFINED,
|
||||
entity_category: EntityCategory | None | UndefinedType = UNDEFINED,
|
||||
hidden_by: RegistryEntryHider | None | UndefinedType = UNDEFINED,
|
||||
icon: str | None | UndefinedType = UNDEFINED,
|
||||
icon: EntityRegistryEntryIcon | str | UndefinedType = UNDEFINED,
|
||||
has_entity_name: bool | UndefinedType = UNDEFINED,
|
||||
labels: set[str] | UndefinedType = UNDEFINED,
|
||||
name: str | None | UndefinedType = UNDEFINED,
|
||||
|
Loading…
x
Reference in New Issue
Block a user