Add album metadata attributes to Album ID sensor
All checks were successful
Validate / Hassfest (push) Successful in 4s
All checks were successful
Validate / Hassfest (push) Successful in 4s
Add asset_count, last_updated, and created_at attributes to the Album ID sensor for convenient access to album metadata. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,7 @@ If no external domain is configured in Immich, all URLs will use the Server URL
|
||||
|
||||
| Entity Type | Name | Description |
|
||||
|-------------|------|-------------|
|
||||
| Sensor | Album ID | Album identifier with `album_name` and `share_url` attributes |
|
||||
| Sensor | Album ID | Album identifier with `album_name`, `asset_count`, `share_url`, `last_updated`, and `created_at` attributes |
|
||||
| Sensor | Asset Count | Total number of assets (includes `people` list in attributes) |
|
||||
| Sensor | Photo Count | Number of photos in the album |
|
||||
| Sensor | Video Count | Number of videos in the album |
|
||||
|
||||
@@ -24,6 +24,7 @@ from homeassistant.util import slugify
|
||||
|
||||
from .const import (
|
||||
ATTR_ALBUM_ID,
|
||||
ATTR_ALBUM_NAME,
|
||||
ATTR_ALBUM_PROTECTED_URL,
|
||||
ATTR_ALBUM_URLS,
|
||||
ATTR_ASSET_COUNT,
|
||||
@@ -1211,7 +1212,10 @@ class ImmichAlbumIdSensor(ImmichAlbumBaseSensor):
|
||||
return {}
|
||||
|
||||
attrs: dict[str, Any] = {
|
||||
"album_name": self._album_data.name,
|
||||
ATTR_ALBUM_NAME: self._album_data.name,
|
||||
ATTR_ASSET_COUNT: self._album_data.asset_count,
|
||||
ATTR_LAST_UPDATED: self._album_data.updated_at,
|
||||
ATTR_CREATED_AT: self._album_data.created_at,
|
||||
}
|
||||
|
||||
# Primary share URL (prefers public, falls back to protected)
|
||||
|
||||
Reference in New Issue
Block a user