From bf886c9347fc45a7a650294bd6b5f8f6b69c5232 Mon Sep 17 00:00:00 2001
From: Home Assistant Version Control
Date: Tue, 6 Oct 2026 17:11:43 +0000
Subject: [PATCH] 361 files
---
.ha_run.lock | 2 +-
.storage/lovelace_resources | 4 +-
custom_components/album_slideshow/__init__.py | 10 +
custom_components/album_slideshow/camera.py | 107 +-
.../album_slideshow/config_flow.py | 547 ++-
custom_components/album_slideshow/const.py | 14 +
.../album_slideshow/coordinator.py | 361 +-
.../album_slideshow/google_scraper.py | 150 +-
.../album_slideshow/image_processing.py | 339 +-
custom_components/album_slideshow/immich.py | 207 +
.../album_slideshow/manifest.json | 4 +-
custom_components/album_slideshow/number.py | 64 +-
custom_components/album_slideshow/playlist.py | 46 +-
custom_components/album_slideshow/sensor.py | 6 +-
custom_components/album_slideshow/store.py | 7 +
.../album_slideshow/strings.json | 40 +-
custom_components/album_slideshow/switch.py | 46 +-
.../album_slideshow/translations/en.json | 40 +-
.../www/album-slideshow-card.js | 812 +++-
.../maintenance_supporter/__init__.py | 23 +
.../maintenance_supporter/calendar.py | 9 +
.../config_flow_options_global.py | 5 +
.../config_flow_options_task_trigger.py | 15 +-
.../maintenance_supporter/const.py | 13 +
.../maintenance_supporter/coordinator.py | 21 +
.../entity/triggers/__init__.py | 22 +
.../maintenance_supporter/export.py | 7 +
.../frontend-src/__tests__/_test-utils.ts | 3 +-
.../__tests__/task-detail-renderer.test.ts | 4 +-
.../__tests__/task-detail-view.test.ts | 2 +-
.../frontend-src/components/object-dialog.ts | 60 +
.../frontend-src/components/settings-view.ts | 1 +
.../frontend-src/components/task-dialog.ts | 7 +-
.../components/task-quick-actions-dialog.ts | 2 +-
.../frontend-src/dialog-mount.ts | 11 +
.../frontend-src/locales/cs.json | 9 +
.../frontend-src/locales/da.json | 9 +
.../frontend-src/locales/de.json | 9 +
.../frontend-src/locales/en.json | 9 +
.../frontend-src/locales/es.json | 9 +
.../frontend-src/locales/fi.json | 9 +
.../frontend-src/locales/fr.json | 9 +
.../frontend-src/locales/hi.json | 9 +
.../frontend-src/locales/hu.json | 9 +
.../frontend-src/locales/it.json | 9 +
.../frontend-src/locales/ja.json | 9 +
.../frontend-src/locales/ko.json | 9 +
.../frontend-src/locales/nb.json | 9 +
.../frontend-src/locales/nl.json | 9 +
.../frontend-src/locales/pl.json | 9 +
.../frontend-src/locales/pt-br.json | 9 +
.../frontend-src/locales/pt.json | 9 +
.../frontend-src/locales/ru.json | 9 +
.../frontend-src/locales/sv.json | 9 +
.../frontend-src/locales/tr.json | 9 +
.../frontend-src/locales/uk.json | 9 +
.../frontend-src/locales/zh.json | 9 +
.../frontend-src/maintenance-panel.ts | 67 +-
.../frontend-src/panel-styles.ts | 8 +
.../frontend-src/renderers/progress.ts | 12 +-
.../frontend-src/renderers/sparkline.ts | 13 +-
.../frontend-src/types.ts | 9 +
.../frontend/locales/cs.json | 9 +
.../frontend/locales/da.json | 9 +
.../frontend/locales/de.json | 9 +
.../frontend/locales/en.json | 9 +
.../frontend/locales/es.json | 9 +
.../frontend/locales/fi.json | 9 +
.../frontend/locales/fr.json | 9 +
.../frontend/locales/hi.json | 9 +
.../frontend/locales/hu.json | 9 +
.../frontend/locales/it.json | 9 +
.../frontend/locales/ja.json | 9 +
.../frontend/locales/ko.json | 9 +
.../frontend/locales/nb.json | 9 +
.../frontend/locales/nl.json | 9 +
.../frontend/locales/pl.json | 9 +
.../frontend/locales/pt-br.json | 9 +
.../frontend/locales/pt.json | 9 +
.../frontend/locales/ru.json | 9 +
.../frontend/locales/sv.json | 9 +
.../frontend/locales/tr.json | 9 +
.../frontend/locales/uk.json | 9 +
.../frontend/locales/zh.json | 9 +
.../frontend/maintenance-calendar-card.js | 285 +-
.../frontend/maintenance-card.js | 337 +-
.../frontend/maintenance-panel.js | 527 +--
.../frontend/maintenance-strategy-shim.js | 4 +-
.../adopt-problem-sensors-dialog-YNUL6UYR.js | 301 ++
.../panel-chunks/area-view-XTWD5MTD.js | 279 ++
.../panel-chunks/areas-view-UDLGVZLY.js | 54 +
.../panel-chunks/bulk-edit-dialog-A7JSPXFS.js | 113 +
.../frontend/panel-chunks/chunk-3FGYBPXY.js | 1314 +++++++
.../frontend/panel-chunks/chunk-4APLU3YR.js | 2 +
.../frontend/panel-chunks/chunk-55ND3GKE.js | 2 +
.../frontend/panel-chunks/chunk-5MYBEQC2.js | 2 +
.../frontend/panel-chunks/chunk-6BKNHM6I.js | 488 +++
.../frontend/panel-chunks/chunk-DRT62KZF.js | 2 +
.../frontend/panel-chunks/chunk-EKN6HBJN.js | 2 +
.../frontend/panel-chunks/chunk-GM2CHGSG.js | 2 +
.../frontend/panel-chunks/chunk-GWAP5R2S.js | 2 +
.../frontend/panel-chunks/chunk-HFZZVTW7.js | 2 +
.../frontend/panel-chunks/chunk-JQXHX4U4.js | 2 +
.../frontend/panel-chunks/chunk-MGSZZ3YF.js | 2 +
.../frontend/panel-chunks/chunk-MNPRUCF5.js | 37 +
.../frontend/panel-chunks/chunk-MQRW7LAF.js | 2 +
.../frontend/panel-chunks/chunk-PCR5FRSH.js | 2 +
.../frontend/panel-chunks/chunk-PL7JXZOW.js | 1490 +++++++
.../frontend/panel-chunks/chunk-RHKFQ4Q2.js | 2 +
.../frontend/panel-chunks/chunk-RUYEMIDM.js | 88 +
.../frontend/panel-chunks/chunk-SUOGXDNI.js | 234 ++
.../frontend/panel-chunks/chunk-SYPCMUXO.js | 2 +
.../frontend/panel-chunks/chunk-TX2GMEMJ.js | 79 +
.../frontend/panel-chunks/chunk-WACUKJSI.js | 2 +
.../frontend/panel-chunks/chunk-XTTCEGMX.js | 1013 +++++
.../frontend/panel-chunks/chunk-ZHMFEWT2.js | 256 ++
.../panel-chunks/complete-dialog-HB2GK5Z3.js | 2 +
.../panel-chunks/dialog-mount-ZEP3U4T7.js | 2 +
.../panel-chunks/object-dialog-GZK3VG7E.js | 2 +
.../panel-chunks/qr-dialog-2SMLHEDB.js | 2 +
.../panel-chunks/settings-view-S7OONH2A.js | 1467 +++++++
.../suggested-setups-dialog-F54DZZLX.js | 184 +
.../panel-chunks/task-dialog-4KQRUMA6.js | 2 +
.../chunks/budget-section-card-GGFM4NWQ.js | 127 +
.../strategy/chunks/chunk-47YHJMQQ.js | 66 +
.../strategy/chunks/chunk-GVWULYYT.js | 2 +
.../strategy/chunks/chunk-KWXSFMBP.js | 1314 +++++++
.../strategy/chunks/chunk-P2ZDMNV3.js | 2 +
.../strategy/chunks/chunk-QZSR3CS5.js | 88 +
.../strategy/chunks/chunk-SZ5OZQBM.js | 2 +
.../strategy/chunks/chunk-ZT3EJK22.js | 60 +
.../strategy/chunks/dialog-mount-COO4BKJS.js | 3502 +++++++++++++++++
.../chunks/groups-section-card-E26J7GJC.js | 137 +
.../chunks/vacation-section-card-RQOCUOWP.js | 134 +
.../maintenance-dashboard-strategy.js | 6 +-
.../helpers/entity_rename.py | 8 +-
.../helpers/notification_manager.py | 122 +
.../helpers/problem_sensors.py | 6 +-
.../maintenance_supporter/helpers/sanitize.py | 18 +
.../helpers/settings_registry.py | 2 +
.../helpers/trigger_fallback.py | 69 +-
.../maintenance_supporter/manifest.json | 2 +-
.../models/maintenance_object.py | 10 +
.../maintenance_supporter/strings.json | 6 +-
.../translations/cs.json | 6 +-
.../translations/da.json | 6 +-
.../translations/de.json | 6 +-
.../translations/en.json | 6 +-
.../translations/es.json | 6 +-
.../translations/fi.json | 6 +-
.../translations/fr.json | 6 +-
.../translations/hi.json | 6 +-
.../translations/hu.json | 6 +-
.../translations/it.json | 6 +-
.../translations/ja.json | 6 +-
.../translations/ko.json | 6 +-
.../translations/nb.json | 6 +-
.../translations/nl.json | 6 +-
.../translations/pl.json | 6 +-
.../translations/pt-BR.json | 6 +-
.../translations/pt.json | 6 +-
.../translations/ru.json | 6 +-
.../translations/sv.json | 6 +-
.../translations/tr.json | 6 +-
.../translations/uk.json | 6 +-
.../translations/zh-Hans.json | 6 +-
.../websocket/__init__.py | 22 +-
.../websocket/dashboard.py | 2 +
.../maintenance_supporter/websocket/io.py | 3 +
.../websocket/objects.py | 17 +
.../websocket/tasks_crud.py | 13 +-
custom_components/spook/__init__.py | 33 +-
.../ectoplasms/automation/repairs/__init__.py | 69 +
.../repairs/unknown_area_references.py | 4 +-
.../repairs/unknown_device_references.py | 4 +-
.../repairs/unknown_entity_references.py | 39 +-
.../repairs/unknown_floor_references.py | 4 +-
.../repairs/unknown_label_references.py | 4 +-
.../repairs/unknown_service_references.py | 8 +-
.../group/repairs/unknown_members.py | 13 +-
.../homeassistant/services/restart.py | 9 +-
.../repairs/unknown_entity_references.py | 31 +-
.../ectoplasms/number/services/__init__.py | 29 +-
.../ectoplasms/number/services/decrement.py | 6 +-
.../ectoplasms/number/services/increment.py | 6 +-
.../repairs/unknown_ignored_zones.py | 2 +-
.../repairs/unknown_tracked_entities.py | 2 +-
.../repairs/unknown_entity_references.py | 7 +-
.../ectoplasms/timer/services/set_duration.py | 4 +
custom_components/spook/icons.json | 12 +
.../spook_calibration/manifest.json | 14 +
.../spook_calibration/translations/af.json | 1 +
.../spook_calibration/translations/ar.json | 1 +
.../spook_calibration/translations/be.json | 1 +
.../spook_calibration/translations/bg.json | 1 +
.../spook_calibration/translations/bn.json | 1 +
.../spook_calibration/translations/bs.json | 1 +
.../spook_calibration/translations/ca.json | 1 +
.../spook_calibration/translations/cs.json | 1 +
.../spook_calibration/translations/cy.json | 1 +
.../spook_calibration/translations/da.json | 1 +
.../spook_calibration/translations/de.json | 37 +
.../spook_calibration/translations/el.json | 1 +
.../spook_calibration/translations/en.json | 37 +
.../spook_calibration/translations/en_GB.json | 1 +
.../spook_calibration/translations/eo.json | 1 +
.../spook_calibration/translations/es.json | 37 +
.../translations/es_419.json | 1 +
.../spook_calibration/translations/et.json | 1 +
.../spook_calibration/translations/eu.json | 1 +
.../spook_calibration/translations/fa.json | 1 +
.../spook_calibration/translations/fi.json | 1 +
.../spook_calibration/translations/fr.json | 37 +
.../spook_calibration/translations/fy.json | 1 +
.../spook_calibration/translations/ga.json | 1 +
.../spook_calibration/translations/gl.json | 1 +
.../spook_calibration/translations/gsw.json | 1 +
.../spook_calibration/translations/he.json | 1 +
.../spook_calibration/translations/hi.json | 1 +
.../spook_calibration/translations/hr.json | 1 +
.../spook_calibration/translations/hu.json | 1 +
.../spook_calibration/translations/hy.json | 1 +
.../spook_calibration/translations/id.json | 1 +
.../spook_calibration/translations/is.json | 1 +
.../spook_calibration/translations/it.json | 1 +
.../spook_calibration/translations/ja.json | 1 +
.../spook_calibration/translations/ka.json | 1 +
.../spook_calibration/translations/ko.json | 1 +
.../spook_calibration/translations/lb.json | 1 +
.../spook_calibration/translations/lt.json | 1 +
.../spook_calibration/translations/lv.json | 1 +
.../spook_calibration/translations/mk.json | 1 +
.../spook_calibration/translations/ml.json | 1 +
.../spook_calibration/translations/mt.json | 1 +
.../spook_calibration/translations/nb.json | 1 +
.../spook_calibration/translations/nl.json | 37 +
.../spook_calibration/translations/nn.json | 1 +
.../spook_calibration/translations/pl.json | 1 +
.../spook_calibration/translations/pt.json | 1 +
.../spook_calibration/translations/pt_BR.json | 1 +
.../spook_calibration/translations/ro.json | 1 +
.../spook_calibration/translations/ru.json | 1 +
.../spook_calibration/translations/sk.json | 1 +
.../spook_calibration/translations/sl.json | 1 +
.../spook_calibration/translations/sq.json | 1 +
.../spook_calibration/translations/sr.json | 37 +
.../translations/sr_Latn.json | 37 +
.../spook_calibration/translations/sv.json | 1 +
.../spook_calibration/translations/ta.json | 1 +
.../spook_calibration/translations/te.json | 1 +
.../spook_calibration/translations/th.json | 1 +
.../spook_calibration/translations/tr.json | 1 +
.../spook_calibration/translations/uk.json | 1 +
.../spook_calibration/translations/ur.json | 1 +
.../spook_calibration/translations/vi.json | 1 +
.../translations/zh_Hans.json | 1 +
.../translations/zh_Hant.json | 1 +
.../integrations/spook_inverse/__init__.py | 100 +-
.../spook_inverse/binary_sensor.py | 9 +-
.../integrations/spook_inverse/config_flow.py | 72 +-
.../spook/integrations/spook_inverse/const.py | 13 +-
.../integrations/spook_inverse/entity.py | 46 +-
.../integrations/spook_inverse/manifest.json | 2 +-
.../integrations/spook_inverse/switch.py | 24 +-
.../spook_inverse/translations/en.json | 42 +-
.../spook_inverse/translations/sr.json | 44 +-
.../spook_inverse/translations/sr_Latn.json | 44 +-
.../spook_time_in_state/manifest.json | 14 +
.../spook_time_in_state/translations/af.json | 1 +
.../spook_time_in_state/translations/ar.json | 1 +
.../spook_time_in_state/translations/be.json | 1 +
.../spook_time_in_state/translations/bg.json | 1 +
.../spook_time_in_state/translations/bn.json | 1 +
.../spook_time_in_state/translations/bs.json | 1 +
.../spook_time_in_state/translations/ca.json | 1 +
.../spook_time_in_state/translations/cs.json | 1 +
.../spook_time_in_state/translations/cy.json | 1 +
.../spook_time_in_state/translations/da.json | 1 +
.../spook_time_in_state/translations/de.json | 33 +
.../spook_time_in_state/translations/el.json | 1 +
.../spook_time_in_state/translations/en.json | 33 +
.../translations/en_GB.json | 1 +
.../spook_time_in_state/translations/eo.json | 1 +
.../spook_time_in_state/translations/es.json | 33 +
.../translations/es_419.json | 1 +
.../spook_time_in_state/translations/et.json | 1 +
.../spook_time_in_state/translations/eu.json | 1 +
.../spook_time_in_state/translations/fa.json | 1 +
.../spook_time_in_state/translations/fi.json | 1 +
.../spook_time_in_state/translations/fr.json | 33 +
.../spook_time_in_state/translations/fy.json | 1 +
.../spook_time_in_state/translations/ga.json | 1 +
.../spook_time_in_state/translations/gl.json | 1 +
.../spook_time_in_state/translations/gsw.json | 1 +
.../spook_time_in_state/translations/he.json | 1 +
.../spook_time_in_state/translations/hi.json | 1 +
.../spook_time_in_state/translations/hr.json | 1 +
.../spook_time_in_state/translations/hu.json | 1 +
.../spook_time_in_state/translations/hy.json | 1 +
.../spook_time_in_state/translations/id.json | 1 +
.../spook_time_in_state/translations/is.json | 1 +
.../spook_time_in_state/translations/it.json | 1 +
.../spook_time_in_state/translations/ja.json | 1 +
.../spook_time_in_state/translations/ka.json | 1 +
.../spook_time_in_state/translations/ko.json | 1 +
.../spook_time_in_state/translations/lb.json | 1 +
.../spook_time_in_state/translations/lt.json | 1 +
.../spook_time_in_state/translations/lv.json | 1 +
.../spook_time_in_state/translations/mk.json | 1 +
.../spook_time_in_state/translations/ml.json | 1 +
.../spook_time_in_state/translations/mt.json | 1 +
.../spook_time_in_state/translations/nb.json | 1 +
.../spook_time_in_state/translations/nl.json | 33 +
.../spook_time_in_state/translations/nn.json | 1 +
.../spook_time_in_state/translations/pl.json | 1 +
.../spook_time_in_state/translations/pt.json | 1 +
.../translations/pt_BR.json | 1 +
.../spook_time_in_state/translations/ro.json | 1 +
.../spook_time_in_state/translations/ru.json | 1 +
.../spook_time_in_state/translations/sk.json | 1 +
.../spook_time_in_state/translations/sl.json | 1 +
.../spook_time_in_state/translations/sq.json | 1 +
.../spook_time_in_state/translations/sr.json | 33 +
.../translations/sr_Latn.json | 33 +
.../spook_time_in_state/translations/sv.json | 1 +
.../spook_time_in_state/translations/ta.json | 1 +
.../spook_time_in_state/translations/te.json | 1 +
.../spook_time_in_state/translations/th.json | 1 +
.../spook_time_in_state/translations/tr.json | 1 +
.../spook_time_in_state/translations/uk.json | 1 +
.../spook_time_in_state/translations/ur.json | 1 +
.../spook_time_in_state/translations/vi.json | 1 +
.../translations/zh_Hans.json | 1 +
.../translations/zh_Hant.json | 1 +
custom_components/spook/manifest.json | 12 +-
custom_components/spook/repairs.py | 299 +-
custom_components/spook/services.py | 294 +-
custom_components/spook/services.yaml | 378 ++
custom_components/spook/translations/de.json | 28 +
.../spook/translations/en-GB.json | 28 +
custom_components/spook/translations/en.json | 271 +-
.../spook/translations/es-419.json | 28 +
custom_components/spook/translations/es.json | 28 +
custom_components/spook/translations/fi.json | 28 +
custom_components/spook/translations/fr.json | 28 +
custom_components/spook/translations/it.json | 28 +
custom_components/spook/translations/nl.json | 619 ++-
.../spook/translations/pt-BR.json | 28 +
custom_components/spook/translations/pt.json | 28 +
.../spook/translations/sr-Latn.json | 593 ++-
custom_components/spook/translations/sr.json | 591 ++-
custom_components/spook/translations/sv.json | 108 +-
.../spook/translations/zh-Hans.json | 28 +
.../spook/translations/zh-Hant.json | 28 +
custom_components/spook/triggers.yaml | 4 +
.../statistics-graph-chart-card.js | 2 +-
.../statistics-graph-chart-card.js.gz | Bin 343878 -> 352310 bytes
.../translations.js | 542 ++-
.../translations.js.gz | Bin 637166 -> 683037 bytes
.../multiple-entity-row.js | 2 +-
.../multiple-entity-row.js.gz | Bin 27566 -> 27616 bytes
zigbee2mqtt/state.json | 26 +-
362 files changed, 22060 insertions(+), 1285 deletions(-)
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/adopt-problem-sensors-dialog-YNUL6UYR.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/area-view-XTWD5MTD.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/areas-view-UDLGVZLY.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/bulk-edit-dialog-A7JSPXFS.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-3FGYBPXY.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-4APLU3YR.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-55ND3GKE.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-5MYBEQC2.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-6BKNHM6I.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-DRT62KZF.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-EKN6HBJN.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-GM2CHGSG.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-GWAP5R2S.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-HFZZVTW7.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-JQXHX4U4.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-MGSZZ3YF.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-MNPRUCF5.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-MQRW7LAF.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-PCR5FRSH.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-PL7JXZOW.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-RHKFQ4Q2.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-RUYEMIDM.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-SUOGXDNI.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-SYPCMUXO.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-TX2GMEMJ.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-WACUKJSI.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-XTTCEGMX.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/chunk-ZHMFEWT2.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/complete-dialog-HB2GK5Z3.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/dialog-mount-ZEP3U4T7.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/object-dialog-GZK3VG7E.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/qr-dialog-2SMLHEDB.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/settings-view-S7OONH2A.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/suggested-setups-dialog-F54DZZLX.js
create mode 100644 custom_components/maintenance_supporter/frontend/panel-chunks/task-dialog-4KQRUMA6.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/budget-section-card-GGFM4NWQ.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-47YHJMQQ.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-GVWULYYT.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-KWXSFMBP.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-P2ZDMNV3.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-QZSR3CS5.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-SZ5OZQBM.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/chunk-ZT3EJK22.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/dialog-mount-COO4BKJS.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/groups-section-card-E26J7GJC.js
create mode 100644 custom_components/maintenance_supporter/frontend/strategy/chunks/vacation-section-card-RQOCUOWP.js
create mode 100644 custom_components/spook/integrations/spook_calibration/manifest.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/af.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ar.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/be.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/bg.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/bn.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/bs.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ca.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/cs.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/cy.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/da.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/de.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/el.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/en.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/en_GB.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/eo.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/es.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/es_419.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/et.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/eu.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/fa.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/fi.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/fr.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/fy.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ga.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/gl.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/gsw.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/he.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/hi.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/hr.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/hu.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/hy.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/id.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/is.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/it.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ja.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ka.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ko.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/lb.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/lt.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/lv.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/mk.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ml.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/mt.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/nb.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/nl.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/nn.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/pl.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/pt.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/pt_BR.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ro.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ru.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sk.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sl.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sq.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sr.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sr_Latn.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/sv.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ta.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/te.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/th.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/tr.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/uk.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/ur.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/vi.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/zh_Hans.json
create mode 100644 custom_components/spook/integrations/spook_calibration/translations/zh_Hant.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/manifest.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/af.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ar.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/be.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/bg.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/bn.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/bs.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ca.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/cs.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/cy.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/da.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/de.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/el.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/en.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/en_GB.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/eo.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/es.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/es_419.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/et.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/eu.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/fa.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/fi.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/fr.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/fy.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ga.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/gl.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/gsw.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/he.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/hi.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/hr.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/hu.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/hy.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/id.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/is.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/it.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ja.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ka.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ko.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/lb.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/lt.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/lv.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/mk.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ml.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/mt.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/nb.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/nl.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/nn.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/pl.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/pt.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/pt_BR.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ro.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ru.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sk.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sl.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sq.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sr.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sr_Latn.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/sv.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ta.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/te.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/th.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/tr.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/uk.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/ur.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/vi.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/zh_Hans.json
create mode 100644 custom_components/spook/integrations/spook_time_in_state/translations/zh_Hant.json
diff --git a/.ha_run.lock b/.ha_run.lock
index 1b983953..b47b8295 100644
--- a/.ha_run.lock
+++ b/.ha_run.lock
@@ -1 +1 @@
-{"pid": 71, "version": 1, "ha_version": "2026.9.4", "start_ts": 1791146884.4391842}
\ No newline at end of file
+{"pid": 70, "version": 1, "ha_version": "2026.9.4", "start_ts": 1791306689.7190704}
\ No newline at end of file
diff --git a/.storage/lovelace_resources b/.storage/lovelace_resources
index 99b5160a..4e62130d 100644
--- a/.storage/lovelace_resources
+++ b/.storage/lovelace_resources
@@ -196,7 +196,7 @@
},
{
"id": "e92ef0caff41454e9f49ea966ed99e41",
- "url": "/hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js?hacstag=1789210374120",
+ "url": "/hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js?hacstag=1789210374130",
"type": "module"
},
{
@@ -256,7 +256,7 @@
},
{
"id": "8713ea9c008e4270bb28085eed5be959",
- "url": "/hacsfiles/Statistics-Graph-Chart-Card/statistics-graph-chart-card.js?hacstag=1034932856404",
+ "url": "/hacsfiles/Statistics-Graph-Chart-Card/statistics-graph-chart-card.js?hacstag=1034932856405",
"type": "module"
},
{
diff --git a/custom_components/album_slideshow/__init__.py b/custom_components/album_slideshow/__init__.py
index f68e4310..30b6bb3b 100644
--- a/custom_components/album_slideshow/__init__.py
+++ b/custom_components/album_slideshow/__init__.py
@@ -516,16 +516,26 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
_register_photo_services(hass)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
+ # Reload when the options flow changes the entry (e.g. a new Immich
+ # selection or the reverse-geocode toggle) so it takes effect at once.
+ entry.async_on_unload(entry.add_update_listener(_async_update_listener))
store.notify()
return True
+async def _async_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
+ await hass.config_entries.async_reload(entry.entry_id)
+
+
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
if unload_ok:
domain_data = hass.data.get(DOMAIN, {})
+ coordinator = domain_data.get(entry.entry_id, {}).get("coordinator")
+ if coordinator is not None:
+ await coordinator._cancel_enrichment()
domain_data.pop(entry.entry_id, None)
# Drop the shared semaphore once the last album is gone so it's
# re-created if the integration is re-added later.
diff --git a/custom_components/album_slideshow/camera.py b/custom_components/album_slideshow/camera.py
index 6f82e7da..c1bb6f36 100644
--- a/custom_components/album_slideshow/camera.py
+++ b/custom_components/album_slideshow/camera.py
@@ -5,6 +5,7 @@ from collections import OrderedDict, deque
from dataclasses import dataclass, replace
from datetime import datetime, timezone
import logging
+import math
import random
from pathlib import Path
from typing import Any
@@ -20,6 +21,10 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
DOMAIN,
+ CAMERA_METADATA_FIELDS,
+ DEFAULT_CUSTOM_LOOKBACK_DAYS,
+ DEFAULT_SHUFFLE_AGE_BIAS,
+ DEFAULT_MISSING_DATE_MODE,
MAX_RESOLUTION_SHORT_EDGE,
ORIENTATION_MISMATCH_PAIR,
ORIENTATION_MISMATCH_AVOID,
@@ -111,6 +116,41 @@ def _utc_now_iso() -> str:
return datetime.now(timezone.utc).isoformat()
+def _camera_metadata_attributes(item: MediaItem | None) -> dict[str, Any]:
+ metadata = getattr(item, "camera_metadata", None)
+ return {
+ field: metadata.get(field) if isinstance(metadata, dict) else None
+ for field in CAMERA_METADATA_FIELDS
+ }
+
+
+def _item_faces(item: MediaItem | None) -> tuple[ip.FaceBox, ...] | None:
+ """Return the validated face boxes stored on a media item.
+
+ None means no face data; an empty tuple means the photo has no faces.
+ """
+ faces = getattr(item, "faces", None) if item is not None else None
+ if not isinstance(faces, (list, tuple)):
+ return None
+ valid: list[ip.FaceBox] = []
+ for face in faces:
+ if (
+ not isinstance(face, (list, tuple))
+ or len(face) not in (5, 6)
+ or not all(
+ not isinstance(value, bool) and isinstance(value, (int, float))
+ and math.isfinite(value) for value in face[:5]
+ )
+ or (len(face) == 6 and not isinstance(face[5], bool))
+ ):
+ continue
+ left, top, right, bottom, weight = (float(value) for value in face[:5])
+ if 0 <= left < right <= 1 and 0 <= top < bottom <= 1 and weight > 0:
+ selected = face[5] if len(face) == 6 else False
+ valid.append(ip.FaceBox(left, top, right, bottom, weight, selected))
+ return tuple(valid)
+
+
class _DownloadCache:
"""Byte-budget LRU cache for downloaded image data, O(1) per operation."""
@@ -208,6 +248,7 @@ class AlbumSlideshowCamera(Camera):
self._frame_id: int = 0
self._interrupt_event: asyncio.Event = asyncio.Event()
+ self._slide_deadline: float | None = None
# Navigation runs directly in the button/service coroutine. The lock
# serialises rapid presses while buffered swaps remain independent of
# the background timer loop.
@@ -244,6 +285,7 @@ class AlbumSlideshowCamera(Camera):
def _on_store_change() -> None:
self._download_cache.resize(self.store.image_cache_mb * 1024 * 1024)
self._effective_cache = None
+ self._slide_deadline = None
self._invalidate_timeline()
store.add_listener(_on_store_change)
@@ -333,12 +375,14 @@ class AlbumSlideshowCamera(Camera):
"captured_at_primary": captured_at,
"uploaded_at": _ts_to_iso(getattr(cur, "uploaded_at", None)),
"byte_size": getattr(cur, "byte_size", None),
- # GPS + reverse-geocoded label come from EXIF for local-folder
- # entries; Google albums leave these as ``None``.
"latitude": getattr(cur, "latitude", None),
"longitude": getattr(cur, "longitude", None),
"location": getattr(cur, "location", None),
"description": getattr(cur, "description", None),
+ **_camera_metadata_attributes(cur),
+ "google_metadata_enabled": bool(getattr(self.coordinator, "google_metadata_enabled", False)),
+ "google_location_enabled": bool(getattr(self.coordinator, "google_location_enabled", False)),
+ "google_reverse_geocode_enabled": bool(getattr(self.coordinator, "google_reverse_geocode_enabled", False)),
# Structured per-image caption metadata. A single-element list for
# normal slides; two elements (top/left first) for paired slides,
# so the card can overlay an accurate date/location on each half.
@@ -351,6 +395,8 @@ class AlbumSlideshowCamera(Camera):
"portrait_mode": self.store.portrait_mode,
"order_mode": self.store.order_mode,
"date_filter": self.store.date_filter,
+ "custom_lookback_days": int(self.store.custom_lookback_days),
+ "shuffle_age_bias": int(self.store.shuffle_age_bias),
"missing_date_mode": self.store.missing_date_mode,
"paused": bool(self.store.paused),
"refresh_hours": int(self.store.refresh_hours),
@@ -393,6 +439,7 @@ class AlbumSlideshowCamera(Camera):
"latitude": getattr(cur, "latitude", None),
"longitude": getattr(cur, "longitude", None),
"description": getattr(cur, "description", None),
+ **_camera_metadata_attributes(cur),
}
]
@@ -429,6 +476,7 @@ class AlbumSlideshowCamera(Camera):
cache_key = (
id(raw),
self.store.date_filter,
+ getattr(self.store, "custom_lookback_days", DEFAULT_CUSTOM_LOOKBACK_DAYS),
self.store.missing_date_mode,
self.store.order_mode,
self.store.hidden_revision,
@@ -440,6 +488,7 @@ class AlbumSlideshowCamera(Camera):
[item for item in raw if item.photo_id and item.photo_id not in self.store.hidden_photo_ids]
if self.store.hidden_photo_ids else raw,
mode=self.store.date_filter,
+ lookback_days=getattr(self.store, "custom_lookback_days", DEFAULT_CUSTOM_LOOKBACK_DAYS),
missing_date=self.store.missing_date_mode,
)
ordered = playlist.order_items(filtered, self.store.order_mode)
@@ -463,6 +512,7 @@ class AlbumSlideshowCamera(Camera):
self._last_nav_outcome = "pending"
self._last_nav_error = None
# Wake the timer loop so the manual frame starts a fresh interval.
+ self._slide_deadline = None
self._interrupt_event.set()
self.async_write_ha_state()
@@ -492,6 +542,8 @@ class AlbumSlideshowCamera(Camera):
)
finally:
self._navigation_pending -= 1
+ self._slide_deadline = None
+ self._interrupt_event.set()
self.async_write_ha_state()
async def async_force_refresh(self) -> None:
@@ -1015,6 +1067,7 @@ class AlbumSlideshowCamera(Camera):
async def _render_loop(self, initial_delay: float = 0.0) -> None:
"""Display buffered frames on command/timer and refill them in the background."""
+ loop = asyncio.get_running_loop()
if initial_delay > 0:
await asyncio.sleep(initial_delay)
@@ -1045,6 +1098,8 @@ class AlbumSlideshowCamera(Camera):
while True:
try:
+ if self._slide_deadline is None:
+ self._slide_deadline = loop.time() + float(int(self.store.slide_interval))
if self._timeline_dirty:
async with self._navigation_lock:
if self._timeline_dirty:
@@ -1052,16 +1107,22 @@ class AlbumSlideshowCamera(Camera):
continue
interrupted = await self._wait_or_interrupt(
- float(int(self.store.slide_interval))
+ max(0.0, self._slide_deadline - loop.time())
)
if not interrupted and not self.store.paused:
async with self._navigation_lock:
- if not self._timeline_dirty:
+ if (
+ not self._timeline_dirty
+ and self._slide_deadline is not None
+ and loop.time() >= self._slide_deadline
+ ):
await self._show_next_frame()
+ self._slide_deadline = loop.time() + float(int(self.store.slide_interval))
self._consecutive_failures = 0
except asyncio.CancelledError:
raise
except Exception as err:
+ self._slide_deadline = None
self._consecutive_failures += 1
_LOGGER.warning(
"Album Slideshow: buffered navigation/render failed (attempt %d): %s",
@@ -1104,7 +1165,8 @@ class AlbumSlideshowCamera(Camera):
self._index = (self._index + 1) % count
return
- self._index = self._next_random_index(count)
+ bias = getattr(self.store, "shuffle_age_bias", DEFAULT_SHUFFLE_AGE_BIAS)
+ self._index = self._next_age_weighted_index(items, bias) if bias else self._next_random_index(count)
cur_url = items[self._index].url
self._recent_urls.append(cur_url)
keep = min(20, max(1, count - 1))
@@ -1122,6 +1184,13 @@ class AlbumSlideshowCamera(Camera):
return
self._index = (self._index + 1) % count
+ def _crop_hints(self, item: MediaItem | None) -> ip.CropHints:
+ return ip.CropHints(
+ faces=_item_faces(item),
+ debug=bool(getattr(getattr(self, "store", None), "face_debug", False)),
+ name=getattr(item, "filename", None),
+ )
+
async def _compose_for_index(
self, items: list[MediaItem]
) -> tuple[Image.Image | None, dict | None]:
@@ -1183,6 +1252,7 @@ class AlbumSlideshowCamera(Camera):
composed = await self._async_image_job(
ip.pair_images, img, other_img, width, height, fill_mode,
is_portrait_canvas, divider, divider_fill, transparent_divider,
+ self._crop_hints(cur), self._crop_hints(other_item),
)
pair_frames = [
{
@@ -1191,6 +1261,7 @@ class AlbumSlideshowCamera(Camera):
"latitude": getattr(cur, "latitude", None),
"longitude": getattr(cur, "longitude", None),
"description": getattr(cur, "description", None),
+ **_camera_metadata_attributes(cur),
},
{
"captured_at": _ts_to_iso(getattr(other_item, "captured_at", None)),
@@ -1198,12 +1269,13 @@ class AlbumSlideshowCamera(Camera):
"latitude": getattr(other_item, "latitude", None),
"longitude": getattr(other_item, "longitude", None),
"description": getattr(other_item, "description", None),
+ **_camera_metadata_attributes(other_item),
},
]
pair_meta = [f["captured_at"] for f in pair_frames]
else:
composed = await self._async_image_job(
- ip.render_image, img, fill_mode, width, height,
+ ip.render_image, img, fill_mode, width, height, self._crop_hints(cur),
)
finally:
ip.safe_close(other_img)
@@ -1226,7 +1298,7 @@ class AlbumSlideshowCamera(Camera):
return composed, meta
composed = await self._async_image_job(
- ip.render_image, img, fill_mode, width, height
+ ip.render_image, img, fill_mode, width, height, self._crop_hints(cur)
)
return composed, {
"is_portrait": cur_is_portrait,
@@ -1278,7 +1350,7 @@ class AlbumSlideshowCamera(Camera):
if self._index != start:
self._do_advance(count, items)
composed = await self._async_image_job(
- ip.render_image, img, fill_mode, width, height
+ ip.render_image, img, fill_mode, width, height, self._crop_hints(cur)
)
return composed, {
"is_portrait": is_portrait_canvas,
@@ -1304,7 +1376,7 @@ class AlbumSlideshowCamera(Camera):
try:
cur_is_portrait = ip.is_portrait_item(item, img)
composed = await self._async_image_job(
- ip.render_image, img, fill_mode, width, height
+ ip.render_image, img, fill_mode, width, height, self._crop_hints(item)
)
return composed, {
"is_portrait": cur_is_portrait,
@@ -1407,6 +1479,23 @@ class AlbumSlideshowCamera(Camera):
return None
+ def _next_age_weighted_index(self, items: list[MediaItem], bias: int) -> int:
+ weights = playlist.age_weights(
+ items, bias, missing_date=getattr(self.store, "missing_date_mode", DEFAULT_MISSING_DATE_MODE),
+ )
+ count = len(items)
+ if count <= 1 or min(weights) == max(weights):
+ return self._next_random_index(count)
+ cooldown = min(5, max(1, count // 10))
+ recent = set(self._recent_urls[-cooldown:])
+ candidates = [
+ index for index, item in enumerate(items)
+ if index != self._index and item.url not in recent
+ ]
+ if not candidates:
+ candidates = [index for index in range(count) if index != self._index]
+ return self._rng.choices(candidates, weights=[weights[index] for index in candidates], k=1)[0]
+
def _next_random_index(self, count: int) -> int:
if count <= 1:
self._random_order = [0]
diff --git a/custom_components/album_slideshow/config_flow.py b/custom_components/album_slideshow/config_flow.py
index b7690c69..636a3ba8 100644
--- a/custom_components/album_slideshow/config_flow.py
+++ b/custom_components/album_slideshow/config_flow.py
@@ -20,6 +20,11 @@ from .const import (
CONF_PROVIDER,
CONF_ALBUM_NAME,
CONF_ALBUM_URL,
+ CONF_GOOGLE_METADATA,
+ DEFAULT_GOOGLE_METADATA,
+ CONF_GOOGLE_LOCATION,
+ DEFAULT_GOOGLE_LOCATION,
+ DEFAULT_GOOGLE_REVERSE_GEOCODE,
CONF_LOCAL_PATH,
CONF_MEDIA_CONTENT_ID,
CONF_RECURSIVE,
@@ -149,6 +154,193 @@ def _redact_token(token: str | None) -> str:
return f"{token[:3]}...({len(token)} chars, shape {shape})"
+async def _fetch_immich_choices(
+ client: Any,
+) -> tuple[dict[str, str], dict[str, str]]:
+ """Return id -> name maps of the albums and named people a key can see.
+
+ A key with limited permissions can read the server but not albums or
+ people; keep going with whatever it can see.
+ """
+ albums: list[dict[str, Any]] = []
+ people: list[dict[str, Any]] = []
+ for label, call in (
+ ("albums", client.async_list_albums),
+ ("people", client.async_list_people),
+ ):
+ try:
+ result = await call()
+ except Exception as err: # noqa: BLE001
+ _LOGGER.warning(
+ "Immich %s listing failed for %s: %s",
+ label,
+ client.base_url,
+ _describe_error(err),
+ )
+ else:
+ if label == "albums":
+ albums = result
+ else:
+ people = result
+ album_map = {
+ a["id"]: (a.get("albumName") or a["id"]) for a in albums if a.get("id")
+ }
+ people_map = {
+ p["id"]: p["name"]
+ for p in people
+ if p.get("id") and (p.get("name") or "").strip()
+ }
+ return album_map, people_map
+
+
+def _immich_validation_error(err: BaseException) -> str:
+ return (
+ "immich_invalid_auth"
+ if getattr(err, "status", None) in (401, 403)
+ else "immich_cannot_connect"
+ )
+
+
+def _immich_select_schema(
+ albums: dict[str, str],
+ people: dict[str, str],
+ defaults: dict[str, Any] | None = None,
+) -> vol.Schema:
+ """Build the albums/people/favorites picker, optionally pre-filled."""
+ defaults = defaults or {}
+
+ def _default(key: str, fallback: Any = vol.UNDEFINED) -> Any:
+ return defaults.get(key, fallback)
+
+ fields: dict[Any, Any] = {
+ vol.Required(CONF_ALBUM_NAME, default=_default(CONF_ALBUM_NAME)): str
+ }
+ if albums:
+ album_options = [
+ selector.SelectOptionDict(value=_ALL_ALBUMS, label="Select all albums")
+ ] + [
+ selector.SelectOptionDict(value=aid, label=name)
+ for aid, name in albums.items()
+ ]
+ fields[vol.Optional("albums", default=_default("albums"))] = (
+ selector.SelectSelector(
+ selector.SelectSelectorConfig(
+ options=album_options,
+ multiple=True,
+ mode=selector.SelectSelectorMode.DROPDOWN,
+ custom_value=False,
+ )
+ )
+ )
+ if people:
+ people_options = [
+ selector.SelectOptionDict(value=_ALL_PEOPLE, label="Select all people")
+ ] + [
+ selector.SelectOptionDict(value=pid, label=name)
+ for pid, name in people.items()
+ ]
+ fields[vol.Optional("people", default=_default("people"))] = (
+ selector.SelectSelector(
+ selector.SelectSelectorConfig(
+ options=people_options,
+ multiple=True,
+ mode=selector.SelectSelectorMode.DROPDOWN,
+ custom_value=False,
+ )
+ )
+ )
+ fields[vol.Optional("favorites", default=_default("favorites", False))] = (
+ selector.BooleanSelector()
+ )
+ filter_default = _default(CONF_IMMICH_FILTER)
+ fields[
+ vol.Optional(
+ CONF_IMMICH_FILTER,
+ description=(
+ {"suggested_value": filter_default}
+ if filter_default is not vol.UNDEFINED
+ else None
+ ),
+ )
+ ] = str
+ fields[
+ vol.Optional(
+ CONF_IMMICH_IMAGE_SIZE,
+ default=_default(CONF_IMMICH_IMAGE_SIZE, DEFAULT_IMMICH_IMAGE_SIZE),
+ )
+ ] = vol.In(IMMICH_IMAGE_SIZE_OPTIONS)
+ return vol.Schema(fields)
+
+
+def _parse_immich_select(
+ user_input: dict[str, Any],
+ albums: dict[str, str],
+ people: dict[str, str],
+) -> tuple[dict[str, Any], dict[str, str]]:
+ """Turn picker input into entry data fields; return ``(fields, errors)``."""
+ errors: dict[str, str] = {}
+ name = user_input[CONF_ALBUM_NAME].strip()
+ size = user_input.get(CONF_IMMICH_IMAGE_SIZE, DEFAULT_IMMICH_IMAGE_SIZE)
+ raw_filter = (user_input.get(CONF_IMMICH_FILTER) or "").strip()
+ favorites = bool(user_input.get("favorites"))
+
+ chosen_albums = [a for a in user_input.get("albums", []) if a]
+ if _ALL_ALBUMS in chosen_albums:
+ chosen_albums = list(albums.keys())
+ else:
+ chosen_albums = [a for a in chosen_albums if a in albums]
+
+ chosen_people = [p for p in user_input.get("people", []) if p]
+ if _ALL_PEOPLE in chosen_people:
+ chosen_people = list(people.keys())
+ else:
+ chosen_people = [p for p in chosen_people if p in people]
+
+ if raw_filter:
+ try:
+ parsed = json.loads(raw_filter)
+ if not isinstance(parsed, dict):
+ raise ValueError
+ except ValueError:
+ errors[CONF_IMMICH_FILTER] = "immich_filter_invalid"
+
+ selection = {
+ "albums": chosen_albums,
+ "people": chosen_people,
+ "favorites": favorites,
+ }
+ fields = {
+ CONF_IMMICH_SELECTION_TYPE: IMMICH_SELECTION_COMPOSITE,
+ CONF_IMMICH_SELECTION_ID: json.dumps(selection, sort_keys=True),
+ CONF_IMMICH_IMAGE_SIZE: size,
+ CONF_ALBUM_NAME: name,
+ CONF_IMMICH_FILTER: raw_filter,
+ }
+ return fields, errors
+
+
+def _immich_current_selection(data: dict[str, Any]) -> dict[str, Any]:
+ """Map an entry's stored Immich selection onto the picker's fields.
+
+ Composite entries map one to one. Older single-type entries are
+ translated where the picker can express them (albums, people,
+ favorites); ``all``/``random``/``search`` start with nothing ticked,
+ which the picker saves as "all photos" (plus any stored filter).
+ """
+ from . import immich as immich_api
+
+ sel_type = data.get(CONF_IMMICH_SELECTION_TYPE)
+ sel_id = data.get(CONF_IMMICH_SELECTION_ID) or ""
+ if sel_type == IMMICH_SELECTION_COMPOSITE:
+ return immich_api.parse_composite_selection(sel_id)
+ ids = [part for part in sel_id.split(",") if part]
+ return {
+ "albums": ids if sel_type in ("album", "albums") else [],
+ "people": ids if sel_type in ("person", "people") else [],
+ "favorites": sel_type == "favorites",
+ }
+
+
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
VERSION = 1
@@ -190,9 +382,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
) -> config_entries.OptionsFlow:
"""Return the options flow handler.
- Only local-folder entries expose user-tunable options today (the
- reverse-geocode toggle); Google entries get a no-op handler so
- that the "Configure" button doesn't appear empty in the UI.
+ Local-folder, Nextcloud and Ente entries expose the reverse-geocode
+ toggle; Immich entries reopen the albums/people/favorites picker.
+ Other providers get a no-op handler so that the "Configure" button
+ doesn't appear empty in the UI.
Note: do NOT pass ``config_entry`` to the OptionsFlow constructor.
Since Home Assistant 2024.12 the base class manages
@@ -206,6 +399,10 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
PROVIDER_ENTE,
):
return LocalFolderOptionsFlow()
+ if config_entry.data.get(CONF_PROVIDER) == PROVIDER_IMMICH:
+ return ImmichOptionsFlow()
+ if config_entry.data.get(CONF_PROVIDER) == PROVIDER_GOOGLE_SHARED:
+ return GoogleOptionsFlow()
return _NoOptionsFlow()
async def async_step_user(self, user_input: dict[str, Any] | None = None) -> FlowResult:
@@ -354,8 +551,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
from . import immich as immich_api
client = immich_api.ImmichClient(self.hass, url, key)
- albums: list[dict[str, Any]] = []
- people: list[dict[str, Any]] = []
try:
await client.async_validate()
except Exception as err: # noqa: BLE001 - any failure means bad URL/key
@@ -364,46 +559,14 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
client.base_url,
_describe_error(err),
)
- errors["base"] = (
- "immich_invalid_auth"
- if getattr(err, "status", None) in (401, 403)
- else "immich_cannot_connect"
- )
+ errors["base"] = _immich_validation_error(err)
else:
- # A key with limited permissions can read the server but not
- # albums or people; keep going with whatever it can see.
- for label, call in (
- ("albums", client.async_list_albums),
- ("people", client.async_list_people),
- ):
- try:
- result = await call()
- except Exception as err: # noqa: BLE001
- _LOGGER.warning(
- "Immich %s listing failed for %s: %s",
- label,
- client.base_url,
- _describe_error(err),
- )
- else:
- if label == "albums":
- albums = result
- else:
- people = result
-
self._immich_url = client.base_url
self._immich_key = key
- # id -> name maps for the two multi-select pickers.
- self._immich_albums = {
- a["id"]: (a.get("albumName") or a["id"])
- for a in albums
- if a.get("id")
- }
- self._immich_people = {
- p["id"]: p["name"]
- for p in people
- if p.get("id") and (p.get("name") or "").strip()
- }
+ (
+ self._immich_albums,
+ self._immich_people,
+ ) = await _fetch_immich_choices(client)
return await self.async_step_immich_select()
schema = vol.Schema(
@@ -428,41 +591,15 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
errors: dict[str, str] = {}
if user_input is not None:
- name = user_input[CONF_ALBUM_NAME].strip()
- size = user_input.get(CONF_IMMICH_IMAGE_SIZE, DEFAULT_IMMICH_IMAGE_SIZE)
- raw_filter = (user_input.get(CONF_IMMICH_FILTER) or "").strip()
- favorites = bool(user_input.get("favorites"))
-
- chosen_albums = [a for a in user_input.get("albums", []) if a]
- if _ALL_ALBUMS in chosen_albums:
- chosen_albums = list(self._immich_albums.keys())
- else:
- chosen_albums = [a for a in chosen_albums if a in self._immich_albums]
-
- chosen_people = [p for p in user_input.get("people", []) if p]
- if _ALL_PEOPLE in chosen_people:
- chosen_people = list(self._immich_people.keys())
- else:
- chosen_people = [p for p in chosen_people if p in self._immich_people]
-
- if raw_filter:
- try:
- parsed = json.loads(raw_filter)
- if not isinstance(parsed, dict):
- raise ValueError
- except ValueError:
- errors[CONF_IMMICH_FILTER] = "immich_filter_invalid"
-
+ fields, errors = _parse_immich_select(
+ user_input, self._immich_albums, self._immich_people
+ )
if not errors:
- selection = {
- "albums": chosen_albums,
- "people": chosen_people,
- "favorites": favorites,
- }
- sel_id = json.dumps(selection, sort_keys=True)
+ name = fields[CONF_ALBUM_NAME]
+ raw_filter = fields.pop(CONF_IMMICH_FILTER)
unique = (
f"{DOMAIN}:{PROVIDER_IMMICH}:{self._immich_url}:"
- f"composite:{sel_id}:{raw_filter}:{name}"
+ f"composite:{fields[CONF_IMMICH_SELECTION_ID]}:{raw_filter}:{name}"
)
await self.async_set_unique_id(unique)
self._abort_if_unique_id_configured()
@@ -470,58 +607,18 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
CONF_PROVIDER: PROVIDER_IMMICH,
CONF_IMMICH_URL: self._immich_url,
CONF_IMMICH_API_KEY: self._immich_key,
- CONF_IMMICH_SELECTION_TYPE: IMMICH_SELECTION_COMPOSITE,
- CONF_IMMICH_SELECTION_ID: sel_id,
- CONF_IMMICH_IMAGE_SIZE: size,
- CONF_ALBUM_NAME: name,
+ **fields,
}
if raw_filter:
data[CONF_IMMICH_FILTER] = raw_filter
return self.async_create_entry(title=name, data=data)
- fields: dict[Any, Any] = {vol.Required(CONF_ALBUM_NAME): str}
- if self._immich_albums:
- album_options = [
- selector.SelectOptionDict(
- value=_ALL_ALBUMS, label="Select all albums"
- )
- ] + [
- selector.SelectOptionDict(value=aid, label=name)
- for aid, name in self._immich_albums.items()
- ]
- fields[vol.Optional("albums")] = selector.SelectSelector(
- selector.SelectSelectorConfig(
- options=album_options,
- multiple=True,
- mode=selector.SelectSelectorMode.DROPDOWN,
- custom_value=False,
- )
- )
- if self._immich_people:
- people_options = [
- selector.SelectOptionDict(
- value=_ALL_PEOPLE, label="Select all people"
- )
- ] + [
- selector.SelectOptionDict(value=pid, label=name)
- for pid, name in self._immich_people.items()
- ]
- fields[vol.Optional("people")] = selector.SelectSelector(
- selector.SelectSelectorConfig(
- options=people_options,
- multiple=True,
- mode=selector.SelectSelectorMode.DROPDOWN,
- custom_value=False,
- )
- )
- fields[vol.Optional("favorites", default=False)] = selector.BooleanSelector()
- fields[vol.Optional(CONF_IMMICH_FILTER)] = str
- fields[
- vol.Optional(CONF_IMMICH_IMAGE_SIZE, default=DEFAULT_IMMICH_IMAGE_SIZE)
- ] = vol.In(IMMICH_IMAGE_SIZE_OPTIONS)
- schema = vol.Schema(fields)
return self.async_show_form(
- step_id="immich_select", data_schema=schema, errors=errors
+ step_id="immich_select",
+ data_schema=_immich_select_schema(
+ self._immich_albums, self._immich_people
+ ),
+ errors=errors,
)
async def async_step_photoprism(
@@ -1263,6 +1360,38 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
)
+class GoogleOptionsFlow(config_entries.OptionsFlow):
+ """Control anonymous Google photo metadata enrichment."""
+
+ async def async_step_init(self, user_input: dict[str, Any] | None = None) -> FlowResult:
+ return await self.async_step_google_metadata(user_input)
+
+ async def async_step_google_metadata(
+ self, user_input: dict[str, Any] | None = None,
+ ) -> FlowResult:
+ defaults = {
+ CONF_GOOGLE_METADATA: DEFAULT_GOOGLE_METADATA,
+ CONF_GOOGLE_LOCATION: DEFAULT_GOOGLE_LOCATION,
+ CONF_REVERSE_GEOCODE: DEFAULT_GOOGLE_REVERSE_GEOCODE,
+ }
+ if user_input is not None:
+ options = {
+ **self.config_entry.options,
+ **{
+ field: bool(user_input.get(field, self.config_entry.options.get(field, default)))
+ for field, default in defaults.items()
+ },
+ }
+ return self.async_create_entry(title="", data=options)
+ return self.async_show_form(
+ step_id="google_metadata",
+ data_schema=vol.Schema({
+ vol.Required(field, default=bool(self.config_entry.options.get(field, default))): bool
+ for field, default in defaults.items()
+ }),
+ )
+
+
class LocalFolderOptionsFlow(config_entries.OptionsFlow):
"""Options for local-folder entries.
@@ -1295,6 +1424,184 @@ class LocalFolderOptionsFlow(config_entries.OptionsFlow):
return self.async_show_form(step_id="init", data_schema=schema)
+class ImmichOptionsFlow(config_entries.OptionsFlow):
+ """Change an Immich entry's source without re-creating the entry.
+
+ The selection lives in ``entry.data`` (the coordinator reads it from
+ there), so this flow writes the new selection back into the entry data;
+ the update listener then reloads the entry. The entry id is unchanged,
+ so entities, their settings and the hidden-photo list are kept.
+ """
+
+ def __init__(self) -> None:
+ super().__init__()
+ self._albums: dict[str, str] = {}
+ self._people: dict[str, str] = {}
+ self._url: str | None = None
+ self._key: str | None = None
+
+ async def async_step_init(
+ self, user_input: dict[str, Any] | None = None
+ ) -> FlowResult:
+ from . import immich as immich_api
+
+ data = self.config_entry.data
+ client = immich_api.ImmichClient(
+ self.hass, data.get(CONF_IMMICH_URL), data.get(CONF_IMMICH_API_KEY)
+ )
+ try:
+ await client.async_validate()
+ except Exception as err: # noqa: BLE001
+ _LOGGER.warning(
+ "Immich validation failed for %s: %s",
+ client.base_url,
+ _describe_error(err),
+ )
+ return await self.async_step_connection(
+ errors={"base": _immich_validation_error(err)}
+ )
+ self._url = client.base_url
+ self._key = data.get(CONF_IMMICH_API_KEY)
+ self._albums, self._people = await _fetch_immich_choices(client)
+ return await self.async_step_immich_select()
+
+ async def async_step_connection(
+ self,
+ user_input: dict[str, Any] | None = None,
+ errors: dict[str, str] | None = None,
+ ) -> FlowResult:
+ """Fix the URL or API key when the stored ones stop working."""
+ from . import immich as immich_api
+
+ errors = dict(errors or {})
+ data = self.config_entry.data
+ if user_input is not None:
+ url = user_input[CONF_IMMICH_URL].strip()
+ key = user_input[CONF_IMMICH_API_KEY].strip()
+ client = immich_api.ImmichClient(self.hass, url, key)
+ try:
+ await client.async_validate()
+ except Exception as err: # noqa: BLE001
+ _LOGGER.warning(
+ "Immich validation failed for %s: %s",
+ client.base_url,
+ _describe_error(err),
+ )
+ errors["base"] = _immich_validation_error(err)
+ else:
+ self._url = client.base_url
+ self._key = key
+ self._albums, self._people = await _fetch_immich_choices(client)
+ return await self.async_step_immich_select()
+
+ schema = vol.Schema(
+ {
+ vol.Required(
+ CONF_IMMICH_URL, default=data.get(CONF_IMMICH_URL, "")
+ ): str,
+ vol.Required(
+ CONF_IMMICH_API_KEY, default=data.get(CONF_IMMICH_API_KEY, "")
+ ): str,
+ }
+ )
+ return self.async_show_form(
+ step_id="connection", data_schema=schema, errors=errors
+ )
+
+ async def async_step_immich_select(
+ self, user_input: dict[str, Any] | None = None
+ ) -> FlowResult:
+ entry = self.config_entry
+ errors: dict[str, str] = {}
+ current = _immich_current_selection(entry.data)
+ for album_id in current["albums"]:
+ self._albums.setdefault(album_id, f"{album_id} (unavailable)")
+ for person_id in current["people"]:
+ self._people.setdefault(person_id, f"{person_id} (unavailable)")
+
+ if user_input is not None:
+ fields, errors = _parse_immich_select(
+ user_input, self._albums, self._people
+ )
+ if not errors:
+ new_data = {
+ **entry.data,
+ **fields,
+ CONF_IMMICH_URL: self._url,
+ CONF_IMMICH_API_KEY: self._key,
+ }
+ if not new_data[CONF_IMMICH_FILTER]:
+ new_data.pop(CONF_IMMICH_FILTER)
+ try:
+ if _immich_source_changed(entry.data, new_data):
+ await _async_clear_item_cache(self.hass, entry.entry_id)
+ except Exception as err:
+ _LOGGER.warning(
+ "Could not clear Immich source cache for %s (%s)",
+ entry.entry_id, type(err).__name__,
+ )
+ errors["base"] = "immich_cache_clear_failed"
+ else:
+ options = {
+ **entry.options,
+ CONF_REVERSE_GEOCODE: user_input.get(
+ CONF_REVERSE_GEOCODE,
+ entry.options.get(CONF_REVERSE_GEOCODE, DEFAULT_REVERSE_GEOCODE),
+ ),
+ }
+ self.hass.config_entries.async_update_entry(
+ entry, data=new_data, title=fields[CONF_ALBUM_NAME], options=options
+ )
+ return self.async_create_entry(title="", data=options)
+
+ defaults = {
+ CONF_ALBUM_NAME: entry.data.get(CONF_ALBUM_NAME) or entry.title,
+ "albums": current["albums"],
+ "people": current["people"],
+ "favorites": current["favorites"],
+ CONF_IMMICH_IMAGE_SIZE: entry.data.get(
+ CONF_IMMICH_IMAGE_SIZE, DEFAULT_IMMICH_IMAGE_SIZE
+ ),
+ }
+ if entry.data.get(CONF_IMMICH_FILTER):
+ defaults[CONF_IMMICH_FILTER] = entry.data[CONF_IMMICH_FILTER]
+ schema = _immich_select_schema(self._albums, self._people, defaults).extend({
+ vol.Required(CONF_REVERSE_GEOCODE, default=bool(entry.options.get(
+ CONF_REVERSE_GEOCODE, DEFAULT_REVERSE_GEOCODE,
+ ))): bool,
+ })
+ return self.async_show_form(
+ step_id="immich_select",
+ data_schema=schema,
+ errors=errors,
+ )
+
+
+def _immich_source_changed(old: dict[str, Any], new: dict[str, Any]) -> bool:
+ """True when the set of photos an Immich entry shows may have changed."""
+ keys = (
+ CONF_IMMICH_URL,
+ CONF_IMMICH_API_KEY,
+ CONF_IMMICH_SELECTION_TYPE,
+ CONF_IMMICH_SELECTION_ID,
+ CONF_IMMICH_FILTER,
+ CONF_IMMICH_IMAGE_SIZE,
+ )
+ return any(old.get(key) != new.get(key) for key in keys)
+
+
+async def _async_clear_item_cache(hass: Any, entry_id: str) -> None:
+ """Drop the persisted item list so a new source never shows old photos.
+
+ The coordinator serves this cache when a refresh fails or comes back
+ empty; after a source change that would resurrect the previous album.
+ Uses the same storage key as ``AlbumCoordinator._items_cache_store``.
+ """
+ from homeassistant.helpers.storage import Store
+
+ await Store(hass, 1, f"{DOMAIN}.{entry_id}.items").async_remove()
+
+
class _NoOptionsFlow(config_entries.OptionsFlow):
"""Fallback options flow for providers that expose nothing tunable."""
diff --git a/custom_components/album_slideshow/const.py b/custom_components/album_slideshow/const.py
index df331c01..2cf3b306 100644
--- a/custom_components/album_slideshow/const.py
+++ b/custom_components/album_slideshow/const.py
@@ -12,6 +12,15 @@ CONF_ALBUM_NAME = "album_name"
CONF_LOCAL_PATH = "local_path"
CONF_RECURSIVE = "recursive"
CONF_IMAGE_CACHE_MB = "image_cache_mb"
+CONF_GOOGLE_METADATA = "google_metadata"
+DEFAULT_GOOGLE_METADATA = True
+CONF_GOOGLE_LOCATION = "google_location"
+DEFAULT_GOOGLE_LOCATION = False
+DEFAULT_GOOGLE_REVERSE_GEOCODE = False
+CAMERA_METADATA_FIELDS = (
+ "camera_make", "camera_model", "focal_length_mm", "aperture_f_number",
+ "iso", "exposure_time_seconds",
+)
# Media Source provider: a ``media-source://...`` content id pointing at a
# folder-like node (e.g. an Immich people/album view, or local media). The
# coordinator browses it, collects the image children, and resolves each to
@@ -258,6 +267,9 @@ DATE_FILTER_OFF = "off"
DATE_FILTER_LAST_7 = "last_7_days"
DATE_FILTER_LAST_30 = "last_30_days"
DATE_FILTER_LAST_365 = "last_365_days"
+DATE_FILTER_CUSTOM = "custom_days"
+DEFAULT_CUSTOM_LOOKBACK_DAYS = 365
+MAX_CUSTOM_LOOKBACK_DAYS = 36500
DATE_FILTER_THIS_MONTH = "this_month"
DATE_FILTER_THIS_YEAR = "this_year"
DATE_FILTER_ON_THIS_DAY = "on_this_day"
@@ -267,6 +279,7 @@ DATE_FILTER_OPTIONS = [
DATE_FILTER_LAST_7,
DATE_FILTER_LAST_30,
DATE_FILTER_LAST_365,
+ DATE_FILTER_CUSTOM,
DATE_FILTER_THIS_MONTH,
DATE_FILTER_THIS_YEAR,
DATE_FILTER_ON_THIS_DAY,
@@ -293,6 +306,7 @@ DEFAULT_REFRESH_HOURS = 24
DEFAULT_FILL_MODE = FILL_BLUR
DEFAULT_ORIENTATION_MISMATCH_MODE = ORIENTATION_MISMATCH_PAIR
DEFAULT_ORDER_MODE = ORDER_RANDOM
+DEFAULT_SHUFFLE_AGE_BIAS = 0
DEFAULT_ASPECT_RATIO = "16:9"
DEFAULT_PAIR_DIVIDER_PX = 8
DEFAULT_PAIR_DIVIDER_COLOR = "#FFFFFF"
diff --git a/custom_components/album_slideshow/coordinator.py b/custom_components/album_slideshow/coordinator.py
index fd33e07f..edddff6e 100644
--- a/custom_components/album_slideshow/coordinator.py
+++ b/custom_components/album_slideshow/coordinator.py
@@ -6,11 +6,13 @@ from datetime import timedelta
from hashlib import sha256
import json
import logging
+import math
import os
from pathlib import Path
import re
from typing import Any
+import aiohttp
import async_timeout
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
@@ -22,6 +24,12 @@ from .const import (
PUBLICALBUM_ENDPOINT,
CONF_PROVIDER,
CONF_ALBUM_URL,
+ CONF_GOOGLE_METADATA,
+ DEFAULT_GOOGLE_METADATA,
+ CONF_GOOGLE_LOCATION,
+ DEFAULT_GOOGLE_LOCATION,
+ DEFAULT_GOOGLE_REVERSE_GEOCODE,
+ CAMERA_METADATA_FIELDS,
CONF_LOCAL_PATH,
CONF_MEDIA_CONTENT_ID,
CONF_RECURSIVE,
@@ -97,6 +105,7 @@ from .const import (
from .store import SlideshowStore
_LOGGER = logging.getLogger(__name__)
+_GOOGLE_METADATA_INTERVAL = 1.0
@dataclass
@@ -127,12 +136,20 @@ class MediaItem:
# Provider-specific source identifier (e.g. the Immich asset id) used by
# background enrichment to fetch per-item metadata.
source_id: str | None = None
+ # Detected faces as normalised [x1, y1, x2, y2, weight, selected] boxes (0..1 in
+ # displayed-image coordinates). Cover-mode cropping keeps as many whole
+ # faces as fit. None means no face data (non-Immich source, not scanned
+ # yet or the face lookup failed); an empty list means "no faces".
+ faces: list[list[float | bool]] | None = None
# True once the local-folder EXIF reader has visited this file.
# Prevents re-reading EXIF on every coordinator refresh and lets the
# background enrichment task skip already-processed files even after
# an HA restart (the flag round-trips through the items cache).
exif_scanned: bool = False
photo_id: str | None = None
+ face_scanned: bool = False
+ camera_metadata: dict[str, Any] | None = None
+ google_location_scanned: bool = False
def __post_init__(self) -> None:
if self.photo_id is None:
@@ -311,11 +328,11 @@ def _pick_timestamp_ms(d: dict[str, Any], *path: str) -> int | None:
if not isinstance(cur, dict):
return None
cur = cur.get(p)
- if cur is None:
+ if cur is None or isinstance(cur, bool):
return None
if isinstance(cur, int):
- # Heuristic: < 1e12 means seconds, otherwise milliseconds.
- return cur * 1000 if cur < 10**12 else cur
+ # Infer seconds only within the plausible 1800-2100 date range.
+ return cur * 1000 if -5_364_662_400 <= cur <= 4_102_444_800 else cur
if isinstance(cur, str):
try:
iso = cur.replace("Z", "+00:00")
@@ -451,6 +468,7 @@ _EXIF_GPS_LAT_REF = 1 # "N" / "S"
_EXIF_GPS_LAT = 2 # rational tuple
_EXIF_GPS_LON_REF = 3 # "E" / "W"
_EXIF_GPS_LON = 4 # rational tuple
+_HEIF_EXIF_RE = re.compile(rb"Exif\x00\x00(?:MM\x00\x2a|II\x2a\x00)")
# Nominatim (OpenStreetMap) is free but rate-limited to 1 request/second
# per IP and asks integrators to identify themselves with a descriptive
@@ -777,7 +795,7 @@ def _read_exif_from_image(img: Any, out: dict[str, Any]) -> None:
def _read_exif_from_bytes(
- data: bytes, mtime_fallback_ms: int | None
+ data: bytes, mtime_fallback_ms: int | None, *, strict: bool = False,
) -> dict[str, Any]:
"""Read EXIF metadata from already-downloaded image bytes.
@@ -802,11 +820,61 @@ def _read_exif_from_bytes(
with Image.open(io.BytesIO(data)) as img:
_read_exif_from_image(img, out)
except Exception as err:
+ if strict:
+ raise
_LOGGER.debug("EXIF: failed to read image bytes: %s", err)
return out
+def _read_gps_from_header(data: bytes) -> dict[str, float]:
+ """Read GPS from an original-image prefix; raise ``ValueError`` if it is too short to tell."""
+ if data[:2] == b"\xff\xd8":
+ payload = _jpeg_exif_segment(data)
+ elif data[4:8] == b"ftyp":
+ match = _HEIF_EXIF_RE.search(data)
+ if match is None:
+ raise ValueError("HEIF EXIF not found in header")
+ payload = data[match.start():]
+ else:
+ metadata = _read_exif_from_bytes(data, None, strict=True)
+ return {key: metadata[key] for key in ("latitude", "longitude") if key in metadata}
+ if payload is None:
+ return {}
+
+ from PIL import Image
+
+ try:
+ exif = Image.Exif()
+ exif.load(payload)
+ gps = exif.get_ifd(_EXIF_TAG_GPS_IFD)
+ except Exception:
+ return {}
+ lat = _gps_to_decimal(gps.get(_EXIF_GPS_LAT), gps.get(_EXIF_GPS_LAT_REF))
+ lon = _gps_to_decimal(gps.get(_EXIF_GPS_LON), gps.get(_EXIF_GPS_LON_REF))
+ return {} if lat is None or lon is None else {"latitude": lat, "longitude": lon}
+
+
+def _jpeg_exif_segment(data: bytes) -> bytes | None:
+ pos = 2
+ while pos + 4 <= len(data):
+ if data[pos] != 0xFF:
+ return None
+ marker = data[pos + 1]
+ if marker == 0xFF:
+ pos += 1
+ continue
+ if marker in (0xD9, 0xDA):
+ return None
+ end = pos + 2 + int.from_bytes(data[pos + 2:pos + 4], "big")
+ if marker == 0xE1 and data[pos + 4:pos + 10] == b"Exif\x00\x00":
+ if end > len(data):
+ raise ValueError("JPEG EXIF segment is truncated")
+ return data[pos + 4:end]
+ pos = end
+ raise ValueError("JPEG header ends before image data")
+
+
def _format_nominatim_location(payload: dict[str, Any]) -> str | None:
"""Turn a Nominatim reverse-geocode response into a short label.
@@ -988,8 +1056,12 @@ def _merge_prior_enrichment(
item.location = prev.location
if prev.description and not item.description:
item.description = prev.description
+ if prev.faces is not None and item.faces is None:
+ item.faces = prev.faces
if prev.exif_scanned:
item.exif_scanned = True
+ if prev.face_scanned and prev.faces is not None:
+ item.face_scanned = True
class AlbumCoordinator(DataUpdateCoordinator):
@@ -1008,6 +1080,13 @@ class AlbumCoordinator(DataUpdateCoordinator):
self.store = store
self.provider: str = entry.data.get(CONF_PROVIDER, PROVIDER_GOOGLE_SHARED)
+ self._immich_cache_source = None
+ if self.provider == PROVIDER_IMMICH:
+ source = [entry.data.get(key) for key in (
+ CONF_IMMICH_URL, CONF_IMMICH_API_KEY, CONF_IMMICH_SELECTION_TYPE,
+ CONF_IMMICH_SELECTION_ID, CONF_IMMICH_FILTER, CONF_IMMICH_IMAGE_SIZE,
+ )]
+ self._immich_cache_source = sha256(json.dumps(source).encode()).hexdigest()
self.album_url: str | None = entry.data.get(CONF_ALBUM_URL)
self.local_path: str | None = entry.data.get(CONF_LOCAL_PATH)
self.recursive: bool = bool(entry.data.get(CONF_RECURSIVE, True))
@@ -1106,7 +1185,29 @@ class AlbumCoordinator(DataUpdateCoordinator):
raise
items = data.get("items") or []
- if self.provider in ENRICHING_PROVIDERS and items:
+ self._apply_google_location_privacy(items)
+ if (self.google_metadata_enabled or self.google_location_enabled) and items:
+ prior = (self.data or {}).get("items", []) if isinstance(self.data, dict) else []
+ if not self._items_cache_loaded:
+ cached = await self._load_cached_items()
+ prior = (cached or {}).get("items", []) + prior
+ self._items_cache_loaded = True
+ by_id = {item.source_id: item for item in prior if item.source_id}
+ for item in items:
+ previous = by_id.get(item.source_id)
+ if previous is None:
+ continue
+ if self.google_metadata_enabled and isinstance(previous.camera_metadata, dict):
+ item.camera_metadata = dict(previous.camera_metadata)
+ item.description = previous.description
+ if self.google_location_enabled and previous.google_location_scanned:
+ item.latitude = previous.latitude
+ item.longitude = previous.longitude
+ item.location = previous.location
+ item.google_location_scanned = True
+ self._apply_google_location_privacy(items)
+ self._schedule_enrichment(data)
+ elif self.provider in ENRICHING_PROVIDERS and items:
# Carry forward EXIF/geocode metadata for items we've already
# scanned this session; new items get filled in by the
# background worker below.
@@ -1144,13 +1245,57 @@ class AlbumCoordinator(DataUpdateCoordinator):
finally:
self._enrichment_task = None
+ @property
+ def google_metadata_enabled(self) -> bool:
+ options = getattr(getattr(self, "entry", None), "options", None) or {}
+ return self.provider == PROVIDER_GOOGLE_SHARED and bool(
+ options.get(CONF_GOOGLE_METADATA, DEFAULT_GOOGLE_METADATA)
+ )
+
+ @property
+ def google_location_enabled(self) -> bool:
+ options = getattr(getattr(self, "entry", None), "options", None) or {}
+ return self.provider == PROVIDER_GOOGLE_SHARED and bool(
+ options.get(CONF_GOOGLE_LOCATION, DEFAULT_GOOGLE_LOCATION)
+ )
+
+ @property
+ def google_reverse_geocode_enabled(self) -> bool:
+ options = getattr(getattr(self, "entry", None), "options", None) or {}
+ return self.google_location_enabled and bool(
+ options.get(CONF_REVERSE_GEOCODE, DEFAULT_GOOGLE_REVERSE_GEOCODE)
+ )
+
+ def _apply_google_location_privacy(self, items: list[MediaItem]) -> None:
+ if getattr(self, "provider", None) != PROVIDER_GOOGLE_SHARED:
+ return
+ for item in items:
+ if not self.google_location_enabled:
+ item.latitude = None
+ item.longitude = None
+ item.location = None
+ item.google_location_scanned = False
+ elif not self.google_reverse_geocode_enabled:
+ item.location = None
+
+ def _needs_enrichment(self, item: MediaItem) -> bool:
+ if self.provider == PROVIDER_GOOGLE_SHARED:
+ return (
+ self.google_metadata_enabled and bool(item.source_id) and item.camera_metadata is None
+ ) or (self.google_location_enabled and not item.google_location_scanned)
+ if not item.exif_scanned:
+ return True
+ return self.provider == PROVIDER_IMMICH and not item.face_scanned
+
def _schedule_enrichment(self, data: dict[str, Any]) -> None:
"""Kick off the background EXIF + geocode worker if there's work."""
items: list[MediaItem] = data.get("items") or []
- unscanned = [it for it in items if not it.exif_scanned]
+ unscanned = [it for it in items if self._needs_enrichment(it)]
# Providers that decrypt/return GPS inline (Ente) have nothing to scan
# but still need the coordinates turned into a place label.
- needs_geocode = any(
+ needs_geocode = (
+ self.provider != PROVIDER_GOOGLE_SHARED or self.google_reverse_geocode_enabled
+ ) and any(
it.latitude is not None and it.longitude is not None and not it.location
for it in items
)
@@ -1174,7 +1319,8 @@ class AlbumCoordinator(DataUpdateCoordinator):
"geocode_done": 0,
}
self._enrichment_task = self.hass.async_create_background_task(
- self._enrich_items_background(data),
+ self._enrich_google_items_background(data) if self.provider == PROVIDER_GOOGLE_SHARED
+ else self._enrich_items_background(data),
name=f"album_slideshow_enrich_{self.entry.entry_id}",
)
@@ -1187,6 +1333,10 @@ class AlbumCoordinator(DataUpdateCoordinator):
if not isinstance(payload, dict):
return None
+ cached_source = payload.get("immich_source")
+ if cached_source is not None and cached_source != getattr(self, "_immich_cache_source", None):
+ return None
+
raw_items = payload.get("items")
if not isinstance(raw_items, list):
return None
@@ -1210,12 +1360,21 @@ class AlbumCoordinator(DataUpdateCoordinator):
location=raw.get("location"),
description=raw.get("description"),
source_id=raw.get("source_id"),
+ faces=raw.get("faces"),
exif_scanned=bool(raw.get("exif_scanned", False)),
photo_id=raw.get("photo_id"),
+ face_scanned=bool(raw.get("face_scanned", False))
+ and isinstance(raw.get("faces"), list),
+ camera_metadata={
+ key: value for key, value in raw["camera_metadata"].items()
+ if key in CAMERA_METADATA_FIELDS
+ } if isinstance(raw.get("camera_metadata"), dict) else None,
+ google_location_scanned=bool(raw.get("google_location_scanned", False)),
))
except Exception:
continue
+ self._apply_google_location_privacy(items)
return {
"title": payload.get("title"),
"items": items,
@@ -1223,6 +1382,7 @@ class AlbumCoordinator(DataUpdateCoordinator):
async def _save_cached_items(self, data: dict[str, Any]) -> None:
items = data.get("items") or []
+ self._apply_google_location_privacy(items)
# Local-folder URLs are absolute paths on the host; persisting them
# is fine but they don't survive a host reformat. Persist anyway,
# the URL check at load time will skip any stale entries.
@@ -1243,12 +1403,18 @@ class AlbumCoordinator(DataUpdateCoordinator):
"location": it.location,
"description": it.description,
"source_id": it.source_id,
+ "faces": it.faces,
"exif_scanned": it.exif_scanned,
"photo_id": it.photo_id,
+ "face_scanned": it.face_scanned,
+ "camera_metadata": it.camera_metadata,
+ "google_location_scanned": it.google_location_scanned,
}
for it in items
],
}
+ if source := getattr(self, "_immich_cache_source", None):
+ payload["immich_source"] = source
try:
await self._items_cache_store.async_save(payload)
except Exception as err: # pragma: no cover - storage layer
@@ -2168,7 +2334,7 @@ class AlbumCoordinator(DataUpdateCoordinator):
return None, {}
async def _enrich_immich_item(self, item: MediaItem) -> None:
- """Fetch one Immich asset's detail and fill location/description."""
+ """Fetch Immich metadata and the face boxes used for cropping."""
from . import immich as immich_api
url = self.entry.data.get(CONF_IMMICH_URL)
@@ -2177,23 +2343,164 @@ class AlbumCoordinator(DataUpdateCoordinator):
item.exif_scanned = True
return
client = immich_api.ImmichClient(self.hass, url, api_key)
- try:
- asset = await client.async_get_asset(item.source_id)
- except Exception as err:
- _LOGGER.debug("Immich: failed to fetch asset %s: %s", item.source_id, err)
- item.exif_scanned = True
+ person_ids = immich_api.selected_person_ids(
+ self.entry.data.get(CONF_IMMICH_SELECTION_TYPE),
+ self.entry.data.get(CONF_IMMICH_SELECTION_ID),
+ )
+
+ requests = {}
+ needs_faces = not item.face_scanned
+ if not item.exif_scanned or needs_faces:
+ requests["asset"] = client.async_get_asset(item.source_id)
+ if needs_faces:
+ requests["faces"] = client.async_get_faces(item.source_id)
+ results = await asyncio.gather(*requests.values(), return_exceptions=True)
+ asset = None
+
+ for kind, result in zip(requests, results):
+ if isinstance(result, asyncio.CancelledError):
+ raise result
+ if isinstance(result, Exception):
+ _LOGGER.debug(
+ "Immich: failed to fetch %s for asset %s: %s",
+ kind,
+ item.source_id,
+ result,
+ )
+ continue
+ if kind == "asset":
+ if not isinstance(result, dict):
+ continue
+ asset = result
+ info = immich_api.parse_asset_exif(result)
+ if "captured_at" in info:
+ item.captured_at = info["captured_at"]
+ if "latitude" in info and "longitude" in info:
+ item.latitude = info["latitude"]
+ item.longitude = info["longitude"]
+ if "location" in info:
+ item.location = info["location"]
+ if "description" in info:
+ item.description = info["description"]
+ item.exif_scanned = True
+ else:
+ if asset is None:
+ continue
+ edits = []
+ if asset.get("isEdited"):
+ try:
+ edits = await client.async_get_asset_edits(item.source_id)
+ if not edits:
+ continue
+ except asyncio.CancelledError:
+ raise
+ except Exception:
+ _LOGGER.debug("Immich: edit metadata unavailable for asset %s", item.source_id)
+ continue
+ try:
+ boxes = immich_api.parse_face_boxes(
+ result, person_ids, edits=edits,
+ original_size=immich_api.original_image_size(asset),
+ )
+ except (TypeError, ValueError):
+ _LOGGER.debug("Immich: unsupported face geometry for asset %s", item.source_id)
+ continue
+ item.faces = boxes
+ item.face_scanned = True
+
+ async def _enrich_google_items_background(self, data: dict[str, Any]) -> None:
+ """Cache optional Google metadata without delaying or failing the playlist."""
+ from . import google_scraper
+
+ jobs = []
+ for item in data.get("items", []):
+ if self.google_metadata_enabled and item.source_id and item.camera_metadata is None:
+ jobs.append((item, False))
+ if self.google_location_enabled and not item.google_location_scanned:
+ jobs.append((item, True))
+ if not jobs:
+ try:
+ if self.google_reverse_geocode_enabled:
+ await self._geocode_items_background(data)
+ finally:
+ self._enrich_progress["phase"] = "done"
return
- info = immich_api.parse_asset_exif(asset)
- if "captured_at" in info:
- item.captured_at = info["captured_at"]
- if "latitude" in info and "longitude" in info:
- item.latitude = info["latitude"]
- item.longitude = info["longitude"]
- if "location" in info:
- item.location = info["location"]
- if "description" in info:
- item.description = info["description"]
- item.exif_scanned = True
+ failures = 0
+ completed = 0
+ next_request = 0.0
+ loop = asyncio.get_running_loop()
+ try:
+ async with aiohttp.ClientSession(
+ cookie_jar=aiohttp.DummyCookieJar(), trust_env=False,
+ ) as session:
+ keys = None
+ for item, location_job in jobs:
+ delay = next_request - loop.time()
+ if delay > 0:
+ await asyncio.sleep(delay)
+ try:
+ if location_job:
+ header = await google_scraper.fetch_photo_location_header(session, item.url)
+ try:
+ metadata = await self.hass.async_add_executor_job(
+ _read_gps_from_header, header,
+ )
+ except Exception as err:
+ # A photo that cannot be parsed must not stop the scan for the rest.
+ _LOGGER.debug("Google photo GPS unreadable (%s)", type(err).__name__)
+ continue
+ latitude = metadata.get("latitude")
+ longitude = metadata.get("longitude")
+ if (
+ all(type(value) in (int, float) and math.isfinite(value)
+ for value in (latitude, longitude))
+ and -90 <= latitude <= 90 and -180 <= longitude <= 180
+ and (abs(latitude) > 1e-6 or abs(longitude) > 1e-6)
+ ):
+ item.latitude, item.longitude = latitude, longitude
+ else:
+ item.latitude = item.longitude = None
+ item.location = None
+ item.google_location_scanned = True
+ else:
+ if keys is None:
+ keys = await google_scraper.fetch_metadata_keys(session, self.album_url)
+ metadata = await google_scraper.fetch_photo_metadata(
+ session, keys, item.source_id,
+ )
+ item.description = metadata.pop("description", None)
+ item.camera_metadata = metadata
+ except asyncio.CancelledError:
+ raise
+ except Exception as err:
+ failures += 1
+ _LOGGER.debug(
+ "Google photo metadata unavailable (%s, status=%s)",
+ type(err).__name__, getattr(err, "status", None),
+ )
+ if failures >= 3 or getattr(err, "status", None) in (401, 403, 429):
+ break
+ else:
+ failures = 0
+ completed += 1
+ if not self._needs_enrichment(item):
+ self._enrich_progress["exif_done"] += 1
+ if completed == 1 or completed % 10 == 0:
+ await self._save_cached_items(data)
+ self.async_set_updated_data(data)
+ finally:
+ next_request = loop.time() + _GOOGLE_METADATA_INTERVAL
+ if self.google_reverse_geocode_enabled:
+ await self._geocode_items_background(data)
+ except asyncio.CancelledError:
+ raise
+ except Exception as err:
+ _LOGGER.debug("Google photo enrichment stopped (%s)", type(err).__name__)
+ finally:
+ self._enrich_progress["phase"] = "done"
+ await self._save_cached_items(data)
+ if completed:
+ self.async_set_updated_data(data)
async def _enrich_items_background(self, data: dict[str, Any]) -> None:
"""Read EXIF for unscanned local files, then reverse-geocode.
@@ -2213,7 +2520,7 @@ class AlbumCoordinator(DataUpdateCoordinator):
scanned_since_save = 0
try:
for idx, item in enumerate(items):
- if item.exif_scanned:
+ if not self._needs_enrichment(item):
# Fast path: yield occasionally so we don't starve
# the event loop when (re-)visiting a long list of
# already-processed items.
@@ -2318,6 +2625,8 @@ class AlbumCoordinator(DataUpdateCoordinator):
the GPS coordinates themselves. Successful labels are written
back into the items in-place and persisted via the items cache.
"""
+ if getattr(self, "provider", None) == PROVIDER_GOOGLE_SHARED and not self.google_reverse_geocode_enabled:
+ return
if not bool(
self.entry.options.get(CONF_REVERSE_GEOCODE, DEFAULT_REVERSE_GEOCODE)
if hasattr(self.entry, "options") and self.entry.options is not None
diff --git a/custom_components/album_slideshow/google_scraper.py b/custom_components/album_slideshow/google_scraper.py
index e635cf24..6e692b43 100644
--- a/custom_components/album_slideshow/google_scraper.py
+++ b/custom_components/album_slideshow/google_scraper.py
@@ -26,9 +26,10 @@ from __future__ import annotations
import json
import logging
+import math
import re
from typing import Any
-from urllib.parse import quote
+from urllib.parse import quote, urlsplit, urlunsplit
from .coordinator import MediaItem
@@ -61,6 +62,7 @@ _SIZE_SUFFIX_RE = re.compile(r"=[wh]\d+(?:-[a-z0-9]+)*$", re.IGNORECASE)
_VIDEO_DURATION_KEY = 76647426 # presence indicates a video; we skip those
_LIVEPHOTO_KEY = 146008172
+_LOCATION_HEADER_BYTES = 256 * 1024
class _AlbumKeys:
@@ -129,6 +131,146 @@ async def fetch_album(
return title, items, video_keys
+async def fetch_metadata_keys(session, share_url: str, *, timeout: float = 15.0):
+ """Read public share keys for optional enrichment, without changing pagination."""
+ async with session.get(
+ share_url, headers={"User-Agent": _BROWSER_UA}, timeout=timeout,
+ allow_redirects=True,
+ ) as response:
+ html = await _read_metadata_body(response, 4 * 1024 * 1024)
+ keys = _extract_keys(html)
+ if keys is None:
+ raise ValueError("Public Google album metadata keys unavailable")
+ return keys
+
+
+async def fetch_photo_location_header(
+ session, image_url: str, *, timeout: float = 15.0,
+) -> bytes:
+ """Read a bounded original-image prefix for explicitly enabled GPS extraction."""
+ parsed = urlsplit(image_url)
+ if (
+ parsed.scheme != "https"
+ or not (parsed.hostname or "").endswith(".googleusercontent.com")
+ or parsed.port not in (None, 443)
+ or parsed.username is not None
+ or parsed.password is not None
+ ):
+ raise ValueError("Unexpected Google image URL")
+ original = urlunsplit(parsed._replace(
+ path=_SIZE_SUFFIX_RE.sub("", parsed.path) + "=d", fragment="",
+ ))
+ async with session.get(
+ original, headers={"Range": f"bytes=0-{_LOCATION_HEADER_BYTES - 1}"},
+ timeout=timeout, allow_redirects=False,
+ ) as response:
+ response.raise_for_status()
+ if response.status not in (200, 206):
+ raise ValueError("Unexpected Google image response")
+ content_type = response.headers.get("Content-Type", "").split(";", 1)[0].lower()
+ if not content_type.startswith("image/") and content_type != "application/octet-stream":
+ raise ValueError("Google image response is not an image")
+ if response.status == 206 and not re.fullmatch(
+ r"bytes 0-\d+/(?:\d+|\*)", response.headers.get("Content-Range", ""),
+ ):
+ raise ValueError("Unexpected Google image byte range")
+ content = bytearray()
+ async for chunk in response.content.iter_chunked(32768):
+ content.extend(chunk[:_LOCATION_HEADER_BYTES - len(content)])
+ if len(content) >= _LOCATION_HEADER_BYTES:
+ break
+ return bytes(content)
+
+
+async def fetch_photo_metadata(
+ session, keys: _AlbumKeys, media_key: str, *, timeout: float = 15.0,
+) -> dict[str, Any]:
+ """Read camera metadata and description from Google's public photo endpoint."""
+ payload = [media_key, None, keys.auth_key, None, keys.album_key]
+ envelope = json.dumps([[["VrseUb", json.dumps(payload), None, "generic"]]])
+ endpoint = "https://photos.google.com/u/0/_/PhotosUi/data/batchexecute"
+ headers = {
+ "User-Agent": _BROWSER_UA,
+ "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
+ "Origin": "https://photos.google.com",
+ "Referer": f"https://photos.google.com/share/{keys.album_key}?key={keys.auth_key}",
+ }
+ async with session.post(
+ endpoint, params={"rpcids": "VrseUb", "source-path": f"/share/{keys.album_key}"},
+ headers=headers, data=f"f.req={quote(envelope)}", timeout=timeout,
+ allow_redirects=False,
+ ) as response:
+ body = await _read_metadata_body(response, 1024 * 1024)
+ for line in body.splitlines():
+ try:
+ entries = json.loads(line)
+ except ValueError:
+ continue
+ if not isinstance(entries, list):
+ continue
+ for entry in entries:
+ if (
+ isinstance(entry, list) and len(entry) >= 3
+ and entry[:2] == ["wrb.fr", "VrseUb"] and isinstance(entry[2], str)
+ ):
+ detail = json.loads(entry[2])
+ if _metadata_value(detail, 0, 0) != media_key:
+ raise ValueError("Google photo metadata identity mismatch")
+ return parse_photo_metadata(detail)
+ raise ValueError("Google photo metadata response unavailable")
+
+
+async def _read_metadata_body(response, limit: int) -> str:
+ response.raise_for_status()
+ if response.status != 200:
+ raise ValueError("Unexpected Google metadata response")
+ chunks = []
+ length = 0
+ async for chunk in response.content.iter_chunked(65536):
+ length += len(chunk)
+ if length > limit:
+ raise ValueError("Google metadata response exceeds size limit")
+ chunks.append(chunk)
+ return b"".join(chunks).decode("utf-8")
+
+
+def _metadata_value(value: Any, *indices: int) -> Any:
+ for index in indices:
+ if not isinstance(value, list) or index >= len(value):
+ return None
+ value = value[index]
+ return value
+
+
+def parse_photo_metadata(detail: Any) -> dict[str, Any]:
+ """Extract the camera and description fields verified in public responses."""
+ photo = _metadata_value(detail, 0)
+ if not isinstance(photo, list):
+ raise ValueError("Invalid Google photo metadata")
+ camera = _metadata_value(detail, 0, 1, 8, 4)
+ result: dict[str, Any] = {}
+ for field, index in (("camera_make", 0), ("camera_model", 1)):
+ value = _metadata_value(camera, index)
+ if isinstance(value, str) and value.strip():
+ result[field] = value.strip()[:128]
+ for field, index in (
+ ("focal_length_mm", 3), ("aperture_f_number", 4),
+ ("iso", 5), ("exposure_time_seconds", 6),
+ ):
+ value = _metadata_value(camera, index)
+ if type(value) in (int, float) and math.isfinite(value) and value > 0:
+ if field != "iso" or float(value).is_integer():
+ result[field] = int(value) if field == "iso" else float(value)
+ for section in photo:
+ if not isinstance(section, dict):
+ continue
+ description = _metadata_value(section.get("396644657", section.get(396644657)), 0)
+ if isinstance(description, str) and description.strip():
+ result["description"] = description.strip()
+ break
+ return result
+
+
# -- Internals ---------------------------------------------------------------
async def _fetch_album_keys(
@@ -398,13 +540,13 @@ def _parse_album_item(raw: Any) -> MediaItem | None:
)
-# Plausible epoch-ms range: 2000-01-01 to 2100-01-01.
-_MIN_TS_MS = 946_684_800_000
+# Plausible epoch-ms range: 1800-01-01 to 2100-01-01.
+_MIN_TS_MS = -5_364_662_400_000
_MAX_TS_MS = 4_102_444_800_000
def _looks_like_timestamp_ms(value: Any) -> bool:
- return isinstance(value, int) and _MIN_TS_MS <= value <= _MAX_TS_MS
+ return type(value) is int and _MIN_TS_MS <= value <= _MAX_TS_MS
# -- AF block parsing (for the initial 300 items embedded in the HTML) ------
diff --git a/custom_components/album_slideshow/image_processing.py b/custom_components/album_slideshow/image_processing.py
index 81be9bdc..097c4621 100644
--- a/custom_components/album_slideshow/image_processing.py
+++ b/custom_components/album_slideshow/image_processing.py
@@ -2,8 +2,10 @@ from __future__ import annotations
import io
import logging
+from dataclasses import dataclass
+from typing import NamedTuple
-from PIL import Image, ImageColor, ImageFilter, ImageOps
+from PIL import Image, ImageColor, ImageDraw, ImageFilter, ImageFont, ImageOps
from .coordinator import MediaItem
@@ -14,6 +16,42 @@ FILL_COVER = "cover"
FILL_CONTAIN = "contain"
FILL_BLUR = "blur"
+class FaceBox(NamedTuple):
+ left: float
+ top: float
+ right: float
+ bottom: float
+ weight: float
+ selected: bool = False
+
+
+@dataclass(frozen=True)
+class CropHints:
+ """Per-photo inputs for face-aware cropping and the debug overlay.
+
+ ``faces`` is None when no face data is known for the photo (not an
+ Immich source, or not scanned yet) and an empty tuple when the photo
+ was scanned and has no faces.
+ """
+
+ faces: tuple[FaceBox, ...] | None = None
+ debug: bool = False
+ name: str | None = None
+
+
+# Padding around a face box, as a fraction of the face's own size, so the
+# crop keeps the whole head rather than just the tight face box.
+_FACE_PAD_SIDE = 0.3
+_FACE_PAD_TOP = 0.6
+_FACE_PAD_BOTTOM = 0.3
+# A face that is cut by the crop edge counts this much worse than one that is
+# left out entirely: half a face looks like a mistake, a missing face doesn't.
+_PARTIAL_PENALTY = 1.5
+
+FACE_KEPT = "kept"
+FACE_CUT = "cut"
+FACE_DROPPED = "dropped"
+
# Absolute pixel ceiling. A 20000x20000 JPEG decodes to ~1.2 GB of RGB; Pillow
# raises DecompressionBombError above MAX_IMAGE_PIXELS. We set this high enough
# that 4K+ sources still decode, but reject anything absurd to protect
@@ -120,13 +158,20 @@ def resolve_output_size(
return (width, height)
-def render_image(img: Image.Image, fill_mode: str, width: int, height: int) -> Image.Image:
+def render_image(
+ img: Image.Image,
+ fill_mode: str,
+ width: int,
+ height: int,
+ hints: CropHints | None = None,
+) -> Image.Image:
"""Render img into a (width x height) canvas using the given fill mode."""
+ hints = hints or CropHints()
if fill_mode == FILL_CONTAIN:
- return _resize_contain(img, width, height)
+ return _resize_contain(img, width, height, hints=hints)
if fill_mode == FILL_BLUR:
- return _blur_fill(img, width, height)
- return _resize_cover(img, width, height)
+ return _blur_fill(img, width, height, hints=hints)
+ return _resize_cover(img, width, height, hints)
def pair_images(
@@ -139,6 +184,8 @@ def pair_images(
divider: int,
divider_fill: tuple[int, int, int] | tuple[int, int, int, int],
transparent_divider: bool,
+ hints1: CropHints | None = None,
+ hints2: CropHints | None = None,
) -> Image.Image:
canvas_mode = "RGBA" if transparent_divider else "RGB"
canvas = Image.new(canvas_mode, (target_w, target_h), divider_fill)
@@ -146,8 +193,8 @@ def pair_images(
if portrait_canvas:
top_h = max(1, (target_h - divider) // 2)
bottom_h = max(1, target_h - divider - top_h)
- top_img = render_image(img1, fill_mode, target_w, top_h)
- bottom_img = render_image(img2, fill_mode, target_w, bottom_h)
+ top_img = render_image(img1, fill_mode, target_w, top_h, hints1)
+ bottom_img = render_image(img2, fill_mode, target_w, bottom_h, hints2)
canvas.paste(top_img.convert(canvas_mode), (0, 0))
canvas.paste(bottom_img.convert(canvas_mode), (0, top_h + divider))
safe_close(top_img)
@@ -156,8 +203,8 @@ def pair_images(
left_w = max(1, (target_w - divider) // 2)
right_w = max(1, target_w - divider - left_w)
- left_img = render_image(img1, fill_mode, left_w, target_h)
- right_img = render_image(img2, fill_mode, right_w, target_h)
+ left_img = render_image(img1, fill_mode, left_w, target_h, hints1)
+ right_img = render_image(img2, fill_mode, right_w, target_h, hints2)
canvas.paste(left_img.convert(canvas_mode), (0, 0))
canvas.paste(right_img.convert(canvas_mode), (left_w + divider, 0))
safe_close(left_img)
@@ -252,7 +299,131 @@ def _parse_aspect_ratio(ratio: str) -> tuple[int, int]:
return (16, 9)
-def _resize_cover(img: Image.Image, target_w: int, target_h: int) -> Image.Image:
+def _padded_face(face: FaceBox) -> tuple[float, float, float, float]:
+ x1, y1, x2, y2 = face[:4]
+ fw, fh = x2 - x1, y2 - y1
+ return (
+ max(0.0, x1 - fw * _FACE_PAD_SIDE),
+ max(0.0, y1 - fh * _FACE_PAD_TOP),
+ min(1.0, x2 + fw * _FACE_PAD_SIDE),
+ min(1.0, y2 + fh * _FACE_PAD_BOTTOM),
+ )
+
+
+def _span_status(a: float, b: float, offset: float, window: float) -> str:
+ # One pixel of slack absorbs rounding when the image is scaled to fit
+ # an axis exactly.
+ if a >= offset - 1 and b <= offset + window + 1:
+ return FACE_KEPT
+ if b <= offset or a >= offset + window:
+ return FACE_DROPPED
+ return FACE_CUT
+
+
+def choose_crop_offset(
+ spans: list[tuple[float, float, float]],
+ src_len: float,
+ window: float,
+ *,
+ selected: list[bool] | None = None,
+ padded_spans: list[tuple[float, float]] | None = None,
+) -> float:
+ """Pick where a crop window of ``window`` px starts along one axis.
+
+ ``spans`` are unpadded ``(start, end, weight)`` face intervals. Selected
+ people rank ahead of all bystanders. Keep whole faces where possible,
+ retain visible face area otherwise, and use padding as a preference.
+ """
+ max_offset = max(0.0, src_len - window)
+ centred = max_offset / 2
+ if max_offset <= 0 or not spans:
+ return centred
+
+ def clamp(value: float) -> float:
+ return max(0.0, min(max_offset, value))
+
+ priorities = selected if selected is not None else [False] * len(spans)
+ padding = padded_spans if padded_spans is not None else [span[:2] for span in spans]
+
+ def visible_fraction(start: float, end: float, offset: float) -> float:
+ overlap = max(0.0, min(end, offset + window) - max(start, offset))
+ return overlap / (end - start)
+
+ def score(offset: float) -> tuple[float, ...]:
+ tiers = []
+ for priority in (True, False):
+ kept_weight = cut_weight = visible_weight = 0.0
+ for (start, end, weight), is_selected in zip(spans, priorities):
+ if is_selected != priority:
+ continue
+ state = _span_status(start, end, offset, window)
+ if state == FACE_KEPT:
+ kept_weight += weight
+ elif state == FACE_CUT:
+ cut_weight += weight
+ visible_weight += weight * visible_fraction(start, end, offset)
+ tiers.extend((
+ kept_weight,
+ -_PARTIAL_PENALTY * cut_weight if kept_weight else visible_weight,
+ ))
+ tiers.append(sum(
+ span[2] * visible_fraction(start, end, offset)
+ for span, (start, end) in zip(spans, padding)
+ ))
+ return tuple(round(value, 12) for value in tiers)
+
+ candidates = {0.0, centred, max_offset}
+ for start, end in [span[:2] for span in spans] + padding:
+ for offset in (start, end - window, end, start - window, (start + end - window) / 2):
+ candidates.add(clamp(offset))
+ best = max(candidates, key=lambda offset: (score(offset), -abs(offset - centred), -offset))
+
+ kept = [
+ index for index, (start, end, _weight) in enumerate(spans)
+ if _span_status(start, end, best, window) == FACE_KEPT
+ ]
+ if not kept:
+ return best
+ group_start = min(padding[index][0] for index in kept)
+ group_end = max(padding[index][1] for index in kept)
+ if group_end - group_start > window:
+ group_start = min(spans[index][0] for index in kept)
+ group_end = max(spans[index][1] for index in kept)
+ target = clamp((group_start + group_end - window) / 2)
+ candidates.add(target)
+ return max(candidates, key=lambda offset: (score(offset), -abs(offset - target), -offset))
+
+
+def _face_statuses(
+ faces: tuple[FaceBox, ...],
+ new_w: int,
+ new_h: int,
+ left: int,
+ top: int,
+ target_w: int,
+ target_h: int,
+) -> list[str]:
+ statuses = []
+ for face in faces:
+ px1, py1, px2, py2 = face[:4]
+ x = _span_status(px1 * new_w, px2 * new_w, left, target_w)
+ y = _span_status(py1 * new_h, py2 * new_h, top, target_h)
+ if FACE_DROPPED in (x, y):
+ statuses.append(FACE_DROPPED)
+ elif FACE_CUT in (x, y):
+ statuses.append(FACE_CUT)
+ else:
+ statuses.append(FACE_KEPT)
+ return statuses
+
+
+def _resize_cover(
+ img: Image.Image,
+ target_w: int,
+ target_h: int,
+ hints: CropHints | None = None,
+) -> Image.Image:
+ hints = hints or CropHints()
src_w, src_h = img.size
if src_w <= 0 or src_h <= 0:
return img.resize((target_w, target_h))
@@ -260,15 +431,137 @@ def _resize_cover(img: Image.Image, target_w: int, target_h: int) -> Image.Image
new_w = max(1, int(round(src_w * scale)))
new_h = max(1, int(round(src_h * scale)))
resized = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
- left = max(0, int(round((new_w - target_w) / 2)))
- top = max(0, int(round((new_h - target_h) / 2)))
+
+ faces = tuple(FaceBox(*face) for face in hints.faces or ())
+ padded = [_padded_face(face) for face in faces]
+ left = choose_crop_offset(
+ [(face.left * new_w, face.right * new_w, face.weight) for face in faces],
+ new_w,
+ target_w,
+ selected=[face.selected for face in faces],
+ padded_spans=[(box[0] * new_w, box[2] * new_w) for box in padded],
+ )
+ top = choose_crop_offset(
+ [(face.top * new_h, face.bottom * new_h, face.weight) for face in faces],
+ new_h,
+ target_h,
+ selected=[face.selected for face in faces],
+ padded_spans=[(box[1] * new_h, box[3] * new_h) for box in padded],
+ )
+ left = max(0, min(max(0, new_w - target_w), int(round(left))))
+ top = max(0, min(max(0, new_h - target_h), int(round(top))))
+
+ statuses = _face_statuses(faces, new_w, new_h, left, top, target_w, target_h)
+ summary = _face_summary(hints.faces, statuses)
+ if faces:
+ _LOGGER.debug("Crop %s: %s", hints.name or "photo", summary)
+ if hints.debug:
+ _draw_debug_marks(resized, faces, statuses)
+
cropped = resized.crop((left, top, left + target_w, top + target_h))
if cropped is not resized:
safe_close(resized)
+ if hints.debug:
+ _draw_offscreen_centre(cropped, new_w / 2 - left, new_h / 2 - top)
+ _draw_debug_label(cropped, summary)
return cropped
-def _resize_contain(img: Image.Image, target_w: int, target_h: int, bg=(0, 0, 0)) -> Image.Image:
+def _face_summary(faces: tuple[FaceBox, ...] | None, statuses: list[str]) -> str:
+ if faces is None:
+ return "no face data"
+ return (
+ f"faces {len(statuses)} · kept {statuses.count(FACE_KEPT)} · "
+ f"cut {statuses.count(FACE_CUT)} · dropped {statuses.count(FACE_DROPPED)}"
+ )
+
+
+_DEBUG_COLORS = {
+ FACE_KEPT: (0, 220, 0),
+ FACE_CUT: (255, 40, 40),
+ FACE_DROPPED: (160, 160, 160),
+}
+_CROSSHAIR_COLOR = (255, 220, 0)
+
+
+def _draw_debug_marks(
+ img: Image.Image, faces: tuple[FaceBox, ...], statuses: list[str]
+) -> None:
+ """Draw face boxes and a crosshair on the photo's own centre.
+
+ Drawn before cropping, so the marks get cut exactly like the photo: a
+ crosshair that is off-centre or missing shows how much was cropped away.
+ """
+ w, h = img.size
+ draw = ImageDraw.Draw(img)
+ line = max(2, round(min(w, h) / 200))
+ for face, status in zip(faces, statuses):
+ color = _DEBUG_COLORS[status]
+ x1, y1, x2, y2 = face[:4]
+ draw.rectangle((x1 * w, y1 * h, x2 * w, y2 * h), outline=color, width=line)
+ px1, py1, px2, py2 = _padded_face(face)
+ draw.rectangle(
+ (px1 * w, py1 * h, px2 * w, py2 * h),
+ outline=color,
+ width=max(1, line // 2),
+ )
+ cx, cy = w / 2, h / 2
+ arm = max(12, round(min(w, h) / 12))
+ for width, color in ((line + 2, (0, 0, 0)), (line, _CROSSHAIR_COLOR)):
+ draw.line((cx - arm, cy, cx + arm, cy), fill=color, width=width)
+ draw.line((cx, cy - arm, cx, cy + arm), fill=color, width=width)
+ radius = arm / 3
+ draw.ellipse(
+ (cx - radius, cy - radius, cx + radius, cy + radius),
+ outline=_CROSSHAIR_COLOR,
+ width=line,
+ )
+
+
+def _draw_offscreen_centre(img: Image.Image, cx: float, cy: float) -> None:
+ """When the photo's centre was cropped away, point at it from the edge."""
+ w, h = img.size
+ if 0 <= cx <= w and 0 <= cy <= h:
+ return
+ size = max(10, round(min(w, h) / 20))
+ x = max(size, min(w - size, cx))
+ y = max(size, min(h - size, cy))
+ if cx < 0:
+ points = [(0, y), (size, y - size), (size, y + size)]
+ elif cx > w:
+ points = [(w, y), (w - size, y - size), (w - size, y + size)]
+ elif cy < 0:
+ points = [(x, 0), (x - size, size), (x + size, size)]
+ else:
+ points = [(x, h), (x - size, h - size), (x + size, h - size)]
+ ImageDraw.Draw(img).polygon(points, fill=_CROSSHAIR_COLOR, outline=(0, 0, 0))
+
+
+def _debug_font(size: int):
+ try:
+ return ImageFont.load_default(size=size)
+ except TypeError: # Pillow < 10.1 has a fixed-size default font
+ return ImageFont.load_default()
+
+
+def _draw_debug_label(img: Image.Image, text: str) -> None:
+ w, h = img.size
+ draw = ImageDraw.Draw(img)
+ size = max(12, round(min(w, h) / 30))
+ font = _debug_font(size)
+ pad = max(4, size // 3)
+ x1, y1, x2, y2 = draw.textbbox((pad, pad), text, font=font)
+ draw.rectangle((x1 - pad, y1 - pad, x2 + pad, y2 + pad), fill=(0, 0, 0))
+ draw.text((pad, pad), text, fill=(255, 255, 255), font=font)
+
+
+def _resize_contain(
+ img: Image.Image,
+ target_w: int,
+ target_h: int,
+ bg=(0, 0, 0),
+ hints: CropHints | None = None,
+) -> Image.Image:
src_w, src_h = img.size
if src_w <= 0 or src_h <= 0:
return img.resize((target_w, target_h))
@@ -276,6 +569,7 @@ def _resize_contain(img: Image.Image, target_w: int, target_h: int, bg=(0, 0, 0)
new_w = max(1, int(src_w * scale))
new_h = max(1, int(src_h * scale))
resized = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
+ _debug_uncropped(resized, hints)
canvas = Image.new("RGB", (target_w, target_h), bg)
rgb_resized = resized if resized.mode == "RGB" else resized.convert("RGB")
canvas.paste(rgb_resized, ((target_w - new_w) // 2, (target_h - new_h) // 2))
@@ -285,7 +579,22 @@ def _resize_contain(img: Image.Image, target_w: int, target_h: int, bg=(0, 0, 0)
return canvas
-def _blur_fill(img: Image.Image, target_w: int, target_h: int) -> Image.Image:
+def _debug_uncropped(img: Image.Image, hints: CropHints | None) -> None:
+ """Debug marks for fill modes that never crop: every face is kept."""
+ if hints is None or not hints.debug:
+ return
+ faces = hints.faces or ()
+ statuses = [FACE_KEPT] * len(faces)
+ _draw_debug_marks(img, faces, statuses)
+ _draw_debug_label(img, _face_summary(hints.faces, statuses))
+
+
+def _blur_fill(
+ img: Image.Image,
+ target_w: int,
+ target_h: int,
+ hints: CropHints | None = None,
+) -> Image.Image:
bg = _resize_cover(img, target_w, target_h).filter(ImageFilter.GaussianBlur(radius=24))
src_w, src_h = img.size
if src_w <= 0 or src_h <= 0:
@@ -294,10 +603,10 @@ def _blur_fill(img: Image.Image, target_w: int, target_h: int) -> Image.Image:
new_w = max(1, int(src_w * scale))
new_h = max(1, int(src_h * scale))
fg = img.resize((new_w, new_h), Image.Resampling.LANCZOS)
+ _debug_uncropped(fg, hints)
rgb_fg = fg if fg.mode == "RGB" else fg.convert("RGB")
bg.paste(rgb_fg, ((target_w - new_w) // 2, (target_h - new_h) // 2))
if rgb_fg is not fg:
safe_close(rgb_fg)
safe_close(fg)
return bg
-
diff --git a/custom_components/album_slideshow/immich.py b/custom_components/album_slideshow/immich.py
index 64ab3b0d..fe0072d2 100644
--- a/custom_components/album_slideshow/immich.py
+++ b/custom_components/album_slideshow/immich.py
@@ -14,12 +14,15 @@ API shape (Immich v1.13x / v3, ``/api`` prefix, ``x-api-key`` header):
``originalFileName`` but NOT ``exifInfo``.
- ``GET /api/assets/{id}`` -> full asset incl ``exifInfo`` (lat/long, city,
country, description) - used to enrich location/description per asset.
+- ``GET /api/faces?id={id}`` -> recognised faces and bounding boxes - used to
+ keep faces whole in cover-mode crops.
- Image bytes: ``/api/assets/{id}/thumbnail?size=preview|fullsize`` or
``/api/assets/{id}/original`` (all require the ``x-api-key`` header).
"""
from __future__ import annotations
import json
+import math
from datetime import datetime, timezone
from typing import Any
@@ -241,6 +244,198 @@ def parse_asset_exif(asset: Any) -> dict[str, Any]:
return out
+def selected_person_ids(
+ selection_type: str | None, selection_id: str | None
+) -> set[str]:
+ """Return the people explicitly selected for an Immich source.
+
+ Current entries use a composite JSON selection, while older entries can
+ still carry the legacy ``person``/``people`` shapes. Album-only, favorite,
+ random and custom-search sources intentionally return an empty set: there
+ is no user-selected face to prioritise for those sources.
+ """
+ if selection_type == "person":
+ return {selection_id} if selection_id else set()
+ if selection_type == "people":
+ return {person_id for person_id in (selection_id or "").split(",") if person_id}
+ if selection_type == "composite":
+ return set(parse_composite_selection(selection_id)["people"])
+ return set()
+
+
+def _normalised_face_box(
+ face: Any,
+ edits: list[dict[str, Any]] | None = None,
+ original_size: tuple[float, float] | None = None,
+) -> tuple[float, float, float, float] | None:
+ """Return a face's bounding box normalised to 0..1, or None if invalid."""
+ if not isinstance(face, dict):
+ return None
+ width = face.get("imageWidth")
+ height = face.get("imageHeight")
+ coords = (
+ face.get("boundingBoxX1"),
+ face.get("boundingBoxY1"),
+ face.get("boundingBoxX2"),
+ face.get("boundingBoxY2"),
+ )
+ if (
+ any(isinstance(value, bool) or not isinstance(value, (int, float))
+ or not math.isfinite(value) for value in (width, height, *coords))
+ or width <= 0
+ or height <= 0
+ ):
+ return None
+ x1, y1, x2, y2 = coords
+ if x2 <= x1 or y2 <= y1:
+ return None
+ box = _original_face_box(
+ (x1 / width, y1 / height, x2 / width, y2 / height),
+ edits or [], original_size,
+ )
+ box = tuple(max(0.0, min(1.0, value)) for value in box)
+ return box if box[2] > box[0] and box[3] > box[1] else None
+
+
+def parse_face_boxes(
+ faces: Any,
+ person_ids: set[str] | None = None,
+ *,
+ edits: list[dict[str, Any]] | None = None,
+ original_size: tuple[float, float] | None = None,
+) -> list[list[float | bool]]:
+ """Return normalised ``[x1, y1, x2, y2, area, selected]`` face boxes.
+
+ Immich reports face boxes in the coordinate space described by each
+ face's ``imageWidth``/``imageHeight``. Normalising each box makes it
+ independent of whether Album Slideshow downloads a preview, full-size
+ derivative or original. Faces Immich has not linked to a named person
+ are included. Explicit person selection is a separate priority from area.
+ """
+ if not isinstance(faces, list):
+ return []
+ boxes: list[list[float | bool]] = []
+ for face in faces:
+ box = _normalised_face_box(face, edits, original_size)
+ if box is None:
+ continue
+ x1, y1, x2, y2 = box
+ weight = (x2 - x1) * (y2 - y1)
+ person = face.get("person")
+ selected = bool(
+ person_ids and isinstance(person, dict) and person.get("id") in person_ids
+ )
+ boxes.append([x1, y1, x2, y2, weight, selected])
+ return boxes
+
+
+def _original_face_box(
+ box: tuple[float, float, float, float],
+ edits: list[dict[str, Any]],
+ original_size: tuple[float, float] | None,
+) -> tuple[float, float, float, float]:
+ points = [(box[0], box[1]), (box[2], box[3])]
+ crop = None
+ for edit in reversed(edits):
+ if not isinstance(edit, dict) or not isinstance(edit.get("parameters"), dict):
+ raise ValueError("Invalid Immich edit metadata")
+ params = edit["parameters"]
+ action = edit.get("action")
+ if action == "rotate":
+ angle = params.get("angle")
+ if angle == 90:
+ points = [(vertical, 1 - horizontal) for horizontal, vertical in points]
+ elif angle == 180:
+ points = [(1 - horizontal, 1 - vertical) for horizontal, vertical in points]
+ elif angle == 270:
+ points = [(1 - vertical, horizontal) for horizontal, vertical in points]
+ elif angle != 0:
+ raise ValueError("Unsupported Immich rotation")
+ elif action == "mirror":
+ axis = params.get("axis")
+ if axis == "horizontal":
+ points = [(horizontal, 1 - vertical) for horizontal, vertical in points]
+ elif axis == "vertical":
+ points = [(1 - horizontal, vertical) for horizontal, vertical in points]
+ else:
+ raise ValueError("Unsupported Immich mirror axis")
+ elif action == "crop" and crop is None:
+ crop = params
+ else:
+ raise ValueError("Unsupported Immich edit")
+ if crop is not None:
+ values = [crop.get(name) for name in ("x", "y", "width", "height")]
+ if original_size is None or any(
+ isinstance(value, bool) or not isinstance(value, (int, float))
+ or not math.isfinite(value) for value in values
+ ):
+ raise ValueError("Missing Immich crop dimensions")
+ crop_left, crop_top, crop_width, crop_height = values
+ original_width, original_height = original_size
+ if (
+ crop_left < 0 or crop_top < 0 or crop_width <= 0 or crop_height <= 0
+ or crop_left + crop_width > original_width
+ or crop_top + crop_height > original_height
+ ):
+ raise ValueError("Invalid Immich crop dimensions")
+ points = [
+ ((horizontal * crop_width + crop_left) / original_width,
+ (vertical * crop_height + crop_top) / original_height)
+ for horizontal, vertical in points
+ ]
+ return (
+ min(point[0] for point in points), min(point[1] for point in points),
+ max(point[0] for point in points), max(point[1] for point in points),
+ )
+
+
+def original_image_size(asset: Any) -> tuple[float, float] | None:
+ info = asset.get("exifInfo") if isinstance(asset, dict) else None
+ if not isinstance(info, dict):
+ return None
+ width, height = info.get("exifImageWidth"), info.get("exifImageHeight")
+ if any(
+ isinstance(value, bool) or not isinstance(value, (int, float))
+ or not math.isfinite(value) or value <= 0 for value in (width, height)
+ ):
+ return None
+ if str(info.get("orientation")) in {"5", "6", "7", "8", "-90", "90"}:
+ return (float(height), float(width))
+ return (float(width), float(height))
+
+
+def parse_face_focus(
+ faces: Any,
+ person_ids: set[str],
+ *,
+ edits: list[dict[str, Any]] | None = None,
+ original_size: tuple[float, float] | None = None,
+) -> tuple[float, float] | None:
+ """Return a normalised crop focus for the selected people in an asset.
+
+ Immich reports face boxes in the coordinate space described by each
+ face's ``imageWidth``/``imageHeight``. Normalising each box makes the
+ focus independent of resolution. Edited coordinates are mapped back to the
+ unedited image before clamping. When several selected people appear in the
+ same photo, focus on the centre of their combined region.
+ """
+ if not isinstance(faces, list) or not person_ids:
+ return None
+ selected_faces = [
+ face for face in faces
+ if isinstance(face, dict) and isinstance(face.get("person"), dict)
+ and face["person"].get("id") in person_ids
+ ]
+ boxes = parse_face_boxes(selected_faces, edits=edits, original_size=original_size)
+ if not boxes:
+ return None
+ left = min(box[0] for box in boxes)
+ top = min(box[1] for box in boxes)
+ right = max(box[2] for box in boxes)
+ bottom = max(box[3] for box in boxes)
+ return ((left + right) / 2, (top + bottom) / 2)
+
+
class ImmichClient:
"""Thin async wrapper over the Immich REST API."""
@@ -373,3 +568,15 @@ class ImmichClient:
async def async_get_asset(self, asset_id: str) -> dict[str, Any]:
return await self._get(f"/api/assets/{asset_id}")
+
+ async def async_get_faces(self, asset_id: str) -> list[dict[str, Any]]:
+ data = await self._get(f"/api/faces?id={asset_id}")
+ if not isinstance(data, list):
+ raise ValueError("Invalid Immich face response")
+ return data
+
+ async def async_get_asset_edits(self, asset_id: str) -> list[dict[str, Any]]:
+ data = await self._get(f"/api/assets/{asset_id}/edits")
+ if not isinstance(data, dict) or not isinstance(data.get("edits"), list):
+ raise ValueError("Invalid Immich edit response")
+ return data["edits"]
diff --git a/custom_components/album_slideshow/manifest.json b/custom_components/album_slideshow/manifest.json
index 91303dca..b6f78d50 100644
--- a/custom_components/album_slideshow/manifest.json
+++ b/custom_components/album_slideshow/manifest.json
@@ -7,6 +7,6 @@
"documentation": "https://github.com/eyalgal/album_slideshow",
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/eyalgal/album_slideshow/issues",
- "requirements": ["Pillow", "PyNaCl>=1.5.0"],
- "version": "1.11.0"
+ "requirements": ["PyNaCl>=1.5.0"],
+ "version": "1.13.0"
}
diff --git a/custom_components/album_slideshow/number.py b/custom_components/album_slideshow/number.py
index cdd245ef..14526732 100644
--- a/custom_components/album_slideshow/number.py
+++ b/custom_components/album_slideshow/number.py
@@ -6,7 +6,7 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.restore_state import RestoreEntity
-from .const import DOMAIN
+from .const import DOMAIN, MAX_CUSTOM_LOOKBACK_DAYS
from .coordinator import AlbumCoordinator
from .store import SlideshowStore
@@ -23,6 +23,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e
PairMinGapPercentNumber(entry, store),
NavigationBufferSizeNumber(entry, store),
ImageCacheMbNumber(entry, store),
+ CustomLookbackDaysNumber(entry, store),
+ ShuffleAgeBiasNumber(entry, store),
]
)
@@ -49,6 +51,66 @@ class _BaseNumber(NumberEntity, RestoreEntity):
}
+class CustomLookbackDaysNumber(_BaseNumber):
+ _attr_icon = "mdi:calendar-range"
+ _attr_native_min_value = 1
+ _attr_native_max_value = MAX_CUSTOM_LOOKBACK_DAYS
+ _attr_native_step = 1
+ _attr_native_unit_of_measurement = "d"
+
+ def __init__(self, entry: ConfigEntry, store: SlideshowStore) -> None:
+ super().__init__(entry, store)
+ self._attr_unique_id = f"{entry.entry_id}_custom_lookback_days"
+ self._attr_name = "Custom lookback days"
+
+ @property
+ def native_value(self):
+ return int(self.store.custom_lookback_days)
+
+ async def async_set_native_value(self, value: float) -> None:
+ self.store.custom_lookback_days = max(1, min(MAX_CUSTOM_LOOKBACK_DAYS, int(value)))
+ self.store.notify()
+
+ async def async_added_to_hass(self) -> None:
+ await super().async_added_to_hass()
+ old = await self.async_get_last_state()
+ if old and old.state not in (None, "unknown", "unavailable"):
+ try:
+ await self.async_set_native_value(float(old.state))
+ except (TypeError, ValueError, OverflowError):
+ return
+
+
+class ShuffleAgeBiasNumber(_BaseNumber):
+ _attr_icon = "mdi:shuffle-variant"
+ _attr_native_min_value = -100
+ _attr_native_max_value = 100
+ _attr_native_step = 1
+ _attr_mode = NumberMode.SLIDER
+
+ def __init__(self, entry: ConfigEntry, store: SlideshowStore) -> None:
+ super().__init__(entry, store)
+ self._attr_unique_id = f"{entry.entry_id}_shuffle_age_bias"
+ self._attr_name = "Shuffle age bias"
+
+ @property
+ def native_value(self):
+ return int(self.store.shuffle_age_bias)
+
+ async def async_set_native_value(self, value: float) -> None:
+ self.store.shuffle_age_bias = max(-100, min(100, int(value)))
+ self.store.notify()
+
+ async def async_added_to_hass(self) -> None:
+ await super().async_added_to_hass()
+ old = await self.async_get_last_state()
+ if old and old.state not in (None, "unknown", "unavailable"):
+ try:
+ await self.async_set_native_value(float(old.state))
+ except (TypeError, ValueError, OverflowError):
+ return
+
+
class SlideIntervalNumber(_BaseNumber):
_attr_icon = "mdi:timer-outline"
_attr_native_min_value = 3
diff --git a/custom_components/album_slideshow/playlist.py b/custom_components/album_slideshow/playlist.py
index 1eca176f..ba3d8866 100644
--- a/custom_components/album_slideshow/playlist.py
+++ b/custom_components/album_slideshow/playlist.py
@@ -7,9 +7,11 @@ implementation. Operates on ``MediaItem``-like objects that expose
from __future__ import annotations
from datetime import datetime, timedelta, timezone
+import math
from typing import Iterable, TypeVar
from .const import (
+ DATE_FILTER_CUSTOM,
DATE_FILTER_LAST_7,
DATE_FILTER_LAST_30,
DATE_FILTER_LAST_365,
@@ -17,7 +19,9 @@ from .const import (
DATE_FILTER_ON_THIS_DAY,
DATE_FILTER_THIS_MONTH,
DATE_FILTER_THIS_YEAR,
+ DEFAULT_CUSTOM_LOOKBACK_DAYS,
DEFAULT_MISSING_DATE_MODE,
+ MAX_CUSTOM_LOOKBACK_DAYS,
MISSING_DATE_EXCLUDE,
MISSING_DATE_USE_UPLOADED,
ORDER_ALBUM,
@@ -31,6 +35,39 @@ from .const import (
T = TypeVar("T")
+def age_weights(
+ items: list[T],
+ bias: float,
+ *,
+ missing_date: str = DEFAULT_MISSING_DATE_MODE,
+) -> list[float]:
+ """Return relative draw weights, from 1 to 10, favoring newer (+) or older (-)."""
+ if isinstance(bias, bool) or not isinstance(bias, (int, float)) or not math.isfinite(bias):
+ bias = 0
+ bias = max(-100, min(100, bias))
+ if not bias:
+ return [1.0] * len(items)
+ timestamps = []
+ for item in items:
+ timestamp = getattr(item, "captured_at", None)
+ if type(timestamp) is not int and missing_date == MISSING_DATE_USE_UPLOADED:
+ timestamp = getattr(item, "uploaded_at", None)
+ timestamps.append(timestamp if type(timestamp) is int else None)
+ dated = [timestamp for timestamp in timestamps if timestamp is not None]
+ if not dated or min(dated) == max(dated):
+ return [1.0] * len(items)
+ oldest, newest = min(dated), max(dated)
+ strength = 9 * abs(bias) / 100
+ weights = []
+ for timestamp in timestamps:
+ if timestamp is None:
+ weights.append(1.0)
+ continue
+ position = (timestamp - oldest) / (newest - oldest)
+ weights.append(1 + strength * (position if bias > 0 else 1 - position))
+ return weights
+
+
def order_items(items: list[T], order_mode: str) -> list[T]:
"""Return a new list ordered per ``order_mode``.
@@ -76,6 +113,7 @@ def filter_items(
*,
mode: str,
missing_date: str = DEFAULT_MISSING_DATE_MODE,
+ lookback_days: int = DEFAULT_CUSTOM_LOOKBACK_DAYS,
now: datetime | None = None,
) -> list[T]:
"""Filter items by date according to ``mode``.
@@ -97,7 +135,7 @@ def filter_items(
today_utc = (now or datetime.now(timezone.utc)).astimezone(timezone.utc)
- pred, strict = _build_predicate(mode, today_utc)
+ pred, strict = _build_predicate(mode, today_utc, lookback_days)
if pred is None:
return list(items)
@@ -130,8 +168,14 @@ def filter_items(
def _build_predicate(
mode: str,
today_utc: datetime,
+ lookback_days: int = DEFAULT_CUSTOM_LOOKBACK_DAYS,
):
"""Return (predicate, strict). ``strict`` drops items without timestamps."""
+ if mode == DATE_FILTER_CUSTOM:
+ days = lookback_days if type(lookback_days) is int else DEFAULT_CUSTOM_LOOKBACK_DAYS
+ days = max(1, min(MAX_CUSTOM_LOOKBACK_DAYS, days))
+ cutoff = int((today_utc - timedelta(days=days)).timestamp() * 1000)
+ return (lambda timestamp: timestamp >= cutoff), False
if mode == DATE_FILTER_LAST_7:
cutoff = int((today_utc - timedelta(days=7)).timestamp() * 1000)
return (lambda ts: ts >= cutoff), False
diff --git a/custom_components/album_slideshow/sensor.py b/custom_components/album_slideshow/sensor.py
index 7ff8d847..97fc217b 100644
--- a/custom_components/album_slideshow/sensor.py
+++ b/custom_components/album_slideshow/sensor.py
@@ -22,7 +22,11 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_e
CacheUsageSensor(entry, coordinator),
HiddenPhotoCountSensor(entry, coordinator),
]
- if coordinator.provider in ENRICHING_PROVIDERS:
+ if (
+ coordinator.provider in ENRICHING_PROVIDERS
+ or coordinator.google_metadata_enabled
+ or coordinator.google_location_enabled
+ ):
# Diagnostic surface for the background enrichment pass (per-photo
# metadata reads and/or reverse-geocode). Providers with nothing to
# enrich omit it to keep the device screen tidy.
diff --git a/custom_components/album_slideshow/store.py b/custom_components/album_slideshow/store.py
index 9180c8d4..682428dc 100644
--- a/custom_components/album_slideshow/store.py
+++ b/custom_components/album_slideshow/store.py
@@ -13,6 +13,7 @@ from .const import (
DEFAULT_FILL_MODE,
DEFAULT_ORIENTATION_MISMATCH_MODE,
DEFAULT_ORDER_MODE,
+ DEFAULT_SHUFFLE_AGE_BIAS,
DEFAULT_ASPECT_RATIO,
DEFAULT_PAIR_DIVIDER_PX,
DEFAULT_PAIR_DIVIDER_COLOR,
@@ -21,6 +22,7 @@ from .const import (
DEFAULT_NAVIGATION_BUFFER_SIZE,
DEFAULT_MAX_RESOLUTION,
DEFAULT_DATE_FILTER,
+ DEFAULT_CUSTOM_LOOKBACK_DAYS,
DEFAULT_MISSING_DATE_MODE,
)
@@ -35,6 +37,7 @@ class SlideshowStore:
fill_mode: str = DEFAULT_FILL_MODE
portrait_mode: str = DEFAULT_ORIENTATION_MISMATCH_MODE
order_mode: str = DEFAULT_ORDER_MODE
+ shuffle_age_bias: int = DEFAULT_SHUFFLE_AGE_BIAS
aspect_ratio: str = DEFAULT_ASPECT_RATIO
pair_divider_px: int = DEFAULT_PAIR_DIVIDER_PX
pair_divider_color: str = DEFAULT_PAIR_DIVIDER_COLOR
@@ -45,6 +48,7 @@ class SlideshowStore:
# Date filter mode (preset windows like this_year / on_this_day).
date_filter: str = DEFAULT_DATE_FILTER
+ custom_lookback_days: int = DEFAULT_CUSTOM_LOOKBACK_DAYS
# How the date filter treats photos with no EXIF capture date.
missing_date_mode: str = DEFAULT_MISSING_DATE_MODE
@@ -52,6 +56,9 @@ class SlideshowStore:
# Pause toggle - when True, the slideshow holds on the current frame.
paused: bool = False
+ # Draw face boxes, a centre crosshair and a crop summary on each slide.
+ face_debug: bool = False
+
# In-memory last rendered frame. Not user-configurable; used to re-serve
# the previous slide instantly across a camera reload.
last_frame: bytes | None = None
diff --git a/custom_components/album_slideshow/strings.json b/custom_components/album_slideshow/strings.json
index 4f7b1f61..1a2ff808 100644
--- a/custom_components/album_slideshow/strings.json
+++ b/custom_components/album_slideshow/strings.json
@@ -172,19 +172,55 @@
"nextcloud_cannot_connect": "Could not connect to Nextcloud. Check the URL, username, app password and folder path.",
"invalid_nextcloud_url": "That does not look like a Nextcloud Photos public album link.",
"nextcloud_public_cannot_connect": "Could not connect to that Nextcloud album. Check the link is still valid.",
- "invalid_ente_url": "That does not look like an Ente public album link. It should look like {example_url}, including the part after the #."
- ,"ente_cannot_connect": "Could not open that Ente album. The link may be expired, revoked, or password-protected."
+ "invalid_ente_url": "That does not look like an Ente public album link. It should look like {example_url}, including the part after the #.",
+ "ente_cannot_connect": "Could not open that Ente album. The link may be expired, revoked, or password-protected."
}
},
"options": {
"step": {
+ "google_metadata": {
+ "title": "Google Photos metadata and privacy",
+ "description": "Photo descriptions, camera details, and exposure metadata use Google's undocumented public endpoint without a Google login. Results are cached; unavailable metadata does not prevent the slideshow from loading.\n\nOriginal photo GPS is a separate opt-in, off by default. It reads up to 256 KB per photo. Google only includes GPS in shared originals when location sharing is turned on for the album; anyone with the album link can then see precise GPS. After changing the album's location sharing, turn this off and back on to rescan. Coordinates are cached in Home Assistant and exposed in camera attributes. Google-added or estimated locations are not included.\n\nPlace-name lookup is also off by default. It requires original GPS reading and sends coordinates to the public OpenStreetMap Nominatim service. Disabling original GPS hides coordinates and place names and stops both lookups; it does not erase previous history or backups.",
+ "data": {
+ "google_metadata": "Fetch photo metadata (experimental)",
+ "google_location": "Read original photo GPS (opt-in)",
+ "reverse_geocode": "Look up GPS place names via OpenStreetMap (opt-in)"
+ }
+ },
"init": {
"title": "Location & privacy options",
"description": "Reverse geocoding sends your photos' EXIF GPS coordinates to the public OpenStreetMap Nominatim service to look up a human-readable place name. Coordinates are rounded to ~100 m before lookup and cached on disk. Turn this off to keep coordinates entirely local; the latitude and longitude attributes still work either way.",
"data": {
"reverse_geocode": "Reverse-geocode EXIF GPS coordinates via OpenStreetMap"
}
+ },
+ "immich_select": {
+ "title": "Immich source",
+ "description": "Change which albums, people and favorites this slideshow shows. Saving reloads the slideshow; its entities, settings and hidden photos are kept.",
+ "data": {
+ "album_name": "Name",
+ "albums": "Albums",
+ "people": "People",
+ "favorites": "Include favorites",
+ "immich_filter": "Extra search filter (JSON, optional)",
+ "immich_image_size": "Image quality",
+ "reverse_geocode": "Look up EXIF GPS locations via OpenStreetMap"
+ }
+ },
+ "connection": {
+ "title": "Immich connection",
+ "description": "The stored Immich URL or API key no longer works. Update them to continue.",
+ "data": {
+ "immich_url": "Immich URL (e.g. http://192.168.1.10:2283)",
+ "immich_api_key": "API key"
+ }
}
+ },
+ "error": {
+ "immich_cache_clear_failed": "Could not clear the previous photo source cache. No source settings were changed. Please try again.",
+ "immich_cannot_connect": "Could not connect to Immich. Check the URL and API key.",
+ "immich_invalid_auth": "Immich rejected the API key. Check that it is valid and that its permissions include server.about, album.read and person.read.",
+ "immich_filter_invalid": "The filter must be a valid JSON object. See the README for examples."
}
}
}
diff --git a/custom_components/album_slideshow/switch.py b/custom_components/album_slideshow/switch.py
index c801c5df..072c9058 100644
--- a/custom_components/album_slideshow/switch.py
+++ b/custom_components/album_slideshow/switch.py
@@ -3,6 +3,7 @@ from __future__ import annotations
from homeassistant.components.switch import SwitchEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
+from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.restore_state import RestoreEntity
@@ -12,7 +13,7 @@ from .store import SlideshowStore
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback) -> None:
store: SlideshowStore = hass.data[DOMAIN][entry.entry_id]["store"]
- async_add_entities([PauseSwitch(entry, store)])
+ async_add_entities([PauseSwitch(entry, store), CropDebugSwitch(entry, store)])
class PauseSwitch(SwitchEntity, RestoreEntity):
@@ -53,3 +54,46 @@ class PauseSwitch(SwitchEntity, RestoreEntity):
if old is not None and old.state in ("on", "off"):
self.store.paused = old.state == "on"
self.store.notify()
+
+
+class CropDebugSwitch(SwitchEntity, RestoreEntity):
+ """Overlay face boxes, a centre crosshair and a crop summary on slides."""
+
+ _attr_has_entity_name = True
+ _attr_should_poll = False
+ _attr_icon = "mdi:face-recognition"
+ _attr_entity_category = EntityCategory.CONFIG
+
+ def __init__(self, entry: ConfigEntry, store: SlideshowStore) -> None:
+ self.entry = entry
+ self.store = store
+ self._attr_unique_id = f"{entry.entry_id}_crop_debug"
+ self._attr_name = "Crop debug overlay"
+
+ @property
+ def is_on(self) -> bool:
+ return bool(self.store.face_debug)
+
+ @property
+ def device_info(self):
+ return {
+ "identifiers": {(DOMAIN, self.entry.entry_id)},
+ "name": f"Album Slideshow {self.entry.title}",
+ "manufacturer": "Album Slideshow",
+ }
+
+ async def async_turn_on(self, **kwargs) -> None:
+ self.store.face_debug = True
+ self.store.notify()
+
+ async def async_turn_off(self, **kwargs) -> None:
+ self.store.face_debug = False
+ self.store.notify()
+
+ async def async_added_to_hass(self) -> None:
+ await super().async_added_to_hass()
+ self.store.add_listener(self.async_write_ha_state)
+ old = await self.async_get_last_state()
+ if old is not None and old.state in ("on", "off"):
+ self.store.face_debug = old.state == "on"
+ self.store.notify()
diff --git a/custom_components/album_slideshow/translations/en.json b/custom_components/album_slideshow/translations/en.json
index 4f7b1f61..1a2ff808 100644
--- a/custom_components/album_slideshow/translations/en.json
+++ b/custom_components/album_slideshow/translations/en.json
@@ -172,19 +172,55 @@
"nextcloud_cannot_connect": "Could not connect to Nextcloud. Check the URL, username, app password and folder path.",
"invalid_nextcloud_url": "That does not look like a Nextcloud Photos public album link.",
"nextcloud_public_cannot_connect": "Could not connect to that Nextcloud album. Check the link is still valid.",
- "invalid_ente_url": "That does not look like an Ente public album link. It should look like {example_url}, including the part after the #."
- ,"ente_cannot_connect": "Could not open that Ente album. The link may be expired, revoked, or password-protected."
+ "invalid_ente_url": "That does not look like an Ente public album link. It should look like {example_url}, including the part after the #.",
+ "ente_cannot_connect": "Could not open that Ente album. The link may be expired, revoked, or password-protected."
}
},
"options": {
"step": {
+ "google_metadata": {
+ "title": "Google Photos metadata and privacy",
+ "description": "Photo descriptions, camera details, and exposure metadata use Google's undocumented public endpoint without a Google login. Results are cached; unavailable metadata does not prevent the slideshow from loading.\n\nOriginal photo GPS is a separate opt-in, off by default. It reads up to 256 KB per photo. Google only includes GPS in shared originals when location sharing is turned on for the album; anyone with the album link can then see precise GPS. After changing the album's location sharing, turn this off and back on to rescan. Coordinates are cached in Home Assistant and exposed in camera attributes. Google-added or estimated locations are not included.\n\nPlace-name lookup is also off by default. It requires original GPS reading and sends coordinates to the public OpenStreetMap Nominatim service. Disabling original GPS hides coordinates and place names and stops both lookups; it does not erase previous history or backups.",
+ "data": {
+ "google_metadata": "Fetch photo metadata (experimental)",
+ "google_location": "Read original photo GPS (opt-in)",
+ "reverse_geocode": "Look up GPS place names via OpenStreetMap (opt-in)"
+ }
+ },
"init": {
"title": "Location & privacy options",
"description": "Reverse geocoding sends your photos' EXIF GPS coordinates to the public OpenStreetMap Nominatim service to look up a human-readable place name. Coordinates are rounded to ~100 m before lookup and cached on disk. Turn this off to keep coordinates entirely local; the latitude and longitude attributes still work either way.",
"data": {
"reverse_geocode": "Reverse-geocode EXIF GPS coordinates via OpenStreetMap"
}
+ },
+ "immich_select": {
+ "title": "Immich source",
+ "description": "Change which albums, people and favorites this slideshow shows. Saving reloads the slideshow; its entities, settings and hidden photos are kept.",
+ "data": {
+ "album_name": "Name",
+ "albums": "Albums",
+ "people": "People",
+ "favorites": "Include favorites",
+ "immich_filter": "Extra search filter (JSON, optional)",
+ "immich_image_size": "Image quality",
+ "reverse_geocode": "Look up EXIF GPS locations via OpenStreetMap"
+ }
+ },
+ "connection": {
+ "title": "Immich connection",
+ "description": "The stored Immich URL or API key no longer works. Update them to continue.",
+ "data": {
+ "immich_url": "Immich URL (e.g. http://192.168.1.10:2283)",
+ "immich_api_key": "API key"
+ }
}
+ },
+ "error": {
+ "immich_cache_clear_failed": "Could not clear the previous photo source cache. No source settings were changed. Please try again.",
+ "immich_cannot_connect": "Could not connect to Immich. Check the URL and API key.",
+ "immich_invalid_auth": "Immich rejected the API key. Check that it is valid and that its permissions include server.about, album.read and person.read.",
+ "immich_filter_invalid": "The filter must be a valid JSON object. See the README for examples."
}
}
}
diff --git a/custom_components/album_slideshow/www/album-slideshow-card.js b/custom_components/album_slideshow/www/album-slideshow-card.js
index c698c9b7..11b2d74a 100644
--- a/custom_components/album_slideshow/www/album-slideshow-card.js
+++ b/custom_components/album_slideshow/www/album-slideshow-card.js
@@ -26,7 +26,7 @@
* tap_action: none # none | more-info
*/
-const VERSION = "1.11.0";
+const VERSION = "1.13.0";
const ANIMATED_TRANSITIONS = [
"fade",
@@ -62,7 +62,12 @@ function normalizePhotoControls(value) {
// Caption overlay (date / location / description). ``show`` is an ordered
// subset of these fields; ``position`` is one of a 3x3 anchor grid;
// ``date_format`` is one of the named presets below or a custom token string.
-const CAPTION_FIELDS = ["date", "location", "description"];
+const CAMERA_CAPTION_FIELDS = [
+ "camera_make", "camera_model", "focal_length_mm", "aperture_f_number",
+ "iso", "exposure_time_seconds",
+];
+const CAPTION_FIELDS = ["date", "location", "description", "camera", ...CAMERA_CAPTION_FIELDS, "current_date", "current_time", "weather"];
+const LIVE_CAPTION_FIELDS = new Set(["current_date", "current_time", "weather"]);
const CAPTION_POSITIONS = new Set([
"top-left",
"top-center",
@@ -604,6 +609,11 @@ function createAlbumSlideshowCardClass(Base) {
if (!FIT_MODES.has(fit)) {
throw new Error(`album-slideshow-card: unknown fit '${fit}'`);
}
+ if (config.captions != null && !Array.isArray(config.captions)) {
+ throw new Error("album-slideshow-card: 'captions' must be a list");
+ }
+ const captions = (config.captions ?? [config.caption])
+ .map((caption) => this._normalizeCaption(caption)).filter(Boolean);
this._config = {
...config,
transition,
@@ -622,8 +632,8 @@ function createAlbumSlideshowCardClass(Base) {
config.tap_pause_seconds === 0
? 0
: Number(config.tap_pause_seconds ?? 8),
- // Caption overlay (date / location). ``null`` when disabled.
- caption: this._normalizeCaption(config.caption),
+ caption: captions[0] || null,
+ captions,
};
if (this._rendered) {
// Config edited live; rebuild styles + reset state.
@@ -643,6 +653,7 @@ function createAlbumSlideshowCardClass(Base) {
if (raw == null || raw === false) return null;
if (raw === true) raw = {};
if (typeof raw !== "object") return null;
+ if (raw.enabled === false) return null;
let show = raw.show;
if (typeof show === "string") show = show.split(/[,\s]+/);
if (!Array.isArray(show)) show = ["date", "location"];
@@ -668,6 +679,11 @@ function createAlbumSlideshowCardClass(Base) {
position,
per_image: raw.per_image !== false,
date_format: raw.date_format != null ? String(raw.date_format) : "medium",
+ current_date_format: String(raw.current_date_format ?? raw.date_format ?? "medium"),
+ time_format: ["auto", "12h", "24h"].includes(raw.time_format) ? raw.time_format : "auto",
+ time_seconds: raw.time_seconds === true,
+ weather_entity: typeof raw.weather_entity === "string" && /^(weather|sensor)\.[a-z0-9_]+$/.test(raw.weather_entity.trim())
+ ? raw.weather_entity.trim() : null,
color,
font_size: fontSize,
font_weight: fontWeight,
@@ -686,10 +702,15 @@ function createAlbumSlideshowCardClass(Base) {
} else {
this._setupPhotoControlsReveal();
}
+ this._captionResizeObserver ??= new ResizeObserver(() => this._fitCaptions());
+ this._captionResizeObserver.observe(this);
this._maybeSwap();
}
disconnectedCallback() {
+ this._captionResizeObserver?.disconnect();
+ clearTimeout(this._captionClockTimer);
+ this._captionClockTimer = null;
this._cancelControlNavigation();
this._controlsReveal?.dispose();
this._controlsReveal = null;
@@ -701,9 +722,14 @@ function createAlbumSlideshowCardClass(Base) {
}
set hass(hass) {
+ const previous = this._hass;
this._hass = hass;
if (!this._rendered) return;
this._maybeSwap();
+ if (this._captionData && this._captionConfigs().some((cap) => cap.show.includes("weather") && cap.weather_entity &&
+ (previous?.states?.[cap.weather_entity] !== hass.states?.[cap.weather_entity] || previous?.locale !== hass.locale))) {
+ this._renderCaptions(this._captionData, false);
+ }
}
_resolvedFit(attrs) {
@@ -722,6 +748,9 @@ function createAlbumSlideshowCardClass(Base) {
_renderShell() {
const c = this._config;
+ clearTimeout(this._captionClockTimer);
+ this._captionClockTimer = null;
+ this._captionData = null;
this._cancelControlNavigation();
this._controlsReveal?.dispose();
this._controlsReveal = null;
@@ -813,15 +842,26 @@ function createAlbumSlideshowCardClass(Base) {
display: flex;
padding: 3.5% 4%;
box-sizing: border-box;
+ min-width: 0;
+ overflow: hidden;
}
.cap-box {
display: flex;
flex-direction: column;
- max-width: 92%;
+ flex-shrink: 0;
+ max-width: 100%;
+ max-height: 100%;
+ min-width: 0;
+ overflow: hidden;
+ overflow-wrap: anywhere;
line-height: 1.25;
font-family: var(--paper-font-body1_-_font-family, sans-serif);
}
- .cap-line { font-weight: inherit; }
+ .cap-stack {
+ display: flex; flex-direction: column; gap: 4px;
+ max-width: 100%; max-height: 100%; min-width: 0; overflow: hidden;
+ }
+ .cap-line { font-weight: inherit; flex-shrink: 0; font-variant-numeric: tabular-nums; }
#photo-controls { position: absolute; right: 8px; max-width: calc(100% - 16px); ${c.caption?.position.startsWith("top") ? "bottom" : "top"}: 8px; z-index: 3; }
.cap-box.cap-shadow {
text-shadow:
@@ -1033,6 +1073,7 @@ function createAlbumSlideshowCardClass(Base) {
latitude: attrs.latitude,
longitude: attrs.longitude,
description: attrs.description,
+ ...Object.fromEntries(CAMERA_CAPTION_FIELDS.map((field) => [field, attrs[field]])),
}
: null;
const photoData = {
@@ -1047,6 +1088,9 @@ function createAlbumSlideshowCardClass(Base) {
}
_clearDisplayedPhotos() {
+ clearTimeout(this._captionClockTimer);
+ this._captionClockTimer = null;
+ this._captionData = null;
this._loadGeneration += 1;
this._displayedPhotoIds = [];
this._displayedFrameId = null;
@@ -1195,26 +1239,31 @@ function createAlbumSlideshowCardClass(Base) {
}
_renderCaptions(captionData, fade) {
- const cap = this._config.caption;
+ clearTimeout(this._captionClockTimer);
+ this._captionClockTimer = null;
+ this._captionData = captionData;
+ const captions = this._captionConfigs();
const container =
this.shadowRoot && this.shadowRoot.getElementById("captions");
if (!container) return;
container.innerHTML = "";
- if (!cap || !captionData) return;
+ if (!captions.length || !captionData) return;
const frames = this._buildCaptionFrames(captionData);
const orientation = captionData.pair_orientation;
- const isPair =
- cap.per_image &&
- frames.length >= 2 &&
- (orientation === "horizontal" || orientation === "vertical");
-
- if (isPair) {
- this._addCaptionRegion(container, frames[0], cap, orientation, 0);
- this._addCaptionRegion(container, frames[1], cap, orientation, 1);
- } else {
- this._addCaptionRegion(container, frames[0], cap, null, 0);
+ for (const cap of captions) {
+ const isPair = cap.per_image && cap.show.some((field) => !LIVE_CAPTION_FIELDS.has(field)) && frames.length >= 2 &&
+ (orientation === "horizontal" || orientation === "vertical");
+ if (isPair) {
+ this._addCaptionRegion(container, frames[0], cap, orientation, 0);
+ this._addCaptionRegion(container, frames[1], cap, orientation, 1);
+ } else {
+ this._addCaptionRegion(container, frames[0], cap, null, 0);
+ }
}
+ this._layoutCaptionRegions(container);
+ this._fitCaptions();
+ this._scheduleCaptionClock();
// Fade the new caption in alongside the image cross-fade. On the very
// first frame (fade=false) just show it immediately.
@@ -1231,6 +1280,79 @@ function createAlbumSlideshowCardClass(Base) {
}
}
+ _captionConfigs() {
+ return this._config?.captions ?? (this._config?.caption ? [this._config.caption] : []);
+ }
+
+ _scheduleCaptionClock() {
+ clearTimeout(this._captionClockTimer);
+ this._captionClockTimer = null;
+ const clocks = this._captionConfigs().filter((cap) =>
+ cap.show.some((field) => field === "current_date" || field === "current_time"));
+ if (!this.isConnected || !this._captionData || !clocks.length) return;
+ const interval = clocks.some((cap) => cap.show.includes("current_time") && cap.time_seconds) ? 1000 : 60000;
+ this._captionClockTimer = setTimeout(() => {
+ this._captionClockTimer = null;
+ if (this.isConnected && this._captionData) this._renderCaptions(this._captionData, false);
+ }, interval - (Date.now() % interval) + 20);
+ }
+
+ _fitCaptions() {
+ if (!this._captionConfigs().length || !this.shadowRoot) return;
+ for (const stack of this.shadowRoot.querySelectorAll(".cap-stack")) {
+ const boxes = [...stack.querySelectorAll(".cap-box")];
+ for (const box of boxes) box.style.fontSize = box._captionFontSize;
+ if (!stack.clientWidth || !stack.clientHeight) continue;
+ const sizes = boxes.map((box) => Number.parseFloat(getComputedStyle(box).fontSize));
+ for (let attempt = 0; attempt < 3; attempt += 1) {
+ const scale = Math.min(stack.clientWidth / stack.scrollWidth, stack.clientHeight / stack.scrollHeight);
+ if (scale >= 1) break;
+ boxes.forEach((box, index) => {
+ sizes[index] = Math.max(1, sizes[index] * scale * 0.98);
+ box.style.fontSize = `${sizes[index]}px`;
+ });
+ }
+ }
+ }
+
+ _layoutCaptionRegions(container) {
+ const placements = [...container.children].map((region) => {
+ const width = region._captionOrientation === "horizontal" ? 0.5 : 1;
+ const height = region._captionOrientation === "vertical" ? 0.5 : 1;
+ const left = width === 0.5 ? region._captionHalf * width : 0;
+ const top = height === 0.5 ? region._captionHalf * height : 0;
+ return { region, left, right: left + width, top, bottom: top + height,
+ anchorX: left + region._captionColumn * width / 2,
+ anchorY: top + region._captionRow * height / 2 };
+ });
+ const space = (start, end, anchor, neighbors, centered) => {
+ let lower = start;
+ let upper = end;
+ for (const other of neighbors) {
+ if (other < anchor) lower = Math.max(lower, (other + anchor) / 2);
+ if (other > anchor) upper = Math.min(upper, (other + anchor) / 2);
+ }
+ if (centered) {
+ const radius = Math.min(anchor - lower, upper - anchor);
+ return [anchor - radius, anchor + radius];
+ }
+ return [lower, upper];
+ };
+ for (const current of placements) {
+ const neighbors = placements.filter((other) => other.left < current.right && other.right > current.left &&
+ other.top < current.bottom && other.bottom > current.top);
+ const [left, right] = space(current.left, current.right, current.anchorX,
+ neighbors.filter((other) => other.anchorY === current.anchorY).map((other) => other.anchorX),
+ current.region._captionColumn === 1);
+ const [top, bottom] = space(current.top, current.bottom, current.anchorY,
+ neighbors.map((other) => other.anchorY), current.region._captionRow === 1);
+ current.region.style.left = `${100 * left}%`;
+ current.region.style.right = `${100 * (1 - right)}%`;
+ current.region.style.top = `${100 * top}%`;
+ current.region.style.bottom = `${100 * (1 - bottom)}%`;
+ }
+ }
+
/** Per-image caption metadata. Prefers the integration's structured
* ``caption_frames`` (one entry per image, two for a pair); falls back to
* the flat attributes for older integration versions. */
@@ -1250,25 +1372,69 @@ function createAlbumSlideshowCardClass(Base) {
latitude: data.latitude ?? null,
longitude: data.longitude ?? null,
description: data.description ?? null,
+ ...Object.fromEntries(CAMERA_CAPTION_FIELDS.map((field) => [field, data[field] ?? null])),
},
];
}
- _captionLines(frame, cap) {
+ _captionLines(frame, cap, now = new Date()) {
const lines = [];
for (const field of cap.show) {
if (field === "date") {
const txt = this._formatDate(frame.captured_at, cap.date_format);
if (txt) lines.push(txt);
+ } else if (field === "current_date") {
+ lines.push(this._formatDate(now.toISOString(), cap.current_date_format ?? cap.date_format, this._hass?.config?.time_zone));
+ } else if (field === "current_time") {
+ lines.push(this._formatCurrentTime(now, cap));
+ } else if (field === "weather") {
+ const weather = this._weatherCaption(cap);
+ if (weather) lines.push(weather);
} else if (field === "location") {
if (frame.location) lines.push(String(frame.location));
} else if (field === "description") {
if (frame.description) lines.push(String(frame.description));
+ } else if (field === "camera") {
+ const make = typeof frame.camera_make === "string" ? frame.camera_make.trim() : "";
+ const model = typeof frame.camera_model === "string" ? frame.camera_model.trim() : "";
+ const camera = make && model.toLowerCase().startsWith(make.toLowerCase())
+ ? model : [make, model].filter(Boolean).join(" ");
+ if (camera) lines.push(camera);
+ } else if (field === "camera_make" || field === "camera_model") {
+ if (typeof frame[field] === "string" && frame[field].trim()) lines.push(frame[field].trim());
+ } else if (CAMERA_CAPTION_FIELDS.includes(field)) {
+ const value = frame[field];
+ if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) continue;
+ const formatted = new Intl.NumberFormat(this._locale(), { maximumFractionDigits: 3 }).format(value);
+ if (field === "focal_length_mm") lines.push(`${formatted} mm`);
+ else if (field === "aperture_f_number") lines.push(`f/${formatted}`);
+ else if (field === "iso") lines.push(`ISO ${Math.round(value)}`);
+ else if (field === "exposure_time_seconds") {
+ lines.push(value <= 0.5 ? `1/${Math.round(1 / value)} s` : `${formatted} s`);
+ }
}
}
return lines;
}
+ _weatherCaption(cap) {
+ if (typeof cap.weather_entity !== "string" || !/^(weather|sensor)\.[a-z0-9_]+$/.test(cap.weather_entity)) return "";
+ const entity = this._hass?.states?.[cap.weather_entity];
+ if (!entity || !entity.state || ["unknown", "unavailable"].includes(entity.state)) return "";
+ const attributes = entity.attributes || {};
+ const isWeather = cap.weather_entity.startsWith("weather.");
+ const state = this._hass.formatEntityState
+ ? this._hass.formatEntityState(entity)
+ : isWeather ? humanizeOption(entity.state.replace("partlycloudy", "partly cloudy"))
+ : [entity.state, attributes.unit_of_measurement].filter(Boolean).join(" ");
+ if (!isWeather || typeof attributes.temperature !== "number" || !Number.isFinite(attributes.temperature)) return state;
+ const temperature = this._hass.formatEntityAttributeValue
+ ? this._hass.formatEntityAttributeValue(entity, "temperature")
+ : [new Intl.NumberFormat(this._locale(), { maximumFractionDigits: 1 }).format(attributes.temperature),
+ attributes.temperature_unit || this._hass.config?.unit_system?.temperature].filter(Boolean).join(" ");
+ return `${state}, ${temperature}`;
+ }
+
/** Build one positioned caption block. ``orientation`` is ``null`` for a
* full-frame caption, or ``horizontal`` / ``vertical`` to anchor the block
* inside the left/right or top/bottom half of a pair (``half`` 0 or 1). */
@@ -1276,26 +1442,6 @@ function createAlbumSlideshowCardClass(Base) {
const lines = this._captionLines(frame, cap);
if (lines.length === 0) return;
- const region = document.createElement("div");
- region.className = "cap-region";
-
- // Region geometry: full frame, or one half of a pair.
- let top = "0";
- let right = "0";
- let bottom = "0";
- let left = "0";
- if (orientation === "horizontal") {
- if (half === 0) right = "50%";
- else left = "50%";
- } else if (orientation === "vertical") {
- if (half === 0) bottom = "50%";
- else top = "50%";
- }
- region.style.top = top;
- region.style.right = right;
- region.style.bottom = bottom;
- region.style.left = left;
-
// Anchor within the region from the 3x3 position grid.
const pos = cap.position;
const parts = pos === "center" ? ["center", "center"] : pos.split("-");
@@ -1303,14 +1449,48 @@ function createAlbumSlideshowCardClass(Base) {
const h = parts[1] || "center";
const justify = { left: "flex-start", center: "center", right: "flex-end" };
const align = { top: "flex-start", center: "center", bottom: "flex-end" };
- region.style.justifyContent = justify[h] || "flex-start";
- region.style.alignItems = align[v] || "flex-end";
+ const row = { top: 0, center: 1, bottom: 2 }[v];
+ const column = { left: 0, center: 1, right: 2 }[h];
+ const anchorX = orientation === "horizontal" ? half / 2 + column / 4 : column / 2;
+ const anchorY = orientation === "vertical" ? half / 2 + row / 4 : row / 2;
+ let region = [...container.children].find((element) => element._captionAnchorX === anchorX &&
+ element._captionAnchorY === anchorY && (!orientation || !element._captionOrientation ||
+ (element._captionOrientation === orientation && element._captionHalf === half)));
+ if (!region) {
+ region = document.createElement("div");
+ region.className = "cap-region";
+ region._captionPosition = pos;
+ region._captionOrientation = orientation;
+ region._captionHalf = half;
+ region._captionRow = row;
+ region._captionColumn = column;
+ region._captionAnchorX = anchorX;
+ region._captionAnchorY = anchorY;
+ region.style.justifyContent = justify[h] || "flex-start";
+ region.style.alignItems = align[v] || "flex-end";
+ const stack = document.createElement("div");
+ stack.className = "cap-stack";
+ stack.style.alignItems = justify[h] || "flex-start";
+ region._captionStack = stack;
+ region.appendChild(stack);
+ container.appendChild(region);
+ }
+ if (!region._captionOrientation && orientation) {
+ region._captionOrientation = orientation;
+ region._captionHalf = half;
+ region._captionRow = row;
+ region._captionColumn = column;
+ region.style.justifyContent = justify[h];
+ region.style.alignItems = align[v];
+ region._captionStack.style.alignItems = justify[h];
+ }
const box = document.createElement("div");
box.className = "cap-box";
if (cap.shadow) box.classList.add("cap-shadow");
box.style.color = cap.color;
box.style.fontSize = cap.font_size;
+ box._captionFontSize = cap.font_size;
box.style.fontWeight = CAPTION_WEIGHT_MAP[cap.font_weight] || 500;
box.style.textAlign = h === "center" ? "center" : h;
@@ -1320,8 +1500,7 @@ function createAlbumSlideshowCardClass(Base) {
el.textContent = line;
box.appendChild(el);
}
- region.appendChild(box);
- container.appendChild(region);
+ region._captionStack.appendChild(box);
}
_locale() {
@@ -1332,7 +1511,23 @@ function createAlbumSlideshowCardClass(Base) {
);
}
- _formatDate(iso, fmt) {
+ _formatCurrentTime(now, cap) {
+ const format = cap.time_format === "auto" || !cap.time_format
+ ? this._hass?.locale?.time_format : cap.time_format;
+ const options = { hour: "numeric", minute: "2-digit", timeZone: this._hass?.config?.time_zone };
+ if (["12h", "am_pm"].includes(format)) options.hourCycle = "h12";
+ if (["24h", "24"].includes(format)) { options.hourCycle = "h23"; options.hour = "2-digit"; }
+ if (cap.time_seconds) options.second = "2-digit";
+ const locale = format === "system" && typeof navigator !== "undefined" ? navigator.language : this._locale();
+ try {
+ return new Intl.DateTimeFormat(locale, options).format(now);
+ } catch (_) {
+ delete options.timeZone;
+ return new Intl.DateTimeFormat(undefined, options).format(now);
+ }
+ }
+
+ _formatDate(iso, fmt, timeZone) {
if (!iso) return "";
const d = new Date(iso);
if (isNaN(d.getTime())) return "";
@@ -1341,13 +1536,13 @@ function createAlbumSlideshowCardClass(Base) {
const preset = DATE_FORMAT_PRESETS[fmt];
if (preset) {
try {
- return new Intl.DateTimeFormat(locale, preset).format(d);
+ return new Intl.DateTimeFormat(locale, { ...preset, timeZone }).format(d);
} catch (_) {
return d.toLocaleDateString();
}
}
// Anything else is treated as a custom token string.
- return this._formatTokens(d, String(fmt));
+ return this._formatTokens(d, String(fmt), timeZone);
}
_relativeTime(d) {
@@ -1391,29 +1586,40 @@ function createAlbumSlideshowCardClass(Base) {
}
}
- _formatTokens(d, fmt) {
+ _formatTokens(d, fmt, timeZone) {
const locale = this._locale();
const pad = (n) => String(n).padStart(2, "0");
const part = (opts) => {
try {
- return new Intl.DateTimeFormat(locale, opts).format(d);
+ return new Intl.DateTimeFormat(locale, { ...opts, timeZone }).format(d);
} catch (_) {
return "";
}
};
+ let calendar = { year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate(), hour: d.getHours(), minute: d.getMinutes() };
+ if (timeZone) {
+ try {
+ const parts = new Intl.DateTimeFormat("en-US-u-nu-latn", {
+ year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric",
+ hourCycle: "h23", timeZone,
+ }).formatToParts(d);
+ calendar = Object.fromEntries(parts.filter((value) => value.type !== "literal")
+ .map((value) => [value.type, Number(value.value)]));
+ } catch (_) {}
+ }
const map = {
- YYYY: d.getFullYear(),
- YY: pad(d.getFullYear() % 100),
+ YYYY: calendar.year,
+ YY: pad(calendar.year % 100),
MMMM: part({ month: "long" }),
MMM: part({ month: "short" }),
- MM: pad(d.getMonth() + 1),
- M: d.getMonth() + 1,
- DD: pad(d.getDate()),
- D: d.getDate(),
+ MM: pad(calendar.month),
+ M: calendar.month,
+ DD: pad(calendar.day),
+ D: calendar.day,
dddd: part({ weekday: "long" }),
ddd: part({ weekday: "short" }),
- HH: pad(d.getHours()),
- mm: pad(d.getMinutes()),
+ HH: pad(calendar.hour),
+ mm: pad(calendar.minute),
// Lets relative time be mixed into a format string, e.g. "DD MMMM YYYY - REL".
REL: this._relativeTime(d),
};
@@ -1498,9 +1704,19 @@ const TAP_OPTIONS = [
];
const CAPTION_SHOW_OPTIONS = [
- { value: "date", label: "Date" },
+ { value: "date", label: "Photo date" },
{ value: "location", label: "Location" },
{ value: "description", label: "Description" },
+ { value: "camera", label: "Camera (make and model)" },
+ { value: "camera_make", label: "Camera make" },
+ { value: "camera_model", label: "Camera model" },
+ { value: "focal_length_mm", label: "Focal length" },
+ { value: "aperture_f_number", label: "Aperture" },
+ { value: "iso", label: "ISO" },
+ { value: "exposure_time_seconds", label: "Exposure time" },
+ { value: "current_date", label: "Today's date" },
+ { value: "current_time", label: "Current time" },
+ { value: "weather", label: "Weather" },
];
const CAPTION_POSITION_OPTIONS = [
@@ -1554,6 +1770,8 @@ const CAPTION_DEFAULTS = {
position: "bottom-left",
per_image: true,
date_format: "medium",
+ time_format: "auto",
+ time_seconds: false,
color: "#ffffff",
font_size: "14px",
font_weight: "medium",
@@ -1568,6 +1786,8 @@ const CAPTION_DEFAULTS = {
const LIVE_FIELDS = [
"paused",
"date_filter",
+ "custom_lookback_days",
+ "shuffle_age_bias",
"missing_date_mode",
"portrait_mode",
"order_mode",
@@ -1580,6 +1800,8 @@ const LIVE_FIELDS = [
const LIVE_SUFFIX = {
paused: "_paused",
date_filter: "_date_filter",
+ custom_lookback_days: "_custom_lookback_days",
+ shuffle_age_bias: "_shuffle_age_bias",
missing_date_mode: "_missing_date_mode",
portrait_mode: "_portrait_mode",
order_mode: "_order_mode",
@@ -1595,6 +1817,8 @@ const LIVE_SUFFIX = {
const LIVE_LABELS = {
live_paused: "Pause slideshow",
live_date_filter: "Date filter",
+ live_custom_lookback_days: "Custom lookback (days)",
+ live_shuffle_age_bias: "Shuffle age bias (older - / newer +)",
live_missing_date_mode: "Missing capture date",
live_portrait_mode: "Orientation mismatch mode",
live_order_mode: "Order mode",
@@ -1741,7 +1965,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
min: a.min != null ? a.min : fallback.min,
max: a.max != null ? a.max : fallback.max,
step: a.step != null ? a.step : fallback.step,
- mode: "box",
+ mode: fallback.mode || "box",
unit_of_measurement: fallback.unit,
};
}
@@ -1769,6 +1993,22 @@ function createAlbumSlideshowCardEditorClass(Base) {
});
}
}
+ if (s.custom_lookback_days && this._hass?.states[s.date_filter]?.state === "custom_days") {
+ items.push({
+ name: "live_custom_lookback_days",
+ selector: { number: this._liveNumberConfig(s.custom_lookback_days, {
+ min: 1, max: 36500, step: 1, unit: "d",
+ }) },
+ });
+ }
+ if (s.shuffle_age_bias && this._hass?.states[s.order_mode]?.state === "random") {
+ items.push({
+ name: "live_shuffle_age_bias",
+ selector: { number: this._liveNumberConfig(s.shuffle_age_bias, {
+ min: -100, max: 100, step: 1, mode: "slider",
+ }) },
+ });
+ }
if (s.slide_interval) {
items.push({
name: "live_slide_interval",
@@ -1905,56 +2145,6 @@ function createAlbumSlideshowCardEditorClass(Base) {
},
],
},
- {
- type: "expandable",
- title: "Caption (date, location & description)",
- icon: "mdi:format-text",
- schema: [
- { name: "caption_enabled", selector: { boolean: {} } },
- {
- name: "caption_show",
- selector: {
- select: {
- multiple: true,
- mode: "list",
- options: CAPTION_SHOW_OPTIONS,
- },
- },
- },
- {
- name: "caption_position",
- selector: {
- select: { mode: "dropdown", options: CAPTION_POSITION_OPTIONS },
- },
- },
- {
- name: "caption_date_format",
- selector: {
- select: {
- mode: "dropdown",
- custom_value: true,
- options: CAPTION_DATE_FORMAT_OPTIONS,
- },
- },
- },
- { name: "caption_per_image", selector: { boolean: {} } },
- {
- type: "grid",
- name: "",
- schema: [
- { name: "caption_color", selector: { text: {} } },
- { name: "caption_font_size", selector: { text: {} } },
- ],
- },
- {
- name: "caption_font_weight",
- selector: {
- select: { mode: "dropdown", options: CAPTION_WEIGHT_OPTIONS },
- },
- },
- { name: "caption_shadow", selector: { boolean: {} } },
- ],
- },
];
if (this._hasLiveControls()) {
@@ -1986,15 +2176,13 @@ function createAlbumSlideshowCardEditorClass(Base) {
c.tap_pause_seconds != null
? Number(c.tap_pause_seconds)
: DEFAULTS.tap_pause_seconds,
- ...this._captionData(),
...this._liveDataFromStates(),
};
}
/** Flatten the nested ``caption`` config into the fields ha-form binds. */
- _captionData() {
- const cap = this._config && this._config.caption;
- const enabled = !!cap && cap !== false;
+ _captionData(cap = this._editorCaptions()[0]) {
+ const enabled = !!cap && cap !== false && cap.enabled !== false;
const c = cap && typeof cap === "object" ? cap : {};
let show = c.show;
if (typeof show === "string") show = show.split(/[,\s]+/).filter(Boolean);
@@ -2005,6 +2193,10 @@ function createAlbumSlideshowCardEditorClass(Base) {
caption_position: c.position || CAPTION_DEFAULTS.position,
caption_per_image: c.per_image !== false,
caption_date_format: c.date_format || CAPTION_DEFAULTS.date_format,
+ caption_current_date_format: c.current_date_format || c.date_format || CAPTION_DEFAULTS.date_format,
+ caption_time_format: c.time_format || CAPTION_DEFAULTS.time_format,
+ caption_time_seconds: c.time_seconds === true,
+ caption_weather_entity: c.weather_entity || "",
caption_color: c.color || CAPTION_DEFAULTS.color,
caption_font_size: c.font_size || CAPTION_DEFAULTS.font_size,
caption_font_weight: c.font_weight || CAPTION_DEFAULTS.font_weight,
@@ -2012,6 +2204,313 @@ function createAlbumSlideshowCardEditorClass(Base) {
};
}
+ _editorCaptions() {
+ const source = this._config.captions ?? (this._config.caption ? [this._config.caption] : []);
+ return Array.isArray(source) ? source.map((caption) => ({
+ ...(caption && typeof caption === "object" ? caption : { enabled: caption !== false }),
+ })) : [];
+ }
+
+ _captionSchema(caption = this._editorCaptions()[0]) {
+ const data = this._captionData(caption);
+ const schema = [
+ { name: "caption_enabled", selector: { boolean: {} } },
+ { name: "caption_position", selector: { select: { mode: "dropdown", options: CAPTION_POSITION_OPTIONS } } },
+ { name: "caption_show", selector: { select: { multiple: true, reorder: true, mode: "dropdown", options: CAPTION_SHOW_OPTIONS } } },
+ ];
+ if (data.caption_show.includes("weather")) {
+ schema.push({ name: "caption_weather_entity", required: true,
+ selector: { entity: { filter: [{ domain: ["weather", "sensor"] }] } } });
+ }
+ if (data.caption_show.includes("date")) {
+ schema.push({ name: "caption_date_format", selector: { select: {
+ mode: "dropdown", custom_value: true, options: CAPTION_DATE_FORMAT_OPTIONS,
+ } } });
+ }
+ if (data.caption_show.includes("current_date")) {
+ schema.push({ name: "caption_current_date_format", selector: { select: {
+ mode: "dropdown", custom_value: true, options: CAPTION_DATE_FORMAT_OPTIONS,
+ } } });
+ }
+ if (data.caption_show.includes("current_time")) {
+ schema.push(
+ { name: "caption_time_format", selector: { select: { mode: "dropdown", options: [
+ { value: "auto", label: "Home Assistant preference" },
+ { value: "12h", label: "12-hour" }, { value: "24h", label: "24-hour" },
+ ] } } },
+ { name: "caption_time_seconds", selector: { boolean: {} } },
+ );
+ }
+ if (data.caption_show.some((field) => !LIVE_CAPTION_FIELDS.has(field))) {
+ schema.push({ name: "caption_per_image", selector: { boolean: {} } });
+ }
+ schema.push(
+ { type: "grid", name: "", schema: [
+ { name: "caption_color", selector: { text: {} } },
+ { name: "caption_font_size", selector: { text: {} } },
+ ] },
+ { name: "caption_font_weight", selector: { select: { mode: "dropdown", options: CAPTION_WEIGHT_OPTIONS } } },
+ { name: "caption_shadow", selector: { boolean: {} } },
+ );
+ return schema;
+ }
+
+ _saveCaptions(captions) {
+ const config = { ...this._config };
+ const useList = Array.isArray(config.captions) || captions.length > 1;
+ delete config.caption;
+ delete config.captions;
+ if (captions.length) {
+ if (useList) config.captions = captions;
+ else config.caption = captions[0];
+ }
+ this._config = config;
+ this._renderCaptionEditors();
+ this.dispatchEvent(new CustomEvent("config-changed", {
+ detail: { config }, bubbles: true, composed: true,
+ }));
+ }
+
+ _nextCaptionPosition(captions) {
+ const used = new Set(captions.map((caption) => caption.position || CAPTION_DEFAULTS.position));
+ return ["bottom-left", "top-left", "bottom-right", "top-right", "bottom-center", "top-center", "center-left", "center-right", "center"]
+ .find((position) => !used.has(position)) || CAPTION_DEFAULTS.position;
+ }
+
+ _addCaption(copyIndex) {
+ const captions = this._editorCaptions();
+ const original = Number.isInteger(copyIndex) ? captions[copyIndex] : null;
+ captions.push({
+ ...(original || {}),
+ show: [...this._captionData(original || {}).caption_show],
+ position: this._nextCaptionPosition(captions),
+ });
+ this._openCaptionIndex = captions.length - 1;
+ this._saveCaptions(captions);
+ }
+
+ _removeCaption(index) {
+ const captions = this._editorCaptions();
+ captions.splice(index, 1);
+ this._openCaptionIndex = Math.min(index, captions.length - 1);
+ this._saveCaptions(captions);
+ }
+
+ _captionChanged(index, event) {
+ event.stopPropagation();
+ const captions = this._editorCaptions();
+ if (!captions[index]) return;
+ const data = { ...this._captionData(captions[index]), ...event.detail?.value };
+ let show = data.caption_show;
+ if (!Array.isArray(show)) show = typeof show === "string" ? show.split(/[,\s]+/) : [];
+ const caption = { show: [...new Set(show.filter((field) => CAPTION_FIELDS.includes(field)))] };
+ if (data.caption_enabled === false) caption.enabled = false;
+ for (const field of ["position", "date_format", "time_format", "color", "font_size", "font_weight"]) {
+ const value = String(data[`caption_${field}`] || CAPTION_DEFAULTS[field]).trim();
+ if (value && value !== CAPTION_DEFAULTS[field]) caption[field] = value;
+ }
+ if (caption.show.includes("current_date") || captions[index].current_date_format != null) {
+ const format = String(data.caption_current_date_format || CAPTION_DEFAULTS.date_format).trim();
+ if (format !== (caption.date_format || CAPTION_DEFAULTS.date_format)) caption.current_date_format = format;
+ }
+ if (data.caption_per_image === false) caption.per_image = false;
+ if (data.caption_shadow === false) caption.shadow = false;
+ if (data.caption_time_seconds === true) caption.time_seconds = true;
+ if (typeof data.caption_weather_entity === "string" && data.caption_weather_entity.trim()) {
+ caption.weather_entity = data.caption_weather_entity.trim();
+ }
+ captions[index] = caption;
+ this._saveCaptions(captions);
+ }
+
+ _captionButton(icon, label, action) {
+ const button = document.createElement("button");
+ button.type = "button";
+ button.className = "caption-tool";
+ button.title = label;
+ button.setAttribute("aria-label", label);
+ const symbol = document.createElement("ha-icon");
+ symbol.setAttribute("icon", icon);
+ button.append(symbol);
+ button.addEventListener("click", action);
+ return button;
+ }
+
+ _moveCaptionContent(index, event) {
+ event.stopPropagation();
+ const { oldIndex, newIndex } = event.detail || {};
+ const show = [...this._captionData(this._editorCaptions()[index]).caption_show];
+ if (!Number.isInteger(oldIndex) || !Number.isInteger(newIndex) || oldIndex === newIndex ||
+ oldIndex < 0 || oldIndex >= show.length || newIndex < 0 || newIndex >= show.length) return;
+ const [field] = show.splice(oldIndex, 1);
+ show.splice(newIndex, 0, field);
+ this._captionChanged(index, { stopPropagation() {}, detail: { value: { caption_show: show } } });
+ }
+
+ _createCaptionContentPicker(index) {
+ const content = document.createElement("div");
+ content.className = "caption-content-selector";
+ const label = document.createElement("span");
+ label.className = "caption-content-label";
+ label.id = `caption-content-label-${index}`;
+ label.textContent = "Content";
+ const picker = document.createElement("ha-generic-picker");
+ picker.label = "Content";
+ picker.searchLabel = "Search content";
+ picker.allowCustomValue = false;
+ picker.value = "";
+ picker.setAttribute("no-sort", "");
+ const field = document.createElement("div");
+ field.slot = "field";
+ field.className = "caption-content-field";
+ field.setAttribute("role", "group");
+ field.setAttribute("aria-labelledby", label.id);
+ const sortable = document.createElement("ha-sortable");
+ sortable.setAttribute("no-style", "");
+ sortable.setAttribute("handle-selector", "button.primary.action");
+ sortable.setAttribute("filter", ".caption-content-add");
+ sortable.addEventListener("item-moved", (event) => this._moveCaptionContent(index, event));
+ const chips = document.createElement("ha-chip-set");
+ const add = document.createElement("ha-assist-chip");
+ add.className = "caption-content-add";
+ add.label = "Add";
+ const icon = document.createElement("ha-icon");
+ icon.slot = "icon";
+ icon.setAttribute("icon", "mdi:plus");
+ add.append(icon);
+ add.addEventListener("click", async (event) => {
+ event.stopPropagation();
+ await picker.updateComplete;
+ if (!add.disabled) picker.open();
+ });
+ picker.addEventListener("value-changed", (event) => {
+ event.stopPropagation();
+ const selected = event.detail?.value;
+ const show = this._captionData(this._editorCaptions()[index]).caption_show;
+ if (!CAPTION_FIELDS.includes(selected) || show.includes(selected)) return;
+ this._captionChanged(index, { stopPropagation() {}, detail: { value: { caption_show: [...show, selected] } } });
+ picker.value = "";
+ });
+ chips.append(add);
+ sortable.append(chips);
+ field.append(sortable);
+ picker.append(field);
+ content.append(label, picker);
+ return content;
+ }
+
+ _updateCaptionContentPicker(content, index, data, selector) {
+ const picker = content.querySelector("ha-generic-picker");
+ const chips = content.querySelector("ha-chip-set");
+ const add = content.querySelector(".caption-content-add");
+ const show = data.caption_show.filter((field) => CAPTION_FIELDS.includes(field));
+ const items = selector.options.filter((option) => !show.includes(option.value))
+ .map((option) => ({ id: option.value, primary: option.label, sorting_label: option.label }));
+ picker.hass = this._hass;
+ picker.getItems = () => items;
+ add.disabled = items.length === 0;
+ content.querySelector("ha-sortable").disabled = !selector.reorder;
+ const signature = JSON.stringify(show);
+ if (content._captionContentSignature === signature) return;
+ content._captionContentSignature = signature;
+ const selected = show.map((value) => {
+ const label = selector.options.find((option) => option.value === value)?.label || value;
+ const chip = document.createElement("ha-input-chip");
+ chip.label = label;
+ chip.title = label;
+ chip.selected = true;
+ chip.setAttribute("data-field", value);
+ const icon = document.createElement("ha-icon");
+ icon.slot = "icon";
+ icon.setAttribute("icon", "mdi:drag-horizontal-variant");
+ chip.append(icon, document.createTextNode(label));
+ chip.addEventListener("click", (event) => event.stopPropagation());
+ chip.addEventListener("remove", (event) => {
+ event.stopPropagation();
+ const remaining = this._captionData(this._editorCaptions()[index]).caption_show.filter((field) => field !== value);
+ this._captionChanged(index, { stopPropagation() {}, detail: { value: { caption_show: remaining } } });
+ });
+ return chip;
+ });
+ chips.replaceChildren(...selected, add);
+ }
+
+ _renderCaptionEditors() {
+ const list = this.shadowRoot?.querySelector(".caption-list");
+ if (!list) return;
+ const captions = this._editorCaptions();
+ if (list.children.length !== captions.length) {
+ list.replaceChildren();
+ captions.forEach((_caption, index) => {
+ const item = document.createElement("div");
+ item.className = "caption-item";
+ const details = document.createElement("details");
+ details.open = index === this._openCaptionIndex || captions.length === 1;
+ const summary = document.createElement("summary");
+ const chevron = document.createElement("ha-icon");
+ chevron.className = "caption-chevron";
+ chevron.setAttribute("icon", "mdi:chevron-right");
+ chevron.setAttribute("aria-hidden", "true");
+ const heading = document.createElement("span");
+ heading.className = "caption-summary";
+ const title = document.createElement("span");
+ title.className = "caption-title";
+ const meta = document.createElement("span");
+ meta.className = "caption-meta";
+ heading.append(title, meta);
+ summary.append(chevron, heading);
+ const body = document.createElement("div");
+ body.className = "caption-body";
+ const controls = document.createElement("ha-form");
+ controls.className = "caption-controls";
+ const options = document.createElement("ha-form");
+ options.className = "caption-options";
+ for (const form of [controls, options]) {
+ form.computeLabel = this._computeLabel;
+ form.computeHelper = this._computeHelper;
+ form.addEventListener("value-changed", (event) => this._captionChanged(index, event));
+ }
+ body.append(controls, this._createCaptionContentPicker(index), options);
+ details.append(summary, body);
+ const tools = document.createElement("div");
+ tools.className = "caption-tools";
+ tools.append(
+ this._captionButton("mdi:content-copy", `Duplicate caption ${index + 1}`, () => this._addCaption(index)),
+ this._captionButton("mdi:delete-outline", `Remove caption ${index + 1}`, () => this._removeCaption(index)),
+ );
+ item.append(details, tools);
+ list.append(item);
+ });
+ }
+ captions.forEach((caption, index) => {
+ const item = list.children[index];
+ const data = this._captionData(caption);
+ const position = CAPTION_POSITION_OPTIONS.find((option) => option.value === data.caption_position)?.label || data.caption_position;
+ const fields = data.caption_show.map((field) => CAPTION_SHOW_OPTIONS.find((option) => option.value === field)?.label)
+ .filter(Boolean).join(", ") || "Empty caption";
+ const title = `${position}${data.caption_enabled ? "" : " (off)"}`;
+ item.querySelector(".caption-title").textContent = title;
+ item.querySelector(".caption-title").title = title;
+ item.querySelector(".caption-meta").textContent = fields;
+ item.querySelector(".caption-meta").title = fields;
+ item.querySelector("summary").setAttribute("aria-label", `Caption ${index + 1}: ${title}. ${fields}`);
+ item.classList.toggle("caption-disabled", !data.caption_enabled);
+ const schema = this._captionSchema(caption);
+ const contentIndex = schema.findIndex((field) => field.name === "caption_show");
+ for (const [className, fields] of [
+ [".caption-controls", schema.slice(0, contentIndex)],
+ [".caption-options", schema.slice(contentIndex + 1)],
+ ]) {
+ const form = item.querySelector(className);
+ form.hass = this._hass;
+ form.schema = fields;
+ form.data = data;
+ }
+ this._updateCaptionContentPicker(item.querySelector(".caption-content-selector"), index, data,
+ schema[contentIndex].selector.select);
+ });
+ }
+
/** Read the current value of each surfaced integration entity. */
_liveDataFromStates() {
const s = this._siblings;
@@ -2028,7 +2527,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
out[`live_${f}`] = e ? e.state : "";
}
}
- for (const f of ["slide_interval", "pair_divider_px", "pair_min_gap_percent"]) {
+ for (const f of ["slide_interval", "pair_divider_px", "pair_min_gap_percent", "custom_lookback_days", "shuffle_age_bias"]) {
if (s[f]) {
const e = st(s[f]);
out[`live_${f}`] = e ? Number(e.state) : null;
@@ -2057,7 +2556,11 @@ function createAlbumSlideshowCardEditorClass(Base) {
caption_show: "Show",
caption_position: "Position",
caption_per_image: "Per-image captions on pairs",
- caption_date_format: "Date format",
+ caption_date_format: "Photo date format",
+ caption_current_date_format: "Today's date format",
+ caption_time_format: "Time format",
+ caption_time_seconds: "Show seconds",
+ caption_weather_entity: "Weather source",
caption_color: "Text color",
caption_font_size: "Font size",
caption_font_weight: "Font weight",
@@ -2075,10 +2578,12 @@ function createAlbumSlideshowCardEditorClass(Base) {
"How long the card freezes its slide after a tap. 0 disables it.",
caption_date_format:
"Pick a preset or type a custom format (YYYY, MMMM, MMM, MM, DD, D, REL for relative time).",
+ caption_current_date_format:
+ "Pick a preset or type a custom format (YYYY, MMMM, MMM, MM, DD, D, REL for relative time).",
caption_show:
- "Description comes from the photo's EXIF/IPTC/XMP caption and is only available with the local-folder provider.",
+ "Available fields depend on the photo source. Missing values are omitted.",
caption_per_image:
- "When a portrait pair is shown, caption each photo with its own date, location and description.",
+ "Use each photo's own metadata on paired slides.",
caption_color: "CSS color, e.g. #ffffff or white.",
caption_font_size: "CSS size, e.g. 14px, 1.1em.",
live_paused:
@@ -2124,10 +2629,50 @@ function createAlbumSlideshowCardEditorClass(Base) {
background: var(--primary-color); color: var(--text-primary-color, #fff);
}
.act:hover { opacity: 0.9; }
+ .caption-editors { display: block; }
+ .caption-content { padding: 4px 12px 12px; }
+ .caption-list { display: flex; flex-direction: column; gap: 12px; }
+ .caption-item { display: grid; min-width: 0; border: 1px solid var(--divider-color, #e0e0e0); border-radius: 8px; background: var(--card-background-color, #fff); }
+ .caption-item details { grid-area: 1 / 1; min-width: 0; }
+ .caption-item summary { display: flex; align-items: center; gap: 8px; box-sizing: border-box; padding: 12px 100px 12px 12px; min-height: 70px; border-radius: 7px; list-style: none; cursor: pointer; background: var(--secondary-background-color, #f5f5f5); }
+ .caption-item summary::-webkit-details-marker { display: none; }
+ .caption-item summary:focus-visible { outline: 2px solid var(--primary-color); outline-offset: -2px; }
+ .caption-item details[open] > summary { border-radius: 7px 7px 0 0; border-bottom: 1px solid var(--divider-color, #e0e0e0); }
+ .caption-chevron { flex: 0 0 18px; --mdc-icon-size: 18px; color: var(--secondary-text-color); }
+ .caption-item details[open] .caption-chevron { transform: rotate(90deg); }
+ .caption-summary { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 3px; }
+ .caption-title { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14px; font-weight: 500; line-height: 1.35; }
+ .caption-meta { color: var(--secondary-text-color); font-size: 12px; line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
+ .caption-disabled .caption-title { color: var(--secondary-text-color); }
+ .caption-body { padding: 12px; display: flex; flex-direction: column; gap: 20px; }
+ .caption-body ha-form { min-width: 0; }
+ .caption-content-selector { min-width: 0; }
+ .caption-content-label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 500; }
+ .caption-content-selector ha-generic-picker { display: block; width: 100%; }
+ .caption-content-field { position: relative; background: var(--mdc-text-field-fill-color, #f5f5f5); border-radius: 4px 4px 0 0; border-bottom: 1px solid var(--mdc-text-field-idle-line-color, #9e9e9e); }
+ .caption-content-field:focus-within { border-bottom-color: var(--primary-color); box-shadow: 0 1px 0 var(--primary-color); }
+ .caption-content-field ha-chip-set { padding: 10px 12px; min-height: 54px; box-sizing: border-box; }
+ .caption-content-field ha-input-chip { max-width: 100%; }
+ .caption-content-field ha-icon { --mdc-icon-size: 18px; }
+ .caption-content-add { order: 1; }
+ .caption-content-field .sortable-fallback { display: none; opacity: 0; }
+ .caption-content-field .sortable-ghost { opacity: 0.4; }
+ .caption-content-field .sortable-drag { cursor: grabbing; }
+ .caption-tools { grid-area: 1 / 1; align-self: start; justify-self: end; z-index: 1; display: flex; gap: 2px; padding: 10px 8px; }
+ .caption-tool { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; flex-shrink: 0; width: 36px; height: 36px; padding: 6px; border: 0; border-radius: 4px; background: transparent; color: var(--secondary-text-color, var(--primary-text-color)); cursor: pointer; }
+ .caption-tool:hover { background: var(--divider-color, #e0e0e0); color: var(--primary-text-color); }
+ .caption-tool:focus-visible { outline: 2px solid var(--primary-color); outline-offset: 2px; }
+ .caption-add { width: 100%; min-height: 40px; gap: 8px; margin-top: 12px; border: 1px dashed var(--divider-color, #e0e0e0); border-radius: 6px; color: var(--primary-color); }
+ .caption-tool ha-icon { --mdc-icon-size: 20px; }
+
+
+
Captions
+
+
@@ -2136,6 +2681,10 @@ function createAlbumSlideshowCardEditorClass(Base) {
form.computeLabel = this._computeLabel;
form.computeHelper = this._computeHelper;
form.addEventListener("value-changed", (ev) => this._valueChanged(ev));
+ const addCaption = this._captionButton("mdi:plus", "Add caption", () => this._addCaption());
+ addCaption.classList.add("caption-add");
+ addCaption.append(document.createTextNode("Add caption"));
+ this.shadowRoot.querySelector(".caption-content").append(addCaption);
this._photoControls = new PhotoControls(
this.shadowRoot.querySelector(".photo-controls"), () => this._hass,
);
@@ -2153,6 +2702,7 @@ function createAlbumSlideshowCardEditorClass(Base) {
form.hass = this._hass;
form.schema = this._schema();
form.data = this._data();
+ this._renderCaptionEditors();
const count = this._countSlideshowCameras();
this._lastEntityCount = count;
@@ -2246,6 +2796,8 @@ function createAlbumSlideshowCardEditorClass(Base) {
});
} else if (
field === "slide_interval" ||
+ field === "custom_lookback_days" ||
+ field === "shuffle_age_bias" ||
field === "pair_divider_px" ||
field === "pair_min_gap_percent"
) {
@@ -2316,32 +2868,8 @@ function createAlbumSlideshowCardEditorClass(Base) {
n.tap_pause_seconds = tps;
}
- // Caption: only emit a ``caption`` block when enabled and at least one
- // field is selected. Non-default sub-settings are written; defaults are
- // omitted to keep the YAML lean.
- if (data.caption_enabled) {
- let show = data.caption_show;
- if (!Array.isArray(show)) show = show ? [show] : [];
- show = show.filter(
- (v) => v === "date" || v === "location" || v === "description",
- );
- if (show.length > 0) {
- const cap = { show };
- const pos = data.caption_position || CAPTION_DEFAULTS.position;
- if (pos !== CAPTION_DEFAULTS.position) cap.position = pos;
- if (data.caption_per_image === false) cap.per_image = false;
- const df = data.caption_date_format || CAPTION_DEFAULTS.date_format;
- if (df !== CAPTION_DEFAULTS.date_format) cap.date_format = df;
- const col = (data.caption_color || "").trim();
- if (col && col.toLowerCase() !== CAPTION_DEFAULTS.color) cap.color = col;
- const fs = (data.caption_font_size || "").trim();
- if (fs && fs !== CAPTION_DEFAULTS.font_size) cap.font_size = fs;
- const fw = data.caption_font_weight || CAPTION_DEFAULTS.font_weight;
- if (fw !== CAPTION_DEFAULTS.font_weight) cap.font_weight = fw;
- if (data.caption_shadow === false) cap.shadow = false;
- n.caption = cap;
- }
- }
+ if (Array.isArray(this._config.captions)) n.captions = this._config.captions;
+ else if (this._config.caption != null) n.caption = this._config.caption;
this._config = n;
this.dispatchEvent(
diff --git a/custom_components/maintenance_supporter/__init__.py b/custom_components/maintenance_supporter/__init__.py
index 67afa2a1..69b88299 100644
--- a/custom_components/maintenance_supporter/__init__.py
+++ b/custom_components/maintenance_supporter/__init__.py
@@ -14,6 +14,7 @@ from homeassistant.auth import EVENT_USER_REMOVED
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_STOP
from homeassistant.core import (
+ CoreState,
Event,
HomeAssistant,
ServiceCall,
@@ -1502,6 +1503,15 @@ async def async_setup_entry(hass: HomeAssistant, entry: MaintenanceSupporterConf
await todo_mirror.async_setup()
hass.data[DOMAIN][TODO_MIRROR_KEY] = todo_mirror
+ # 2026-10 places: tell a person what is due where they just arrived —
+ # same lifecycle as the mirrors (global entry owns it).
+ from .helpers.places import PLACES_KEY, PlaceArrivals
+
+ if PLACES_KEY not in hass.data[DOMAIN]:
+ place_arrivals = PlaceArrivals(hass)
+ place_arrivals.async_setup()
+ hass.data[DOMAIN][PLACES_KEY] = place_arrivals
+
# One-time migration: auto-enable advanced feature flags for existing users
options = dict(entry.options or entry.data)
if CONF_ADVANCED_ADAPTIVE not in options:
@@ -1727,6 +1737,14 @@ async def async_setup_entry(hass: HomeAssistant, entry: MaintenanceSupporterConf
entry.runtime_data = MaintenanceSupporterData(coordinator=coordinator, store=store)
await coordinator.async_config_entry_first_refresh()
+ # A shopping-list row checked while this object was not loaded (a
+ # reload after a task edit, a setup retry) waits for it — the resync
+ # books it now. At startup the pass after "started" covers it.
+ if hass.state is CoreState.running:
+ from .shopping_sync import schedule_resync
+
+ schedule_resync(hass)
+
# #148: a battery type that becomes known only after fleet setup (a
# Battery Notes note added later, a typed low-only Matter binary)
# never got its spare part — reconcile once per start, after the
@@ -2118,6 +2136,11 @@ async def async_unload_entry(hass: HomeAssistant, entry: MaintenanceSupporterCon
todo_mirror = hass.data.get(DOMAIN, {}).pop(TODO_MIRROR_KEY, None)
if todo_mirror is not None:
todo_mirror.async_teardown()
+ from .helpers.places import PLACES_KEY
+
+ place_arrivals = hass.data.get(DOMAIN, {}).pop(PLACES_KEY, None)
+ if place_arrivals is not None:
+ place_arrivals.async_teardown()
# NOT the full-text index: it is shared runtime (built once per boot
# by _async_setup_shared, which a hub reload does not re-run) — a
# reload of the global entry (any settings save) closed it for the
diff --git a/custom_components/maintenance_supporter/calendar.py b/custom_components/maintenance_supporter/calendar.py
index 4e56edc5..47069c16 100644
--- a/custom_components/maintenance_supporter/calendar.py
+++ b/custom_components/maintenance_supporter/calendar.py
@@ -2,6 +2,7 @@
from __future__ import annotations
+import dataclasses
import logging
from datetime import date, datetime, time, timedelta
from typing import TYPE_CHECKING, Any
@@ -700,6 +701,12 @@ class MaintenanceCalendar(CalendarEntity):
else:
live_tasks = {}
+ # 2026-10 places: an object maintained away from home names its
+ # place as the events' location (phone calendars show it).
+ from .helpers.places import object_place, zone_name
+
+ place_name = zone_name(self._hass, object_place(entry.data.get(CONF_OBJECT)))
+
# Merge static (ConfigEntry) + dynamic (Store) task data
tasks_data = merged_tasks(entry)
schedule_time_enabled = self._is_schedule_time_feature_enabled()
@@ -731,6 +738,8 @@ class MaintenanceCalendar(CalendarEntity):
event = self._create_event_for_task(task, obj_name, start_d, end_d, live_status=live.get("_status"))
if event:
+ if place_name:
+ event = dataclasses.replace(event, location=place_name)
events.append(event)
return events
diff --git a/custom_components/maintenance_supporter/config_flow_options_global.py b/custom_components/maintenance_supporter/config_flow_options_global.py
index 4ec89b55..012c9901 100644
--- a/custom_components/maintenance_supporter/config_flow_options_global.py
+++ b/custom_components/maintenance_supporter/config_flow_options_global.py
@@ -29,6 +29,7 @@ from .const import (
CONF_ADVANCED_COMPLETION_ACTIONS,
CONF_ADVANCED_ENVIRONMENTAL,
CONF_ADVANCED_GROUPS,
+ CONF_ADVANCED_PLACES,
CONF_ADVANCED_SCHEDULE_TIME,
CONF_ADVANCED_SEASONAL,
CONF_ARCHIVE_ONEOFF_DAYS,
@@ -771,6 +772,10 @@ class GlobalOptionsFlow(OptionsFlow):
CONF_ADVANCED_COMPLETION_ACTIONS,
default=self._opt(CONF_ADVANCED_COMPLETION_ACTIONS),
): selector.BooleanSelector(),
+ vol.Optional(
+ CONF_ADVANCED_PLACES,
+ default=self._opt(CONF_ADVANCED_PLACES),
+ ): selector.BooleanSelector(),
}
),
)
diff --git a/custom_components/maintenance_supporter/config_flow_options_task_trigger.py b/custom_components/maintenance_supporter/config_flow_options_task_trigger.py
index e64ee736..408c353b 100644
--- a/custom_components/maintenance_supporter/config_flow_options_task_trigger.py
+++ b/custom_components/maintenance_supporter/config_flow_options_task_trigger.py
@@ -197,17 +197,14 @@ class TriggerStepsMixin(TriggerConfigMixin):
def _clear_stale_trigger_runtime(self, old_tc: dict[str, Any], new_tc: dict[str, Any]) -> None:
"""Drop persisted trigger runtime when the trigger fundamentally changed.
- Mirrors the WS update path (websocket/tasks_crud.py): the Store
- runtime wins over config on restore (#102), so an options-flow edit
- that changes type/entities/baseline must clear it or the old
+ The same rule as the WS update path (trigger_runtime_stale): the
+ Store runtime wins over config on restore (#102), so an options-flow
+ edit that changes type/entities/baseline must clear it or the old
counters/anchors silently survive the edit (bug audit 2026-08-22).
"""
- if (
- old_tc.get("type") != new_tc.get("type")
- or old_tc.get("entity_id") != new_tc.get("entity_id")
- or old_tc.get("entity_ids") != new_tc.get("entity_ids")
- or old_tc.get("trigger_baseline_value") != new_tc.get("trigger_baseline_value")
- ):
+ from .entity.triggers import trigger_runtime_stale
+
+ if trigger_runtime_stale(old_tc, new_tc):
rd = getattr(self.config_entry, "runtime_data", None)
store = getattr(rd, "store", None) if rd else None
if store is not None:
diff --git a/custom_components/maintenance_supporter/const.py b/custom_components/maintenance_supporter/const.py
index 264e8a3c..4e1151a8 100644
--- a/custom_components/maintenance_supporter/const.py
+++ b/custom_components/maintenance_supporter/const.py
@@ -162,6 +162,9 @@ CONF_ADVANCED_SCHEDULE_TIME = "advanced_schedule_time_visible"
# Print-QR generator. Default OFF — beginners aren't overwhelmed; data
# still persists if a user toggles the flag off again.
CONF_ADVANCED_COMPLETION_ACTIONS = "advanced_completion_actions_visible"
+# 2026-10: shows the object's place (an HA zone) and "remind only on site" in
+# the panel. Visibility only, like the others: a place set before keeps working.
+CONF_ADVANCED_PLACES = "advanced_places_visible"
# Panel-access overrides: HA user IDs who get the full admin panel despite
# not being HA admins. Empty list means only admins see the full panel.
@@ -419,6 +422,10 @@ VENDOR_URL = "/maintenance_supporter_vendor"
CONF_OBJECT = "object"
CONF_OBJECT_NAME = "name"
CONF_OBJECT_AREA = "area_id"
+# 2026-10 places: an HA zone the object is maintained at (None = home), and
+# whether its reminders wait until somebody is there (helpers/places.py).
+CONF_OBJECT_PLACE = "place"
+CONF_OBJECT_REMIND_ON_SITE = "remind_on_site"
CONF_OBJECT_MANUFACTURER = "manufacturer"
CONF_OBJECT_MODEL = "model"
CONF_OBJECT_SERIAL_NUMBER = "serial_number"
@@ -838,6 +845,12 @@ SIGNAL_DOCUMENTS_UPDATED = f"{DOMAIN}_documents_updated"
# --- Trigger Completion Cooldown ---
TRIGGER_COMPLETION_COOLDOWN_SECONDS = 600 # 10 minutes
+
+# Places (helpers/places.py): a person must stay this long in a zone before
+# the arrival message goes out (a drive past a zone edge is no visit), and
+# gets it at most once per this window for the same place.
+PLACE_ARRIVAL_DWELL_SECONDS = 120
+PLACE_ARRIVAL_COOLDOWN_SECONDS = 6 * 3600
# Household double-complete window: two people tapping Complete on the same
# task within this many seconds count as ONE real-world action (journey M1).
# Short on purpose — a deliberate complete → reset → complete-again correction
diff --git a/custom_components/maintenance_supporter/coordinator.py b/custom_components/maintenance_supporter/coordinator.py
index 0130c9c8..899af2d3 100644
--- a/custom_components/maintenance_supporter/coordinator.py
+++ b/custom_components/maintenance_supporter/coordinator.py
@@ -89,6 +89,10 @@ _TRIGGER_EPOCH_TYPES = frozenset(
}
)
+# Trigger types whose refresh-time fallback reads the live entity states (the
+# others read persisted counters): only a reading may end their episode.
+_STATE_READING_TRIGGER_TYPES = frozenset({"threshold", "counter", "due_date"})
+
def _takes_day_suggestion(schedule: Schedule) -> bool:
"""True when a suggested interval IN DAYS can be applied to the schedule:
@@ -706,6 +710,14 @@ class MaintenanceCoordinator(DataUpdateCoordinator[dict[str, Any]]):
task._trigger_current_value = result.current_value
if in_cooldown:
return # the value for display only — no re-activation yet
+ if result.active is False and trigger_type in _STATE_READING_TRIGGER_TYPES and not self._trigger_has_reading(entity_ids):
+ # An episode ends on a reading, never on sensors that are all
+ # offline. The evaluators already give no verdict then; this
+ # keeps the rule for any evaluator to come: a counter read as
+ # "not reached" while it was unavailable flipped the task to OK
+ # and back, and the next restart announced the same activation
+ # again (live installation 2026-10-04).
+ return
if result.active is not None:
if task._trigger_active and not result.active:
# A recovery only this sweep saw still ends the episode.
@@ -1959,6 +1971,15 @@ class MaintenanceCoordinator(DataUpdateCoordinator[dict[str, Any]]):
task_result["_trigger_current_value"] = value
task_result["_status"] = compute_status_from_task_dict(task_result)
+ def _trigger_has_reading(self, entity_ids: list[str]) -> bool:
+ """Whether at least one of a trigger's entities has a state at all
+ (exists, and is not unavailable / unknown)."""
+ for entity_id in entity_ids:
+ state = self.hass.states.get(entity_id)
+ if state is not None and state.state not in UNAVAILABLE_STATES:
+ return True
+ return False
+
def note_trigger_cleared(self, task_id: str) -> None:
"""The task's trigger episode ended (every entity back in range).
Persisted, so :meth:`trigger_already_announced` sees the episode
diff --git a/custom_components/maintenance_supporter/entity/triggers/__init__.py b/custom_components/maintenance_supporter/entity/triggers/__init__.py
index bda183fa..a0de0a44 100644
--- a/custom_components/maintenance_supporter/entity/triggers/__init__.py
+++ b/custom_components/maintenance_supporter/entity/triggers/__init__.py
@@ -70,6 +70,28 @@ def primary_entity_id(trigger_config: Any) -> str | None:
return next((eid for eid in normalize_entity_ids(trigger_config) if isinstance(eid, str) and eid), None)
+def trigger_runtime_stale(old: Any, new: Any) -> bool:
+ """Whether a trigger edit invalidates the task's persisted trigger
+ runtime (counter baselines, runtime hours, change counts): another type,
+ other entities or an edited counting start value. The ONE rule for the
+ WebSocket update and the options flow.
+
+ The entities are compared normalized. An old task stores only the legacy
+ ``entity_id``, while every validated edit carries ``entity_ids`` too;
+ comparing the raw keys read that as "other entities", so the first save
+ of such a task wiped its baseline or hours even when only the target
+ changed (live installation 2026-10-04). A compound keeps its runtime per
+ condition and, as before, only a type change resets it.
+ """
+ old_tc = old if isinstance(old, dict) else {}
+ new_tc = new if isinstance(new, dict) else {}
+ if old_tc.get("type") != new_tc.get("type"):
+ return True
+ if new_tc.get("type") != TriggerType.COMPOUND and normalize_entity_ids(old_tc) != normalize_entity_ids(new_tc):
+ return True
+ return bool(old_tc.get("trigger_baseline_value") != new_tc.get("trigger_baseline_value"))
+
+
def _migrate_flat_to_per_entity(config: dict[str, Any], first_entity_id: str) -> dict[str, dict[str, Any]]:
"""Create ``_trigger_state`` from legacy flat keys on first load.
diff --git a/custom_components/maintenance_supporter/export.py b/custom_components/maintenance_supporter/export.py
index 48b980a4..e8572b82 100644
--- a/custom_components/maintenance_supporter/export.py
+++ b/custom_components/maintenance_supporter/export.py
@@ -227,6 +227,13 @@ def _build_export_object(
# gallery) — only emitted when set, like the fleet flag below.
if obj_data.get("template_id"):
export_obj["template_id"] = obj_data["template_id"]
+ # 2026-10 places — only when set, so an object at home exports as before.
+ # A zone id is instance-specific: on another instance without that zone
+ # the object behaves as at home and the panel says the zone is missing.
+ if obj_data.get("place"):
+ export_obj["place"] = obj_data["place"]
+ if obj_data.get("remind_on_site") is True:
+ export_obj["remind_on_site"] = True
# Battery fleet identity — only emitted for the fleet object so a plain
# object's export stays byte-identical to earlier versions. The importer
# mirrors these (and keeps the deterministic ``batt_`` part ids).
diff --git a/custom_components/maintenance_supporter/frontend-src/__tests__/_test-utils.ts b/custom_components/maintenance_supporter/frontend-src/__tests__/_test-utils.ts
index d36841ae..e27a34eb 100644
--- a/custom_components/maintenance_supporter/frontend-src/__tests__/_test-utils.ts
+++ b/custom_components/maintenance_supporter/frontend-src/__tests__/_test-utils.ts
@@ -42,12 +42,13 @@ export interface MockFeatures {
checklists: boolean;
schedule_time: boolean;
completion_actions: boolean;
+ places: boolean;
}
export const DEFAULT_FEATURES: MockFeatures = {
adaptive: false, seasonal: false,
environmental: false, budget: false, groups: false,
- checklists: false, schedule_time: false, completion_actions: false,
+ checklists: false, schedule_time: false, completion_actions: false, places: false,
};
/**
diff --git a/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-renderer.test.ts b/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-renderer.test.ts
index f1ac1b09..81d20cdd 100644
--- a/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-renderer.test.ts
+++ b/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-renderer.test.ts
@@ -69,7 +69,7 @@ function ctx(overrides: Partial = {}): TaskDetailContext {
features: {
adaptive: false, seasonal: false,
environmental: false, budget: false, groups: false,
- checklists: false, schedule_time: false, completion_actions: false,
+ checklists: false, schedule_time: false, completion_actions: false, places: false,
},
currencySymbol: "€",
collapsedSections: new Set(),
@@ -297,7 +297,7 @@ describe("task-detail renderer", () => {
features: {
adaptive: false, seasonal: false,
environmental: false, budget: false, groups: false,
- checklists: true, schedule_time: false, completion_actions: false,
+ checklists: true, schedule_time: false, completion_actions: false, places: false,
},
setChecklistItem: (item, done) => calls.push([item, done]),
}),
diff --git a/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-view.test.ts b/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-view.test.ts
index 848ebca3..a4983c16 100644
--- a/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-view.test.ts
+++ b/custom_components/maintenance_supporter/frontend-src/__tests__/task-detail-view.test.ts
@@ -66,7 +66,7 @@ function ctx(overrides: Partial = {}): TaskDetailContext {
features: {
adaptive: false, seasonal: false,
environmental: false, budget: false, groups: false,
- checklists: false, schedule_time: false, completion_actions: false,
+ checklists: false, schedule_time: false, completion_actions: false, places: false,
},
currencySymbol: "€",
collapsedSections: new Set(),
diff --git a/custom_components/maintenance_supporter/frontend-src/components/object-dialog.ts b/custom_components/maintenance_supporter/frontend-src/components/object-dialog.ts
index 5a1af106..1da2ae5e 100644
--- a/custom_components/maintenance_supporter/frontend-src/components/object-dialog.ts
+++ b/custom_components/maintenance_supporter/frontend-src/components/object-dialog.ts
@@ -21,6 +21,8 @@ export class MaintenanceObjectDialog extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
/** All objects — choices for the parent-object picker (2.19). */
@property({ attribute: false }) public objects: MaintenanceObjectResponse[] = [];
+ /** 2026-10 places: the advanced feature switch shows the place fields. */
+ @property({ type: Boolean }) public placesEnabled = false;
@state() private _open = false;
@state() private _loading = false;
@state() private _error = "";
@@ -39,6 +41,9 @@ export class MaintenanceObjectDialog extends LitElement {
// 2.19: attach to an existing HA device / nest under another object
@state() private _haDeviceId = "";
@state() private _parentEntryId = "";
+ // 2026-10 places: an HA zone ("" = home) and "remind only on site".
+ @state() private _place = "";
+ @state() private _remindOnSite = false;
@state() private _entryId: string | null = null; // null = create, string = update
// Replace (journey N1): the successor's device. The old unit's device is
// what the object links to now; a new unit usually is a new device.
@@ -63,6 +68,8 @@ export class MaintenanceObjectDialog extends LitElement {
this._notes = "";
this._haDeviceId = "";
this._parentEntryId = "";
+ this._place = "";
+ this._remindOnSite = false;
this._replacing = false;
this._error = "";
this._open = true;
@@ -96,6 +103,8 @@ export class MaintenanceObjectDialog extends LitElement {
this._notes = obj.notes || "";
this._haDeviceId = obj.ha_device_id || "";
this._parentEntryId = obj.parent_entry_id || "";
+ this._place = obj.place || "";
+ this._remindOnSite = !!obj.remind_on_site;
this._replacing = false;
this._error = "";
this._open = true;
@@ -194,6 +203,35 @@ export class MaintenanceObjectDialog extends LitElement {
`;
}
+ /** 2026-10 places: the zone the object is maintained at ("" = home) and
+ * whether its reminders wait until somebody is there. */
+ private _renderPlace(L: string) {
+ const missing = !!this._place && !this.hass?.states?.[this._place];
+ return html`
+ t("place_optional", L)}
+ @value-changed=${(e: CustomEvent) => {
+ this._place = ((e.detail.value as { place?: string })?.place as string) || "";
+ if (!this._place) this._remindOnSite = false;
+ }}
+ >
+ ${missing ? html`
${t("place_missing", L)}
` : nothing}
+
+ ${this._place ? html`
${t("remind_on_site_hint", L)}
` : nothing}
+ `;
+ }
+
private async _save(): Promise {
if (this._loading) return; // synchronous re-entry guard (double-click)
if (!this._name.trim()) return;
@@ -211,6 +249,8 @@ export class MaintenanceObjectDialog extends LitElement {
notes: this._notes.trim() || null,
ha_device_id: this._haDeviceId || null,
parent_entry_id: this._parentEntryId || null,
+ // Only with the feature on: switched off, a stored place is kept as is.
+ ...(this.placesEnabled ? { place: this._place || null, remind_on_site: !!this._place && this._remindOnSite } : {}),
};
const res = await runWs<{ device_swap?: DeviceSwap }>(
this,
@@ -278,6 +318,7 @@ export class MaintenanceObjectDialog extends LitElement {
@value-changed=${(e: CustomEvent) =>
(this._areaId = (e.detail.value as string) || "")}
>
+ ${this.placesEnabled ? this._renderPlace(L) : nothing}
{
+ const hass = getHass();
+ if (!hass) return;
+ dlg.placesEnabled = (await fetchSettingsOnce(hass)).features.places;
+}
+
export function openEditObjectDialog(
entryId: string,
obj: MaintenanceObject,
@@ -139,6 +149,7 @@ export function openEditObjectDialog(
const dlg = getOrCreate(OBJECT_DIALOG_TAG);
if (!syncHass(dlg)) return false;
dlg.openEdit(entryId, obj);
+ void applyObjectDialogSettings(dlg);
return true;
}
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/cs.json b/custom_components/maintenance_supporter/frontend-src/locales/cs.json
index 496d5a89..553503b8 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/cs.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/cs.json
@@ -545,6 +545,11 @@
"no_objects": "Zatím žádné objekty.",
"action_error": "Akce se nezdařila. Zkuste to znovu.",
"area_id_optional": "Oblast (volitelná)",
+ "place_optional": "Místo (zóna, volitelné)",
+ "remind_on_site": "Připomínat jen, když tam někdo je",
+ "remind_on_site_hint": "Připomínky čekají, dokud někdo nebude v této zóně. Kdo tam přijede, dostane zprávu s tím, co je potřeba udělat.",
+ "place_missing": "Zóna nenalezena: připomínky jako doma",
+ "place_home": "Domov",
"installation_date_optional": "Datum instalace (volitelné)",
"warranty_expiry_optional": "Konec záruky (volitelné)",
"warranty": "Záruka",
@@ -781,6 +786,8 @@
"owner_label": "Vlastník",
"feat_completion_actions": "Akce při dokončení",
"feat_completion_actions_desc": "Akce HA na úlohu při dokončení + QR rychlého dokončení s předvolenými hodnotami.",
+ "feat_places": "Místa",
+ "feat_places_desc": "Objekty udržované na jiném místě (zóna Home Assistantu): připomínky jen když tam někdo je a zpráva při příjezdu.",
"on_complete_action_title": "Při dokončení: spustit akci HA (volitelné)",
"on_complete_action_desc": "Volá službu HA, když je úloha dokončena — např. resetuje čítač na zařízení.",
"on_complete_action_target": "Cílová entita",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Používá díl: {name}",
"label_filter": "Štítek",
"all_labels": "Všechny štítky",
+ "filter_place": "Místo",
+ "filter_place_all": "Všechna místa",
"settings_notify_scope": "Upozorňovat jen pro zobrazení",
"settings_notify_scope_all": "Všechny úkoly",
"settings_notify_scope_hint": "Připomenutí posílají jen úkoly odpovídající filtrům štítku/uživatele zvoleného zobrazení. Stav, řazení a seskupení zobrazení se zde ignorují.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/da.json b/custom_components/maintenance_supporter/frontend-src/locales/da.json
index ee9fe532..e05874ee 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/da.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/da.json
@@ -547,6 +547,11 @@
"no_objects": "Ingen objekter endnu.",
"action_error": "Handlingen mislykkedes. Prøv igen.",
"area_id_optional": "Område (valgfrit)",
+ "place_optional": "Sted (zone, valgfrit)",
+ "remind_on_site": "Påmind kun, når nogen er der",
+ "remind_on_site_hint": "Påmindelser venter, til nogen er i denne zone. Den, der ankommer, får en besked med det, der skal gøres.",
+ "place_missing": "Zone ikke fundet: påmindelser som hjemme",
+ "place_home": "Hjemme",
"installation_date_optional": "Installationsdato (valgfrit)",
"warranty_expiry_optional": "Garantiens udløb (valgfrit)",
"warranty": "Garanti",
@@ -806,6 +811,8 @@
"owner_label": "Ejer",
"feat_completion_actions": "Fuldførelseshandlinger",
"feat_completion_actions_desc": "HA-handling pr. opgave ved fuldførelse + hurtig-fuldfør-QR med forudindstillede værdier.",
+ "feat_places": "Steder",
+ "feat_places_desc": "Objekter, der vedligeholdes et andet sted (en Home Assistant-zone): påmindelser kun når nogen er der, og en besked ved ankomst.",
"on_complete_action_title": "Ved fuldførelse: udløs HA-handling (valgfrit)",
"on_complete_action_desc": "Kalder en HA-tjeneste, når opgaven fuldføres — f.eks. nulstil en tæller på enheden.",
"on_complete_action_target": "Målenhed",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Bruger reservedel: {name}",
"label_filter": "Etiket",
"all_labels": "Alle etiketter",
+ "filter_place": "Sted",
+ "filter_place_all": "Alle steder",
"settings_notify_scope": "Underret kun for visning",
"settings_notify_scope_all": "Alle opgaver",
"settings_notify_scope_hint": "Kun opgaver, der matcher den valgte visnings etiket-/brugerfiltre, sender påmindelser. Visningens status, sortering og gruppering ignoreres her.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/de.json b/custom_components/maintenance_supporter/frontend-src/locales/de.json
index d6be2e3b..26e3f83f 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/de.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/de.json
@@ -547,6 +547,11 @@
"no_objects": "Keine Objekte vorhanden.",
"action_error": "Aktion fehlgeschlagen. Bitte erneut versuchen.",
"area_id_optional": "Bereich (optional)",
+ "place_optional": "Ort (Zone, optional)",
+ "remind_on_site": "Nur erinnern, wenn jemand dort ist",
+ "remind_on_site_hint": "Erinnerungen warten, bis jemand in dieser Zone ist. Wer dort ankommt, bekommt eine Nachricht mit dem, was fällig ist.",
+ "place_missing": "Zone nicht gefunden: Erinnerungen wie zuhause",
+ "place_home": "Zuhause",
"installation_date_optional": "Installationsdatum (optional)",
"warranty_expiry_optional": "Garantie-Ablauf (optional)",
"warranty": "Garantie",
@@ -806,6 +811,8 @@
"owner_label": "Besitzer",
"feat_completion_actions": "Completion-Actions",
"feat_completion_actions_desc": "Pro Aufgabe HA-Action beim Abschluss konfigurieren + Quick-Complete-QR mit voreingestellten Werten.",
+ "feat_places": "Orte",
+ "feat_places_desc": "Objekte an einem anderen Ort (eine Home-Assistant-Zone): Erinnerungen nur, wenn jemand dort ist, und eine Nachricht bei Ankunft.",
"on_complete_action_title": "Beim Abschluss: HA-Action auslösen (optional)",
"on_complete_action_desc": "Ruft beim Erledigen der Aufgabe einen HA-Service auf — z. B. einen Zähler am Gerät zurücksetzen.",
"on_complete_action_target": "Ziel-Entität",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Nutzt Ersatzteil: {name}",
"label_filter": "Label",
"all_labels": "Alle Labels",
+ "filter_place": "Ort",
+ "filter_place_all": "Alle Orte",
"settings_notify_scope": "Nur benachrichtigen für Ansicht",
"settings_notify_scope_all": "Alle Aufgaben",
"settings_notify_scope_hint": "Nur Aufgaben, die zu den Label-/Nutzer-Filtern der gewählten Ansicht passen, senden Erinnerungen. Status, Sortierung und Gruppierung der Ansicht werden hier ignoriert.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/en.json b/custom_components/maintenance_supporter/frontend-src/locales/en.json
index 963791e3..74362d38 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/en.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/en.json
@@ -547,6 +547,11 @@
"no_objects": "No objects yet.",
"action_error": "Action failed. Please try again.",
"area_id_optional": "Area (optional)",
+ "place_optional": "Place (zone, optional)",
+ "remind_on_site": "Remind only while somebody is there",
+ "remind_on_site_hint": "Reminders wait until somebody is in this zone. Whoever arrives there gets a message with what is due.",
+ "place_missing": "Zone not found: reminders as at home",
+ "place_home": "Home",
"installation_date_optional": "Installation date (optional)",
"warranty_expiry_optional": "Warranty expiry (optional)",
"warranty": "Warranty",
@@ -813,6 +818,8 @@
"owner_label": "Owner",
"feat_completion_actions": "Completion actions",
"feat_completion_actions_desc": "Per-task HA action on complete + quick-complete QR with pre-set values.",
+ "feat_places": "Places",
+ "feat_places_desc": "Objects maintained at another place (a Home Assistant zone): reminders only while somebody is there, and a message on arrival.",
"on_complete_action_title": "On complete: trigger HA action (optional)",
"on_complete_action_desc": "Calls an HA service when the task is completed — e.g. reset a counter on the device.",
"on_complete_action_target": "Target entity",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Uses part: {name}",
"label_filter": "Label",
"all_labels": "All labels",
+ "filter_place": "Place",
+ "filter_place_all": "All places",
"settings_notify_scope": "Notify only for view",
"settings_notify_scope_all": "All tasks",
"settings_notify_scope_hint": "Only tasks matching the selected saved view's label/user filters send reminders. Status, sorting and grouping of the view are ignored here.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/es.json b/custom_components/maintenance_supporter/frontend-src/locales/es.json
index 6a35fc58..614611a6 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/es.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/es.json
@@ -545,6 +545,11 @@
"no_objects": "Aún no hay objetos.",
"action_error": "Acción fallida. Inténtelo de nuevo.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Lugar (zona, opcional)",
+ "remind_on_site": "Recordar solo cuando alguien esté allí",
+ "remind_on_site_hint": "Los recordatorios esperan a que alguien esté en esta zona. Quien llega allí recibe un mensaje con lo pendiente.",
+ "place_missing": "Zona no encontrada: recordatorios como en casa",
+ "place_home": "Casa",
"installation_date_optional": "Fecha de instalación (opcional)",
"warranty_expiry_optional": "Vencimiento de garantía (opcional)",
"warranty": "Garantía",
@@ -781,6 +786,8 @@
"owner_label": "Propietario",
"feat_completion_actions": "Acciones de finalización",
"feat_completion_actions_desc": "Acción HA por tarea al completar + QR de finalización rápida con valores prefijados.",
+ "feat_places": "Lugares",
+ "feat_places_desc": "Objetos mantenidos en otro lugar (una zona de Home Assistant): recordatorios solo cuando alguien está allí y un mensaje al llegar.",
"on_complete_action_title": "Al completar: ejecutar acción HA (opcional)",
"on_complete_action_desc": "Llama un servicio HA cuando se completa la tarea — p. ej. reiniciar un contador del dispositivo.",
"on_complete_action_target": "Entidad objetivo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa la pieza: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas las etiquetas",
+ "filter_place": "Lugar",
+ "filter_place_all": "Todos los lugares",
"settings_notify_scope": "Notificar solo para la vista",
"settings_notify_scope_all": "Todas las tareas",
"settings_notify_scope_hint": "Solo las tareas que coinciden con los filtros de etiqueta/usuario de la vista seleccionada envían recordatorios. El estado, el orden y la agrupación de la vista se ignoran aquí.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/fi.json b/custom_components/maintenance_supporter/frontend-src/locales/fi.json
index 9dfb0ca3..65c11c42 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/fi.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/fi.json
@@ -547,6 +547,11 @@
"no_objects": "Ei vielä kohteita.",
"action_error": "Toiminto epäonnistui. Yritä uudelleen.",
"area_id_optional": "Alue (valinnainen)",
+ "place_optional": "Paikka (vyöhyke, valinnainen)",
+ "remind_on_site": "Muistuta vain, kun joku on paikalla",
+ "remind_on_site_hint": "Muistutukset odottavat, kunnes joku on tällä vyöhykkeellä. Sinne saapuva saa viestin tehtävistä asioista.",
+ "place_missing": "Vyöhykettä ei löydy: muistutukset kuin kotona",
+ "place_home": "Koti",
"installation_date_optional": "Asennuspäivä (valinnainen)",
"warranty_expiry_optional": "Takuun päättyminen (valinnainen)",
"warranty": "Takuu",
@@ -806,6 +811,8 @@
"owner_label": "Omistaja",
"feat_completion_actions": "Suoritustoiminnot",
"feat_completion_actions_desc": "Tehtäväkohtainen HA-toiminto suorituksen yhteydessä + pikasuoritus-QR esiasetetuilla arvoilla.",
+ "feat_places": "Paikat",
+ "feat_places_desc": "Toisessa paikassa (Home Assistant -vyöhyke) huollettavat kohteet: muistutukset vain, kun joku on paikalla, ja viesti saavuttaessa.",
"on_complete_action_title": "Suorituksen yhteydessä: laukaise HA-toiminto (valinnainen)",
"on_complete_action_desc": "Kutsuu HA-palvelua, kun tehtävä suoritetaan — esim. nollaa laitteen laskuri.",
"on_complete_action_target": "Kohde-entiteetti",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Käyttää varaosaa: {name}",
"label_filter": "Tunniste",
"all_labels": "Kaikki tunnisteet",
+ "filter_place": "Paikka",
+ "filter_place_all": "Kaikki paikat",
"settings_notify_scope": "Ilmoita vain näkymälle",
"settings_notify_scope_all": "Kaikki tehtävät",
"settings_notify_scope_hint": "Vain valitun näkymän tunniste-/käyttäjäsuodattimiin osuvat tehtävät lähettävät muistutuksia. Näkymän tila, lajittelu ja ryhmittely ohitetaan tässä.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/fr.json b/custom_components/maintenance_supporter/frontend-src/locales/fr.json
index b83b4dfc..87b6809c 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/fr.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/fr.json
@@ -545,6 +545,11 @@
"no_objects": "Aucun objet pour l'instant.",
"action_error": "Action échouée. Veuillez réessayer.",
"area_id_optional": "Zone (optionnel)",
+ "place_optional": "Lieu (zone, facultatif)",
+ "remind_on_site": "Rappeler seulement quand quelqu'un y est",
+ "remind_on_site_hint": "Les rappels attendent que quelqu'un soit dans cette zone. Qui y arrive reçoit un message avec ce qui est à faire.",
+ "place_missing": "Zone introuvable : rappels comme à la maison",
+ "place_home": "Domicile",
"installation_date_optional": "Date d'installation (optionnel)",
"warranty_expiry_optional": "Fin de garantie (optionnel)",
"warranty": "Garantie",
@@ -781,6 +786,8 @@
"owner_label": "Propriétaire",
"feat_completion_actions": "Actions de finalisation",
"feat_completion_actions_desc": "Action HA par tâche lors de la finalisation + QR de finalisation rapide avec valeurs pré-définies.",
+ "feat_places": "Lieux",
+ "feat_places_desc": "Objets entretenus à un autre endroit (une zone Home Assistant) : rappels seulement quand quelqu'un y est, et un message à l'arrivée.",
"on_complete_action_title": "À la finalisation : déclencher une action HA (optionnel)",
"on_complete_action_desc": "Appelle un service HA quand la tâche est terminée — p. ex. réinitialiser un compteur sur l'appareil.",
"on_complete_action_target": "Entité cible",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Utilise la pièce : {name}",
"label_filter": "Étiquette",
"all_labels": "Toutes les étiquettes",
+ "filter_place": "Lieu",
+ "filter_place_all": "Tous les lieux",
"settings_notify_scope": "Notifier uniquement pour la vue",
"settings_notify_scope_all": "Toutes les tâches",
"settings_notify_scope_hint": "Seules les tâches correspondant aux filtres étiquette/utilisateur de la vue choisie envoient des rappels. Le statut, le tri et le regroupement de la vue sont ignorés ici.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/hi.json b/custom_components/maintenance_supporter/frontend-src/locales/hi.json
index ff6aad53..94fdc93d 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/hi.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/hi.json
@@ -547,6 +547,11 @@
"no_objects": "अभी कोई वस्तु नहीं।",
"action_error": "क्रिया विफल। कृपया पुनः प्रयास करें।",
"area_id_optional": "क्षेत्र (वैकल्पिक)",
+ "place_optional": "स्थान (ज़ोन, वैकल्पिक)",
+ "remind_on_site": "केवल तब याद दिलाएँ जब कोई वहाँ हो",
+ "remind_on_site_hint": "रिमाइंडर तब तक रुकते हैं जब तक कोई इस ज़ोन में न हो। वहाँ पहुँचने वाले को बाकी कामों का संदेश मिलता है।",
+ "place_missing": "ज़ोन नहीं मिला: रिमाइंडर घर जैसे",
+ "place_home": "घर",
"installation_date_optional": "स्थापना तिथि (वैकल्पिक)",
"warranty_expiry_optional": "वारंटी समाप्ति (वैकल्पिक)",
"warranty": "वारंटी",
@@ -806,6 +811,8 @@
"owner_label": "स्वामी",
"feat_completion_actions": "पूर्णता क्रियाएँ",
"feat_completion_actions_desc": "पूर्ण होने पर प्रति-कार्य HA क्रिया + पूर्व-निर्धारित मानों के साथ त्वरित-पूर्ण QR।",
+ "feat_places": "स्थान",
+ "feat_places_desc": "किसी दूसरी जगह (Home Assistant ज़ोन) पर रखरखाव वाले ऑब्जेक्ट: रिमाइंडर तभी जब कोई वहाँ हो, और पहुँचने पर एक संदेश।",
"on_complete_action_title": "पूर्ण होने पर: HA क्रिया ट्रिगर करें (वैकल्पिक)",
"on_complete_action_desc": "कार्य पूर्ण होने पर एक HA सेवा कॉल करता है — उदा. डिवाइस पर काउंटर रीसेट करना।",
"on_complete_action_target": "लक्ष्य एंटिटी",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "पुर्ज़ा उपयोग करता है: {name}",
"label_filter": "लेबल",
"all_labels": "सभी लेबल",
+ "filter_place": "स्थान",
+ "filter_place_all": "सभी स्थान",
"settings_notify_scope": "केवल इस व्यू के लिए सूचित करें",
"settings_notify_scope_all": "सभी कार्य",
"settings_notify_scope_hint": "केवल वे कार्य अनुस्मारक भेजते हैं जो चुने गए व्यू के लेबल/उपयोगकर्ता फ़िल्टर से मेल खाते हैं। व्यू की स्थिति, क्रम और समूहन यहाँ अनदेखे रहते हैं।",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/hu.json b/custom_components/maintenance_supporter/frontend-src/locales/hu.json
index c819bab9..0fe88085 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/hu.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/hu.json
@@ -547,6 +547,11 @@
"no_objects": "Még nincsenek objektumok.",
"action_error": "A művelet nem sikerült. Próbálja újra.",
"area_id_optional": "Terület (opcionális)",
+ "place_optional": "Helyszín (zóna, opcionális)",
+ "remind_on_site": "Csak akkor emlékeztessen, ha valaki ott van",
+ "remind_on_site_hint": "Az emlékeztetők megvárják, amíg valaki ebben a zónában lesz. Aki odaér, üzenetet kap az esedékes teendőkről.",
+ "place_missing": "A zóna nem található: emlékeztetők, mint otthon",
+ "place_home": "Otthon",
"installation_date_optional": "Telepítés dátuma (opcionális)",
"warranty_expiry_optional": "Garancia lejárta (opcionális)",
"warranty": "Garancia",
@@ -813,6 +818,8 @@
"owner_label": "Tulajdonos",
"feat_completion_actions": "Elvégzési műveletek",
"feat_completion_actions_desc": "Feladatonkénti HA művelet elvégzéskor + gyorselvégző QR előre beállított értékekkel.",
+ "feat_places": "Helyszínek",
+ "feat_places_desc": "Másik helyszínen (Home Assistant-zóna) karbantartott objektumok: emlékeztető csak akkor, ha valaki ott van, és üzenet érkezéskor.",
"on_complete_action_title": "Elvégzéskor: HA művelet indítása (opcionális)",
"on_complete_action_desc": "HA szolgáltatást hív meg a feladat elvégzésekor — pl. számláló nullázása az eszközön.",
"on_complete_action_target": "Cél entitás",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Alkatrészt használ: {name}",
"label_filter": "Címke",
"all_labels": "Minden címke",
+ "filter_place": "Helyszín",
+ "filter_place_all": "Minden helyszín",
"settings_notify_scope": "Értesítés csak erre a nézetre",
"settings_notify_scope_all": "Minden feladat",
"settings_notify_scope_hint": "Csak a kiválasztott mentett nézet címke-/felhasználószűrőinek megfelelő feladatok küldenek emlékeztetőt. A nézet állapot-, rendezési és csoportosítási beállításait itt figyelmen kívül hagyjuk.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/it.json b/custom_components/maintenance_supporter/frontend-src/locales/it.json
index 25a11695..d7426916 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/it.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/it.json
@@ -545,6 +545,11 @@
"no_objects": "Nessun oggetto ancora.",
"action_error": "Azione fallita. Riprova.",
"area_id_optional": "Area (opzionale)",
+ "place_optional": "Luogo (zona, facoltativo)",
+ "remind_on_site": "Ricorda solo quando qualcuno è lì",
+ "remind_on_site_hint": "I promemoria aspettano che qualcuno sia in questa zona. Chi arriva lì riceve un messaggio con ciò che è da fare.",
+ "place_missing": "Zona non trovata: promemoria come a casa",
+ "place_home": "Casa",
"installation_date_optional": "Data di installazione (opzionale)",
"warranty_expiry_optional": "Scadenza garanzia (opzionale)",
"warranty": "Garanzia",
@@ -781,6 +786,8 @@
"owner_label": "Proprietario",
"feat_completion_actions": "Azioni di completamento",
"feat_completion_actions_desc": "Azione HA per attività al completamento + QR completamento rapido con valori predefiniti.",
+ "feat_places": "Luoghi",
+ "feat_places_desc": "Oggetti curati in un altro luogo (una zona di Home Assistant): promemoria solo quando qualcuno è lì e un messaggio all'arrivo.",
"on_complete_action_title": "Al completamento: attiva azione HA (opzionale)",
"on_complete_action_desc": "Chiama un servizio HA quando l'attività viene completata — es. azzerare un contatore sul dispositivo.",
"on_complete_action_target": "Entità target",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa il ricambio: {name}",
"label_filter": "Etichetta",
"all_labels": "Tutte le etichette",
+ "filter_place": "Luogo",
+ "filter_place_all": "Tutti i luoghi",
"settings_notify_scope": "Notifica solo per la vista",
"settings_notify_scope_all": "Tutte le attività",
"settings_notify_scope_hint": "Solo le attività che corrispondono ai filtri etichetta/utente della vista scelta inviano promemoria. Stato, ordinamento e raggruppamento della vista qui vengono ignorati.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/ja.json b/custom_components/maintenance_supporter/frontend-src/locales/ja.json
index cde6c06d..19acbefa 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/ja.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/ja.json
@@ -547,6 +547,11 @@
"no_objects": "対象がまだありません。",
"action_error": "操作に失敗しました。もう一度お試しください。",
"area_id_optional": "エリア(任意)",
+ "place_optional": "場所(ゾーン、任意)",
+ "remind_on_site": "誰かがいるときだけリマインド",
+ "remind_on_site_hint": "リマインドは誰かがこのゾーンにいるまで待機します。到着した人には、やるべきことをまとめたメッセージが届きます。",
+ "place_missing": "ゾーンが見つかりません:自宅と同じようにリマインドします",
+ "place_home": "自宅",
"installation_date_optional": "設置日(任意)",
"warranty_expiry_optional": "保証期限(任意)",
"warranty": "保証",
@@ -806,6 +811,8 @@
"owner_label": "オーナー",
"feat_completion_actions": "完了時アクション",
"feat_completion_actions_desc": "タスクごとの完了時HAアクション+事前設定値付きのクイック完了QR。",
+ "feat_places": "場所",
+ "feat_places_desc": "別の場所(Home Assistant のゾーン)で管理するオブジェクト:誰かがその場にいるときだけリマインドし、到着時に通知します。",
"on_complete_action_title": "完了時: HAアクションを実行(任意)",
"on_complete_action_desc": "タスク完了時にHAサービスを呼び出します — 例: デバイスのカウンターをリセット。",
"on_complete_action_target": "対象エンティティ",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "使用する部品: {name}",
"label_filter": "ラベル",
"all_labels": "すべてのラベル",
+ "filter_place": "場所",
+ "filter_place_all": "すべての場所",
"settings_notify_scope": "このビューのみ通知",
"settings_notify_scope_all": "すべてのタスク",
"settings_notify_scope_hint": "選択した保存済みビューのラベル/ユーザーフィルターに一致するタスクのみがリマインダーを送信します。ビューのステータス・並び順・グループ化はここでは無視されます。",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/ko.json b/custom_components/maintenance_supporter/frontend-src/locales/ko.json
index dff2c732..10b873b2 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/ko.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/ko.json
@@ -547,6 +547,11 @@
"no_objects": "아직 객체가 없습니다.",
"action_error": "동작에 실패했습니다. 다시 시도해 주세요.",
"area_id_optional": "구역 (선택)",
+ "place_optional": "장소 (구역, 선택 사항)",
+ "remind_on_site": "누군가 있을 때만 알림",
+ "remind_on_site_hint": "누군가 이 구역에 있을 때까지 알림이 대기합니다. 그곳에 도착한 사람은 해야 할 일을 담은 메시지를 받습니다.",
+ "place_missing": "구역을 찾을 수 없음: 집과 같이 알림",
+ "place_home": "집",
"installation_date_optional": "설치일 (선택)",
"warranty_expiry_optional": "보증 만료일 (선택)",
"warranty": "보증",
@@ -813,6 +818,8 @@
"owner_label": "소유자",
"feat_completion_actions": "완료 동작",
"feat_completion_actions_desc": "완료 시 작업별 HA 동작 실행 + 사전 설정값이 있는 빠른 완료 QR.",
+ "feat_places": "장소",
+ "feat_places_desc": "다른 장소(Home Assistant 구역)에서 관리하는 개체: 누군가 그곳에 있을 때만 알림을 보내고, 도착하면 메시지를 보냅니다.",
"on_complete_action_title": "완료 시: HA 동작 실행 (선택)",
"on_complete_action_desc": "작업이 완료되면 HA 서비스를 호출합니다 — 예: 기기의 카운터 초기화.",
"on_complete_action_target": "대상 엔티티",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "사용 부품: {name}",
"label_filter": "라벨",
"all_labels": "모든 라벨",
+ "filter_place": "장소",
+ "filter_place_all": "모든 장소",
"settings_notify_scope": "특정 보기만 알림",
"settings_notify_scope_all": "모든 작업",
"settings_notify_scope_hint": "선택한 저장된 보기의 라벨/사용자 필터와 일치하는 작업만 알림을 보냅니다. 보기의 상태·정렬·그룹화는 여기서 무시됩니다.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/nb.json b/custom_components/maintenance_supporter/frontend-src/locales/nb.json
index d0640429..49db1a37 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/nb.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/nb.json
@@ -547,6 +547,11 @@
"no_objects": "Ingen objekter ennå.",
"action_error": "Handlingen mislyktes. Prøv igjen.",
"area_id_optional": "Område (valgfritt)",
+ "place_optional": "Sted (sone, valgfritt)",
+ "remind_on_site": "Påminn bare når noen er der",
+ "remind_on_site_hint": "Påminnelser venter til noen er i denne sonen. Den som kommer dit, får en melding med det som skal gjøres.",
+ "place_missing": "Fant ikke sonen: påminnelser som hjemme",
+ "place_home": "Hjemme",
"installation_date_optional": "Installasjonsdato (valgfritt)",
"warranty_expiry_optional": "Garanti utløper (valgfritt)",
"warranty": "Garanti",
@@ -806,6 +811,8 @@
"owner_label": "Eier",
"feat_completion_actions": "Fullføringshandlinger",
"feat_completion_actions_desc": "HA-handling per oppgave ved fullføring + hurtigfullføring med QR og forhåndsinnstilte verdier.",
+ "feat_places": "Steder",
+ "feat_places_desc": "Objekter som vedlikeholdes et annet sted (en Home Assistant-sone): påminnelser bare når noen er der, og en melding ved ankomst.",
"on_complete_action_title": "Ved fullføring: utløs HA-handling (valgfritt)",
"on_complete_action_desc": "Kaller en HA-tjeneste når oppgaven fullføres — f.eks. tilbakestille en teller på enheten.",
"on_complete_action_target": "Målentitet",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Bruker del: {name}",
"label_filter": "Etikett",
"all_labels": "Alle etiketter",
+ "filter_place": "Sted",
+ "filter_place_all": "Alle steder",
"settings_notify_scope": "Varsle kun for visning",
"settings_notify_scope_all": "Alle oppgaver",
"settings_notify_scope_hint": "Bare oppgaver som matcher etikett-/brukerfiltrene til valgt visning sender påminnelser. Visningens status, sortering og gruppering ignoreres her.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/nl.json b/custom_components/maintenance_supporter/frontend-src/locales/nl.json
index 82b507ac..90df823c 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/nl.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/nl.json
@@ -545,6 +545,11 @@
"no_objects": "Nog geen objecten.",
"action_error": "Actie mislukt. Probeer het opnieuw.",
"area_id_optional": "Gebied (optioneel)",
+ "place_optional": "Locatie (zone, optioneel)",
+ "remind_on_site": "Alleen herinneren als er iemand is",
+ "remind_on_site_hint": "Herinneringen wachten tot iemand in deze zone is. Wie daar aankomt, krijgt een bericht met wat er te doen is.",
+ "place_missing": "Zone niet gevonden: herinneringen zoals thuis",
+ "place_home": "Thuis",
"installation_date_optional": "Installatiedatum (optioneel)",
"warranty_expiry_optional": "Garantie verloopt (optioneel)",
"warranty": "Garantie",
@@ -781,6 +786,8 @@
"owner_label": "Eigenaar",
"feat_completion_actions": "Voltooiings-acties",
"feat_completion_actions_desc": "Per taak HA-actie bij voltooien + snel-voltooien-QR met vooraf ingestelde waarden.",
+ "feat_places": "Locaties",
+ "feat_places_desc": "Objecten op een andere locatie (een Home Assistant-zone): herinneringen alleen als er iemand is, en een bericht bij aankomst.",
"on_complete_action_title": "Bij voltooien: HA-actie uitvoeren (optioneel)",
"on_complete_action_desc": "Roept een HA-service aan wanneer de taak is voltooid — bv. een teller op het apparaat resetten.",
"on_complete_action_target": "Doel-entiteit",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Gebruikt onderdeel: {name}",
"label_filter": "Label",
"all_labels": "Alle labels",
+ "filter_place": "Locatie",
+ "filter_place_all": "Alle locaties",
"settings_notify_scope": "Alleen melden voor weergave",
"settings_notify_scope_all": "Alle taken",
"settings_notify_scope_hint": "Alleen taken die overeenkomen met de label-/gebruikersfilters van de gekozen weergave sturen herinneringen. Status, sortering en groepering van de weergave worden hier genegeerd.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/pl.json b/custom_components/maintenance_supporter/frontend-src/locales/pl.json
index e7d7b605..bd71473e 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/pl.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/pl.json
@@ -545,6 +545,11 @@
"no_objects": "Brak obiektów.",
"action_error": "Akcja nie powiodła się. Spróbuj ponownie.",
"area_id_optional": "Obszar (opcjonalny)",
+ "place_optional": "Miejsce (strefa, opcjonalnie)",
+ "remind_on_site": "Przypominaj tylko, gdy ktoś tam jest",
+ "remind_on_site_hint": "Przypomnienia czekają, aż ktoś będzie w tej strefie. Kto tam przyjedzie, dostaje wiadomość z tym, co jest do zrobienia.",
+ "place_missing": "Nie znaleziono strefy: przypomnienia jak w domu",
+ "place_home": "Dom",
"installation_date_optional": "Data instalacji (opcjonalna)",
"warranty_expiry_optional": "Wygaśnięcie gwarancji (opcjonalnie)",
"warranty": "Gwarancja",
@@ -781,6 +786,8 @@
"owner_label": "Właściciel",
"feat_completion_actions": "Akcje po zakończeniu",
"feat_completion_actions_desc": "Akcja HA per zadanie po zakończeniu + QR szybkiego zakończenia z predefiniowanymi wartościami.",
+ "feat_places": "Miejsca",
+ "feat_places_desc": "Obiekty w innym miejscu (strefa Home Assistant): przypomnienia tylko wtedy, gdy ktoś tam jest, i wiadomość po przybyciu.",
"on_complete_action_title": "Po zakończeniu: wywołaj akcję HA (opcjonalnie)",
"on_complete_action_desc": "Wywołuje usługę HA po zakończeniu zadania — np. zresetuj licznik urządzenia.",
"on_complete_action_target": "Encja docelowa",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Używa części: {name}",
"label_filter": "Etykieta",
"all_labels": "Wszystkie etykiety",
+ "filter_place": "Miejsce",
+ "filter_place_all": "Wszystkie miejsca",
"settings_notify_scope": "Powiadamiaj tylko dla widoku",
"settings_notify_scope_all": "Wszystkie zadania",
"settings_notify_scope_hint": "Przypomnienia wysyłają tylko zadania pasujące do filtrów etykiety/użytkownika wybranego widoku. Status, sortowanie i grupowanie widoku są tu ignorowane.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/pt-br.json b/custom_components/maintenance_supporter/frontend-src/locales/pt-br.json
index 03c1a270..af53a8f0 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/pt-br.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/pt-br.json
@@ -547,6 +547,11 @@
"no_objects": "Ainda não há objetos.",
"action_error": "A ação falhou. Tente novamente.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Local (zona, opcional)",
+ "remind_on_site": "Lembrar só quando alguém estiver lá",
+ "remind_on_site_hint": "Os lembretes esperam até alguém estar nesta zona. Quem chega lá recebe uma mensagem com o que está pendente.",
+ "place_missing": "Zona não encontrada: lembretes como em casa",
+ "place_home": "Casa",
"installation_date_optional": "Data de instalação (opcional)",
"warranty_expiry_optional": "Fim da garantia (opcional)",
"warranty": "Garantia",
@@ -813,6 +818,8 @@
"owner_label": "Proprietário",
"feat_completion_actions": "Ações de conclusão",
"feat_completion_actions_desc": "Ação do HA por tarefa ao concluir + QR de conclusão rápida com valores predefinidos.",
+ "feat_places": "Locais",
+ "feat_places_desc": "Objetos mantidos em outro local (uma zona do Home Assistant): lembretes só quando alguém está lá e uma mensagem na chegada.",
"on_complete_action_title": "Ao concluir: acionar ação do HA (opcional)",
"on_complete_action_desc": "Chama um serviço do HA quando a tarefa é concluída — ex.: zerar um contador no dispositivo.",
"on_complete_action_target": "Entidade alvo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa a peça: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas as etiquetas",
+ "filter_place": "Local",
+ "filter_place_all": "Todos os locais",
"settings_notify_scope": "Notificar apenas para a visualização",
"settings_notify_scope_all": "Todas as tarefas",
"settings_notify_scope_hint": "Apenas tarefas que correspondem aos filtros de etiqueta/usuário da visualização salva selecionada enviam lembretes. Status, ordenação e agrupamento da visualização são ignorados aqui.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/pt.json b/custom_components/maintenance_supporter/frontend-src/locales/pt.json
index 35d58bf1..48941a72 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/pt.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/pt.json
@@ -545,6 +545,11 @@
"no_objects": "Ainda sem objetos.",
"action_error": "Ação falhada. Tente novamente.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Local (zona, opcional)",
+ "remind_on_site": "Lembrar só quando alguém lá estiver",
+ "remind_on_site_hint": "Os lembretes esperam até alguém estar nesta zona. Quem lá chega recebe uma mensagem com o que está pendente.",
+ "place_missing": "Zona não encontrada: lembretes como em casa",
+ "place_home": "Casa",
"installation_date_optional": "Data de instalação (opcional)",
"warranty_expiry_optional": "Validade da garantia (opcional)",
"warranty": "Garantia",
@@ -781,6 +786,8 @@
"owner_label": "Proprietário",
"feat_completion_actions": "Ações de conclusão",
"feat_completion_actions_desc": "Ação HA por tarefa ao concluir + QR de conclusão rápida com valores predefinidos.",
+ "feat_places": "Locais",
+ "feat_places_desc": "Objetos mantidos noutro local (uma zona do Home Assistant): lembretes só quando alguém lá está e uma mensagem à chegada.",
"on_complete_action_title": "Na conclusão: acionar ação HA (opcional)",
"on_complete_action_desc": "Chama um serviço HA quando a tarefa é concluída — p. ex. reiniciar um contador no dispositivo.",
"on_complete_action_target": "Entidade alvo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa a peça: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas as etiquetas",
+ "filter_place": "Local",
+ "filter_place_all": "Todos os locais",
"settings_notify_scope": "Notificar apenas para a vista",
"settings_notify_scope_all": "Todas as tarefas",
"settings_notify_scope_hint": "Apenas as tarefas que correspondem aos filtros de etiqueta/utilizador da vista escolhida enviam lembretes. O estado, a ordenação e o agrupamento da vista são ignorados aqui.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/ru.json b/custom_components/maintenance_supporter/frontend-src/locales/ru.json
index 30823484..788f909c 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/ru.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/ru.json
@@ -545,6 +545,11 @@
"no_objects": "Пока нет объектов.",
"action_error": "Не удалось выполнить действие. Попробуйте ещё раз.",
"area_id_optional": "Зона (опционально)",
+ "place_optional": "Место (зона, необязательно)",
+ "remind_on_site": "Напоминать, только когда там кто-то есть",
+ "remind_on_site_hint": "Напоминания ждут, пока кто-нибудь окажется в этой зоне. Кто туда приезжает, получает сообщение о том, что нужно сделать.",
+ "place_missing": "Зона не найдена: напоминания как дома",
+ "place_home": "Дом",
"installation_date_optional": "Дата установки (опционально)",
"warranty_expiry_optional": "Окончание гарантии (опционально)",
"warranty": "Гарантия",
@@ -781,6 +786,8 @@
"owner_label": "Владелец",
"feat_completion_actions": "Действия при завершении",
"feat_completion_actions_desc": "HA-действие по задаче при завершении + QR быстрого завершения с предустановленными значениями.",
+ "feat_places": "Места",
+ "feat_places_desc": "Объекты в другом месте (зона Home Assistant): напоминания только когда там кто-то есть, и сообщение по прибытии.",
"on_complete_action_title": "При завершении: запустить HA-действие (опционально)",
"on_complete_action_desc": "Вызывает HA-сервис при завершении задачи — напр., сбросить счётчик на устройстве.",
"on_complete_action_target": "Целевая сущность",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Использует деталь: {name}",
"label_filter": "Метка",
"all_labels": "Все метки",
+ "filter_place": "Место",
+ "filter_place_all": "Все места",
"settings_notify_scope": "Уведомлять только для представления",
"settings_notify_scope_all": "Все задачи",
"settings_notify_scope_hint": "Напоминания отправляют только задачи, совпадающие с фильтрами метки/пользователя выбранного представления. Статус, сортировка и группировка представления здесь игнорируются.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/sv.json b/custom_components/maintenance_supporter/frontend-src/locales/sv.json
index 2ed19dbc..7780d503 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/sv.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/sv.json
@@ -545,6 +545,11 @@
"no_objects": "Inga objekt än.",
"action_error": "Åtgärden misslyckades. Försök igen.",
"area_id_optional": "Område (valfritt)",
+ "place_optional": "Plats (zon, valfritt)",
+ "remind_on_site": "Påminn bara när någon är där",
+ "remind_on_site_hint": "Påminnelser väntar tills någon är i den här zonen. Den som kommer dit får ett meddelande med det som ska göras.",
+ "place_missing": "Zonen hittades inte: påminnelser som hemma",
+ "place_home": "Hemma",
"installation_date_optional": "Installationsdatum (valfritt)",
"warranty_expiry_optional": "Garantins utgång (valfritt)",
"warranty": "Garanti",
@@ -781,6 +786,8 @@
"owner_label": "Ägare",
"feat_completion_actions": "Slutförande-åtgärder",
"feat_completion_actions_desc": "HA-åtgärd per uppgift vid slutförande + snabb-slutför-QR med förinställda värden.",
+ "feat_places": "Platser",
+ "feat_places_desc": "Objekt som sköts på en annan plats (en Home Assistant-zon): påminnelser bara när någon är där, och ett meddelande vid ankomst.",
"on_complete_action_title": "Vid slutförande: utlös HA-åtgärd (valfritt)",
"on_complete_action_desc": "Anropar en HA-tjänst när uppgiften slutförs — t.ex. återställ en räknare på enheten.",
"on_complete_action_target": "Målentitet",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Använder reservdel: {name}",
"label_filter": "Etikett",
"all_labels": "Alla etiketter",
+ "filter_place": "Plats",
+ "filter_place_all": "Alla platser",
"settings_notify_scope": "Avisera endast för vy",
"settings_notify_scope_all": "Alla uppgifter",
"settings_notify_scope_hint": "Endast uppgifter som matchar den valda vyns etikett-/användarfilter skickar påminnelser. Vyns status, sortering och gruppering ignoreras här.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/tr.json b/custom_components/maintenance_supporter/frontend-src/locales/tr.json
index 26f2d7af..b65b9f5a 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/tr.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/tr.json
@@ -547,6 +547,11 @@
"no_objects": "Henüz nesne yok.",
"action_error": "Eylem başarısız oldu. Lütfen tekrar deneyin.",
"area_id_optional": "Alan (isteğe bağlı)",
+ "place_optional": "Yer (bölge, isteğe bağlı)",
+ "remind_on_site": "Yalnızca biri oradayken hatırlat",
+ "remind_on_site_hint": "Hatırlatmalar biri bu bölgede olana kadar bekler. Oraya varan kişi yapılacakların listesini içeren bir mesaj alır.",
+ "place_missing": "Bölge bulunamadı: hatırlatmalar evdeki gibi",
+ "place_home": "Ev",
"installation_date_optional": "Kurulum tarihi (isteğe bağlı)",
"warranty_expiry_optional": "Garanti bitişi (isteğe bağlı)",
"warranty": "Garanti",
@@ -813,6 +818,8 @@
"owner_label": "Sahip",
"feat_completion_actions": "Tamamlama eylemleri",
"feat_completion_actions_desc": "Görev başına tamamlamada HA eylemi + önceden ayarlı değerlerle hızlı tamamlama QR'ı.",
+ "feat_places": "Yerler",
+ "feat_places_desc": "Başka bir yerde (Home Assistant bölgesi) bakımı yapılan nesneler: hatırlatmalar yalnızca biri oradayken, varışta bir mesaj.",
"on_complete_action_title": "Tamamlandığında: HA eylemi tetikle (isteğe bağlı)",
"on_complete_action_desc": "Görev tamamlandığında bir HA servisi çağırır — örn. cihazdaki bir sayacı sıfırlar.",
"on_complete_action_target": "Hedef varlık",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Kullanılan parça: {name}",
"label_filter": "Etiket",
"all_labels": "Tüm etiketler",
+ "filter_place": "Yer",
+ "filter_place_all": "Tüm yerler",
"settings_notify_scope": "Yalnızca şu görünüm için bildir",
"settings_notify_scope_all": "Tüm görevler",
"settings_notify_scope_hint": "Yalnızca seçili kayıtlı görünümün etiket/kullanıcı filtreleriyle eşleşen görevler hatırlatma gönderir. Görünümün durum, sıralama ve gruplaması burada dikkate alınmaz.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/uk.json b/custom_components/maintenance_supporter/frontend-src/locales/uk.json
index e013ceb3..40d4978a 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/uk.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/uk.json
@@ -545,6 +545,11 @@
"no_objects": "Поки немає об'єктів.",
"action_error": "Дія не вдалась. Спробуйте ще раз.",
"area_id_optional": "Зона (необов'язково)",
+ "place_optional": "Місце (зона, необов'язково)",
+ "remind_on_site": "Нагадувати, лише коли там хтось є",
+ "remind_on_site_hint": "Нагадування чекають, поки хтось буде в цій зоні. Хто туди прибуває, отримує повідомлення про те, що потрібно зробити.",
+ "place_missing": "Зону не знайдено: нагадування як удома",
+ "place_home": "Дім",
"installation_date_optional": "Дата встановлення (необов'язково)",
"warranty_expiry_optional": "Закінчення гарантії (необов'язково)",
"warranty": "Гарантія",
@@ -781,6 +786,8 @@
"owner_label": "Власник",
"feat_completion_actions": "Дії при завершенні",
"feat_completion_actions_desc": "Дія HA по завданню при завершенні + QR швидкого завершення з попередньо встановленими значеннями.",
+ "feat_places": "Місця",
+ "feat_places_desc": "Об'єкти в іншому місці (зона Home Assistant): нагадування лише тоді, коли там хтось є, і повідомлення після прибуття.",
"on_complete_action_title": "При завершенні: викликати HA-дію (опційно)",
"on_complete_action_desc": "Викликає HA-сервіс, коли завдання завершено — напр., скинути лічильник на пристрої.",
"on_complete_action_target": "Цільова сутність",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Використовує деталь: {name}",
"label_filter": "Мітка",
"all_labels": "Усі мітки",
+ "filter_place": "Місце",
+ "filter_place_all": "Усі місця",
"settings_notify_scope": "Сповіщати лише для подання",
"settings_notify_scope_all": "Усі завдання",
"settings_notify_scope_hint": "Нагадування надсилають лише завдання, що відповідають фільтрам мітки/користувача обраного подання. Статус, сортування та групування подання тут ігноруються.",
diff --git a/custom_components/maintenance_supporter/frontend-src/locales/zh.json b/custom_components/maintenance_supporter/frontend-src/locales/zh.json
index 64d4d24a..ed804b8e 100644
--- a/custom_components/maintenance_supporter/frontend-src/locales/zh.json
+++ b/custom_components/maintenance_supporter/frontend-src/locales/zh.json
@@ -547,6 +547,11 @@
"no_objects": "暂无维护项。",
"action_error": "操作失败。请重试。",
"area_id_optional": "区域 (可选)",
+ "place_optional": "地点(区域,可选)",
+ "remind_on_site": "仅当有人在场时提醒",
+ "remind_on_site_hint": "提醒会等到有人在此区域时再发送。到达那里的人会收到一条列出待办事项的消息。",
+ "place_missing": "未找到区域:按在家处理提醒",
+ "place_home": "家",
"installation_date_optional": "安装日期 (可选)",
"warranty_expiry_optional": "保修到期 (可选)",
"warranty": "保修",
@@ -806,6 +811,8 @@
"owner_label": "所有者",
"feat_completion_actions": "完成动作",
"feat_completion_actions_desc": "为每个任务配置完成时的 HA 动作 + 预设值的快速完成二维码。",
+ "feat_places": "地点",
+ "feat_places_desc": "在其他地点(Home Assistant 区域)维护的对象:仅当有人在场时提醒,并在到达时发送消息。",
"on_complete_action_title": "完成时:触发 HA 动作(可选)",
"on_complete_action_desc": "任务完成时调用 HA 服务 — 例如重置设备上的物理计数器。",
"on_complete_action_target": "目标实体",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "使用配件:{name}",
"label_filter": "标签",
"all_labels": "所有标签",
+ "filter_place": "地点",
+ "filter_place_all": "所有地点",
"settings_notify_scope": "仅为该视图发送通知",
"settings_notify_scope_all": "所有任务",
"settings_notify_scope_hint": "只有匹配所选视图的标签/用户筛选的任务才会发送提醒。视图的状态、排序和分组在此处被忽略。",
diff --git a/custom_components/maintenance_supporter/frontend-src/maintenance-panel.ts b/custom_components/maintenance_supporter/frontend-src/maintenance-panel.ts
index ea37680f..f91baef3 100644
--- a/custom_components/maintenance_supporter/frontend-src/maintenance-panel.ts
+++ b/custom_components/maintenance_supporter/frontend-src/maintenance-panel.ts
@@ -131,6 +131,7 @@ import type { PartsCostMode } from "./helpers/parts-cost";
import { canWrite } from "./helpers/permissions";
import { renderStatusBadge } from "./renderers/status";
import { TOAST_MS, ACTION_TOAST_MS } from "./helpers/toast";
+import { primaryTriggerEntity } from "./helpers/trigger-entities";
import { buildHistoryEntryDraft } from "./helpers/history-draft";
import { readingSlotDelta } from "./helpers/reading-slots";
import { bulkResultMessage, codedFailures, runWs, runWsEach } from "./helpers/ws-run";
@@ -236,6 +237,8 @@ export class MaintenanceSupporterPanel extends LitElement {
@state() private _filterStatus = "";
@state() private _filterUser: string | null = null;
@state() private _filterLabel: string | null = null;
+ // 2026-10 places: "" = all, "home" = objects without a place, else a zone id.
+ @state() private _filterPlace = "";
/** #134: only tasks of this priority (low|normal|high); "" = no filter. */
@state() private _filterPriority = "";
// v2.24: shared saved filter views + the id of the one currently applied ("" =
@@ -264,7 +267,7 @@ export class MaintenanceSupporterPanel extends LitElement {
@state() private _groups: Record = {};
@state() private _detailStatsData: Map = new Map();
@state() private _miniStatsData: Map = new Map();
- @state() private _features: AdvancedFeatures = { adaptive: false, seasonal: false, environmental: false, budget: false, groups: false, checklists: false, schedule_time: false, completion_actions: false };
+ @state() private _features: AdvancedFeatures = { adaptive: false, seasonal: false, environmental: false, budget: false, groups: false, checklists: false, schedule_time: false, completion_actions: false, places: false };
// HA user IDs (UUIDs) granted full panel access despite not being HA admins.
@state() private _adminPanelUserIds: string[] = [];
// v2.8.4: master switch — the allowlist only grants the full panel when this
@@ -1087,7 +1090,7 @@ export class MaintenanceSupporterPanel extends LitElement {
const task = this._selectedEntryId && this._selectedTaskId
? this._getTask(this._selectedEntryId, this._selectedTaskId)
: null;
- const entityId = task?.trigger_config?.entity_id;
+ const entityId = primaryTriggerEntity(task?.trigger_config);
if (entityId) {
// Drop the stale-range series so the chart shows its loading state.
const updated = new Map(this._detailStatsData);
@@ -1111,7 +1114,8 @@ export class MaintenanceSupporterPanel extends LitElement {
const entities: Array<{ entityId: string; isCounter: boolean }> = [];
for (const obj of this._objects) {
for (const task of obj.tasks) {
- const entityId = task.trigger_config?.entity_id;
+ // The battery fleet's row shows "N to replace", not a sparkline.
+ const entityId = task.battery_fleet_task ? undefined : primaryTriggerEntity(task.trigger_config);
if (!entityId) continue;
entities.push({ entityId, isCounter: this._isCounterEntity(task.trigger_config) });
}
@@ -1217,6 +1221,9 @@ export class MaintenanceSupporterPanel extends LitElement {
// Label filter (v2.26 — also captured by saved views)
if (this._filterLabel && !(task.labels || []).includes(this._filterLabel)) continue;
+ // Place filter (2026-10): the object's zone, "home" for none.
+ if (this._filterPlace && (obj.object.place || "home") !== this._filterPlace) continue;
+
// Priority filter (#134 — also captured by saved views). Tasks
// without an explicit priority are "normal", the model default.
if (this._filterPriority && (task.priority || "normal") !== this._filterPriority) continue;
@@ -1353,8 +1360,9 @@ export class MaintenanceSupporterPanel extends LitElement {
if (s.msp_view === "task" && s.msp_entry && s.msp_task) {
this._historyFilter = null;
const task = this._getTask(s.msp_entry, s.msp_task);
- if (task?.trigger_config?.entity_id) {
- this._fetchDetailStats(task.trigger_config.entity_id, this._isCounterEntity(task.trigger_config));
+ const entityId = primaryTriggerEntity(task?.trigger_config);
+ if (task && entityId) {
+ this._fetchDetailStats(entityId, this._isCounterEntity(task.trigger_config));
}
}
}
@@ -1454,6 +1462,16 @@ export class MaintenanceSupporterPanel extends LitElement {
return [...seen].sort((a, b) => a.localeCompare(b));
}
+ /** 2026-10 places: the zones objects are maintained at, for the filter. */
+ private get _allPlaces(): { id: string; name: string }[] {
+ const seen = new Map();
+ for (const obj of this._objects) {
+ const o = obj.object;
+ if (o.place && !seen.has(o.place)) seen.set(o.place, o.place_name || o.place);
+ }
+ return [...seen].map(([id, name]) => ({ id, name })).sort((a, b) => a.name.localeCompare(b.name));
+ }
+
/** The panel's current task-list filter state, in the shape a view stores. */
private get _currentFilters(): SavedViewFilters {
return {
@@ -1615,8 +1633,9 @@ export class MaintenanceSupporterPanel extends LitElement {
this._resetStickyPane();
this._fetchFullHistory(entryId, taskId);
const task = this._getTask(entryId, taskId);
- if (task?.trigger_config?.entity_id) {
- this._fetchDetailStats(task.trigger_config.entity_id, this._isCounterEntity(task.trigger_config));
+ const entityId = primaryTriggerEntity(task?.trigger_config);
+ if (task && entityId) {
+ this._fetchDetailStats(entityId, this._isCounterEntity(task.trigger_config));
}
return;
}
@@ -1637,10 +1656,9 @@ export class MaintenanceSupporterPanel extends LitElement {
// Lazy-load statistics for the task's trigger entity
const task = this._getTask(entryId, taskId);
- if (task?.trigger_config?.entity_id) {
- const entityId = task.trigger_config.entity_id;
- const isCounter = this._isCounterEntity(task.trigger_config);
- this._fetchDetailStats(entityId, isCounter);
+ const entityId = primaryTriggerEntity(task?.trigger_config);
+ if (task && entityId) {
+ this._fetchDetailStats(entityId, this._isCounterEntity(task.trigger_config));
}
}
@@ -3196,6 +3214,7 @@ export class MaintenanceSupporterPanel extends LitElement {
@@ -3543,6 +3562,7 @@ export class MaintenanceSupporterPanel extends LitElement {
(this._filterStatus ? 1 : 0) +
(this._filterUser ? 1 : 0) +
(this._filterLabel ? 1 : 0) +
+ (this._filterPlace ? 1 : 0) +
(this._filterPriority ? 1 : 0) +
(this._activeViewId ? 1 : 0);
@@ -3626,6 +3646,24 @@ export class MaintenanceSupporterPanel extends LitElement {
` : nothing}
+ ${this._features.places && this._allPlaces.length > 0 ? html`
+
+ ` : nothing}
${t("documentation_url_label", L)}:
${o.documentation_url}
diff --git a/custom_components/maintenance_supporter/frontend-src/panel-styles.ts b/custom_components/maintenance_supporter/frontend-src/panel-styles.ts
index 0e7bd628..c08164db 100644
--- a/custom_components/maintenance_supporter/frontend-src/panel-styles.ts
+++ b/custom_components/maintenance_supporter/frontend-src/panel-styles.ts
@@ -963,6 +963,14 @@ export const panelStyles = css`
color: var(--info-color, #2196f3); font-weight: 500;
}
.paused-meta ha-icon { --mdc-icon-size: 16px; }
+ /* 2026-10 places: the object's place on its detail page. */
+ .place-meta {
+ display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
+ }
+ .place-meta ha-icon { --mdc-icon-size: 16px; color: var(--secondary-text-color); }
+ .place-missing-badge {
+ font-size: 12px; color: var(--warning-color, #c77700);
+ }
.objects-table .oc-notes {
max-width: 220px;
overflow: hidden;
diff --git a/custom_components/maintenance_supporter/frontend-src/renderers/progress.ts b/custom_components/maintenance_supporter/frontend-src/renderers/progress.ts
index a9415ba1..7b8eabea 100644
--- a/custom_components/maintenance_supporter/frontend-src/renderers/progress.ts
+++ b/custom_components/maintenance_supporter/frontend-src/renderers/progress.ts
@@ -16,6 +16,7 @@ import { t, formatDate, formatDueDays, formatNumber } from "../styles";
import { px } from "./chart-utils";
import { daysProgress } from "../helpers/interval";
import { stampMs } from "../helpers/ha-time";
+import { primaryTriggerEntity } from "../helpers/trigger-entities";
import type { MaintenanceTask, TaskRow, StatisticsPoint } from "../types";
const MINI_SPARKLINE_W = 60;
@@ -36,7 +37,9 @@ export function computeTrend(
miniStatsData: Map,
): TrendState | null {
const tc = row.trigger_config;
- if (!tc?.entity_id) return null;
+ const entityId = primaryTriggerEntity(tc);
+ // The battery fleet's row tells "N to replace", not one battery's curve.
+ if (!tc || !entityId || row.battery_fleet_task) return null;
let toward: 1 | -1;
const type = tc.type || "threshold";
if (type === "threshold") {
@@ -48,7 +51,7 @@ export function computeTrend(
} else {
return null; // compound: conditions may point both ways
}
- const statsPoints = miniStatsData.get(tc.entity_id) || [];
+ const statsPoints = miniStatsData.get(entityId) || [];
// Runtime and state_change accumulate SINCE the last completion — the
// history's trigger_value is the count at the previous trigger, a point
// from before the reset. Falling back to it read a freshly reset task
@@ -235,8 +238,9 @@ export function renderMiniSparkline(
miniStatsData: Map,
lang: string,
) {
- if (!row.trigger_config?.entity_id) return nothing;
- const entityId = row.trigger_config.entity_id;
+ const entityId = primaryTriggerEntity(row.trigger_config);
+ // The battery fleet's row tells "N to replace", not one battery's curve.
+ if (!entityId || row.battery_fleet_task) return nothing;
// PRIMARY: HA recorder statistics (daily, last 14 days)
const statsPoints = miniStatsData.get(entityId) || [];
diff --git a/custom_components/maintenance_supporter/frontend-src/renderers/sparkline.ts b/custom_components/maintenance_supporter/frontend-src/renderers/sparkline.ts
index d72f5acb..e8008c57 100644
--- a/custom_components/maintenance_supporter/frontend-src/renderers/sparkline.ts
+++ b/custom_components/maintenance_supporter/frontend-src/renderers/sparkline.ts
@@ -16,6 +16,7 @@ import { t, fireMoreInfo, formatDueDays } from "../styles";
import { fmtNum, fmtVal } from "./chart-utils";
import { dueDaysOf } from "./progress";
import { stampMs } from "../helpers/ha-time";
+import { primaryTriggerEntity, triggerEntityIds } from "../helpers/trigger-entities";
import "../components/trigger-chart";
import type { ChartPoint, ChartEvent } from "../components/trigger-chart";
import type { MaintenanceTask, TriggerConfig, StatisticsPoint } from "../types";
@@ -156,9 +157,9 @@ export function renderTriggerSection(task: MaintenanceTask, ctx: SparklineContex
const L = ctx.lang;
const info = task.trigger_entity_info;
const infos = task.trigger_entity_infos;
- const friendlyName = info?.friendly_name || tc.entity_id || "—";
- const entityId = tc.entity_id || "";
- const entityIds = tc.entity_ids || (entityId ? [entityId] : []);
+ const entityId = primaryTriggerEntity(tc) || "";
+ const friendlyName = info?.friendly_name || entityId || "—";
+ const entityIds = triggerEntityIds(tc);
const unit = info?.unit_of_measurement || "";
const currentVal = task.trigger_current_value;
const triggerType = tc.type || "threshold";
@@ -215,7 +216,7 @@ export function renderTriggerSection(task: MaintenanceTask, ctx: SparklineContex
${triggerType === "compound" ? html`
${t("compound_logic", L)}: ${tc.compound_logic || (tc as any).operator || "AND"}
${(tc.conditions || []).map((cond: any, i: number) => html`
- ${i + 1}. ${t(cond.type === "due_date" ? "trigger_type_due_date" : cond.type || "unknown", L)}: ${cond.entity_id ? html` fireMoreInfo(ev, cond.entity_id)}>${cond.entity_id}` : ""}
+ ${i + 1}. ${t(cond.type === "due_date" ? "trigger_type_due_date" : cond.type || "unknown", L)}: ${triggerEntityIds(cond).map((eid, j) => html`${j > 0 ? ", " : ""} fireMoreInfo(ev, eid)}>${eid}`)}
`)}
` : nothing}
@@ -330,7 +331,7 @@ function rawStatsPoints(task: MaintenanceTask, ctx: SparklineContext): ChartPoin
const tc = task.trigger_config;
if (!tc) return [];
const triggerType = tc.type || "threshold";
- const entityId = tc.entity_id || "";
+ const entityId = primaryTriggerEntity(tc) || "";
// Runtime accumulates hours DERIVED from the entity's on/off time — the
// entity's own long-term statistics (an on/off ratio, or an unrelated raw
// sensor value) are NOT that accumulation. Plot only the recorded per-cycle
@@ -372,7 +373,7 @@ function renderChart(task: MaintenanceTask, unit: string, ctx: SparklineContext)
const tc = task.trigger_config;
if (!tc) return nothing;
const triggerType = tc.type || "threshold";
- const entityId = tc.entity_id || "";
+ const entityId = primaryTriggerEntity(tc) || "";
// A due date only counts down — no curve to tell.
if (triggerType === "due_date") return nothing;
diff --git a/custom_components/maintenance_supporter/frontend-src/types.ts b/custom_components/maintenance_supporter/frontend-src/types.ts
index 3fa73955..c9b6c911 100644
--- a/custom_components/maintenance_supporter/frontend-src/types.ts
+++ b/custom_components/maintenance_supporter/frontend-src/types.ts
@@ -40,6 +40,13 @@ export interface MaintenanceObject {
// 2.19: attach to an existing HA device / nest under another object
ha_device_id?: string | null;
parent_entry_id?: string | null;
+ /** 2026-10 places: an HA zone the object is maintained at (null = home),
+ * its name, whether the zone is gone (then: as at home), and whether the
+ * object's reminders wait until somebody is there. */
+ place?: string | null;
+ place_name?: string | null;
+ place_missing?: boolean;
+ remind_on_site?: boolean;
/** v1.4.0 (#43): optional link to PDF manual / vendor page for the object */
documentation_url?: string | null;
/** v1.4.10 (#46): free-form notes — part numbers, procedures, etc. */
@@ -550,6 +557,8 @@ export interface AdvancedFeatures {
schedule_time: boolean;
/** v1.3.0: gates per-task on_complete_action + quick_complete_defaults UI. */
completion_actions: boolean;
+ /** 2026-10: an object's place (an HA zone) and "remind only on site". */
+ places: boolean;
}
/** A single point in a recorder statistics time series. */
diff --git a/custom_components/maintenance_supporter/frontend/locales/cs.json b/custom_components/maintenance_supporter/frontend/locales/cs.json
index 496d5a89..553503b8 100644
--- a/custom_components/maintenance_supporter/frontend/locales/cs.json
+++ b/custom_components/maintenance_supporter/frontend/locales/cs.json
@@ -545,6 +545,11 @@
"no_objects": "Zatím žádné objekty.",
"action_error": "Akce se nezdařila. Zkuste to znovu.",
"area_id_optional": "Oblast (volitelná)",
+ "place_optional": "Místo (zóna, volitelné)",
+ "remind_on_site": "Připomínat jen, když tam někdo je",
+ "remind_on_site_hint": "Připomínky čekají, dokud někdo nebude v této zóně. Kdo tam přijede, dostane zprávu s tím, co je potřeba udělat.",
+ "place_missing": "Zóna nenalezena: připomínky jako doma",
+ "place_home": "Domov",
"installation_date_optional": "Datum instalace (volitelné)",
"warranty_expiry_optional": "Konec záruky (volitelné)",
"warranty": "Záruka",
@@ -781,6 +786,8 @@
"owner_label": "Vlastník",
"feat_completion_actions": "Akce při dokončení",
"feat_completion_actions_desc": "Akce HA na úlohu při dokončení + QR rychlého dokončení s předvolenými hodnotami.",
+ "feat_places": "Místa",
+ "feat_places_desc": "Objekty udržované na jiném místě (zóna Home Assistantu): připomínky jen když tam někdo je a zpráva při příjezdu.",
"on_complete_action_title": "Při dokončení: spustit akci HA (volitelné)",
"on_complete_action_desc": "Volá službu HA, když je úloha dokončena — např. resetuje čítač na zařízení.",
"on_complete_action_target": "Cílová entita",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Používá díl: {name}",
"label_filter": "Štítek",
"all_labels": "Všechny štítky",
+ "filter_place": "Místo",
+ "filter_place_all": "Všechna místa",
"settings_notify_scope": "Upozorňovat jen pro zobrazení",
"settings_notify_scope_all": "Všechny úkoly",
"settings_notify_scope_hint": "Připomenutí posílají jen úkoly odpovídající filtrům štítku/uživatele zvoleného zobrazení. Stav, řazení a seskupení zobrazení se zde ignorují.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/da.json b/custom_components/maintenance_supporter/frontend/locales/da.json
index ee9fe532..e05874ee 100644
--- a/custom_components/maintenance_supporter/frontend/locales/da.json
+++ b/custom_components/maintenance_supporter/frontend/locales/da.json
@@ -547,6 +547,11 @@
"no_objects": "Ingen objekter endnu.",
"action_error": "Handlingen mislykkedes. Prøv igen.",
"area_id_optional": "Område (valgfrit)",
+ "place_optional": "Sted (zone, valgfrit)",
+ "remind_on_site": "Påmind kun, når nogen er der",
+ "remind_on_site_hint": "Påmindelser venter, til nogen er i denne zone. Den, der ankommer, får en besked med det, der skal gøres.",
+ "place_missing": "Zone ikke fundet: påmindelser som hjemme",
+ "place_home": "Hjemme",
"installation_date_optional": "Installationsdato (valgfrit)",
"warranty_expiry_optional": "Garantiens udløb (valgfrit)",
"warranty": "Garanti",
@@ -806,6 +811,8 @@
"owner_label": "Ejer",
"feat_completion_actions": "Fuldførelseshandlinger",
"feat_completion_actions_desc": "HA-handling pr. opgave ved fuldførelse + hurtig-fuldfør-QR med forudindstillede værdier.",
+ "feat_places": "Steder",
+ "feat_places_desc": "Objekter, der vedligeholdes et andet sted (en Home Assistant-zone): påmindelser kun når nogen er der, og en besked ved ankomst.",
"on_complete_action_title": "Ved fuldførelse: udløs HA-handling (valgfrit)",
"on_complete_action_desc": "Kalder en HA-tjeneste, når opgaven fuldføres — f.eks. nulstil en tæller på enheden.",
"on_complete_action_target": "Målenhed",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Bruger reservedel: {name}",
"label_filter": "Etiket",
"all_labels": "Alle etiketter",
+ "filter_place": "Sted",
+ "filter_place_all": "Alle steder",
"settings_notify_scope": "Underret kun for visning",
"settings_notify_scope_all": "Alle opgaver",
"settings_notify_scope_hint": "Kun opgaver, der matcher den valgte visnings etiket-/brugerfiltre, sender påmindelser. Visningens status, sortering og gruppering ignoreres her.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/de.json b/custom_components/maintenance_supporter/frontend/locales/de.json
index d6be2e3b..26e3f83f 100644
--- a/custom_components/maintenance_supporter/frontend/locales/de.json
+++ b/custom_components/maintenance_supporter/frontend/locales/de.json
@@ -547,6 +547,11 @@
"no_objects": "Keine Objekte vorhanden.",
"action_error": "Aktion fehlgeschlagen. Bitte erneut versuchen.",
"area_id_optional": "Bereich (optional)",
+ "place_optional": "Ort (Zone, optional)",
+ "remind_on_site": "Nur erinnern, wenn jemand dort ist",
+ "remind_on_site_hint": "Erinnerungen warten, bis jemand in dieser Zone ist. Wer dort ankommt, bekommt eine Nachricht mit dem, was fällig ist.",
+ "place_missing": "Zone nicht gefunden: Erinnerungen wie zuhause",
+ "place_home": "Zuhause",
"installation_date_optional": "Installationsdatum (optional)",
"warranty_expiry_optional": "Garantie-Ablauf (optional)",
"warranty": "Garantie",
@@ -806,6 +811,8 @@
"owner_label": "Besitzer",
"feat_completion_actions": "Completion-Actions",
"feat_completion_actions_desc": "Pro Aufgabe HA-Action beim Abschluss konfigurieren + Quick-Complete-QR mit voreingestellten Werten.",
+ "feat_places": "Orte",
+ "feat_places_desc": "Objekte an einem anderen Ort (eine Home-Assistant-Zone): Erinnerungen nur, wenn jemand dort ist, und eine Nachricht bei Ankunft.",
"on_complete_action_title": "Beim Abschluss: HA-Action auslösen (optional)",
"on_complete_action_desc": "Ruft beim Erledigen der Aufgabe einen HA-Service auf — z. B. einen Zähler am Gerät zurücksetzen.",
"on_complete_action_target": "Ziel-Entität",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Nutzt Ersatzteil: {name}",
"label_filter": "Label",
"all_labels": "Alle Labels",
+ "filter_place": "Ort",
+ "filter_place_all": "Alle Orte",
"settings_notify_scope": "Nur benachrichtigen für Ansicht",
"settings_notify_scope_all": "Alle Aufgaben",
"settings_notify_scope_hint": "Nur Aufgaben, die zu den Label-/Nutzer-Filtern der gewählten Ansicht passen, senden Erinnerungen. Status, Sortierung und Gruppierung der Ansicht werden hier ignoriert.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/en.json b/custom_components/maintenance_supporter/frontend/locales/en.json
index 963791e3..74362d38 100644
--- a/custom_components/maintenance_supporter/frontend/locales/en.json
+++ b/custom_components/maintenance_supporter/frontend/locales/en.json
@@ -547,6 +547,11 @@
"no_objects": "No objects yet.",
"action_error": "Action failed. Please try again.",
"area_id_optional": "Area (optional)",
+ "place_optional": "Place (zone, optional)",
+ "remind_on_site": "Remind only while somebody is there",
+ "remind_on_site_hint": "Reminders wait until somebody is in this zone. Whoever arrives there gets a message with what is due.",
+ "place_missing": "Zone not found: reminders as at home",
+ "place_home": "Home",
"installation_date_optional": "Installation date (optional)",
"warranty_expiry_optional": "Warranty expiry (optional)",
"warranty": "Warranty",
@@ -813,6 +818,8 @@
"owner_label": "Owner",
"feat_completion_actions": "Completion actions",
"feat_completion_actions_desc": "Per-task HA action on complete + quick-complete QR with pre-set values.",
+ "feat_places": "Places",
+ "feat_places_desc": "Objects maintained at another place (a Home Assistant zone): reminders only while somebody is there, and a message on arrival.",
"on_complete_action_title": "On complete: trigger HA action (optional)",
"on_complete_action_desc": "Calls an HA service when the task is completed — e.g. reset a counter on the device.",
"on_complete_action_target": "Target entity",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Uses part: {name}",
"label_filter": "Label",
"all_labels": "All labels",
+ "filter_place": "Place",
+ "filter_place_all": "All places",
"settings_notify_scope": "Notify only for view",
"settings_notify_scope_all": "All tasks",
"settings_notify_scope_hint": "Only tasks matching the selected saved view's label/user filters send reminders. Status, sorting and grouping of the view are ignored here.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/es.json b/custom_components/maintenance_supporter/frontend/locales/es.json
index 6a35fc58..614611a6 100644
--- a/custom_components/maintenance_supporter/frontend/locales/es.json
+++ b/custom_components/maintenance_supporter/frontend/locales/es.json
@@ -545,6 +545,11 @@
"no_objects": "Aún no hay objetos.",
"action_error": "Acción fallida. Inténtelo de nuevo.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Lugar (zona, opcional)",
+ "remind_on_site": "Recordar solo cuando alguien esté allí",
+ "remind_on_site_hint": "Los recordatorios esperan a que alguien esté en esta zona. Quien llega allí recibe un mensaje con lo pendiente.",
+ "place_missing": "Zona no encontrada: recordatorios como en casa",
+ "place_home": "Casa",
"installation_date_optional": "Fecha de instalación (opcional)",
"warranty_expiry_optional": "Vencimiento de garantía (opcional)",
"warranty": "Garantía",
@@ -781,6 +786,8 @@
"owner_label": "Propietario",
"feat_completion_actions": "Acciones de finalización",
"feat_completion_actions_desc": "Acción HA por tarea al completar + QR de finalización rápida con valores prefijados.",
+ "feat_places": "Lugares",
+ "feat_places_desc": "Objetos mantenidos en otro lugar (una zona de Home Assistant): recordatorios solo cuando alguien está allí y un mensaje al llegar.",
"on_complete_action_title": "Al completar: ejecutar acción HA (opcional)",
"on_complete_action_desc": "Llama un servicio HA cuando se completa la tarea — p. ej. reiniciar un contador del dispositivo.",
"on_complete_action_target": "Entidad objetivo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa la pieza: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas las etiquetas",
+ "filter_place": "Lugar",
+ "filter_place_all": "Todos los lugares",
"settings_notify_scope": "Notificar solo para la vista",
"settings_notify_scope_all": "Todas las tareas",
"settings_notify_scope_hint": "Solo las tareas que coinciden con los filtros de etiqueta/usuario de la vista seleccionada envían recordatorios. El estado, el orden y la agrupación de la vista se ignoran aquí.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/fi.json b/custom_components/maintenance_supporter/frontend/locales/fi.json
index 9dfb0ca3..65c11c42 100644
--- a/custom_components/maintenance_supporter/frontend/locales/fi.json
+++ b/custom_components/maintenance_supporter/frontend/locales/fi.json
@@ -547,6 +547,11 @@
"no_objects": "Ei vielä kohteita.",
"action_error": "Toiminto epäonnistui. Yritä uudelleen.",
"area_id_optional": "Alue (valinnainen)",
+ "place_optional": "Paikka (vyöhyke, valinnainen)",
+ "remind_on_site": "Muistuta vain, kun joku on paikalla",
+ "remind_on_site_hint": "Muistutukset odottavat, kunnes joku on tällä vyöhykkeellä. Sinne saapuva saa viestin tehtävistä asioista.",
+ "place_missing": "Vyöhykettä ei löydy: muistutukset kuin kotona",
+ "place_home": "Koti",
"installation_date_optional": "Asennuspäivä (valinnainen)",
"warranty_expiry_optional": "Takuun päättyminen (valinnainen)",
"warranty": "Takuu",
@@ -806,6 +811,8 @@
"owner_label": "Omistaja",
"feat_completion_actions": "Suoritustoiminnot",
"feat_completion_actions_desc": "Tehtäväkohtainen HA-toiminto suorituksen yhteydessä + pikasuoritus-QR esiasetetuilla arvoilla.",
+ "feat_places": "Paikat",
+ "feat_places_desc": "Toisessa paikassa (Home Assistant -vyöhyke) huollettavat kohteet: muistutukset vain, kun joku on paikalla, ja viesti saavuttaessa.",
"on_complete_action_title": "Suorituksen yhteydessä: laukaise HA-toiminto (valinnainen)",
"on_complete_action_desc": "Kutsuu HA-palvelua, kun tehtävä suoritetaan — esim. nollaa laitteen laskuri.",
"on_complete_action_target": "Kohde-entiteetti",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Käyttää varaosaa: {name}",
"label_filter": "Tunniste",
"all_labels": "Kaikki tunnisteet",
+ "filter_place": "Paikka",
+ "filter_place_all": "Kaikki paikat",
"settings_notify_scope": "Ilmoita vain näkymälle",
"settings_notify_scope_all": "Kaikki tehtävät",
"settings_notify_scope_hint": "Vain valitun näkymän tunniste-/käyttäjäsuodattimiin osuvat tehtävät lähettävät muistutuksia. Näkymän tila, lajittelu ja ryhmittely ohitetaan tässä.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/fr.json b/custom_components/maintenance_supporter/frontend/locales/fr.json
index b83b4dfc..87b6809c 100644
--- a/custom_components/maintenance_supporter/frontend/locales/fr.json
+++ b/custom_components/maintenance_supporter/frontend/locales/fr.json
@@ -545,6 +545,11 @@
"no_objects": "Aucun objet pour l'instant.",
"action_error": "Action échouée. Veuillez réessayer.",
"area_id_optional": "Zone (optionnel)",
+ "place_optional": "Lieu (zone, facultatif)",
+ "remind_on_site": "Rappeler seulement quand quelqu'un y est",
+ "remind_on_site_hint": "Les rappels attendent que quelqu'un soit dans cette zone. Qui y arrive reçoit un message avec ce qui est à faire.",
+ "place_missing": "Zone introuvable : rappels comme à la maison",
+ "place_home": "Domicile",
"installation_date_optional": "Date d'installation (optionnel)",
"warranty_expiry_optional": "Fin de garantie (optionnel)",
"warranty": "Garantie",
@@ -781,6 +786,8 @@
"owner_label": "Propriétaire",
"feat_completion_actions": "Actions de finalisation",
"feat_completion_actions_desc": "Action HA par tâche lors de la finalisation + QR de finalisation rapide avec valeurs pré-définies.",
+ "feat_places": "Lieux",
+ "feat_places_desc": "Objets entretenus à un autre endroit (une zone Home Assistant) : rappels seulement quand quelqu'un y est, et un message à l'arrivée.",
"on_complete_action_title": "À la finalisation : déclencher une action HA (optionnel)",
"on_complete_action_desc": "Appelle un service HA quand la tâche est terminée — p. ex. réinitialiser un compteur sur l'appareil.",
"on_complete_action_target": "Entité cible",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Utilise la pièce : {name}",
"label_filter": "Étiquette",
"all_labels": "Toutes les étiquettes",
+ "filter_place": "Lieu",
+ "filter_place_all": "Tous les lieux",
"settings_notify_scope": "Notifier uniquement pour la vue",
"settings_notify_scope_all": "Toutes les tâches",
"settings_notify_scope_hint": "Seules les tâches correspondant aux filtres étiquette/utilisateur de la vue choisie envoient des rappels. Le statut, le tri et le regroupement de la vue sont ignorés ici.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/hi.json b/custom_components/maintenance_supporter/frontend/locales/hi.json
index ff6aad53..94fdc93d 100644
--- a/custom_components/maintenance_supporter/frontend/locales/hi.json
+++ b/custom_components/maintenance_supporter/frontend/locales/hi.json
@@ -547,6 +547,11 @@
"no_objects": "अभी कोई वस्तु नहीं।",
"action_error": "क्रिया विफल। कृपया पुनः प्रयास करें।",
"area_id_optional": "क्षेत्र (वैकल्पिक)",
+ "place_optional": "स्थान (ज़ोन, वैकल्पिक)",
+ "remind_on_site": "केवल तब याद दिलाएँ जब कोई वहाँ हो",
+ "remind_on_site_hint": "रिमाइंडर तब तक रुकते हैं जब तक कोई इस ज़ोन में न हो। वहाँ पहुँचने वाले को बाकी कामों का संदेश मिलता है।",
+ "place_missing": "ज़ोन नहीं मिला: रिमाइंडर घर जैसे",
+ "place_home": "घर",
"installation_date_optional": "स्थापना तिथि (वैकल्पिक)",
"warranty_expiry_optional": "वारंटी समाप्ति (वैकल्पिक)",
"warranty": "वारंटी",
@@ -806,6 +811,8 @@
"owner_label": "स्वामी",
"feat_completion_actions": "पूर्णता क्रियाएँ",
"feat_completion_actions_desc": "पूर्ण होने पर प्रति-कार्य HA क्रिया + पूर्व-निर्धारित मानों के साथ त्वरित-पूर्ण QR।",
+ "feat_places": "स्थान",
+ "feat_places_desc": "किसी दूसरी जगह (Home Assistant ज़ोन) पर रखरखाव वाले ऑब्जेक्ट: रिमाइंडर तभी जब कोई वहाँ हो, और पहुँचने पर एक संदेश।",
"on_complete_action_title": "पूर्ण होने पर: HA क्रिया ट्रिगर करें (वैकल्पिक)",
"on_complete_action_desc": "कार्य पूर्ण होने पर एक HA सेवा कॉल करता है — उदा. डिवाइस पर काउंटर रीसेट करना।",
"on_complete_action_target": "लक्ष्य एंटिटी",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "पुर्ज़ा उपयोग करता है: {name}",
"label_filter": "लेबल",
"all_labels": "सभी लेबल",
+ "filter_place": "स्थान",
+ "filter_place_all": "सभी स्थान",
"settings_notify_scope": "केवल इस व्यू के लिए सूचित करें",
"settings_notify_scope_all": "सभी कार्य",
"settings_notify_scope_hint": "केवल वे कार्य अनुस्मारक भेजते हैं जो चुने गए व्यू के लेबल/उपयोगकर्ता फ़िल्टर से मेल खाते हैं। व्यू की स्थिति, क्रम और समूहन यहाँ अनदेखे रहते हैं।",
diff --git a/custom_components/maintenance_supporter/frontend/locales/hu.json b/custom_components/maintenance_supporter/frontend/locales/hu.json
index c819bab9..0fe88085 100644
--- a/custom_components/maintenance_supporter/frontend/locales/hu.json
+++ b/custom_components/maintenance_supporter/frontend/locales/hu.json
@@ -547,6 +547,11 @@
"no_objects": "Még nincsenek objektumok.",
"action_error": "A művelet nem sikerült. Próbálja újra.",
"area_id_optional": "Terület (opcionális)",
+ "place_optional": "Helyszín (zóna, opcionális)",
+ "remind_on_site": "Csak akkor emlékeztessen, ha valaki ott van",
+ "remind_on_site_hint": "Az emlékeztetők megvárják, amíg valaki ebben a zónában lesz. Aki odaér, üzenetet kap az esedékes teendőkről.",
+ "place_missing": "A zóna nem található: emlékeztetők, mint otthon",
+ "place_home": "Otthon",
"installation_date_optional": "Telepítés dátuma (opcionális)",
"warranty_expiry_optional": "Garancia lejárta (opcionális)",
"warranty": "Garancia",
@@ -813,6 +818,8 @@
"owner_label": "Tulajdonos",
"feat_completion_actions": "Elvégzési műveletek",
"feat_completion_actions_desc": "Feladatonkénti HA művelet elvégzéskor + gyorselvégző QR előre beállított értékekkel.",
+ "feat_places": "Helyszínek",
+ "feat_places_desc": "Másik helyszínen (Home Assistant-zóna) karbantartott objektumok: emlékeztető csak akkor, ha valaki ott van, és üzenet érkezéskor.",
"on_complete_action_title": "Elvégzéskor: HA művelet indítása (opcionális)",
"on_complete_action_desc": "HA szolgáltatást hív meg a feladat elvégzésekor — pl. számláló nullázása az eszközön.",
"on_complete_action_target": "Cél entitás",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Alkatrészt használ: {name}",
"label_filter": "Címke",
"all_labels": "Minden címke",
+ "filter_place": "Helyszín",
+ "filter_place_all": "Minden helyszín",
"settings_notify_scope": "Értesítés csak erre a nézetre",
"settings_notify_scope_all": "Minden feladat",
"settings_notify_scope_hint": "Csak a kiválasztott mentett nézet címke-/felhasználószűrőinek megfelelő feladatok küldenek emlékeztetőt. A nézet állapot-, rendezési és csoportosítási beállításait itt figyelmen kívül hagyjuk.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/it.json b/custom_components/maintenance_supporter/frontend/locales/it.json
index 25a11695..d7426916 100644
--- a/custom_components/maintenance_supporter/frontend/locales/it.json
+++ b/custom_components/maintenance_supporter/frontend/locales/it.json
@@ -545,6 +545,11 @@
"no_objects": "Nessun oggetto ancora.",
"action_error": "Azione fallita. Riprova.",
"area_id_optional": "Area (opzionale)",
+ "place_optional": "Luogo (zona, facoltativo)",
+ "remind_on_site": "Ricorda solo quando qualcuno è lì",
+ "remind_on_site_hint": "I promemoria aspettano che qualcuno sia in questa zona. Chi arriva lì riceve un messaggio con ciò che è da fare.",
+ "place_missing": "Zona non trovata: promemoria come a casa",
+ "place_home": "Casa",
"installation_date_optional": "Data di installazione (opzionale)",
"warranty_expiry_optional": "Scadenza garanzia (opzionale)",
"warranty": "Garanzia",
@@ -781,6 +786,8 @@
"owner_label": "Proprietario",
"feat_completion_actions": "Azioni di completamento",
"feat_completion_actions_desc": "Azione HA per attività al completamento + QR completamento rapido con valori predefiniti.",
+ "feat_places": "Luoghi",
+ "feat_places_desc": "Oggetti curati in un altro luogo (una zona di Home Assistant): promemoria solo quando qualcuno è lì e un messaggio all'arrivo.",
"on_complete_action_title": "Al completamento: attiva azione HA (opzionale)",
"on_complete_action_desc": "Chiama un servizio HA quando l'attività viene completata — es. azzerare un contatore sul dispositivo.",
"on_complete_action_target": "Entità target",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa il ricambio: {name}",
"label_filter": "Etichetta",
"all_labels": "Tutte le etichette",
+ "filter_place": "Luogo",
+ "filter_place_all": "Tutti i luoghi",
"settings_notify_scope": "Notifica solo per la vista",
"settings_notify_scope_all": "Tutte le attività",
"settings_notify_scope_hint": "Solo le attività che corrispondono ai filtri etichetta/utente della vista scelta inviano promemoria. Stato, ordinamento e raggruppamento della vista qui vengono ignorati.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/ja.json b/custom_components/maintenance_supporter/frontend/locales/ja.json
index cde6c06d..19acbefa 100644
--- a/custom_components/maintenance_supporter/frontend/locales/ja.json
+++ b/custom_components/maintenance_supporter/frontend/locales/ja.json
@@ -547,6 +547,11 @@
"no_objects": "対象がまだありません。",
"action_error": "操作に失敗しました。もう一度お試しください。",
"area_id_optional": "エリア(任意)",
+ "place_optional": "場所(ゾーン、任意)",
+ "remind_on_site": "誰かがいるときだけリマインド",
+ "remind_on_site_hint": "リマインドは誰かがこのゾーンにいるまで待機します。到着した人には、やるべきことをまとめたメッセージが届きます。",
+ "place_missing": "ゾーンが見つかりません:自宅と同じようにリマインドします",
+ "place_home": "自宅",
"installation_date_optional": "設置日(任意)",
"warranty_expiry_optional": "保証期限(任意)",
"warranty": "保証",
@@ -806,6 +811,8 @@
"owner_label": "オーナー",
"feat_completion_actions": "完了時アクション",
"feat_completion_actions_desc": "タスクごとの完了時HAアクション+事前設定値付きのクイック完了QR。",
+ "feat_places": "場所",
+ "feat_places_desc": "別の場所(Home Assistant のゾーン)で管理するオブジェクト:誰かがその場にいるときだけリマインドし、到着時に通知します。",
"on_complete_action_title": "完了時: HAアクションを実行(任意)",
"on_complete_action_desc": "タスク完了時にHAサービスを呼び出します — 例: デバイスのカウンターをリセット。",
"on_complete_action_target": "対象エンティティ",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "使用する部品: {name}",
"label_filter": "ラベル",
"all_labels": "すべてのラベル",
+ "filter_place": "場所",
+ "filter_place_all": "すべての場所",
"settings_notify_scope": "このビューのみ通知",
"settings_notify_scope_all": "すべてのタスク",
"settings_notify_scope_hint": "選択した保存済みビューのラベル/ユーザーフィルターに一致するタスクのみがリマインダーを送信します。ビューのステータス・並び順・グループ化はここでは無視されます。",
diff --git a/custom_components/maintenance_supporter/frontend/locales/ko.json b/custom_components/maintenance_supporter/frontend/locales/ko.json
index dff2c732..10b873b2 100644
--- a/custom_components/maintenance_supporter/frontend/locales/ko.json
+++ b/custom_components/maintenance_supporter/frontend/locales/ko.json
@@ -547,6 +547,11 @@
"no_objects": "아직 객체가 없습니다.",
"action_error": "동작에 실패했습니다. 다시 시도해 주세요.",
"area_id_optional": "구역 (선택)",
+ "place_optional": "장소 (구역, 선택 사항)",
+ "remind_on_site": "누군가 있을 때만 알림",
+ "remind_on_site_hint": "누군가 이 구역에 있을 때까지 알림이 대기합니다. 그곳에 도착한 사람은 해야 할 일을 담은 메시지를 받습니다.",
+ "place_missing": "구역을 찾을 수 없음: 집과 같이 알림",
+ "place_home": "집",
"installation_date_optional": "설치일 (선택)",
"warranty_expiry_optional": "보증 만료일 (선택)",
"warranty": "보증",
@@ -813,6 +818,8 @@
"owner_label": "소유자",
"feat_completion_actions": "완료 동작",
"feat_completion_actions_desc": "완료 시 작업별 HA 동작 실행 + 사전 설정값이 있는 빠른 완료 QR.",
+ "feat_places": "장소",
+ "feat_places_desc": "다른 장소(Home Assistant 구역)에서 관리하는 개체: 누군가 그곳에 있을 때만 알림을 보내고, 도착하면 메시지를 보냅니다.",
"on_complete_action_title": "완료 시: HA 동작 실행 (선택)",
"on_complete_action_desc": "작업이 완료되면 HA 서비스를 호출합니다 — 예: 기기의 카운터 초기화.",
"on_complete_action_target": "대상 엔티티",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "사용 부품: {name}",
"label_filter": "라벨",
"all_labels": "모든 라벨",
+ "filter_place": "장소",
+ "filter_place_all": "모든 장소",
"settings_notify_scope": "특정 보기만 알림",
"settings_notify_scope_all": "모든 작업",
"settings_notify_scope_hint": "선택한 저장된 보기의 라벨/사용자 필터와 일치하는 작업만 알림을 보냅니다. 보기의 상태·정렬·그룹화는 여기서 무시됩니다.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/nb.json b/custom_components/maintenance_supporter/frontend/locales/nb.json
index d0640429..49db1a37 100644
--- a/custom_components/maintenance_supporter/frontend/locales/nb.json
+++ b/custom_components/maintenance_supporter/frontend/locales/nb.json
@@ -547,6 +547,11 @@
"no_objects": "Ingen objekter ennå.",
"action_error": "Handlingen mislyktes. Prøv igjen.",
"area_id_optional": "Område (valgfritt)",
+ "place_optional": "Sted (sone, valgfritt)",
+ "remind_on_site": "Påminn bare når noen er der",
+ "remind_on_site_hint": "Påminnelser venter til noen er i denne sonen. Den som kommer dit, får en melding med det som skal gjøres.",
+ "place_missing": "Fant ikke sonen: påminnelser som hjemme",
+ "place_home": "Hjemme",
"installation_date_optional": "Installasjonsdato (valgfritt)",
"warranty_expiry_optional": "Garanti utløper (valgfritt)",
"warranty": "Garanti",
@@ -806,6 +811,8 @@
"owner_label": "Eier",
"feat_completion_actions": "Fullføringshandlinger",
"feat_completion_actions_desc": "HA-handling per oppgave ved fullføring + hurtigfullføring med QR og forhåndsinnstilte verdier.",
+ "feat_places": "Steder",
+ "feat_places_desc": "Objekter som vedlikeholdes et annet sted (en Home Assistant-sone): påminnelser bare når noen er der, og en melding ved ankomst.",
"on_complete_action_title": "Ved fullføring: utløs HA-handling (valgfritt)",
"on_complete_action_desc": "Kaller en HA-tjeneste når oppgaven fullføres — f.eks. tilbakestille en teller på enheten.",
"on_complete_action_target": "Målentitet",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Bruker del: {name}",
"label_filter": "Etikett",
"all_labels": "Alle etiketter",
+ "filter_place": "Sted",
+ "filter_place_all": "Alle steder",
"settings_notify_scope": "Varsle kun for visning",
"settings_notify_scope_all": "Alle oppgaver",
"settings_notify_scope_hint": "Bare oppgaver som matcher etikett-/brukerfiltrene til valgt visning sender påminnelser. Visningens status, sortering og gruppering ignoreres her.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/nl.json b/custom_components/maintenance_supporter/frontend/locales/nl.json
index 82b507ac..90df823c 100644
--- a/custom_components/maintenance_supporter/frontend/locales/nl.json
+++ b/custom_components/maintenance_supporter/frontend/locales/nl.json
@@ -545,6 +545,11 @@
"no_objects": "Nog geen objecten.",
"action_error": "Actie mislukt. Probeer het opnieuw.",
"area_id_optional": "Gebied (optioneel)",
+ "place_optional": "Locatie (zone, optioneel)",
+ "remind_on_site": "Alleen herinneren als er iemand is",
+ "remind_on_site_hint": "Herinneringen wachten tot iemand in deze zone is. Wie daar aankomt, krijgt een bericht met wat er te doen is.",
+ "place_missing": "Zone niet gevonden: herinneringen zoals thuis",
+ "place_home": "Thuis",
"installation_date_optional": "Installatiedatum (optioneel)",
"warranty_expiry_optional": "Garantie verloopt (optioneel)",
"warranty": "Garantie",
@@ -781,6 +786,8 @@
"owner_label": "Eigenaar",
"feat_completion_actions": "Voltooiings-acties",
"feat_completion_actions_desc": "Per taak HA-actie bij voltooien + snel-voltooien-QR met vooraf ingestelde waarden.",
+ "feat_places": "Locaties",
+ "feat_places_desc": "Objecten op een andere locatie (een Home Assistant-zone): herinneringen alleen als er iemand is, en een bericht bij aankomst.",
"on_complete_action_title": "Bij voltooien: HA-actie uitvoeren (optioneel)",
"on_complete_action_desc": "Roept een HA-service aan wanneer de taak is voltooid — bv. een teller op het apparaat resetten.",
"on_complete_action_target": "Doel-entiteit",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Gebruikt onderdeel: {name}",
"label_filter": "Label",
"all_labels": "Alle labels",
+ "filter_place": "Locatie",
+ "filter_place_all": "Alle locaties",
"settings_notify_scope": "Alleen melden voor weergave",
"settings_notify_scope_all": "Alle taken",
"settings_notify_scope_hint": "Alleen taken die overeenkomen met de label-/gebruikersfilters van de gekozen weergave sturen herinneringen. Status, sortering en groepering van de weergave worden hier genegeerd.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/pl.json b/custom_components/maintenance_supporter/frontend/locales/pl.json
index e7d7b605..bd71473e 100644
--- a/custom_components/maintenance_supporter/frontend/locales/pl.json
+++ b/custom_components/maintenance_supporter/frontend/locales/pl.json
@@ -545,6 +545,11 @@
"no_objects": "Brak obiektów.",
"action_error": "Akcja nie powiodła się. Spróbuj ponownie.",
"area_id_optional": "Obszar (opcjonalny)",
+ "place_optional": "Miejsce (strefa, opcjonalnie)",
+ "remind_on_site": "Przypominaj tylko, gdy ktoś tam jest",
+ "remind_on_site_hint": "Przypomnienia czekają, aż ktoś będzie w tej strefie. Kto tam przyjedzie, dostaje wiadomość z tym, co jest do zrobienia.",
+ "place_missing": "Nie znaleziono strefy: przypomnienia jak w domu",
+ "place_home": "Dom",
"installation_date_optional": "Data instalacji (opcjonalna)",
"warranty_expiry_optional": "Wygaśnięcie gwarancji (opcjonalnie)",
"warranty": "Gwarancja",
@@ -781,6 +786,8 @@
"owner_label": "Właściciel",
"feat_completion_actions": "Akcje po zakończeniu",
"feat_completion_actions_desc": "Akcja HA per zadanie po zakończeniu + QR szybkiego zakończenia z predefiniowanymi wartościami.",
+ "feat_places": "Miejsca",
+ "feat_places_desc": "Obiekty w innym miejscu (strefa Home Assistant): przypomnienia tylko wtedy, gdy ktoś tam jest, i wiadomość po przybyciu.",
"on_complete_action_title": "Po zakończeniu: wywołaj akcję HA (opcjonalnie)",
"on_complete_action_desc": "Wywołuje usługę HA po zakończeniu zadania — np. zresetuj licznik urządzenia.",
"on_complete_action_target": "Encja docelowa",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Używa części: {name}",
"label_filter": "Etykieta",
"all_labels": "Wszystkie etykiety",
+ "filter_place": "Miejsce",
+ "filter_place_all": "Wszystkie miejsca",
"settings_notify_scope": "Powiadamiaj tylko dla widoku",
"settings_notify_scope_all": "Wszystkie zadania",
"settings_notify_scope_hint": "Przypomnienia wysyłają tylko zadania pasujące do filtrów etykiety/użytkownika wybranego widoku. Status, sortowanie i grupowanie widoku są tu ignorowane.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/pt-br.json b/custom_components/maintenance_supporter/frontend/locales/pt-br.json
index 03c1a270..af53a8f0 100644
--- a/custom_components/maintenance_supporter/frontend/locales/pt-br.json
+++ b/custom_components/maintenance_supporter/frontend/locales/pt-br.json
@@ -547,6 +547,11 @@
"no_objects": "Ainda não há objetos.",
"action_error": "A ação falhou. Tente novamente.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Local (zona, opcional)",
+ "remind_on_site": "Lembrar só quando alguém estiver lá",
+ "remind_on_site_hint": "Os lembretes esperam até alguém estar nesta zona. Quem chega lá recebe uma mensagem com o que está pendente.",
+ "place_missing": "Zona não encontrada: lembretes como em casa",
+ "place_home": "Casa",
"installation_date_optional": "Data de instalação (opcional)",
"warranty_expiry_optional": "Fim da garantia (opcional)",
"warranty": "Garantia",
@@ -813,6 +818,8 @@
"owner_label": "Proprietário",
"feat_completion_actions": "Ações de conclusão",
"feat_completion_actions_desc": "Ação do HA por tarefa ao concluir + QR de conclusão rápida com valores predefinidos.",
+ "feat_places": "Locais",
+ "feat_places_desc": "Objetos mantidos em outro local (uma zona do Home Assistant): lembretes só quando alguém está lá e uma mensagem na chegada.",
"on_complete_action_title": "Ao concluir: acionar ação do HA (opcional)",
"on_complete_action_desc": "Chama um serviço do HA quando a tarefa é concluída — ex.: zerar um contador no dispositivo.",
"on_complete_action_target": "Entidade alvo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa a peça: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas as etiquetas",
+ "filter_place": "Local",
+ "filter_place_all": "Todos os locais",
"settings_notify_scope": "Notificar apenas para a visualização",
"settings_notify_scope_all": "Todas as tarefas",
"settings_notify_scope_hint": "Apenas tarefas que correspondem aos filtros de etiqueta/usuário da visualização salva selecionada enviam lembretes. Status, ordenação e agrupamento da visualização são ignorados aqui.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/pt.json b/custom_components/maintenance_supporter/frontend/locales/pt.json
index 35d58bf1..48941a72 100644
--- a/custom_components/maintenance_supporter/frontend/locales/pt.json
+++ b/custom_components/maintenance_supporter/frontend/locales/pt.json
@@ -545,6 +545,11 @@
"no_objects": "Ainda sem objetos.",
"action_error": "Ação falhada. Tente novamente.",
"area_id_optional": "Área (opcional)",
+ "place_optional": "Local (zona, opcional)",
+ "remind_on_site": "Lembrar só quando alguém lá estiver",
+ "remind_on_site_hint": "Os lembretes esperam até alguém estar nesta zona. Quem lá chega recebe uma mensagem com o que está pendente.",
+ "place_missing": "Zona não encontrada: lembretes como em casa",
+ "place_home": "Casa",
"installation_date_optional": "Data de instalação (opcional)",
"warranty_expiry_optional": "Validade da garantia (opcional)",
"warranty": "Garantia",
@@ -781,6 +786,8 @@
"owner_label": "Proprietário",
"feat_completion_actions": "Ações de conclusão",
"feat_completion_actions_desc": "Ação HA por tarefa ao concluir + QR de conclusão rápida com valores predefinidos.",
+ "feat_places": "Locais",
+ "feat_places_desc": "Objetos mantidos noutro local (uma zona do Home Assistant): lembretes só quando alguém lá está e uma mensagem à chegada.",
"on_complete_action_title": "Na conclusão: acionar ação HA (opcional)",
"on_complete_action_desc": "Chama um serviço HA quando a tarefa é concluída — p. ex. reiniciar um contador no dispositivo.",
"on_complete_action_target": "Entidade alvo",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Usa a peça: {name}",
"label_filter": "Etiqueta",
"all_labels": "Todas as etiquetas",
+ "filter_place": "Local",
+ "filter_place_all": "Todos os locais",
"settings_notify_scope": "Notificar apenas para a vista",
"settings_notify_scope_all": "Todas as tarefas",
"settings_notify_scope_hint": "Apenas as tarefas que correspondem aos filtros de etiqueta/utilizador da vista escolhida enviam lembretes. O estado, a ordenação e o agrupamento da vista são ignorados aqui.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/ru.json b/custom_components/maintenance_supporter/frontend/locales/ru.json
index 30823484..788f909c 100644
--- a/custom_components/maintenance_supporter/frontend/locales/ru.json
+++ b/custom_components/maintenance_supporter/frontend/locales/ru.json
@@ -545,6 +545,11 @@
"no_objects": "Пока нет объектов.",
"action_error": "Не удалось выполнить действие. Попробуйте ещё раз.",
"area_id_optional": "Зона (опционально)",
+ "place_optional": "Место (зона, необязательно)",
+ "remind_on_site": "Напоминать, только когда там кто-то есть",
+ "remind_on_site_hint": "Напоминания ждут, пока кто-нибудь окажется в этой зоне. Кто туда приезжает, получает сообщение о том, что нужно сделать.",
+ "place_missing": "Зона не найдена: напоминания как дома",
+ "place_home": "Дом",
"installation_date_optional": "Дата установки (опционально)",
"warranty_expiry_optional": "Окончание гарантии (опционально)",
"warranty": "Гарантия",
@@ -781,6 +786,8 @@
"owner_label": "Владелец",
"feat_completion_actions": "Действия при завершении",
"feat_completion_actions_desc": "HA-действие по задаче при завершении + QR быстрого завершения с предустановленными значениями.",
+ "feat_places": "Места",
+ "feat_places_desc": "Объекты в другом месте (зона Home Assistant): напоминания только когда там кто-то есть, и сообщение по прибытии.",
"on_complete_action_title": "При завершении: запустить HA-действие (опционально)",
"on_complete_action_desc": "Вызывает HA-сервис при завершении задачи — напр., сбросить счётчик на устройстве.",
"on_complete_action_target": "Целевая сущность",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Использует деталь: {name}",
"label_filter": "Метка",
"all_labels": "Все метки",
+ "filter_place": "Место",
+ "filter_place_all": "Все места",
"settings_notify_scope": "Уведомлять только для представления",
"settings_notify_scope_all": "Все задачи",
"settings_notify_scope_hint": "Напоминания отправляют только задачи, совпадающие с фильтрами метки/пользователя выбранного представления. Статус, сортировка и группировка представления здесь игнорируются.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/sv.json b/custom_components/maintenance_supporter/frontend/locales/sv.json
index 2ed19dbc..7780d503 100644
--- a/custom_components/maintenance_supporter/frontend/locales/sv.json
+++ b/custom_components/maintenance_supporter/frontend/locales/sv.json
@@ -545,6 +545,11 @@
"no_objects": "Inga objekt än.",
"action_error": "Åtgärden misslyckades. Försök igen.",
"area_id_optional": "Område (valfritt)",
+ "place_optional": "Plats (zon, valfritt)",
+ "remind_on_site": "Påminn bara när någon är där",
+ "remind_on_site_hint": "Påminnelser väntar tills någon är i den här zonen. Den som kommer dit får ett meddelande med det som ska göras.",
+ "place_missing": "Zonen hittades inte: påminnelser som hemma",
+ "place_home": "Hemma",
"installation_date_optional": "Installationsdatum (valfritt)",
"warranty_expiry_optional": "Garantins utgång (valfritt)",
"warranty": "Garanti",
@@ -781,6 +786,8 @@
"owner_label": "Ägare",
"feat_completion_actions": "Slutförande-åtgärder",
"feat_completion_actions_desc": "HA-åtgärd per uppgift vid slutförande + snabb-slutför-QR med förinställda värden.",
+ "feat_places": "Platser",
+ "feat_places_desc": "Objekt som sköts på en annan plats (en Home Assistant-zon): påminnelser bara när någon är där, och ett meddelande vid ankomst.",
"on_complete_action_title": "Vid slutförande: utlös HA-åtgärd (valfritt)",
"on_complete_action_desc": "Anropar en HA-tjänst när uppgiften slutförs — t.ex. återställ en räknare på enheten.",
"on_complete_action_target": "Målentitet",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Använder reservdel: {name}",
"label_filter": "Etikett",
"all_labels": "Alla etiketter",
+ "filter_place": "Plats",
+ "filter_place_all": "Alla platser",
"settings_notify_scope": "Avisera endast för vy",
"settings_notify_scope_all": "Alla uppgifter",
"settings_notify_scope_hint": "Endast uppgifter som matchar den valda vyns etikett-/användarfilter skickar påminnelser. Vyns status, sortering och gruppering ignoreras här.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/tr.json b/custom_components/maintenance_supporter/frontend/locales/tr.json
index 26f2d7af..b65b9f5a 100644
--- a/custom_components/maintenance_supporter/frontend/locales/tr.json
+++ b/custom_components/maintenance_supporter/frontend/locales/tr.json
@@ -547,6 +547,11 @@
"no_objects": "Henüz nesne yok.",
"action_error": "Eylem başarısız oldu. Lütfen tekrar deneyin.",
"area_id_optional": "Alan (isteğe bağlı)",
+ "place_optional": "Yer (bölge, isteğe bağlı)",
+ "remind_on_site": "Yalnızca biri oradayken hatırlat",
+ "remind_on_site_hint": "Hatırlatmalar biri bu bölgede olana kadar bekler. Oraya varan kişi yapılacakların listesini içeren bir mesaj alır.",
+ "place_missing": "Bölge bulunamadı: hatırlatmalar evdeki gibi",
+ "place_home": "Ev",
"installation_date_optional": "Kurulum tarihi (isteğe bağlı)",
"warranty_expiry_optional": "Garanti bitişi (isteğe bağlı)",
"warranty": "Garanti",
@@ -813,6 +818,8 @@
"owner_label": "Sahip",
"feat_completion_actions": "Tamamlama eylemleri",
"feat_completion_actions_desc": "Görev başına tamamlamada HA eylemi + önceden ayarlı değerlerle hızlı tamamlama QR'ı.",
+ "feat_places": "Yerler",
+ "feat_places_desc": "Başka bir yerde (Home Assistant bölgesi) bakımı yapılan nesneler: hatırlatmalar yalnızca biri oradayken, varışta bir mesaj.",
"on_complete_action_title": "Tamamlandığında: HA eylemi tetikle (isteğe bağlı)",
"on_complete_action_desc": "Görev tamamlandığında bir HA servisi çağırır — örn. cihazdaki bir sayacı sıfırlar.",
"on_complete_action_target": "Hedef varlık",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Kullanılan parça: {name}",
"label_filter": "Etiket",
"all_labels": "Tüm etiketler",
+ "filter_place": "Yer",
+ "filter_place_all": "Tüm yerler",
"settings_notify_scope": "Yalnızca şu görünüm için bildir",
"settings_notify_scope_all": "Tüm görevler",
"settings_notify_scope_hint": "Yalnızca seçili kayıtlı görünümün etiket/kullanıcı filtreleriyle eşleşen görevler hatırlatma gönderir. Görünümün durum, sıralama ve gruplaması burada dikkate alınmaz.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/uk.json b/custom_components/maintenance_supporter/frontend/locales/uk.json
index e013ceb3..40d4978a 100644
--- a/custom_components/maintenance_supporter/frontend/locales/uk.json
+++ b/custom_components/maintenance_supporter/frontend/locales/uk.json
@@ -545,6 +545,11 @@
"no_objects": "Поки немає об'єктів.",
"action_error": "Дія не вдалась. Спробуйте ще раз.",
"area_id_optional": "Зона (необов'язково)",
+ "place_optional": "Місце (зона, необов'язково)",
+ "remind_on_site": "Нагадувати, лише коли там хтось є",
+ "remind_on_site_hint": "Нагадування чекають, поки хтось буде в цій зоні. Хто туди прибуває, отримує повідомлення про те, що потрібно зробити.",
+ "place_missing": "Зону не знайдено: нагадування як удома",
+ "place_home": "Дім",
"installation_date_optional": "Дата встановлення (необов'язково)",
"warranty_expiry_optional": "Закінчення гарантії (необов'язково)",
"warranty": "Гарантія",
@@ -781,6 +786,8 @@
"owner_label": "Власник",
"feat_completion_actions": "Дії при завершенні",
"feat_completion_actions_desc": "Дія HA по завданню при завершенні + QR швидкого завершення з попередньо встановленими значеннями.",
+ "feat_places": "Місця",
+ "feat_places_desc": "Об'єкти в іншому місці (зона Home Assistant): нагадування лише тоді, коли там хтось є, і повідомлення після прибуття.",
"on_complete_action_title": "При завершенні: викликати HA-дію (опційно)",
"on_complete_action_desc": "Викликає HA-сервіс, коли завдання завершено — напр., скинути лічильник на пристрої.",
"on_complete_action_target": "Цільова сутність",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "Використовує деталь: {name}",
"label_filter": "Мітка",
"all_labels": "Усі мітки",
+ "filter_place": "Місце",
+ "filter_place_all": "Усі місця",
"settings_notify_scope": "Сповіщати лише для подання",
"settings_notify_scope_all": "Усі завдання",
"settings_notify_scope_hint": "Нагадування надсилають лише завдання, що відповідають фільтрам мітки/користувача обраного подання. Статус, сортування та групування подання тут ігноруються.",
diff --git a/custom_components/maintenance_supporter/frontend/locales/zh.json b/custom_components/maintenance_supporter/frontend/locales/zh.json
index 64d4d24a..ed804b8e 100644
--- a/custom_components/maintenance_supporter/frontend/locales/zh.json
+++ b/custom_components/maintenance_supporter/frontend/locales/zh.json
@@ -547,6 +547,11 @@
"no_objects": "暂无维护项。",
"action_error": "操作失败。请重试。",
"area_id_optional": "区域 (可选)",
+ "place_optional": "地点(区域,可选)",
+ "remind_on_site": "仅当有人在场时提醒",
+ "remind_on_site_hint": "提醒会等到有人在此区域时再发送。到达那里的人会收到一条列出待办事项的消息。",
+ "place_missing": "未找到区域:按在家处理提醒",
+ "place_home": "家",
"installation_date_optional": "安装日期 (可选)",
"warranty_expiry_optional": "保修到期 (可选)",
"warranty": "保修",
@@ -806,6 +811,8 @@
"owner_label": "所有者",
"feat_completion_actions": "完成动作",
"feat_completion_actions_desc": "为每个任务配置完成时的 HA 动作 + 预设值的快速完成二维码。",
+ "feat_places": "地点",
+ "feat_places_desc": "在其他地点(Home Assistant 区域)维护的对象:仅当有人在场时提醒,并在到达时发送消息。",
"on_complete_action_title": "完成时:触发 HA 动作(可选)",
"on_complete_action_desc": "任务完成时调用 HA 服务 — 例如重置设备上的物理计数器。",
"on_complete_action_target": "目标实体",
@@ -1125,6 +1132,8 @@
"adopt_problem_part": "使用配件:{name}",
"label_filter": "标签",
"all_labels": "所有标签",
+ "filter_place": "地点",
+ "filter_place_all": "所有地点",
"settings_notify_scope": "仅为该视图发送通知",
"settings_notify_scope_all": "所有任务",
"settings_notify_scope_hint": "只有匹配所选视图的标签/用户筛选的任务才会发送提醒。视图的状态、排序和分组在此处被忽略。",
diff --git a/custom_components/maintenance_supporter/frontend/maintenance-calendar-card.js b/custom_components/maintenance_supporter/frontend/maintenance-calendar-card.js
index 4f1ca2eb..50f024db 100644
--- a/custom_components/maintenance_supporter/frontend/maintenance-calendar-card.js
+++ b/custom_components/maintenance_supporter/frontend/maintenance-calendar-card.js
@@ -1,9 +1,9 @@
-/*! maintenance_supporter frontend 2.98.0 */
-var fr=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var y=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var ma=(s,r)=>{for(var e in r)fr(s,e,{get:r[e],enumerable:!0})};var c=(s,r,e,t)=>{for(var i=t>1?void 0:t?_a(r,e):r,a=s.length-1,o;a>=0;a--)(o=s[a])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&fr(r,e,i),i};var Rt,Pt,mi,vr,ct,yr,E,br,gi,fi=y(()=>{Rt=globalThis,Pt=Rt.ShadowRoot&&(Rt.ShadyCSS===void 0||Rt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,mi=Symbol(),vr=new WeakMap,ct=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==mi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Pt&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=vr.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&vr.set(e,r))}return r}toString(){return this.cssText}},yr=s=>new ct(typeof s=="string"?s:s+"",void 0,mi),E=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new ct(e,s,mi)},br=(s,r)=>{if(Pt)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Rt.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},gi=Pt?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return yr(e)})(s):s});var ga,fa,va,ya,ba,xa,Lt,xr,wa,ka,dt,pt,Nt,wr,ce,ut=y(()=>{fi();fi();({is:ga,defineProperty:fa,getOwnPropertyDescriptor:va,getOwnPropertyNames:ya,getOwnPropertySymbols:ba,getPrototypeOf:xa}=Object),Lt=globalThis,xr=Lt.trustedTypes,wa=xr?xr.emptyScript:"",ka=Lt.reactiveElementPolyfillSupport,dt=(s,r)=>s,pt={toAttribute(s,r){switch(r){case Boolean:s=s?wa:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},Nt=(s,r)=>!ga(s,r),wr={attribute:!0,type:String,converter:pt,reflect:!1,useDefault:!1,hasChanged:Nt};Symbol.metadata??=Symbol("metadata"),Lt.litPropertyMetadata??=new WeakMap;ce=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=wr){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&fa(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=va(this.prototype,r)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){let d=i?.call(this);a?.call(this,o),this.requestUpdate(r,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??wr}static _$Ei(){if(this.hasOwnProperty(dt("elementProperties")))return;let r=xa(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(dt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(dt("properties"))){let e=this.properties,t=[...ya(e),...ba(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(gi(i))}else r!==void 0&&e.push(gi(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return br(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(r=>r.hostConnected?.())}enableUpdating(r){}disconnectedCallback(){this._$EO?.forEach(r=>r.hostDisconnected?.())}attributeChangedCallback(r,e,t){this._$AK(r,t)}_$ET(r,e){let t=this.constructor.elementProperties.get(r),i=this.constructor._$Eu(r,t);if(i!==void 0&&t.reflect===!0){let a=(t.converter?.toAttribute!==void 0?t.converter:pt).toAttribute(e,t.type);this._$Em=r,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(r,e){let t=this.constructor,i=t._$Eh.get(r);if(i!==void 0&&this._$Em!==i){let a=t.getPropertyOptions(i),o=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:pt;this._$Em=i;let d=o.fromAttribute(e,a.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(r,e,t,i=!1,a){if(r!==void 0){let o=this.constructor;if(i===!1&&(a=this[r]),t??=o.getPropertyOptions(r),!((t.hasChanged??Nt)(a,e)||t.useDefault&&t.reflect&&a===this._$Ej?.get(r)&&!this.hasAttribute(o._$Eu(r,t))))return;this.C(r,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(r,e,{useDefault:t,reflect:i,wrapped:a},o){t&&!(this._$Ej??=new Map).has(r)&&(this._$Ej.set(r,o??e??this[r]),a!==!0||o!==void 0)||(this._$AL.has(r)||(this.hasUpdated||t||(e=void 0),this._$AL.set(r,e)),i===!0&&this._$Em!==r&&(this._$Eq??=new Set).add(r))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,a]of t){let{wrapped:o}=a,d=this[i];o!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,a,d)}}let r=!1,e=this._$AL;try{r=this.shouldUpdate(e),r?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw r=!1,this._$EM(),t}r&&this._$AE(e)}willUpdate(r){}_$AE(r){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(r){}firstUpdated(r){}};ce.elementStyles=[],ce.shadowRootOptions={mode:"open"},ce[dt("elementProperties")]=new Map,ce[dt("finalized")]=new Map,ka?.({ReactiveElement:ce}),(Lt.reactiveElementVersions??=[]).push("2.1.2")});function Lr(s,r){if(!Ei(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return $r!==void 0?$r.createHTML(r):r}function Ue(s,r,e=s,t){if(r===Ce)return r;let i=t!==void 0?e._$Co?.[t]:e._$Cl,a=mt(r)?void 0:r._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(s),i._$AT(s,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(r=Ue(s,i._$AS(s,r.values),i,t)),r}var $i,kr,qt,$r,Ir,me,Rr,$a,Ae,_t,mt,Ei,Ea,vi,ht,Er,Sr,Se,Tr,Ar,Pr,Si,l,We,bl,Ce,h,Cr,Te,Sa,gt,yi,ft,Be,bi,xi,wi,ki,Ta,Nr,Ht=y(()=>{$i=globalThis,kr=s=>s,qt=$i.trustedTypes,$r=qt?qt.createPolicy("lit-html",{createHTML:s=>s}):void 0,Ir="$lit$",me=`lit$${Math.random().toFixed(9).slice(2)}$`,Rr="?"+me,$a=`<${Rr}>`,Ae=document,_t=()=>Ae.createComment(""),mt=s=>s===null||typeof s!="object"&&typeof s!="function",Ei=Array.isArray,Ea=s=>Ei(s)||typeof s?.[Symbol.iterator]=="function",vi=`[
-\f\r]`,ht=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Er=/-->/g,Sr=/>/g,Se=RegExp(`>|${vi}(?:([^\\s"'>=/]+)(${vi}*=${vi}*(?:[^
-\f\r"'\`<>=]|("|')|))|$)`,"g"),Tr=/'/g,Ar=/"/g,Pr=/^(?:script|style|textarea|title)$/i,Si=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),l=Si(1),We=Si(2),bl=Si(3),Ce=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Cr=new WeakMap,Te=Ae.createTreeWalker(Ae,129);Sa=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"":r===3?"":"")),t]},gt=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,o=0,d=r.length-1,p=this.parts,[_,m]=Sa(r,e);if(this.el=s.createElement(_,t),Te.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Te.nextNode())!==null&&p.length0){i.textContent=qt?qt.emptyScript:"";for(let w=0;w2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(r,e=this,t,i){let a=this.strings,o=!1;if(a===void 0)r=Ue(this,r,e,0),o=!mt(r)||r!==this._$AH&&r!==Ce,o&&(this._$AH=r);else{let d=r,p,_;for(r=a[0],p=0;p{let t=e?.renderBefore??r,i=t._$litPart$;if(i===void 0){let a=e?.renderBefore??null;t._$litPart$=i=new ft(r.insertBefore(_t(),a),a,void 0,e??{})}return i._$AI(s),i}});var Ti,S,Aa,qr=y(()=>{ut();ut();Ht();Ht();Ti=globalThis,S=class extends ce{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let r=super.createRenderRoot();return this.renderOptions.renderBefore??=r.firstChild,r}update(r){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=Nr(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ce}};S._$litElement$=!0,S.finalized=!0,Ti.litElementHydrateSupport?.({LitElement:S});Aa=Ti.litElementPolyfillSupport;Aa?.({LitElement:S});(Ti.litElementVersions??=[]).push("4.2.2")});var Hr=y(()=>{});var I=y(()=>{ut();Ht();qr();Hr()});var Or=y(()=>{});function v(s){return(r,e)=>typeof e=="object"?Ia(s,r,e):((t,i,a)=>{let o=i.hasOwnProperty(a);return i.constructor.createProperty(a,t),o?Object.getOwnPropertyDescriptor(i,a):void 0})(s,r,e)}var Ca,Ia,Ai=y(()=>{ut();Ca={attribute:!0,type:String,converter:pt,reflect:!1,hasChanged:Nt},Ia=(s=Ca,r,e)=>{let{kind:t,metadata:i}=e,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),t==="setter"&&((s=Object.create(s)).wrapped=!0),a.set(e.name,s),t==="accessor"){let{name:o}=e;return{set(d){let p=r.get.call(this);r.set.call(this,d),this.requestUpdate(o,p,s,!0,d)},init(d){return d!==void 0&&this.C(o,void 0,s,d),d}}}if(t==="setter"){let{name:o}=e;return function(d){let p=this[o];r.call(this,d),this.requestUpdate(o,p,s,!0,d)}}throw Error("Unsupported decorator location: "+t)}});function u(s){return v({...s,state:!0,attribute:!1})}var jr=y(()=>{Ai();});var Dr=y(()=>{});var Ve=y(()=>{});var Mr=y(()=>{Ve();});var zr=y(()=>{Ve();});var Fr=y(()=>{Ve();});var Ur=y(()=>{Ve();});var Br=y(()=>{Ve();});var F=y(()=>{Or();Ai();jr();Dr();Mr();zr();Fr();Ur();Br()});function Wr(s){return s==="use"?"use":"purchase"}function Vr(s){let r=jt(s?.cost);if(r===null)return null;let e=jt(s?.package_size);return e&&e>0?r/e:r}function Dt(s){let r=jt(s.cost);if(s.cost_basis!=="use")return r;let e=jt(s.parts_cost),t=s.purchase?null:r;return t===null&&e===null?null:(t??0)+(e??0)}var jt,Mt=y(()=>{"use strict";jt=s=>typeof s=="number"&&Number.isFinite(s)?s:null});function Ii(s){return Pa[s??""]??Kr.length}var Ci,Kr,Pa,vt,zt=y(()=>{"use strict";Ci={ok:"var(--success-color, #4caf50)",due_soon:"var(--warning-color, #ff9800)",overdue:"var(--error-color, #f44336)",triggered:"var(--deep-orange-color, #ff5722)",archived:"var(--disabled-color, #9e9e9e)",paused:"var(--info-color, #2196f3)"},Kr=["overdue","triggered","due_soon","ok"],Pa=Object.fromEntries(Kr.map((s,r)=>[s,r]));vt={ok:"mdi:check-circle",due_soon:"mdi:alert-circle",overdue:"mdi:alert-octagon",triggered:"mdi:bell-alert",archived:"mdi:archive-outline",paused:"mdi:pause-circle-outline",completed:"mdi:check-circle",skipped:"mdi:skip-next",missed:"mdi:calendar-remove",reset:"mdi:refresh"}});function yt(s){let r=Qr.get(s);if(r===void 0){try{r=new Intl.DateTimeFormat("en-US",{timeZone:s,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{r=null}Qr.set(s,r)}return r}function Jr(){if(Ri===void 0){let s;try{s=new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}Ri=s&&yt(s)?s:null}return Ri}function Xr(){return Jr()??"UTC"}function ge(){let s=Zr.serverTimeZone;return s&&yt(s)?s:Xr()}function fe(){let s=Jr();return Zr.timeZone!=="server"&&s?s:ge()}function Ft(s,r){let e=yt(r)??yt(Xr())??yt("UTC"),t={};for(let i of e.formatToParts(s))i.type!=="literal"&&(t[i.type]=Number(i.value));return{y:t.year,mo:t.month,d:t.day,h:t.hour%24,mi:t.minute,s:t.second}}function ve(s,r){return Li(Ft(+s,r))}function Ut(s,r){let e=Ft(+s,r);return`${Li(e)}T${te(e.h)}:${te(e.mi)}`}function Ie(){return ve(Date.now(),ge())}function es(){return Ut(Date.now(),ge())}function Pi(s,r){let e=Ft(s,r);return Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s)-Math.floor(s/1e3)*1e3}function La(s,r,e,t,i,a,o){let d=Date.UTC(s,r-1,e,t,i,a),p=Pi(d-Yr,o),_=Pi(d+Yr,o);for(let m of p===_?[p]:[p,_])if(Pi(d-m,o)===m)return d-m;return d-p}function ts(s,r,e){if(s.has(r))return s.get(r);s.size>=Ha&&s.clear();let t=e();return s.set(r,t),t}function Q(s){if(typeof s!="string"||!s)return NaN;let r=Ni.exec(s);if(!r)return Date.parse(s);let e=ge();return ts(qa,`${e}|${s}`,()=>{let[t,i,a,o,d,p]=[r[1],r[2],r[3],r[4]??"0",r[5]??"0",r[6]??"0"].map(Number);if(i<1||i>12||new Date(Date.UTC(t,i-1,a)).getUTCDate()!==a||o>23||d>59||p>59)return NaN;let _=r[7]?Math.floor(+`0.${r[7]}`*1e3):0;return La(t,i,a,o,d,p,e)+_})}function qi(s){if(typeof s!="string"||!s)return null;let r=Ni.exec(s);if(r)return`${r[1]}-${r[2]}-${r[3]}`;let e=ge();return ts(Na,`${e}|${s}`,()=>{let t=Date.parse(s);return Number.isFinite(t)?ve(t,e):/^\d{4}-\d{2}-\d{2}/.test(s)?s.slice(0,10):null})}function is(s){if(typeof s!="string"||!s)return"";let r=Ni.exec(s);if(r)return`${r[1]}-${r[2]}-${r[3]}T${r[4]??"00"}:${r[5]??"00"}:${r[6]??"00"}`;let e=Date.parse(s);if(!Number.isFinite(e))return"";let t=Ft(e,ge());return`${Li(t)}T${te(t.h)}:${te(t.mi)}:${te(t.s)}`}function Re(s,r){let e=Oa.exec(s);if(!e)return s;let t=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])+Math.round(r)));return`${te(t.getUTCFullYear(),4)}-${te(t.getUTCMonth()+1)}-${te(t.getUTCDate())}`}var Zr,Yr,te,Qr,Ri,Li,Ni,Na,qa,Ha,Oa,Z=y(()=>{"use strict";Zr=window.__msDateTimePrefs??={},Yr=864e5,te=(s,r=2)=>String(s).padStart(r,"0"),Qr=new Map;Li=s=>`${te(s.y,4)}-${te(s.mo)}-${te(s.d)}`;Ni=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?$/,Na=new Map,qa=new Map,Ha=2e4;Oa=/^(\d{4})-(\d{2})-(\d{2})$/});var ds,cs=y(()=>{ds={maintenance:"Maintenance",objects:"Objects",tasks:"Tasks",overdue:"Overdue",due_soon:"Due Soon",triggered:"Triggered",trigger_replaced:"Trigger replaced",trigger_removed:"Trigger removed",ok:"OK",all:"All",new_object:"+ New Object",templates_from:"From template",templates_title:"Start from a template",templates_task_count:"{n} tasks",templates_task_count_one:"1 task",template_created:"Created from template",onboard_hint:"Add your first object to start tracking maintenance.",edit:"Edit",duplicate:"Duplicate",task_duplicated:"Task duplicated",task_moved:"Task moved",move_task_target:"Target object",move_task_message:"Choose the object this task should belong to. Its history, readings and trigger state move with it; it gets a new reference number and its entities are recreated under the new object. Linked documents stay with the current object.",bulk_move_message:"Choose the object the selected tasks should belong to. Tasks that already live there are skipped; history, readings and trigger state move along.",bulk_moved:"{n} tasks moved",more_actions:"More actions",move_task_title:"Move task",move_task:"Move to another object\u2026",object_duplicated:"Object duplicated",delete:"Delete",add_task:"+ Add Task",complete:"Complete",completed:"Completed",skip:"Skip",skipped:"Skipped",missed:"Missed",reset:"Reset",snooze:"Snooze",snoozed:"Snoozed",snoozed_for:"Reminders muted for {hours} hours \u2014 until {until}",snoozed_for_one:"Reminders muted for one hour \u2014 until {until}",cancel:"Cancel",bulk_select:"Select",bulk_select_all:"Select all",bulk_n_selected:"{n} selected",bulk_completed:"{n} tasks completed",bulk_archived:"{n} tasks archived",bulk_delete_objects_confirm:"Delete {n} objects and all their tasks? Archiving keeps their history instead.",bulk_objects_deleted:"{n} objects deleted",bulk_objects_archived:"{n} objects archived",bulk_assign:"Assign",bulk_assign_one:"One person",bulk_assign_rotate:"Several people, in turns",bulk_assign_hint:"Replaces who is assigned to the selected tasks \u2014 a rotation included.",bulk_rotation_min_two:"Pick at least two people.",bulk_labels_add:"Add labels",bulk_labels_remove:"Remove labels",bulk_edit_hint:"Only the ticked settings change; everything else stays as it is.",bulk_no_notifications:"No notifications for these tasks",bulk_updated:"{n} tasks updated",bulk_paused:"{n} tasks paused",bulk_resumed:"{n} tasks resumed",bulk_objects_area:"Area set for {n} objects",bulk_failed:"{n} failed: {reason}",completing:"Completing\u2026",interval:"Interval",warning:"Warning",last_performed:"Last performed",next_due:"Next due",days_until_due:"Days until due",avg_duration:"Avg duration",trigger:"Trigger",trigger_type:"Trigger type",threshold_above:"Upper limit",threshold_below:"Lower limit",threshold:"Threshold",counter:"Counter",state_change:"State change",runtime:"Runtime",trigger_type_due_date:"Date from a sensor",runtime_hours:"Target runtime (hours)",days_before:"Days before the date",days_before_help:`For a sensor that reports when the maintenance is due (a date or timestamp). 0 = on the date itself. The device's own "done" button moves the date forward, which clears the trigger \u2014 make it the completion action.`,target_value:"Target value",target_changes:"Target changes",for_minutes:"For (minutes)",time_based:"Time-based",sensor_based:"Sensor-based",manual:"Manual",one_time:"One-time",weekdays:"Weekdays",nth_weekday:"Nth weekday of month",day_of_month:"Day of month",calendar:"Calendar entity",calendar_entity_label:"Calendar",calendar_entity_hint:"Due once per event of this calendar, on the event's start date \u2014 the next event after the last completion.",calendar_entity_required:"Choose a calendar entity.",recurrence_on_days:"Repeat on",recurrence_occurrence:"Occurrence",recurrence_weekday:"Weekday",recurrence_day:"Day of month (1\u201331)",recurrence_last_day:"Last day of the month",recurrence_business_day:"Business days only (roll back from weekend)",recurrence_offset:"Offset (days, \xB1)",recurrence_offset_help:"Shift the date by \xB1N days, e.g. -2 = two days before.",last_day_month:"Last day of month",last_business_day_month:"Last business day",ord_1:"1st",ord_2:"2nd",ord_3:"3rd",ord_4:"4th",ord_5:"5th",ord_last:"Last",day_word:"Day",interval_value:"Interval",interval_unit:"Unit",unit_days:"Days",unit_weeks:"Weeks",unit_months:"Months",unit_years:"Years",due_date:"Due date",cleaning:"Cleaning",inspection:"Inspection",replacement:"Replacement",calibration:"Calibration",service:"Service",reading:"Reading",custom:"Custom",history:"History",cost:"Cost",cost_kind_credit:"Credit",cost_credit_hint:"Money back \u2014 a sale, a refund. It lowers the totals; the average per completion leaves it out.",report_button:"Report",report_title:"Maintenance report",report_generated:"Generated",report_times_done:"Done",report_total_cost:"Total cost",report_notes:"Notes",report_col_type:"Type",report_col_status:"Status",report_col_schedule:"Schedule",duration:"Duration",minutes_short:"min",both:"Both",trigger_val:"Trigger value",complete_title:"Complete: ",checklist:"Checklist",require_on_completion:"Require on completion",checklist_steps_optional:"Checklist steps (optional)",checklist_placeholder:`Clean filter
+/*! maintenance_supporter frontend 2.99.0 */
+var vr=Object.defineProperty;var va=Object.getOwnPropertyDescriptor;var y=(s,r,e)=>()=>{if(e)throw e[0];try{return s&&(r=s(s=0)),r}catch(t){throw e=[t],t}};var ya=(s,r)=>{for(var e in r)vr(s,e,{get:r[e],enumerable:!0})};var c=(s,r,e,t)=>{for(var i=t>1?void 0:t?va(r,e):r,a=s.length-1,o;a>=0;a--)(o=s[a])&&(i=(t?o(r,e,i):o(i))||i);return t&&i&&vr(r,e,i),i};var Pt,Lt,gi,yr,ct,br,E,xr,fi,vi=y(()=>{Pt=globalThis,Lt=Pt.ShadowRoot&&(Pt.ShadyCSS===void 0||Pt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,gi=Symbol(),yr=new WeakMap,ct=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==gi)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o,e=this.t;if(Lt&&r===void 0){let t=e!==void 0&&e.length===1;t&&(r=yr.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&yr.set(e,r))}return r}toString(){return this.cssText}},br=s=>new ct(typeof s=="string"?s:s+"",void 0,gi),E=(s,...r)=>{let e=s.length===1?s[0]:r.reduce((t,i,a)=>t+(o=>{if(o._$cssResult$===!0)return o.cssText;if(typeof o=="number")return o;throw Error("Value passed to 'css' function must be a 'css' function result: "+o+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+s[a+1],s[0]);return new ct(e,s,gi)},xr=(s,r)=>{if(Lt)s.adoptedStyleSheets=r.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of r){let t=document.createElement("style"),i=Pt.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,s.appendChild(t)}},fi=Lt?s=>s:s=>s instanceof CSSStyleSheet?(r=>{let e="";for(let t of r.cssRules)e+=t.cssText;return br(e)})(s):s});var ba,xa,wa,ka,$a,Ea,Nt,wr,Sa,Ta,dt,pt,qt,kr,ce,ut=y(()=>{vi();vi();({is:ba,defineProperty:xa,getOwnPropertyDescriptor:wa,getOwnPropertyNames:ka,getOwnPropertySymbols:$a,getPrototypeOf:Ea}=Object),Nt=globalThis,wr=Nt.trustedTypes,Sa=wr?wr.emptyScript:"",Ta=Nt.reactiveElementPolyfillSupport,dt=(s,r)=>s,pt={toAttribute(s,r){switch(r){case Boolean:s=s?Sa:null;break;case Object:case Array:s=s==null?s:JSON.stringify(s)}return s},fromAttribute(s,r){let e=s;switch(r){case Boolean:e=s!==null;break;case Number:e=s===null?null:Number(s);break;case Object:case Array:try{e=JSON.parse(s)}catch{e=null}}return e}},qt=(s,r)=>!ba(s,r),kr={attribute:!0,type:String,converter:pt,reflect:!1,useDefault:!1,hasChanged:qt};Symbol.metadata??=Symbol("metadata"),Nt.litPropertyMetadata??=new WeakMap;ce=class extends HTMLElement{static addInitializer(r){this._$Ei(),(this.l??=[]).push(r)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(r,e=kr){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(r)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(r,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(r,t,e);i!==void 0&&xa(this.prototype,r,i)}}static getPropertyDescriptor(r,e,t){let{get:i,set:a}=wa(this.prototype,r)??{get(){return this[e]},set(o){this[e]=o}};return{get:i,set(o){let d=i?.call(this);a?.call(this,o),this.requestUpdate(r,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(r){return this.elementProperties.get(r)??kr}static _$Ei(){if(this.hasOwnProperty(dt("elementProperties")))return;let r=Ea(this);r.finalize(),r.l!==void 0&&(this.l=[...r.l]),this.elementProperties=new Map(r.elementProperties)}static finalize(){if(this.hasOwnProperty(dt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(dt("properties"))){let e=this.properties,t=[...ka(e),...$a(e)];for(let i of t)this.createProperty(i,e[i])}let r=this[Symbol.metadata];if(r!==null){let e=litPropertyMetadata.get(r);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(r){let e=[];if(Array.isArray(r)){let t=new Set(r.flat(1/0).reverse());for(let i of t)e.unshift(fi(i))}else r!==void 0&&e.push(fi(r));return e}static _$Eu(r,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof r=="string"?r.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(r=>r(this))}addController(r){(this._$EO??=new Set).add(r),this.renderRoot!==void 0&&this.isConnected&&r.hostConnected?.()}removeController(r){this._$EO?.delete(r)}_$E_(){let r=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(r.set(t,this[t]),delete this[t]);r.size>0&&(this._$Ep=r)}createRenderRoot(){let r=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xr(r,this.constructor.elementStyles),r}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(r=>r.hostConnected?.())}enableUpdating(r){}disconnectedCallback(){this._$EO?.forEach(r=>r.hostDisconnected?.())}attributeChangedCallback(r,e,t){this._$AK(r,t)}_$ET(r,e){let t=this.constructor.elementProperties.get(r),i=this.constructor._$Eu(r,t);if(i!==void 0&&t.reflect===!0){let a=(t.converter?.toAttribute!==void 0?t.converter:pt).toAttribute(e,t.type);this._$Em=r,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(r,e){let t=this.constructor,i=t._$Eh.get(r);if(i!==void 0&&this._$Em!==i){let a=t.getPropertyOptions(i),o=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:pt;this._$Em=i;let d=o.fromAttribute(e,a.type);this[i]=d??this._$Ej?.get(i)??d,this._$Em=null}}requestUpdate(r,e,t,i=!1,a){if(r!==void 0){let o=this.constructor;if(i===!1&&(a=this[r]),t??=o.getPropertyOptions(r),!((t.hasChanged??qt)(a,e)||t.useDefault&&t.reflect&&a===this._$Ej?.get(r)&&!this.hasAttribute(o._$Eu(r,t))))return;this.C(r,e,t)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(r,e,{useDefault:t,reflect:i,wrapped:a},o){t&&!(this._$Ej??=new Map).has(r)&&(this._$Ej.set(r,o??e??this[r]),a!==!0||o!==void 0)||(this._$AL.has(r)||(this.hasUpdated||t||(e=void 0),this._$AL.set(r,e)),i===!0&&this._$Em!==r&&(this._$Eq??=new Set).add(r))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let r=this.scheduleUpdate();return r!=null&&await r,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[i,a]of this._$Ep)this[i]=a;this._$Ep=void 0}let t=this.constructor.elementProperties;if(t.size>0)for(let[i,a]of t){let{wrapped:o}=a,d=this[i];o!==!0||this._$AL.has(i)||d===void 0||this.C(i,void 0,a,d)}}let r=!1,e=this._$AL;try{r=this.shouldUpdate(e),r?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(t){throw r=!1,this._$EM(),t}r&&this._$AE(e)}willUpdate(r){}_$AE(r){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(r)),this.updated(r)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(r){return!0}update(r){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(r){}firstUpdated(r){}};ce.elementStyles=[],ce.shadowRootOptions={mode:"open"},ce[dt("elementProperties")]=new Map,ce[dt("finalized")]=new Map,Ta?.({ReactiveElement:ce}),(Nt.reactiveElementVersions??=[]).push("2.1.2")});function Nr(s,r){if(!Si(s)||!s.hasOwnProperty("raw"))throw Error("invalid template strings array");return Er!==void 0?Er.createHTML(r):r}function Ue(s,r,e=s,t){if(r===Ce)return r;let i=t!==void 0?e._$Co?.[t]:e._$Cl,a=mt(r)?void 0:r._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(s),i._$AT(s,e,t)),t!==void 0?(e._$Co??=[])[t]=i:e._$Cl=i),i!==void 0&&(r=Ue(s,i._$AS(s,r.values),i,t)),r}var Ei,$r,Ht,Er,Rr,me,Pr,Aa,Ae,_t,mt,Si,Ca,yi,ht,Sr,Tr,Se,Ar,Cr,Lr,Ti,l,We,$l,Ce,h,Ir,Te,Ia,gt,bi,ft,Be,xi,wi,ki,$i,Ra,qr,Ot=y(()=>{Ei=globalThis,$r=s=>s,Ht=Ei.trustedTypes,Er=Ht?Ht.createPolicy("lit-html",{createHTML:s=>s}):void 0,Rr="$lit$",me=`lit$${Math.random().toFixed(9).slice(2)}$`,Pr="?"+me,Aa=`<${Pr}>`,Ae=document,_t=()=>Ae.createComment(""),mt=s=>s===null||typeof s!="object"&&typeof s!="function",Si=Array.isArray,Ca=s=>Si(s)||typeof s?.[Symbol.iterator]=="function",yi=`[
+\f\r]`,ht=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Sr=/-->/g,Tr=/>/g,Se=RegExp(`>|${yi}(?:([^\\s"'>=/]+)(${yi}*=${yi}*(?:[^
+\f\r"'\`<>=]|("|')|))|$)`,"g"),Ar=/'/g,Cr=/"/g,Lr=/^(?:script|style|textarea|title)$/i,Ti=s=>(r,...e)=>({_$litType$:s,strings:r,values:e}),l=Ti(1),We=Ti(2),$l=Ti(3),Ce=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),Ir=new WeakMap,Te=Ae.createTreeWalker(Ae,129);Ia=(s,r)=>{let e=s.length-1,t=[],i,a=r===2?"":r===3?"":"")),t]},gt=class s{constructor({strings:r,_$litType$:e},t){let i;this.parts=[];let a=0,o=0,d=r.length-1,p=this.parts,[_,m]=Ia(r,e);if(this.el=s.createElement(_,t),Te.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=Te.nextNode())!==null&&p.length0){i.textContent=Ht?Ht.emptyScript:"";for(let w=0;w2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(r,e=this,t,i){let a=this.strings,o=!1;if(a===void 0)r=Ue(this,r,e,0),o=!mt(r)||r!==this._$AH&&r!==Ce,o&&(this._$AH=r);else{let d=r,p,_;for(r=a[0],p=0;p{let t=e?.renderBefore??r,i=t._$litPart$;if(i===void 0){let a=e?.renderBefore??null;t._$litPart$=i=new ft(r.insertBefore(_t(),a),a,void 0,e??{})}return i._$AI(s),i}});var Ai,S,Pa,Hr=y(()=>{ut();ut();Ot();Ot();Ai=globalThis,S=class extends ce{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let r=super.createRenderRoot();return this.renderOptions.renderBefore??=r.firstChild,r}update(r){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(r),this._$Do=qr(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Ce}};S._$litElement$=!0,S.finalized=!0,Ai.litElementHydrateSupport?.({LitElement:S});Pa=Ai.litElementPolyfillSupport;Pa?.({LitElement:S});(Ai.litElementVersions??=[]).push("4.2.2")});var Or=y(()=>{});var I=y(()=>{ut();Ot();Hr();Or()});var jr=y(()=>{});function v(s){return(r,e)=>typeof e=="object"?Na(s,r,e):((t,i,a)=>{let o=i.hasOwnProperty(a);return i.constructor.createProperty(a,t),o?Object.getOwnPropertyDescriptor(i,a):void 0})(s,r,e)}var La,Na,Ci=y(()=>{ut();La={attribute:!0,type:String,converter:pt,reflect:!1,hasChanged:qt},Na=(s=La,r,e)=>{let{kind:t,metadata:i}=e,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),t==="setter"&&((s=Object.create(s)).wrapped=!0),a.set(e.name,s),t==="accessor"){let{name:o}=e;return{set(d){let p=r.get.call(this);r.set.call(this,d),this.requestUpdate(o,p,s,!0,d)},init(d){return d!==void 0&&this.C(o,void 0,s,d),d}}}if(t==="setter"){let{name:o}=e;return function(d){let p=this[o];r.call(this,d),this.requestUpdate(o,p,s,!0,d)}}throw Error("Unsupported decorator location: "+t)}});function u(s){return v({...s,state:!0,attribute:!1})}var Dr=y(()=>{Ci();});var Mr=y(()=>{});var Ve=y(()=>{});var zr=y(()=>{Ve();});var Fr=y(()=>{Ve();});var Ur=y(()=>{Ve();});var Br=y(()=>{Ve();});var Wr=y(()=>{Ve();});var F=y(()=>{jr();Ci();Dr();Mr();zr();Fr();Ur();Br();Wr()});function Vr(s){return s==="use"?"use":"purchase"}function Gr(s){let r=Dt(s?.cost);if(r===null)return null;let e=Dt(s?.package_size);return e&&e>0?r/e:r}function Mt(s){let r=Dt(s.cost);if(s.cost_basis!=="use")return r;let e=Dt(s.parts_cost),t=s.purchase?null:r;return t===null&&e===null?null:(t??0)+(e??0)}var Dt,zt=y(()=>{"use strict";Dt=s=>typeof s=="number"&&Number.isFinite(s)?s:null});function Ri(s){return Ha[s??""]??Yr.length}var Ii,Yr,Ha,vt,Ft=y(()=>{"use strict";Ii={ok:"var(--success-color, #4caf50)",due_soon:"var(--warning-color, #ff9800)",overdue:"var(--error-color, #f44336)",triggered:"var(--deep-orange-color, #ff5722)",archived:"var(--disabled-color, #9e9e9e)",paused:"var(--info-color, #2196f3)"},Yr=["overdue","triggered","due_soon","ok"],Ha=Object.fromEntries(Yr.map((s,r)=>[s,r]));vt={ok:"mdi:check-circle",due_soon:"mdi:alert-circle",overdue:"mdi:alert-octagon",triggered:"mdi:bell-alert",archived:"mdi:archive-outline",paused:"mdi:pause-circle-outline",completed:"mdi:check-circle",skipped:"mdi:skip-next",missed:"mdi:calendar-remove",reset:"mdi:refresh"}});function yt(s){let r=Zr.get(s);if(r===void 0){try{r=new Intl.DateTimeFormat("en-US",{timeZone:s,hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{r=null}Zr.set(s,r)}return r}function Xr(){if(Pi===void 0){let s;try{s=new Intl.DateTimeFormat().resolvedOptions().timeZone}catch{}Pi=s&&yt(s)?s:null}return Pi}function es(){return Xr()??"UTC"}function ge(){let s=Jr.serverTimeZone;return s&&yt(s)?s:es()}function fe(){let s=Xr();return Jr.timeZone!=="server"&&s?s:ge()}function Ut(s,r){let e=yt(r)??yt(es())??yt("UTC"),t={};for(let i of e.formatToParts(s))i.type!=="literal"&&(t[i.type]=Number(i.value));return{y:t.year,mo:t.month,d:t.day,h:t.hour%24,mi:t.minute,s:t.second}}function ve(s,r){return Ni(Ut(+s,r))}function Bt(s,r){let e=Ut(+s,r);return`${Ni(e)}T${te(e.h)}:${te(e.mi)}`}function Ie(){return ve(Date.now(),ge())}function ts(){return Bt(Date.now(),ge())}function Li(s,r){let e=Ut(s,r);return Date.UTC(e.y,e.mo-1,e.d,e.h,e.mi,e.s)-Math.floor(s/1e3)*1e3}function Oa(s,r,e,t,i,a,o){let d=Date.UTC(s,r-1,e,t,i,a),p=Li(d-Qr,o),_=Li(d+Qr,o);for(let m of p===_?[p]:[p,_])if(Li(d-m,o)===m)return d-m;return d-p}function is(s,r,e){if(s.has(r))return s.get(r);s.size>=Ma&&s.clear();let t=e();return s.set(r,t),t}function Q(s){if(typeof s!="string"||!s)return NaN;let r=qi.exec(s);if(!r)return Date.parse(s);let e=ge();return is(Da,`${e}|${s}`,()=>{let[t,i,a,o,d,p]=[r[1],r[2],r[3],r[4]??"0",r[5]??"0",r[6]??"0"].map(Number);if(i<1||i>12||new Date(Date.UTC(t,i-1,a)).getUTCDate()!==a||o>23||d>59||p>59)return NaN;let _=r[7]?Math.floor(+`0.${r[7]}`*1e3):0;return Oa(t,i,a,o,d,p,e)+_})}function Hi(s){if(typeof s!="string"||!s)return null;let r=qi.exec(s);if(r)return`${r[1]}-${r[2]}-${r[3]}`;let e=ge();return is(ja,`${e}|${s}`,()=>{let t=Date.parse(s);return Number.isFinite(t)?ve(t,e):/^\d{4}-\d{2}-\d{2}/.test(s)?s.slice(0,10):null})}function rs(s){if(typeof s!="string"||!s)return"";let r=qi.exec(s);if(r)return`${r[1]}-${r[2]}-${r[3]}T${r[4]??"00"}:${r[5]??"00"}:${r[6]??"00"}`;let e=Date.parse(s);if(!Number.isFinite(e))return"";let t=Ut(e,ge());return`${Ni(t)}T${te(t.h)}:${te(t.mi)}:${te(t.s)}`}function Re(s,r){let e=za.exec(s);if(!e)return s;let t=new Date(Date.UTC(Number(e[1]),Number(e[2])-1,Number(e[3])+Math.round(r)));return`${te(t.getUTCFullYear(),4)}-${te(t.getUTCMonth()+1)}-${te(t.getUTCDate())}`}var Jr,Qr,te,Zr,Pi,Ni,qi,ja,Da,Ma,za,Z=y(()=>{"use strict";Jr=window.__msDateTimePrefs??={},Qr=864e5,te=(s,r=2)=>String(s).padStart(r,"0"),Zr=new Map;Ni=s=>`${te(s.y,4)}-${te(s.mo)}-${te(s.d)}`;qi=/^(\d{4})-(\d{2})-(\d{2})(?:[T ](\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?)?$/,ja=new Map,Da=new Map,Ma=2e4;za=/^(\d{4})-(\d{2})-(\d{2})$/});var ps,ds=y(()=>{ps={maintenance:"Maintenance",objects:"Objects",tasks:"Tasks",overdue:"Overdue",due_soon:"Due Soon",triggered:"Triggered",trigger_replaced:"Trigger replaced",trigger_removed:"Trigger removed",ok:"OK",all:"All",new_object:"+ New Object",templates_from:"From template",templates_title:"Start from a template",templates_task_count:"{n} tasks",templates_task_count_one:"1 task",template_created:"Created from template",onboard_hint:"Add your first object to start tracking maintenance.",edit:"Edit",duplicate:"Duplicate",task_duplicated:"Task duplicated",task_moved:"Task moved",move_task_target:"Target object",move_task_message:"Choose the object this task should belong to. Its history, readings and trigger state move with it; it gets a new reference number and its entities are recreated under the new object. Linked documents stay with the current object.",bulk_move_message:"Choose the object the selected tasks should belong to. Tasks that already live there are skipped; history, readings and trigger state move along.",bulk_moved:"{n} tasks moved",more_actions:"More actions",move_task_title:"Move task",move_task:"Move to another object\u2026",object_duplicated:"Object duplicated",delete:"Delete",add_task:"+ Add Task",complete:"Complete",completed:"Completed",skip:"Skip",skipped:"Skipped",missed:"Missed",reset:"Reset",snooze:"Snooze",snoozed:"Snoozed",snoozed_for:"Reminders muted for {hours} hours \u2014 until {until}",snoozed_for_one:"Reminders muted for one hour \u2014 until {until}",cancel:"Cancel",bulk_select:"Select",bulk_select_all:"Select all",bulk_n_selected:"{n} selected",bulk_completed:"{n} tasks completed",bulk_archived:"{n} tasks archived",bulk_delete_objects_confirm:"Delete {n} objects and all their tasks? Archiving keeps their history instead.",bulk_objects_deleted:"{n} objects deleted",bulk_objects_archived:"{n} objects archived",bulk_assign:"Assign",bulk_assign_one:"One person",bulk_assign_rotate:"Several people, in turns",bulk_assign_hint:"Replaces who is assigned to the selected tasks \u2014 a rotation included.",bulk_rotation_min_two:"Pick at least two people.",bulk_labels_add:"Add labels",bulk_labels_remove:"Remove labels",bulk_edit_hint:"Only the ticked settings change; everything else stays as it is.",bulk_no_notifications:"No notifications for these tasks",bulk_updated:"{n} tasks updated",bulk_paused:"{n} tasks paused",bulk_resumed:"{n} tasks resumed",bulk_objects_area:"Area set for {n} objects",bulk_failed:"{n} failed: {reason}",completing:"Completing\u2026",interval:"Interval",warning:"Warning",last_performed:"Last performed",next_due:"Next due",days_until_due:"Days until due",avg_duration:"Avg duration",trigger:"Trigger",trigger_type:"Trigger type",threshold_above:"Upper limit",threshold_below:"Lower limit",threshold:"Threshold",counter:"Counter",state_change:"State change",runtime:"Runtime",trigger_type_due_date:"Date from a sensor",runtime_hours:"Target runtime (hours)",days_before:"Days before the date",days_before_help:`For a sensor that reports when the maintenance is due (a date or timestamp). 0 = on the date itself. The device's own "done" button moves the date forward, which clears the trigger \u2014 make it the completion action.`,target_value:"Target value",target_changes:"Target changes",for_minutes:"For (minutes)",time_based:"Time-based",sensor_based:"Sensor-based",manual:"Manual",one_time:"One-time",weekdays:"Weekdays",nth_weekday:"Nth weekday of month",day_of_month:"Day of month",calendar:"Calendar entity",calendar_entity_label:"Calendar",calendar_entity_hint:"Due once per event of this calendar, on the event's start date \u2014 the next event after the last completion.",calendar_entity_required:"Choose a calendar entity.",recurrence_on_days:"Repeat on",recurrence_occurrence:"Occurrence",recurrence_weekday:"Weekday",recurrence_day:"Day of month (1\u201331)",recurrence_last_day:"Last day of the month",recurrence_business_day:"Business days only (roll back from weekend)",recurrence_offset:"Offset (days, \xB1)",recurrence_offset_help:"Shift the date by \xB1N days, e.g. -2 = two days before.",last_day_month:"Last day of month",last_business_day_month:"Last business day",ord_1:"1st",ord_2:"2nd",ord_3:"3rd",ord_4:"4th",ord_5:"5th",ord_last:"Last",day_word:"Day",interval_value:"Interval",interval_unit:"Unit",unit_days:"Days",unit_weeks:"Weeks",unit_months:"Months",unit_years:"Years",due_date:"Due date",cleaning:"Cleaning",inspection:"Inspection",replacement:"Replacement",calibration:"Calibration",service:"Service",reading:"Reading",custom:"Custom",history:"History",cost:"Cost",cost_kind_credit:"Credit",cost_credit_hint:"Money back \u2014 a sale, a refund. It lowers the totals; the average per completion leaves it out.",report_button:"Report",report_title:"Maintenance report",report_generated:"Generated",report_times_done:"Done",report_total_cost:"Total cost",report_notes:"Notes",report_col_type:"Type",report_col_status:"Status",report_col_schedule:"Schedule",duration:"Duration",minutes_short:"min",both:"Both",trigger_val:"Trigger value",complete_title:"Complete: ",checklist:"Checklist",require_on_completion:"Require on completion",checklist_steps_optional:"Checklist steps (optional)",checklist_placeholder:`Clean filter
Replace seal
-Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",ws_err_not_found:"Not found \u2014 it may have been deleted meanwhile",ws_err_invalid_input:"Invalid input",ws_err_invalid_date:"Invalid date",ws_err_invalid_format:"Invalid format",ws_err_invalid_url:"Invalid link",ws_err_invalid_mirror_todo:"Invalid to-do list",ws_err_not_configured:"Not set up yet",ws_err_not_loaded:"Not loaded yet \u2014 try again in a moment",ws_err_limit_reached:"Limit reached",ws_err_too_many:"Too many entries",ws_err_too_large:"Too large",ws_err_not_archived:"Not archived",ws_err_invalid_target:"Invalid target",ws_err_create_failed:"Could not be created",ws_err_archived:"Archived \u2014 restore it first",ws_err_already_archived:"Already archived",ws_err_unavailable:"Currently unavailable",ws_err_unauthorized:"Not permitted for your user",ws_err_too_many_views:"Too many saved views",ws_err_storage_unavailable:"Storage is not available",ws_err_replace_failed:"Replacement failed",ws_err_not_paused:"Not paused",ws_err_not_available:"Nothing available",ws_err_no_url:"No link given",ws_err_no_phases:"This task has no phases",ws_err_invalid_view:"Invalid view",ws_err_invalid_user:"Unknown user",ws_err_invalid_range:"Invalid range",ws_err_invalid_parent:"Invalid parent object",ws_err_invalid_device:"Unknown device",ws_err_empty_csv:"The CSV file is empty",ws_err_empty:"Nothing to import",ws_err_duplicate_failed:"Could not duplicate",ws_err_already_paused:"Already paused",ws_err_invalid_cursor:"Invalid phase position",ws_err_invalid_entity_slug:"Invalid entity name",ws_err_invalid_trigger_config:"Invalid trigger configuration",ws_err_no_defaults:"No quick-complete defaults set",ws_err_self_link_device:"An object cannot be linked to itself",ws_err_too_early:"Too early \u2014 this task can only be completed closer to its due date",ws_err_invalid_search_template:"The search link must be an http(s) URL containing {q}",ws_err_invalid_icon:"The notification icon must be an mdi: name, e.g. mdi:air-filter",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_toggle:"Due at a specific time",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",notes_markdown_hint:"Markdown is supported \u2014 **bold**, lists, [links](\u2026)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",completed_at_optional:"Completed at (optional, empty = now)",completed_at_pick:"Set date & time",completed_at_future_error:"The completion date cannot be in the future.",ha_time_zone_hint:"Time in Home Assistant's time zone ({zone})",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",task_mirror_todo:"Mirror into to-do lists",task_mirror_todo_hint:"The task appears in these lists while it is due; checking it off there completes it here.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",all_priorities:"All priorities",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",object_replaces:"Replaces",object_replaced_by:"Replaced by",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",all_parts:"All parts",all_areas:"All areas",areas_filter:"Filter areas\u2026",areas_filter_none:"No area matches the filter.",area_cost_year:"Cost {year}",area_object_count:"{n} objects",area_object_count_one:"1 object",area_range_12m:"Last 12 months",area_range_all:"All time",area_task_filter:"Filter by task\u2026",area_kpi_completions:"Completions",area_kpi_total_time:"Total time",area_cost_per_month:"Cost per month",area_cost_per_year:"Cost per year",area_cost_per_object:"Cost per object",area_cost_share:"Share",area_history_section:"History (all objects)",area_report_print:"Area report (PDF)",area_report_title:"Area report",area_report_period:"Period",area_no_costs:"No costs recorded in this period.",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",trigger_equals:"Trigger when equal to (=)",trigger_not_equals:"Trigger when different from (\u2260)",for_at_least_minutes:"For at least (minutes)",safety_interval:"Safety interval (optional)",trigger_combinator:"Combine trigger and interval",trigger_combinator_any:"Trigger or interval (whichever first)",trigger_combinator_all:"Trigger and interval (both required)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",adaptive_prediction_enabled:"Enable sensor-driven predictions",adaptive_seasonal_enabled:"Enable seasonal awareness",adaptive_max_interval:"Maximum interval (days)",adaptive_min_interval:"Minimum interval (days)",adaptive_ewa_alpha:"Learning rate (alpha)",adaptive_enabled:"Enable adaptive scheduling",adaptive_section_title:"Adaptive Scheduling",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_completed:"Least completed",rotation_random:"Random",no_user_assigned:"(No user assigned)",all_users:"All Users",my_tasks:"My Tasks",tab_calendar:"Calendar",cal_no_events:"No maintenance",cal_every_n_days:"every {n} days",cal_every_day:"every day",cal_source_time:"Time-based",cal_source_time_adaptive:"Time-based (adaptive)",cal_source_sensor:"Sensor-based",cal_predicted:"predicted",cal_confidence_high:"high confidence",cal_confidence_medium:"medium confidence",cal_confidence_low:"low confidence",budget_monthly:"Monthly budget",budget_yearly:"Yearly budget",groups:"Groups",new_group:"New group",edit_group:"Edit group",no_groups:"No groups yet",delete_group:"Delete group",delete_group_confirm:"Delete group '{name}'?",group_select_tasks:"Select tasks",group_name_required:"Name is required",description_optional:"Description (optional)",selected:"Selected",loading_chart:"Loading chart data...",hide_outliers:"Hide outliers (sensor glitches)",was_maintenance_needed:"Was this maintenance needed?",feedback_needed:"Needed",feedback_not_needed:"Not needed",feedback_not_sure:"Not sure",suggested_interval:"Suggested interval",apply_suggestion:"Apply",reanalyze:"Re-analyze",reanalyze_result:"New analysis",reanalyze_insufficient_data:"Not enough data to produce a recommendation",data_points:"data points",dismiss_suggestion:"Dismiss",confidence_low:"Low",confidence_medium:"Medium",confidence_high:"High",recommended:"recommended",seasonal_awareness:"Seasonal Awareness",edit_seasonal_overrides:"Edit seasonal factors",seasonal_overrides_title:"Seasonal factors (override)",seasonal_overrides_hint:"Factor per month (0.1\u20135.0). Empty = learned automatically.",seasonal_override_invalid:"Invalid value",seasonal_override_range:"Factor must be between 0.1 and 5.0",clear_all:"Clear all",clear:"Clear",date_type_toggle:"Type the date",date_type_invalid:"Not a valid date \u2014 try 1978-03-15, a year like 1978, or your own date format",seasonal_chart_title:"Seasonal Factors",seasonal_learned:"Learned",seasonal_manual:"Manual",month_jan:"Jan",month_feb:"Feb",month_mar:"Mar",month_apr:"Apr",month_may:"May",month_jun:"Jun",month_jul:"Jul",month_aug:"Aug",month_sep:"Sep",month_oct:"Oct",month_nov:"Nov",month_dec:"Dec",sensor_prediction:"Sensor Prediction",degradation_trend:"Trend",trend_rising:"Rising",trend_falling:"Falling",trend_stable:"Stable",trend_insufficient_data:"Insufficient data",days_until_threshold:"Days until threshold",threshold_exceeded:"Threshold exceeded",environmental_adjustment:"Environmental factor",sensor_prediction_urgency:"Sensor predicts threshold in ~{days} days",day_short:"day",weibull_reliability_curve:"Reliability Curve",weibull_failure_probability:"Failure Probability",weibull_r_squared:"Fit R\xB2",beta_early_failures:"Early Failures",beta_random_failures:"Random Failures",beta_wear_out:"Wear-out",beta_highly_predictable:"Highly Predictable",confidence_interval:"Confidence Interval",confidence_conservative:"Conservative",confidence_aggressive:"Optimistic",current_interval_marker:"Current interval",recommended_marker:"Recommended",characteristic_life:"Characteristic life",chart_mini_sparkline:"Trend sparkline",chart_history:"Cost and duration history",chart_seasonal:"Seasonal factors, 12 months",chart_weibull:"Weibull reliability curve",chart_sparkline:"Sensor trigger value chart",days_progress:"Days progress",qr_code:"QR Code",qr_generating:"Generating QR code\u2026",qr_error:"Failed to generate QR code.",qr_error_no_url:"No HA URL configured. Please set an external or internal URL in Settings \u2192 System \u2192 Network.",save_error:"Failed to save. Please try again.",subsave_warning:"Saved, but one setting was rejected: {detail}",qr_print:"Print",qr_download:"Download SVG",qr_action_view:"View maintenance info",qr_action_complete:"Mark maintenance as complete",qr_action_quick_complete:"Quick-complete \u2014 no dialog",qr_print_quick_none:"Quick-complete codes need quick-complete defaults on a task (Settings \u2192 Advanced Features \u2192 Completion actions; task dialog \u2192 Quick-complete defaults) \u2014 none of the chosen objects' tasks has them yet.",qr_url_mode:"Link type",qr_mode_companion:"Companion App",qr_mode_local:"Local (mDNS)",qr_mode_server:"Server URL",overview:"Overview",strat_this_month:"This Month",strat_later:"Later",strat_week:"Week",strat_fortnight:"Fortnight",strat_month:"Month",strat_year:"Year",strat_other:"Other",strat_status:"Status",strat_empty_title:"No maintenance objects yet",strat_empty_content:"Open the Maintenance panel to add your first object \u2014 pool pump, HVAC filter, vehicle, anything that needs scheduled care.",strat_open_panel:"Open Maintenance panel",strat_add_object:"Add object",strat_not_loaded:"**Maintenance Supporter** is not loaded. Install/enable the integration first.",strat_group_by:"Group views by",strat_group_area:"By area (default)",strat_group_status:"By status (Overdue / Triggered / Due Soon / OK)",strat_group_floor:"By floor (uses HA floors)",strat_group_due_date:"By due date (Overdue / Today / Week / Month / Later)",strat_group_calendar:"Rolling calendar (Week / Fortnight / Month / Year)",strat_editor_help:'The "Overview" view is always first. Empty groups are skipped.',picker_name_calendar:"Maintenance Supporter \u2014 Calendar",picker_name_panel:"Maintenance Supporter \u2014 Panel",picker_name_budget:"Maintenance Supporter \u2014 Budget",picker_name_groups:"Maintenance Supporter \u2014 Groups",picker_name_vacation:"Maintenance Supporter \u2014 Vacation",picker_name_battery_fleet:"Battery Fleet",picker_name_section:"Maintenance Supporter \u2014 Section",picker_name_vacation_status:"Maintenance Supporter \u2014 Vacation Status",picker_name_budget_status:"Maintenance Supporter \u2014 Budget Status",picker_desc_card:"Overview of your maintenance tasks with quick actions.",picker_desc_calendar:"Rolling calendar of maintenance tasks with 7/14/30/365 day windows, source icons, and prediction-confidence pills.",picker_desc_panel:"The complete Maintenance Supporter panel as a card \u2014 for a panel view / dashboard subview without the sidebar entry.",picker_desc_budget:"Edit the monthly and yearly budget right on the dashboard.",picker_desc_groups:"Create, rename and delete task groups right on the dashboard.",picker_desc_vacation:"Switch vacation mode on or off and set its dates right on the dashboard.",picker_desc_battery_fleet:"All tracked batteries: what is low now, what runs out soon, and what to buy.",picker_desc_dashboard:"Auto-generated dashboard. Group views by area, status, floor, or due date \u2014 picked from the strategy editor or YAML.",picker_desc_section:"Embed maintenance tasks (filterable by area, status, due date) as a section in any dashboard view.",picker_desc_vacation_status:"Compact vacation-mode status banner. Tap to open settings in the panel.",picker_desc_budget_status:"Monthly + yearly maintenance budget overview. Tap for details.",picker_desc_groups_status:"List of configured task groups with member counts.",hist_note_button:"Completed from dashboard button",hist_note_todo:"Completed from the To-do list",hist_note_voice:"Completed by voice",hist_note_notification:"Completed from the notification",hist_note_nfc:"Completed via NFC tag",hist_note_shopping_list:"Completed from the shopping list",hist_note_todo_mirror:"Completed from a mirrored to-do list",hist_note_skipped_notification:"Skipped from notification",hist_note_skipped_button:"Skipped from dashboard button",hist_note_sensor_triggered:"Sensor trigger activated",hist_note_initial:"Initial value set during task creation",hist_note_auto_recovered:"Auto-completed: sensor recovered ({value})",hist_note_reset:"Reset to {date}",hist_note_trigger_replaced:"Trigger entity replaced: {old} \u2192 {new}",hist_note_trigger_removed:"Sensor trigger removed (entity was: {entity}). Schedule converted to {schedule}.",hist_note_compound_removed:"Entity {entity} removed from compound trigger; {count} conditions remain.",recent_activities:"Recent Activities",search_notes:"Search notes",avg_cost:"Avg Cost",current:"Current",shorter:"Shorter",longer:"Longer",normal:"Normal",disabled:"Disabled",compound_logic:"Compound logic",compound:"Compound (multiple conditions)",compound_logic_and:"AND \u2014 all conditions must trigger",compound_logic_or:"OR \u2014 any condition triggers",compound_help:"Combine several sensor conditions into one trigger.",compound_no_conditions:"No conditions yet \u2014 add at least one.",compound_add_condition:"Add condition",compound_condition:"Condition",compound_remove_condition:"Remove condition",card_title:"Title",card_show_header:"Show header with statistics",card_show_actions:"Show action buttons",card_action_style:"Complete button style",card_compact:"Compact mode",card_max_items:"Max items (0 = all)",card_filter_status:"Filter by status",card_filter_status_help:"Empty = show all statuses.",card_filter_objects:"Filter by objects",card_filter_objects_help:"Empty = show all objects.",card_filter_areas:"Filter by areas",card_filter_areas_help:"Empty = show all areas.",card_filter_priority_help:"Empty = show all priorities. Tasks without an explicit priority count as Normal.",card_filter_entities:"Filter by entities (entity_ids)",card_filter_entities_help:"Pick sensor / binary_sensor entities from this integration. Empty = all.",card_loading_objects:"Loading objects\u2026",card_load_error:"Could not load objects \u2014 check the WebSocket connection.",card_no_tasks_title:"No maintenance tasks yet",card_no_tasks_cta:"\u2192 Create one in the Maintenance panel",no_objects:"No objects yet.",action_error:"Action failed. Please try again.",area_id_optional:"Area (optional)",installation_date_optional:"Installation date (optional)",warranty_expiry_optional:"Warranty expiry (optional)",warranty:"Warranty",warranty_valid_until:"valid until {date}",warranty_expires_in:"expires in {days} days",warranty_expired:"expired",cal_past_windows:"Past windows",cal_forward_windows:"Forward windows",history_edit_title:"Edit history entry",history_delete_entry:"Delete entry",history_delete_confirm_entry:"Delete this history entry? The task's last-performed date falls back to the previous completion; photos stay with the object.",history_delete_returns_parts:"The parts it used go back to stock: {parts}.",history_edit_timestamp:"Timestamp",manufacturer:"Manufacturer",model:"Model",area:"Area",actions:"Actions",view_mode_label:"View",view_cards:"Card view",view_table:"Table view",objects_table_columns_label:"Objects table columns",objects_table_columns_hint:"Choose which columns appear in the objects table view.",custom_icon_optional:"Icon (optional, e.g. mdi:wrench)",notify_icon:"Notification icon",notify_icon_hint:"Shown by the Companion app on Android. Empty = the icon of this task's maintenance type ({default}).",task_enabled:"Task enabled",skip_reason_prompt:"Skip this task?",reason_optional:"Reason (optional)",reset_date_prompt:"Mark task as performed?",reset_date_optional:"Last performed date (optional, defaults to today)",notes_label:"Notes",documentation_label:"Documentation",no_nfc_tag:"\u2014 No tag \u2014",dashboard:"Dashboard",tab_today:"Today",palette_placeholder:"Search objects, tasks, spare parts, documents, notes\u2026",palette_no_results:"No matches",palette_hint:"\u2191\u2193 to navigate \xB7 Enter to open \xB7 Esc to close \xB7 / opens the search anywhere",search_open:"Search",search_group_parts:"Spare parts",search_group_content:"In documents",search_group_history:"History notes",search_page:"Page {page}",search_empty_hint:"Type to search objects, tasks, spare parts, documents and notes",search_searching:"Searching documents and notes\u2026",search_index_status:"Full-text search: {indexed} of {total} files indexed \xB7 {no_text} without text layer \xB7 {pending} pending",today_all_caught_up:"All caught up! Nothing due this week.",today_overdue:"Overdue",today_due_today:"Due today",today_this_week:"This week",settings:"Settings",settings_features:"Advanced Features",settings_features_desc:"Enable or disable advanced features. Disabling hides them from the UI but does not delete data.",feat_adaptive:"Adaptive Scheduling",feat_adaptive_desc:"Learn optimal intervals from maintenance history",feat_seasonal:"Seasonal Adjustments",feat_seasonal_desc:"Adjust intervals based on seasonal patterns",feat_environmental:"Environmental Correlation",feat_environmental_desc:"Correlate intervals with temperature/humidity",feat_budget:"Budget Tracking",feat_budget_desc:"Track monthly and yearly maintenance spending",feat_groups:"Task Groups",feat_groups_desc:"Organize tasks into logical groups",feat_checklists:"Checklists",feat_checklists_desc:"Multi-step procedures for task completion",settings_general:"General",settings_default_warning:"Default warning days",settings_consumable_threshold:"Consumable low threshold (%)",settings_battery_low_percent:"Battery low threshold (%)",settings_battery_recovered_percent:"Battery counts as replaced above (%)",settings_battery_recovered_percent_hint:"A low battery stays counted as low until its level rises above this value or a replacement is recorded \u2014 so a level hovering around the low threshold cannot complete the fleet task again and again.",settings_battery_auto_record:"Record a replacement automatically when a low battery recovers",settings_battery_auto_record_hint:"When a battery that was low rises above the recovery threshold, the replacement date is recorded in Battery Notes and the spare cells are taken from stock \u2014 no tap needed.",settings_battery_lifetimes:"Typical battery lifetimes",settings_battery_lifetimes_hint:'Only used for batteries without a percentage: a Battery Notes note that has just a type and a last-replaced date, or a sensor that only reports "low". Their due date is last replaced + this lifetime. Batteries that report a level get their forecast from the measured discharge instead. Once the fleet has seen three replacements of a type, the median interval takes over from the built-in value \u2014 your own value always wins.',settings_battery_lifetime_months:"months",settings_battery_lifetime_reset:"Use default",settings_battery_lifetime_in_fleet:"in your fleet",settings_battery_lifetime_learned_models:"Learned per model: {list}",settings_thresholds_hint:"Defaults for new Suggested setups (percent-remaining consumables) and for fleet batteries without their own Battery Notes threshold. Existing tasks keep their value.",settings_part_search_url:"Shopping search link",settings_part_search_url_hint:"URL with {q} in place of the search terms, used for parts without a product link. Leave empty for the automatic store (by country, then by language).",settings_value_out_of_range:"Value must be between {min} and {max}",bn_summary:"{name}: {pct} % for {n} batteries",bn_floor_decides:"Your {floor} % floor decides for all of them; the higher of the two thresholds counts per battery.",bn_above_floor:"That is above your {floor} % floor, so {name} decides for all noted batteries.",bn_overrides:"{n} devices with their own threshold:",bn_more:"+ {n} more",settings_row_actions:"Task row actions",settings_ref_numbers_in_lists:"Reference numbers in lists",settings_ref_numbers_in_lists_hint:"Show the #8 / #8.3 chips in front of object and task names in the Today list, the task table, the object cards and the objects table.",settings_compact_refs:"Compact reference numbers",settings_compact_refs_hint:"Renumbers all objects, tasks and completions in order (1, 2, 3 \u2026) and closes the gaps left by deletions. Numbers already printed on service booklets, photos or notes will no longer match.",settings_compact_refs_confirm:"Renumber every object, task and completion sequentially in creation order? Numbers already written on printed service booklets, photos or notes will no longer match. This cannot be undone.",settings_compact_refs_done:"Renumbered {objects} objects, {tasks} tasks and {completions} completions.",row_actions_buttons_compact:"Buttons (icons only on phones)",row_actions_buttons:"Buttons with text",row_actions_icons:"Icons (classic)",row_actions_follow:"Follow the household setting",settings_panel_enabled:"Sidebar panel",settings_panel_title:"Sidebar panel title",settings_notifications:"Notifications",settings_notify_service:"Notification service",settings_shopping_list:"Shopping list (buy tasks)",settings_shopping_list_help:"Low-part buy reminders appear in this to-do list; checking one off restocks the part.",shopping_list_none:"Off \u2014 no shopping list",settings_install_assist_sentences:"Install Assist sentences",settings_install_assist_sentences_hint:"Copies the voice sentences into your configuration so the classic Assist agent recognises them. A file you edited yourself is never overwritten.",test_notification:"Test notification",send_test:"Send test",testing:"Sending\u2026",test_notification_success:"Test notification sent",test_notification_failed:"Test notification failed",notify_per_person:"Per-person delivery",member_avatars:"Member avatars",member_avatars_hint:"Shown next to assigned tasks \u2014 initials in the member's colour. Defaults come from the name; set your own initials or pick a colour to tell members apart.",member_initials:"Initials",member_color:"Colour",member_avatar_reset:"Reset",notify_no_own_device:"No own device \u2014 uses the household service",settings_notify_due_soon:"Notify when due soon",settings_notify_overdue:"Notify when overdue",settings_notify_triggered:"Notify when triggered",settings_interval_hours:"Repeat interval (hours, 0 = once)",settings_quiet_hours:"Quiet hours",settings_quiet_start:"Start",settings_quiet_end:"End",settings_max_per_day:"Max notifications per day (0 = unlimited)",settings_bundling:"Bundle notifications",settings_bundle_threshold:"Bundle threshold",settings_reminder_leads:"Extra reminders (days before due)",settings_reminder_leads_hint:"Comma-separated lead times, e.g. 14, 3, 0 \u2014 one extra reminder fires on each matching day. Empty = off.",settings_actions:"Mobile Action Buttons",settings_action_complete:"Show 'Complete' button",settings_action_skip:"Show 'Skip' button",settings_action_snooze:"Show 'Snooze' button",settings_weekly_digest:"Weekly digest",settings_weekly_digest_hint:"A single summary notification on Monday morning when tasks are due.",settings_warranty_reminder:"Warranty expiry reminder",settings_warranty_reminder_days:"Days before expiry",settings_warranty_reminder_hint:"Notify once when an object's warranty is this many days from expiring.",settings_snooze_hours:"Snooze duration (hours)",settings_snooze_hours_hint:"How long Snooze mutes a task's reminders \u2014 from the task menu, a card, voice or the phone's Snooze button. The due date stays as it is.",settings_budget:"Budget",settings_currency:"Currency",settings_currency_decimals:"Decimal places for amounts",settings_currency_decimals_hint:"How many decimals every amount shows: KPIs, budgets, costs in lists and reports, budget alerts. 0 = whole numbers.",settings_parts_cost_mode:"Spare parts count as spending",settings_parts_cost_purchase:"When bought",settings_parts_cost_use:"When used",settings_parts_cost_mode_hint:"When bought: a buy reminder's cost counts, and the parts a job uses are shown as information. When used: every completion books the value of the parts it used, and a purchase sets the part's price instead of counting. Applies to completions from now on \u2014 history keeps how it was booked.",settings_budget_monthly:"Monthly budget",settings_budget_yearly:"Yearly budget",settings_budget_alerts:"Budget alerts",settings_budget_threshold:"Alert threshold (%)",settings_import_export:"Import / Export",settings_export_json:"Export JSON",settings_export_yaml:"Export YAML",settings_export_csv:"Export CSV",settings_export_settings:"Export settings (JSON)",settings_import_placeholder:"Paste JSON or CSV content here\u2026",settings_import_btn:"Import",settings_import_success:"{count} objects imported successfully.",settings_import_unmatched_users:"Not found on this instance: {names}. Their task assignments were removed \u2014 add people with the same names in Home Assistant and import again to keep them.",settings_export_success:"Export downloaded.",settings_saved:"Setting saved.",settings_include_history:"Include history",settings_export_selection:"Limit to selected objects (optional)",settings_docs_archive:"Documents archive (with files)",settings_docs_archive_hint:"The JSON and YAML exports list your documents but not their files; CSV leaves documents out. This ZIP holds the uploaded files \u2014 restore it after importing the JSON and nothing is missing.",settings_docs_export_btn:"Download documents ZIP",settings_docs_import_btn:"Restore documents ZIP",settings_docs_import_success:"Restored: {blobs} files, {docs} documents",settings_docs_import_missing:"{n} skipped \u2014 their files were not in the ZIP",sort_alphabetical:"Alphabetical",sort_due_soonest:"Due soonest",sort_task_count:"Task count",sort_area:"Area",sort_assigned_user:"Assigned user",sort_group:"Group",groupby_none:"No grouping",groupby_area:"By area",groupby_group:"By group",groupby_user:"By user",groupby_object:"By object",filter_label:"Filter",user_label:"User",photo_label:"Photo",sort_label:"Sort",group_by_label:"Group by",state_value_help:'Use the HA state value (usually lowercase, e.g. "on"/"off"). Case is normalised on save.',target_changes_help:"Number of matching transitions before the trigger fires (default: 1).",state_latch_help:"With 1 transition the trigger is a latch: it recovers when the entity leaves the To-state \u2014 or, with only a From-state set, when it returns to that state.",for_minutes_state_help:"0 counts every change immediately. Set minutes and the new state must hold that long first \u2014 brief flickers then neither trigger nor count.",qr_print_title:"Print QR codes",qr_print_desc:"Generate a printable page of QR codes to cut out and stick on your equipment.",qr_print_load:"Load objects",qr_print_filter:"Filter",qr_print_objects:"Objects",qr_print_actions:"Actions",qr_print_url_mode:"Link type",qr_print_estimate:"Estimated QR codes",qr_print_over_limit:"cap is 200, narrow the filter",qr_print_generate:"Generate QR codes",qr_print_generating:"Generating\u2026",qr_print_ready:"QR codes ready",qr_print_print_button:"Print",qr_print_empty:"Nothing to generate",qr_action_skip:"Skip",vacation_title:"Vacation mode",vacation_active:"active",vacation_ended:"ended",vacation_desc:"Plan a vacation: notifications are paused during the period plus a buffer of days. You can opt specific tasks back in.",vacation_enable:"Enable vacation mode",vacation_start:"Start",vacation_end:"End",vacation_buffer:"Buffer (days)",vacation_exempt_title:"Notify anyway during vacation",vacation_exempt_desc:"Pick tasks that should still notify during vacation (e.g. critical pool chemistry).",vacation_load_tasks:"Load tasks",vacation_preview_btn:"Show preview",vacation_preview_affected:"tasks affected",vacation_event_due_soon:"becomes due soon",vacation_event_overdue:"becomes overdue",vacation_event_triggered_est:"sensor trigger possible",vacation_sensor_based:"(sensor-based)",vacation_action_notify:"Notify anyway",vacation_action_unsilence:"Silence again",vacation_marked_complete:"Marked complete",vacation_marked_skip:"Skipped",vacation_end_now:"End vacation now",add:"Add",show_stats:"Show stats + graphs",hide_stats:"Hide stats",adaptive_no_data:"Not enough completion history yet for adaptive analysis. Complete this task a few more times to unlock interval recommendations and reliability charts.",suggestion_applied:"Suggested interval applied",vacation_mode:"Vacation mode",vacation_status_active:"Active now",vacation_status_scheduled:"Scheduled",vacation_status_inactive:"Inactive",vacation_end_now_confirm:"End vacation immediately?",vacation_exempt_count:"exempt",vacation_advanced:"Advanced\u2026",vacation_open_panel:"Open in panel",enable:"Enable",saved:"Saved",budget_monthly_set:"Set monthly",budget_yearly_set:"Set yearly",budget_advanced:"Currency, alerts\u2026",budget_open_panel:"Open in panel",groups_empty:"No groups yet.",group_new_placeholder:"Add group\u2026",groups_manage_tasks:"Manage task assignments\u2026",groups_open_panel:"Open in panel",unassigned:"Unassigned",no_area:"No area",has_overdue:"Has overdue tasks",object:"Object",settings_panel_access:"Panel access",settings_panel_access_desc:"Admins always have full access. To delegate create, edit and delete to specific non-admins, switch this on and pick them below \u2014 everyone else only gets Complete, Skip, Reset, Postpone and Snooze.",settings_operator_write:"Allow selected users to create, edit & delete",settings_operator_write_desc:"Off: only admins can change content. On: the selected users below get full access too.",no_non_admin_users:"No non-admin users found. Add some in Settings \u2192 People.",owner_label:"Owner",feat_completion_actions:"Completion actions",feat_completion_actions_desc:"Per-task HA action on complete + quick-complete QR with pre-set values.",on_complete_action_title:"On complete: trigger HA action (optional)",on_complete_action_desc:"Calls an HA service when the task is completed \u2014 e.g. reset a counter on the device.",on_complete_action_target:"Target entity",on_complete_action_target_hint:"Note: the entity domain must match the service \u2014 e.g. 'button.press' only works on button.*, 'counter.increment' only on counter.*, 'input_button.press' only on input_button.* etc. On a mismatch the action will silently fail (HA logs 'Referenced entities ... missing or not currently available').",on_complete_action_target_more:"This action targets more than this field shows: {targets}. That is kept as it is \u2014 choosing another entity here replaces the whole target.",on_complete_action_skip_auto:"Not when the task completes itself (its sensor recovered)",on_complete_action_data:"Data (JSON, optional)",on_complete_action_test:"Validate configuration",on_complete_action_test_success:"\u2713 Configuration valid (action will fire only on task completion)",on_complete_action_test_failed:"Failed",action_test_bad_format:"Invalid service format (expected 'domain.service')",action_test_unknown_service:'Service "{service}" is not registered in Home Assistant. Check the spelling and that the integration providing it is loaded.',action_test_domain_mismatch:`Service "{service}" only works on {domain}.* entities; entity "{entity}" is in {entity_domain}.* \u2014 pick a service that matches the entity's domain (e.g. {suggestion})`,action_test_entity_missing:'Target entity "{entity}" was not found in Home Assistant \u2014 it may have been renamed or its integration removed.',quick_complete_defaults_title:"Quick-complete defaults (for QR scans, optional)",quick_complete_defaults_desc:"Pre-set values for quick-complete QR scans. Without these, the QR opens the complete dialog.",quick_complete_defaults_notes:"Notes",quick_complete_defaults_cost:"Cost",quick_complete_defaults_duration:"Duration (minutes)",quick_complete_defaults_feedback_none:"No feedback",quick_complete_defaults_feedback_needed:"Was needed",quick_complete_defaults_feedback_not_needed:"Not needed",quick_complete_success:"Quickly marked complete",show_all_objects:"Show all objects",show_all_tasks:"Clear filter \u2014 show all tasks",filter_to_overdue:"Filter task list to overdue only",filter_to_due_soon:"Filter task list to due-soon only",filter_to_triggered:"Filter task list to triggered only",open_task:"Open task",show_details:"Show history + stats",hide_details:"Hide details",history_empty:"No history yet.",history_edit_button:"Edit entry",total_cost:"Total cost",times_performed:"Performed",older_entries:"older",open_in_panel:"Open in Maintenance panel",skip_reason:"Skip reason (optional)",reset_to_date:"Reset last_performed to",delete_task_confirm:"Delete this task and its history?",delete_object_confirm:"Delete this object and all its tasks?",loading:"Loading\u2026",archive:"Archive",undo:"Undo",task_completed_named:"Completed: {task}",undo_done:"Completion undone",undo_done_action_ran:"Completion undone. Its completion action had already run and cannot be taken back.",undo_nothing:"Nothing to undo. Only your own last completion can be taken back, within 10 minutes.",undo_changed:"Can't undo. The task has changed since.",task_archived:"Task archived",object_archived:"Object archived",unarchive:"Unarchive",archived:"Archived",show_archived:"Show archived",hide_archived:"Hide archived",section_collapse:"Collapse section",section_expand:"Expand section",confirm_archive_object:"Archive this object and its tasks? They keep their history and can be unarchived later.",settings_archive:"Archive & Retention",settings_archive_desc:"Retire completed one-off tasks without deleting them. Archived items are hidden and inert but keep their history and cost.",settings_archive_oneoff_days:"Auto-archive completed one-off tasks after (days, 0 = off)",settings_delete_archived_oneoff_days:"Auto-delete archived one-off tasks after (days, 0 = never)",archive_object:"Archive object",unarchive_object:"Unarchive object",documents:"Documents",documents_empty:"No documents yet.",doc_upload:"Upload file",doc_uploading:"Uploading\u2026",doc_add_link:"Add link",doc_link_url:"URL (https://\u2026)",doc_link_title:"Title (optional)",doc_open:"Open",doc_delete_confirm:'Delete "{name}"?',doc_too_large:"File is too large (max 25 MB).",doc_upload_failed:"Upload failed.",docs_archive_too_large:"The archive is too large (max {max}).",docs_archive_no_manifest:"This ZIP has no manifest.json, so the restore cannot tell which document a file belongs to. Keep manifest.json next to the folders when zipping again.",completion_photos_optional:"Completion photos (optional)",completion_photos:"Completion photos",choose_photos:"Choose photos",choose_photo:"Choose photo",photos_android_hint:"The Android app hands over one photo per pick \u2014 each pick is added.",photos_limit:"Up to {max} photos per completion",history_edit_photos_hint:"Removing a photo here keeps the file in the object's documents.",uploading:"Uploading\u2026",remove:"Remove",doc_deduped:"Already stored elsewhere \u2014 shared, no extra space used.",doc_dup_in_object:"This file is already attached to this object.",doc_link_invalid:"Only http/https links are allowed.",doc_cat_manual:"Manual",doc_cat_warranty:"Warranty",doc_cat_invoice:"Invoice",doc_cat_spare_parts:"Spare parts",doc_cat_photo:"Photo",doc_cat_other:"Other",doc_link_badge:"Link",doc_storage_title:"Document storage",doc_storage_saved:"Saved via deduplication",doc_storage_refresh:"Refresh",doc_download:"Download",doc_close:"Close",doc_camera:"Take photo",camera_capture_shoot:"Capture",camera_switch_lens:"Switch camera",camera_switching:"Switching camera\u2026",camera_not_answered:"This camera did not answer. Tap the switch again to try the next one, or use the file picker.",camera_diagnostics:"Details for a bug report",camera_copy:"Copy",camera_copied:"Copied",doc_drop_hint:"Drop files here",doc_task_none:"No documents linked to this task.",doc_link_existing:"Link a document\u2026",doc_attach:"Link",doc_unlink:"Unlink",doc_page:"Page",chart_range_7d:"7d",chart_range_30d:"30d",chart_range_90d:"90d",chart_range_1y:"1y",chart_since_service:"since last service",chart_no_stats:"No long-term statistics for this entity \u2014 showing maintenance-event values only",auto_complete_on_recovery:"Auto-complete when the sensor recovers",auto_complete_on_recovery_help:"Records a completion (sets last performed) when the trigger clears itself \u2014 e.g. salt refilled, filter replaced.",doc_search:"Search documents\u2026",doc_search_none:"No matching documents",doc_description:"Description (optional)",doc_sort:"Sort documents",doc_sort_newest:"Newest first",doc_sort_oldest:"Oldest first",doc_sort_title:"By title (1, 2, 3 \u2026)",doc_sort_category:"By category",link_device_optional:"Link to existing device (optional)",parent_object_optional:"Parent object (optional)",parent_none:"(No parent)",paused:"Paused",pause_object:"Pause",resume_object:"Resume",pause_task:"Pause",resume_task:"Resume",pause_task_prompt:"Freeze this task's schedule \u2014 it does not become due and does not notify until you resume it, and resuming starts a fresh cycle from that day. The object's other tasks keep running. Optionally set a date to resume by itself.",task_paused:"Task paused",task_resumed:"Task resumed \u2014 its schedule restarted",pause_until_prompt:"Freeze this object's schedules \u2014 nothing becomes due and nothing notifies until it is resumed. Optionally set an auto-resume date.",pause_until_label:"Resume on (optional)",object_paused:"Object paused",object_resumed:"Object resumed \u2014 schedules restarted",object_paused_badge:"Paused",paused_until_label:"until",replace_object:"Replace\u2026",replace_object_prompt:"Retire this object and create a successor. History and costs stay archived on the old one; tasks and documents carry over to the new one, counters start fresh.",replace_name_label:"Successor name",replace_device_heading:"Device in Home Assistant",replace_device_keep:"Same device as before ({device})",replace_device_keep_hint:"Also the choice when the new unit is not in Home Assistant yet: once it is, pick it as the object's device in its settings \u2014 the sensor triggers move along then.",replace_device_other:"The new unit is another device",replace_device_pick:"Device of the new unit",replace_device_other_hint:"Sensor triggers, completion actions and the counter reset move to the matching entities of that device.",replace_device_none:"No device",object_replaced:"Object replaced \u2014 successor created",device_swap_moved:"{count} sensor links moved to the new device.",device_swap_moved_one:"One sensor link moved to the new device.",device_swap_unmatched:"{count} could not be matched \u2014 check those tasks' sensor triggers.",device_swap_unmatched_one:"One could not be matched \u2014 check that task's sensor trigger.",reading_unit_label:"Reading unit (e.g. kWh, m\xB3)",reading_unit_help:"Shown next to the recorded value when completing this task.",reading_value_label:"Reading value",reading_label:"Reading",readings_section:"Readings",readings_hint:"Several named values per completion \u2014 one row per meter. Leave empty to record a single value.",reading_name_label:"Reading name",reading_unit_short:"Unit",reading_add:"Add reading",reading_duplicate_name:"Name already used",reading_last:"last: {value}",reading_below_last:"Lower than the last reading ({value})",settings_templates_label:"Template gallery",settings_templates_hint:`Untick templates you'll never need \u2014 they disappear from the "From template" pickers (panel and config flow). Nothing else changes; you can re-enable them any time.`,home_profile_title:"Home profile",home_profile_hint:"Recommends templates and sets seasonal windows for your climate and hemisphere. Everything is worked out locally from your floors, areas and home location.",home_type_label:"Home type",home_type_auto:"Automatic ({detected})",home_region_label:"State, province or region",home_region_none:"not found",home_region_hint:"Some rules differ within a country \u2014 a yearly vehicle inspection in one state, none in the next. Found from your home location.",home_dwelling_house:"House",home_dwelling_apartment:"Apartment",home_dwelling_unknown:"not recognised",home_detected_from:"Detected from: {reasons}",home_reason_floors:"several floors",home_reason_basement:"a basement",home_reason_garden:"a garden",home_reason_shed:"a shed",home_reason_driveway:"a driveway",home_reason_garage:"a garage",home_reason_attic:"an attic",home_reason_lawn_mower:"a lawn mower",home_reason_gate:"a gate",home_reason_balcony:"a balcony",home_reason_small_home:"few rooms on one floor",home_reason_ups:"a UPS",home_climate_label:"Climate",home_climate_value:"K\xF6ppen {koppen} \xB7 coldest month {cold} \xB0C \xB7 warmest month {warm} \xB0C",home_climate_unknown:"No home location set in Home Assistant",home_hemisphere_south:"Southern hemisphere \u2014 seasonal windows are mirrored",home_trait_freeze:"Frost in winter",home_trait_snow:"Snowy winters",home_trait_severe_winter:"Severe winters",home_trait_damp:"Damp climate",home_trait_mediterranean:"Mediterranean climate",home_trait_earthquake:"Earthquake region",home_trait_hot_summer:"Hot summers",home_trait_hot_humid:"Hot and humid",home_trait_hot_dry:"Hot and dry",home_trait_termites:"Termite region",home_trait_wildfire:"Wildfire risk",home_trait_cyclone:"Hurricane / typhoon region",home_trait_tropical:"Tropical climate",home_trait_radon:"Radon test recommended",home_reason_starter:"Basics for your home",home_reason_country:"Common in {country}",home_reason_feature:"Found in your home: {feature}",templates_recommended_title:"Recommended for your home",templates_recommended_hint:"Based on your home profile \u2014 adjust it in Settings.",templates_legal_hint:"Notes on legal duties and intervals are guidance, not legal advice. Rules vary by region and change over time \u2014 local regulations and the manufacturer's instructions take precedence.",templates_not_typical:"Not typical for your home type",templates_set_up:"Already set up",worksheet:"Work sheet",worksheet_scan_view:"Scan to open the task",worksheet_scan_complete:"Scan to complete",worksheet_manual_excerpt:"Manual excerpt",worksheet_pages:"pages",worksheet_printed:"Printed",worksheet_never:"Never",card_all_caught_up:"All caught up \u2014 nothing needs attention",postpone:"Postpone",postpone_date_prompt:"Postpone this occurrence to which date?",postpone_date_label:"New due date",postponed:"Postponed",postponed_to:"Postponed to",season_window_label:"Seasonal window (months)",season_window_hint:"Only due in the selected months; off-season dates roll to the next active month. None = all year.",series_end_label:"Ends",series_end_never:"Never (repeats indefinitely)",series_end_after_count:"After a number of times",series_end_until:"On a date",series_end_count_label:"Number of times",series_end_until_label:"End date",parts_section:"Parts & consumables",parts_inventory_value:"Inventory value",part_add:"Add part",part_name:"Name",part_vendor:"Manufacturer",part_storage_location:"Storage location",part_product_url:"Product URL",part_unit:"Unit",part_cost:"Unit price",part_stock:"Stock",part_reorder_threshold:"Reorder at",part_restock_quantity:"Restock quantity",part_package_size:"Package size (units)",part_restock_packages:"Restock amount (packages)",part_package_hint:"Bought in packages, used in the unit: stock, the amount a task uses and the reorder threshold count units; the restock amount and the price are per package.",part_auto_buy:"Auto-create buy task when low",part_restock:"Adjust stock",parts_used_by:"Used by",restock_quantity_label:"Quantity bought",consumes_parts_label:"Consumes parts",task_parts_fleet_hint:"Battery quantities come from Battery Notes per device \u2014 nothing to link here.",shared_parts_other_objects:"Parts from other objects",shared_parts_help:"Several objects can share one stock. Completing this task takes from the owning object.",shared_part_unknown:"Unknown part",parts_load_failed:"Couldn't load this object's parts \u2014 the consumes-parts options are unavailable right now.",adopt_problem_button:"Adopt problem sensors",adopt_problem_title:"Adopt problem sensors",adopt_problem_hint:"Turn HA problem sensors (printer errors, filter warnings, low battery) into maintenance tasks that trigger while the problem is active and clear themselves when it resolves.",adopt_problem_none:"No problem sensors found that aren't already tracked.",adopt_problem_active:"active",adopt_problem_ok:"ok",adopt_problem_new_object:"(new)",adopt_object_hint:"Give several sensors the same object name and they become one object; type an existing object's name to add them there.",adopt_summary_title:"What adopting changes",adopt_summary_existing:'"{name}": tasks {before} \u2192 {after}',adopt_problem_adopt:"Adopt selected",adopt_problem_done:"Adopted {tasks} problem sensor(s)",adopt_problem_done_one:"Adopted 1 problem sensor",views_label:"Views",views_none:"\u2014 No view \u2014",views_manage:"Save / manage views",views_dialog_title:"Saved views",views_dialog_hint:"Save the current filters as a named view everyone can reuse.",views_name_placeholder:"View name",views_save_current:"Save current filters",views_none_yet:"No saved views yet.",close:"Close",trigger_hint_now:"The sensor reads {value} right now.",trigger_hint_above:"The task triggers once it rises above {target}.",trigger_hint_below:"It triggers once it falls below {target}.",trigger_hint_overlap:"These limits overlap: every reading triggers the task and it can never recover. Leave one of them empty.",trigger_hint_counter_delta:"Counts from the current reading ({value}): due at {due} (+{target}), and the count restarts after each completion.",trigger_hint_counter_delta_edit:"Counts usage since the last completion: due after +{target}; the count restarts after each completion.",trigger_hint_counter_abs:"The task becomes due once the sensor reaches {target}.",trigger_hint_runtime:"The task becomes due after {hours} h of accumulated on-time; the counter restarts after each completion.",trigger_hint_due_date:"The task becomes due {days} days before the date the sensor reports.",trigger_hint_due_date_one:"The task becomes due one day before the date the sensor reports.",trigger_hint_due_date_same_day:"The task becomes due on the date the sensor reports.",trigger_hint_due_date_now:"Reported date: {date}.",trigger_hint_state_change:"The task becomes due after {count} state change(s).",trigger_hint_state_change_to:"The task becomes due after {count} change(s) to \u201C{state}\u201D.",trigger_hint_state_now:"Current state: {value}.",adopt_problem_part:"Uses part: {name}",label_filter:"Label",all_labels:"All labels",settings_notify_scope:"Notify only for view",settings_notify_scope_all:"All tasks",settings_notify_scope_hint:"Only tasks matching the selected saved view's label/user filters send reminders. Status, sorting and grouping of the view are ignored here.",settings_notify_completed:"Completion notifications",settings_notify_completed_hint:`Household news when a task is completed, with the reason and who did it. "Automatic only" announces just the completions nobody made on the spot: sensor recovery, shopping-list check-off, an automation's service call. Sent to the household service only; quiet hours and the daily cap apply.`,settings_title_style:"Notification title style",settings_title_style_hint:"What appears as the notification's TITLE. Default keeps the per-status text (e.g. 'Maintenance overdue!'). Object name / Task name help when phone notifications stack.",title_style_default:"Default (per-status title)",title_style_object_name:"Object name as title",title_style_task_name:"Task name as title",notify_completed_off:"Off",notify_completed_automatic:"Automatic completions only",notify_completed_all:"All completions",settings_notify_rule:"Your own notification rule",settings_notify_rule_hint:"Every notification also fires the event maintenance_supporter_notification (kind, status, object, task, reference numbers, priority, deep link, the payload). Route it with an automation \u2014 e.g. into Ticker, Telegram or Pushover.",settings_notify_event_only:"Only fire the event, send nothing myself",settings_notify_event_only_hint:"Your automation is the whole delivery. Rate limits, quiet hours and the daily cap still apply to when the event fires.",settings_notify_extra_data:"Extra notification data (template)",settings_notify_extra_data_hint:"JSON or YAML, Jinja allowed; merged into the notify call's data (your keys win). Variables: kind, status, priority, labels, notes, area_name, object_name, task_name, object_ref, task_ref, days_until_due, next_due, last_performed, responsible_user_id, sensor_entity_id, url, target, title, message. Test it with the Send test button.",card_saved_view:"Saved view",card_saved_view_none:"None",card_saved_view_help:"Applies the view's status, user, label and priority filters on top of the filters above. The view's sorting and grouping are panel display settings and are not applied on the card.",panel_card_tab:"Open on tab",panel_card_tab_default:"Remembered tab (as in the panel)",panel_card_view:"Open with saved view",panel_card_height:"Height",panel_card_height_help:"Empty = fill the screen below the card (panel view). Otherwise a CSS length such as 600px or 80vh for views with other cards.",panel_card_not_registered:"The Maintenance Supporter panel is not available \u2014 is the integration set up?",panel_card_load_failed:"The Maintenance Supporter panel could not be loaded \u2014 reload the page (after an update: clear the browser cache).",doc_part_none:"No documents linked to this part.",settings_templates_toggle_group:"Enable or disable all templates in this group",setups_button:"Suggested setups",setups_title:"Suggested setups (Beta)",setups_hint:"Devices of supported integrations whose consumable sensors can drive maintenance tasks. Adopting creates the object and wires each task to its sensor \u2014 it triggers when the consumable runs low and resolves itself after replacement.",setups_none:"No supported devices with unwired consumable sensors found.",setups_adopt:"Set up selected",setups_done:"{tasks} sensor-wired tasks created.",setups_done_one:"1 sensor-wired task created.",complete_parts_used:"Parts used this time",part_delete_confirm:"Delete part '{name}'? Its stock tracking, task links and any open buy reminder will be removed.",baseline_start_value:"Start reading (optional)",baseline_start_help:"Counting starts from this reading. Leave empty to count from the current value; enter the reading at the last service so usage since then already counts.",setups_baseline_hint:"reading at last service (optional)",baseline_start_help_edit:"Leave empty to keep the existing counting. Entering a value re-anchors the counting (e.g. the reading at the last service).",baseline_current_effective:"Currently effective start value: {value}",runtime_on_states:"Active states",runtime_on_states_help:"States that count as running \u2014 default: on. E.g. mowing, cleaning, printing. With an attribute selected, its values are matched instead.",runtime_max_session:"Max session runtime (seconds)",runtime_max_session_help:"A single run counts at most this many seconds \u2014 protects against a sensor stuck ON (lost connection, restart). Empty = no cap.",trend_approaching:"Heading toward the threshold",trend_easing:"Easing away from the threshold",split_select_hint:"Select a task to see its details here",setups_target_new:"Create new: {name}",setups_target_match:"{name} \u2014 matches: {reasons}",setups_reason_model:"model number",setups_reason_name:"name",setups_reason_area:"area",setups_reason_sibling:"same model on another device",setups_maybe_covered:'Probably there already as "{name}"',setups_already:"Already there: {names}",setups_reset_line:"Completing it also resets the counter in the integration (\u201C{button}\u201D)",setups_reset_enable:"\u2014 the button gets switched on for this",reset_offers_title:"Reset counters on completion",reset_offers_hint:"These tasks watch a counter the integration keeps itself. Connected, completing the task here also presses the integration's reset button \u2014 otherwise the counter keeps running and the task falls due again right away.",reset_offers_before:"Now: completing it leaves the counter in {integration} running",reset_offers_after:"Then: it also presses \u201C{button}\u201D",reset_offers_renamed:"Renamed since it was set up \u2014 check that this task is for this part",reset_offers_apply:"Connect resets",reset_offers_done:"{count} tasks now reset their counter on completion",reset_offers_done_one:"1 task now resets its counter on completion",setups_before_after:"Tasks on the object: {before} \u2192 {after}",setups_new_object_count:'New object "{name}" \xB7 tasks: {count}',schedule_preview_title:"Next dates",schedule_preview_ontime:"Assuming on-time completion.",schedule_preview_ends:"(series ends)",adopt_problem_responsible:"Responsible user for all adopted tasks (optional)",adopt_for_minutes_hint:"Only trigger once the problem has persisted this long \u2014 0 reacts to the first flicker.",adopt_problem_configure:"Configure",history_auto:"Automatic",battery_fleet_title:"Battery fleet",battery_fleet_none_low:"All batteries OK \u2014 nothing to replace.",battery_fleet_progress:"{n} to replace",battery_fleet_buy_now:"Buy now",battery_fleet_soon:"Needed soon",battery_fleet_soon_hint:"Predicted from the last replacement date \u2014 order ahead.",battery_fleet_mark_all:"Mark all replaced",battery_fleet_mark_one:"Mark this battery replaced",battery_fleet_offline:"offline",battery_fleet_no_sensor:"No sensor",battery_fleet_trigger_lost:"This task's sensor trigger was lost \u2014 it will not fire or auto-complete.",battery_fleet_repair:"Repair",battery_fleet_exclude:"Exclude from the fleet",battery_fleet_excluded:"Excluded",battery_fleet_include:"Track again",battery_fleet_all:"All tracked batteries",battery_fleet_all_hint:"Exclude a device here to drop it from the fleet before it ever reports low \u2014 a vacuum that recharges itself, or a phone that warns you on its own.",battery_fleet_add:"Add a battery",battery_fleet_add_hint:"Pick a battery sensor the automatic discovery missed \u2014 it joins the roster immediately.",battery_fleet_track_self:"Track self-charging batteries",battery_fleet_track_self_hint:"Phones, vacuums and other devices that recharge themselves appear as rechargeables \u2014 a low one asks for a charge, never for new cells.",battery_fleet_due_without_sensor:"Treat a passed forecast as due when a battery has no sensor",battery_fleet_due_without_sensor_hint:"Some devices report no battery level at all \u2014 Battery Notes only knows the type and the last replacement. Once the typical lifetime has passed, such a battery counts as low and the fleet task reminds you; marking it replaced resets the forecast.",battery_fleet_status_low:"Low",battery_fleet_status_soon:"Soon",battery_fleet_status_ok:"Healthy",battery_fleet_status_due:"Due",battery_fleet_predicted_on:"Expected around {date}",battery_fleet_predicted_typical:"Expected around {date} \u2014 {months} months typical for {type} ({source})",lifetime_source_default:"built-in default",lifetime_source_table:"built-in table",lifetime_source_learned:"learned from {n} replacements",lifetime_source_override:"your setting",lifetime_source_learned_device:"learned from this device's {n} replacements",lifetime_source_learned_model:"learned from {n} replacements on devices of this model",battery_fleet_predicted_trend:"Predicted from this battery's discharge trend: around {date} ({confidence})",battery_fleet_rechargeable:"Rechargeable: charge instead of replacing \u2014 never on the shopping list",battery_fleet_sort_name:"Sort by name",battery_fleet_sort_urgency:"Sort by urgency",battery_fleet_mark_recharged:"Mark as recharged",battery_fleet_sparkline_hint:"Battery level over the last 30 days \u2014 dotted: projected until the low threshold",battery_fleet_filter_type:"Show only this battery type",battery_fleet_record_replacement:"The level jumped around {date} \u2014 record this replacement in Battery Notes",battery_fleet_total:"{n} batteries tracked",battery_fleet_setup_button:"Battery fleet",battery_fleet_setup_done:"Battery fleet set up \u2014 one task tracks all your batteries.",update_banner:"A newer version of Maintenance Supporter is on the server \u2014 reload to update the panel.",update_reload:"Reload",row_actions_banner:"Complete and Skip in task rows are now buttons. Prefer the old icons?",row_actions_keep:"Keep buttons",row_actions_back:"Back to icons",battery_fleet_forecast_overdue:"Predicted date passed \u2014 the battery still reports healthy. If you swapped it, record the replacement; otherwise the forecast was off.",cost_from_parts:"Use \u2248 {amount} from parts",cost_parts_booked:"Parts used \u2248 {amount} are booked automatically \u2014 enter only additional costs.",cost_parts_info:"Parts used \u2248 {amount} \u2014 counted when they were bought, not here.",cost_purchase_use_hint:"The price paid becomes the part's price \u2014 spare parts count when they are used.",history_parts_counted:"Parts: {amount}",history_parts_counted_hint:"Value of the parts used \u2014 counted as spending",history_parts_info:"Parts \u2248 {amount}",history_parts_info_hint:"Value of the parts used \u2014 information only; the money counted when they were bought",history_purchase_stock:"Bought for {amount} (counted when used)",dismiss:"Dismiss",gs_label:"Getting started \u2014 these hints retire as your setup grows",gs_setups_chip:"Suggested setups found {n} devices with pre-wired triggers",gs_setups_chip_one:"Suggested setups found 1 device with pre-wired triggers",gs_adopt_chip:"{n} problem sensors can become maintenance tasks",gs_adopt_chip_one:"1 problem sensor can become a maintenance task",gs_fleet_chip:"One click sets up the battery fleet",gs_reset_chip:"{n} tasks can reset their counter in the integration",gs_reset_chip_one:"1 task can reset its counter in the integration",cal_editor_window:"Default window",cal_editor_window_week:"Week (7 days)",cal_editor_window_fortnight:"Fortnight (14 days)",cal_editor_window_month:"Month (30 days, default)",cal_editor_window_year:"Year (365 days, empty days collapsed)",cal_editor_window_past_30:"Past 30 days (history)",cal_editor_window_past_90:"Past 90 days (history)",cal_editor_show_chips:"Show window chips inside the card",cal_editor_chips_hint:"Hide the chips when the card is embedded in a strategy view that already serves as the window selector.",cal_editor_show_user_filter:"Show user filter dropdown",cal_editor_default_user:"Default user filter",cal_editor_my_tasks:"My tasks (current user)",cal_editor_show_object_filter:"Show object filter dropdown",cal_editor_object_hint:'Pre-select one object via YAML: object_filter: "