1 """Demo image platform."""
3 from __future__
import annotations
5 from pathlib
import Path
18 async_add_entities: AddEntitiesCallback,
19 discovery_info: DiscoveryInfoType |
None =
None,
21 """Set up image entities."""
26 "kitchen_sink_image_001",
37 config_entry: ConfigEntry,
38 async_add_entities: AddEntitiesCallback,
40 """Set up the Everything but the Kitchen Sink config entry."""
45 """Representation of an image entity."""
55 """Initialize the image entity."""
63 """Set the update time."""
67 """Return bytes of image."""
68 image_path = Path(__file__).parent / self.
_image_filename_image_filename
69 return await self.
hasshass.async_add_executor_job(image_path.read_bytes)
bytes|None async_image(self)
def async_added_to_hass(self)
None __init__(self, HomeAssistant hass, str unique_id, str name, str content_type, str image)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
None async_setup_platform(HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)