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

Namespaces

 const
 

Classes

class  ImageServeView
 
class  ImageStorageCollection
 
class  ImageUploadStorageCollectionWebsocket
 
class  ImageUploadView
 

Functions

None _generate_thumbnail_if_file_does_not_exist (pathlib.Path target_file, pathlib.Path original_path, str content_type, pathlib.Path target_path, tuple[int, int] target_size)
 
tuple[int, int] _validate_size_from_filename (str filename)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
 CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
 
int MAX_SIZE = 1024 * 1024 * 10
 
string STORAGE_KEY = "image"
 
int STORAGE_VERSION = 1
 
dictionary VALID_SIZES = {256, 512}
 
 VolDictType
 

Detailed Description

The Image Upload integration.

Function Documentation

◆ _generate_thumbnail_if_file_does_not_exist()

None homeassistant.components.image_upload._generate_thumbnail_if_file_does_not_exist ( pathlib.Path  target_file,
pathlib.Path  original_path,
str  content_type,
pathlib.Path  target_path,
tuple[int, int]  target_size 
)
private
Generate a size.

Definition at line 242 of file __init__.py.

◆ _validate_size_from_filename()

tuple[int, int] homeassistant.components.image_upload._validate_size_from_filename ( str  filename)
private
Parse image size from the given filename (of the form WIDTHxHEIGHT-filename).

>>> _validate_size_from_filename("100x100-image.png")
(100, 100)
>>> _validate_size_from_filename("jeff.png")
Traceback (most recent call last):
...

Definition at line 256 of file __init__.py.

◆ async_setup()

bool homeassistant.components.image_upload.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the Image integration.

Definition at line 46 of file __init__.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 29 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.image_upload.CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

Definition at line 43 of file __init__.py.

◆ MAX_SIZE

int homeassistant.components.image_upload.MAX_SIZE = 1024 * 1024 * 10

Definition at line 33 of file __init__.py.

◆ STORAGE_KEY

string homeassistant.components.image_upload.STORAGE_KEY = "image"

Definition at line 30 of file __init__.py.

◆ STORAGE_VERSION

int homeassistant.components.image_upload.STORAGE_VERSION = 1

Definition at line 31 of file __init__.py.

◆ VALID_SIZES

dictionary homeassistant.components.image_upload.VALID_SIZES = {256, 512}

Definition at line 32 of file __init__.py.

◆ VolDictType

homeassistant.components.image_upload.VolDictType

Definition at line 35 of file __init__.py.