Added proper russian locale
This commit is contained in:
46
.gitignore
vendored
Normal file
46
.gitignore
vendored
Normal file
@@ -0,0 +1,46 @@
|
||||
# Python
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
*.so
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
|
||||
# Virtual environments
|
||||
venv/
|
||||
ENV/
|
||||
env/
|
||||
.venv/
|
||||
|
||||
# IDE
|
||||
.idea/
|
||||
.vscode/
|
||||
*.swp
|
||||
*.swo
|
||||
*~
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Testing
|
||||
.pytest_cache/
|
||||
.coverage
|
||||
htmlcov/
|
||||
|
||||
# Claude Code
|
||||
.claude/
|
||||
73
README.md
Normal file
73
README.md
Normal file
@@ -0,0 +1,73 @@
|
||||
# HAOS Integrations
|
||||
|
||||
A collection of custom Home Assistant integrations.
|
||||
|
||||
## Integrations
|
||||
|
||||
### Immich Album Watcher
|
||||
|
||||
<img src="immich_album_watcher/icon.png" alt="Immich" width="64" height="64">
|
||||
|
||||
Monitors [Immich](https://immich.app/) photo/video library albums for changes and exposes them as Home Assistant sensors with event-firing capabilities.
|
||||
|
||||
#### Features
|
||||
|
||||
- **Album Monitoring** - Watch selected Immich albums for asset additions and removals
|
||||
- **Sensor Integration** - Creates Home Assistant sensors showing current asset count per album
|
||||
- **Event Firing** - Fires Home Assistant events when albums change:
|
||||
- `immich_album_watcher_album_changed` - General album changes
|
||||
- `immich_album_watcher_assets_added` - When new assets are added
|
||||
- `immich_album_watcher_assets_removed` - When assets are removed
|
||||
- **Configurable Polling** - Adjustable scan interval (10-3600 seconds)
|
||||
- **Rich Metadata** - Provides detailed album info including:
|
||||
- Album name and ID
|
||||
- Asset count
|
||||
- Owner information
|
||||
- Shared status
|
||||
- Thumbnail URL
|
||||
- Last updated timestamp
|
||||
|
||||
#### Installation
|
||||
|
||||
1. Copy the `immich_album_watcher` folder to your Home Assistant `custom_components` directory
|
||||
2. Restart Home Assistant
|
||||
3. Go to **Settings** → **Devices & Services** → **Add Integration**
|
||||
4. Search for "Immich Album Watcher"
|
||||
5. Enter your Immich server URL and API key
|
||||
6. Select the albums you want to monitor
|
||||
|
||||
#### Configuration
|
||||
|
||||
| Option | Description | Default |
|
||||
|--------|-------------|---------|
|
||||
| Server URL | Your Immich server URL (e.g., `https://immich.example.com`) | Required |
|
||||
| API Key | Your Immich API key | Required |
|
||||
| Albums | Albums to monitor | Required |
|
||||
| Scan Interval | How often to check for changes (seconds) | 60 |
|
||||
|
||||
#### Events
|
||||
|
||||
Use these events in your automations:
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
- alias: "New photos added to album"
|
||||
trigger:
|
||||
- platform: event
|
||||
event_type: immich_album_watcher_assets_added
|
||||
action:
|
||||
- service: notify.mobile_app
|
||||
data:
|
||||
title: "New Photos"
|
||||
message: "{{ trigger.event.data.added_count }} new photos in {{ trigger.event.data.album_name }}"
|
||||
```
|
||||
|
||||
#### Requirements
|
||||
|
||||
- Home Assistant 2024.1.0 or newer
|
||||
- Immich server with API access
|
||||
- Valid Immich API key
|
||||
|
||||
## License
|
||||
|
||||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
||||
BIN
immich_album_watcher/icon.png
Normal file
BIN
immich_album_watcher/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
@@ -51,9 +51,10 @@ class ImmichAlbumSensor(CoordinatorEntity[ImmichAlbumWatcherCoordinator], Sensor
|
||||
"""Sensor representing an Immich album."""
|
||||
|
||||
_attr_state_class = SensorStateClass.MEASUREMENT
|
||||
_attr_native_unit_of_measurement = "assets"
|
||||
_attr_icon = "mdi:image-album"
|
||||
|
||||
_attr_translation_key = "album_asset_count"
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
coordinator: ImmichAlbumWatcherCoordinator,
|
||||
@@ -77,11 +78,11 @@ class ImmichAlbumSensor(CoordinatorEntity[ImmichAlbumWatcherCoordinator], Sensor
|
||||
return self.coordinator.data.get(self._album_id)
|
||||
|
||||
@property
|
||||
def name(self) -> str:
|
||||
"""Return the name of the sensor."""
|
||||
def translation_placeholders(self) -> dict[str, str]:
|
||||
"""Return translation placeholders."""
|
||||
if self._album_data:
|
||||
return self._album_data.name
|
||||
return f"Album {self._album_id[:8]}"
|
||||
return {"album_name": self._album_data.name}
|
||||
return {"album_name": f"Album {self._album_id[:8]}"}
|
||||
|
||||
@property
|
||||
def native_value(self) -> int | None:
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"album_asset_count": {
|
||||
"name": "{album_name}: Asset Count"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"album_asset_count": {
|
||||
"name": "{album_name}: Asset Count"
|
||||
}
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
|
||||
60
immich_album_watcher/translations/ru.json
Normal file
60
immich_album_watcher/translations/ru.json
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"config": {
|
||||
"step": {
|
||||
"user": {
|
||||
"title": "Подключение к Immich",
|
||||
"description": "Введите данные вашего сервера Immich. API-ключ можно получить в Immich → Настройки пользователя → API-ключи.",
|
||||
"data": {
|
||||
"immich_url": "URL Immich",
|
||||
"api_key": "API-ключ"
|
||||
},
|
||||
"data_description": {
|
||||
"immich_url": "URL вашего сервера Immich (например, http://192.168.1.100:2283)",
|
||||
"api_key": "Ваш API-ключ Immich"
|
||||
}
|
||||
},
|
||||
"albums": {
|
||||
"title": "Выбор альбомов",
|
||||
"description": "Выберите альбомы для отслеживания изменений.",
|
||||
"data": {
|
||||
"albums": "Альбомы для отслеживания"
|
||||
}
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Не удалось подключиться к серверу Immich",
|
||||
"invalid_auth": "Неверный API-ключ",
|
||||
"no_albums": "На сервере не найдено альбомов",
|
||||
"no_albums_selected": "Пожалуйста, выберите хотя бы один альбом",
|
||||
"unknown": "Произошла непредвиденная ошибка"
|
||||
},
|
||||
"abort": {
|
||||
"already_configured": "Этот сервер Immich уже настроен"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
"step": {
|
||||
"init": {
|
||||
"title": "Настройки Immich Album Watcher",
|
||||
"description": "Настройте отслеживаемые альбомы и частоту проверки изменений.",
|
||||
"data": {
|
||||
"albums": "Альбомы для отслеживания",
|
||||
"scan_interval": "Интервал сканирования (секунды)"
|
||||
},
|
||||
"data_description": {
|
||||
"scan_interval": "Как часто проверять изменения в альбомах (10-3600 секунд)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
"cannot_connect": "Не удалось подключиться к серверу Immich"
|
||||
}
|
||||
},
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"album_asset_count": {
|
||||
"name": "{album_name}: Число файлов"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user