Home Assistant Unofficial Reference 2024.12.1
homeassistant.helpers.icon Namespace Reference

Classes

class  _IconsCache
 

Functions

dict[str, Any] _async_get_component_icons (HomeAssistant hass, set[str] components, dict[str, Integration] integrations)
 
dict[str, Any] _load_icons_file (pathlib.Path icons_file)
 
dict[str, dict[str, Any]] _load_icons_files (dict[str, pathlib.Path] icons_files)
 
dict[str, Any] async_get_icons (HomeAssistant hass, str category, Iterable[str]|None integrations=None)
 
dict[str, str|dict[str, str]] convert_shorthand_service_icon (str|dict[str, str|dict[str, str]] value)
 
str icon_for_battery_level (int|None battery_level=None, bool charging=False)
 
str icon_for_signal_level (int|None signal_level=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 

Detailed Description

Icon helper methods.

Function Documentation

◆ _async_get_component_icons()

dict[str, Any] homeassistant.helpers.icon._async_get_component_icons ( HomeAssistant  hass,
set[str]  components,
dict[str, Integration integrations 
)
private
Load icons.

Definition at line 56 of file icon.py.

◆ _load_icons_file()

dict[str, Any] homeassistant.helpers.icon._load_icons_file ( pathlib.Path  icons_file)
private
Load and parse an icons.json file.

Definition at line 33 of file icon.py.

◆ _load_icons_files()

dict[str, dict[str, Any]] homeassistant.helpers.icon._load_icons_files ( dict[str, pathlib.Path]  icons_files)
private
Load and parse icons.json files.

Definition at line 46 of file icon.py.

◆ async_get_icons()

dict[str, Any] homeassistant.helpers.icon.async_get_icons ( HomeAssistant  hass,
str  category,
Iterable[str] | None   integrations = None 
)
Return all icons of integrations.

If integration specified, load it for that one; otherwise default to loaded
integrations.

Definition at line 143 of file icon.py.

◆ convert_shorthand_service_icon()

dict[str, str | dict[str, str]] homeassistant.helpers.icon.convert_shorthand_service_icon ( str | dict[str, str | dict[str, str]]  value)
Convert shorthand service icon to dict.

Definition at line 24 of file icon.py.

◆ icon_for_battery_level()

str homeassistant.helpers.icon.icon_for_battery_level ( int | None   battery_level = None,
bool   charging = False 
)
Return a battery icon valid identifier.

Definition at line 167 of file icon.py.

◆ icon_for_signal_level()

str homeassistant.helpers.icon.icon_for_signal_level ( int | None   signal_level = None)
Return a signal icon valid identifier.

Definition at line 185 of file icon.py.

Variable Documentation

◆ _LOGGER

homeassistant.helpers.icon._LOGGER = logging.getLogger(__name__)
private

Definition at line 21 of file icon.py.