291 files
This commit is contained in:
@@ -480,6 +480,13 @@ async def _async_setup_shared(hass: HomeAssistant) -> bool:
|
||||
"""
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
|
||||
# Which version this run imported: an update HACS installs later changes
|
||||
# the files (and HA's integration cache) but not the code in memory, and
|
||||
# the panel asks for a restart until they agree again.
|
||||
from .helpers.update_state import async_remember_running_version
|
||||
|
||||
await async_remember_running_version(hass)
|
||||
|
||||
# The Lovelace card / calendar card / strategy modules FIRST (#184): HA
|
||||
# builds the list of extra module scripts into index.html at the moment a
|
||||
# page is served, and the frontend does not load modules registered later
|
||||
@@ -974,6 +981,10 @@ async def _async_setup_shared(hass: HomeAssistant) -> bool:
|
||||
return
|
||||
|
||||
nm = hass.data.get(DOMAIN, {}).get(NOTIFICATION_MANAGER_KEY)
|
||||
# Whose phones carry the reminder: read BEFORE completing, which
|
||||
# hands a rotation on to the next person.
|
||||
task_cfg = (config_entry.data.get(CONF_TASKS) or {}).get(task_id) or {} if config_entry is not None else {}
|
||||
reminded_user_ids = task_user_ids(task_cfg)
|
||||
|
||||
try:
|
||||
if action_type == "complete":
|
||||
@@ -1017,9 +1028,7 @@ async def _async_setup_shared(hass: HomeAssistant) -> bool:
|
||||
|
||||
# Action succeeded — dismiss notification and clear NM rate-limit state
|
||||
if nm is not None:
|
||||
cfg_entry = hass.config_entries.async_get_entry(entry_id)
|
||||
task_cfg = ((cfg_entry.data.get(CONF_TASKS) or {}).get(task_id) or {}) if cfg_entry is not None else {}
|
||||
await nm.async_dismiss_task_notification(task_id, user_ids=task_user_ids(task_cfg))
|
||||
await nm.async_dismiss_task_notification(task_id, user_ids=reminded_user_ids)
|
||||
nm.clear_task_state(entry_id, task_id)
|
||||
|
||||
unsub_notification = hass.bus.async_listen("mobile_app_notification_action", _handle_notification_action)
|
||||
|
||||
Reference in New Issue
Block a user