Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.image Namespace Reference

Classes

class  MqttImage
 

Functions

None async_setup_entry (HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
 
ConfigType validate_topic_required (ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string CONF_CONTENT_TYPE = "content_type"
 
string CONF_IMAGE_ENCODING = "image_encoding"
 
string CONF_IMAGE_TOPIC = "image_topic"
 
string CONF_URL_TEMPLATE = "url_template"
 
string CONF_URL_TOPIC = "url_topic"
 
string DEFAULT_NAME = "MQTT Image"
 
 DISCOVERY_SCHEMA
 
int GET_IMAGE_TIMEOUT = 10
 
int PARALLEL_UPDATES = 0
 
 PLATFORM_SCHEMA_BASE
 
 PLATFORM_SCHEMA_MODERN = vol.All(PLATFORM_SCHEMA_BASE.schema, validate_topic_required)
 

Detailed Description

Support for MQTT images.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.mqtt.image.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  config_entry,
AddEntitiesCallback  async_add_entities 
)
Set up MQTT image through YAML and through MQTT discovery.

Definition at line 82 of file image.py.

◆ validate_topic_required()

ConfigType homeassistant.components.mqtt.image.validate_topic_required ( ConfigType  config)
Ensure at least one subscribe topic is configured.

Definition at line 53 of file image.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.mqtt.image._LOGGER = logging.getLogger(__name__)
private

Definition at line 38 of file image.py.

◆ CONF_CONTENT_TYPE

string homeassistant.components.mqtt.image.CONF_CONTENT_TYPE = "content_type"

Definition at line 42 of file image.py.

◆ CONF_IMAGE_ENCODING

string homeassistant.components.mqtt.image.CONF_IMAGE_ENCODING = "image_encoding"

Definition at line 43 of file image.py.

◆ CONF_IMAGE_TOPIC

string homeassistant.components.mqtt.image.CONF_IMAGE_TOPIC = "image_topic"

Definition at line 44 of file image.py.

◆ CONF_URL_TEMPLATE

string homeassistant.components.mqtt.image.CONF_URL_TEMPLATE = "url_template"

Definition at line 45 of file image.py.

◆ CONF_URL_TOPIC

string homeassistant.components.mqtt.image.CONF_URL_TOPIC = "url_topic"

Definition at line 46 of file image.py.

◆ DEFAULT_NAME

string homeassistant.components.mqtt.image.DEFAULT_NAME = "MQTT Image"

Definition at line 48 of file image.py.

◆ DISCOVERY_SCHEMA

homeassistant.components.mqtt.image.DISCOVERY_SCHEMA
Initial value:
1 = vol.All(
2  PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA), validate_topic_required
3 )

Definition at line 77 of file image.py.

◆ GET_IMAGE_TIMEOUT

int homeassistant.components.mqtt.image.GET_IMAGE_TIMEOUT = 10

Definition at line 50 of file image.py.

◆ PARALLEL_UPDATES

int homeassistant.components.mqtt.image.PARALLEL_UPDATES = 0

Definition at line 40 of file image.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.components.mqtt.image.PLATFORM_SCHEMA_BASE
Initial value:
1 = MQTT_BASE_SCHEMA.extend(
2  {
3  vol.Optional(CONF_CONTENT_TYPE): cv.string,
4  vol.Optional(CONF_NAME): vol.Any(cv.string, None),
5  vol.Exclusive(CONF_URL_TOPIC, "image_topic"): valid_subscribe_topic,
6  vol.Exclusive(CONF_IMAGE_TOPIC, "image_topic"): valid_subscribe_topic,
7  vol.Optional(CONF_IMAGE_ENCODING): "b64",
8  vol.Optional(CONF_URL_TEMPLATE): cv.template,
9  }
10 ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema)

Definition at line 64 of file image.py.

◆ PLATFORM_SCHEMA_MODERN

homeassistant.components.mqtt.image.PLATFORM_SCHEMA_MODERN = vol.All(PLATFORM_SCHEMA_BASE.schema, validate_topic_required)

Definition at line 75 of file image.py.