Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.color_extractor Namespace Reference

Namespaces

 config_flow
 
 const
 

Functions

tuple _get_color (file_handler)
 
def _get_file (file_path)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)
 
 SERVICE_SCHEMA
 

Detailed Description

Module for color_extractor (RGB extraction from images) component.

Function Documentation

◆ _get_color()

tuple homeassistant.components.color_extractor._get_color (   file_handler)
private
Given an image file, extract the predominant color from it.

Definition at line 51 of file __init__.py.

◆ _get_file()

def homeassistant.components.color_extractor._get_file (   file_path)
private
Get a PIL acceptable input file reference.

Allows us to mock patch during testing to make BytesIO stream.

Definition at line 43 of file __init__.py.

◆ async_setup()

bool homeassistant.components.color_extractor.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the Color extractor component.

Definition at line 63 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.color_extractor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Load a config entry.

Definition at line 159 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.color_extractor._LOGGER = logging.getLogger(__name__)
private

Definition at line 26 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.color_extractor.CONFIG_SCHEMA = cv.removed(DOMAIN, raise_if_present=False)

Definition at line 28 of file __init__.py.

◆ SERVICE_SCHEMA

homeassistant.components.color_extractor.SERVICE_SCHEMA
Initial value:
1 = vol.All(
2  cv.has_at_least_one_key(ATTR_URL, ATTR_PATH),
3  cv.make_entity_service_schema(
4  {
5  **LIGHT_TURN_ON_SCHEMA,
6  vol.Exclusive(ATTR_PATH, "color_extractor"): cv.isfile,
7  vol.Exclusive(ATTR_URL, "color_extractor"): cv.url,
8  }
9  ),
10 )

Definition at line 31 of file __init__.py.