Skip to content

Commit 5e6b042

Browse files
Treat missing window Core restart as disabled
1 parent f1bca34 commit 5e6b042

4 files changed

Lines changed: 16 additions & 19 deletions

File tree

maintenance_window/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
All notable changes to the Maintenance Window add-on are documented here.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
55

6+
## 0.8.9
7+
8+
- Make per-window `restart_core` optional again so existing saved
9+
configurations continue to load after update.
10+
- Treat missing per-window `restart_core` as disabled instead of falling back to
11+
the global Core restart default.
12+
613
## 0.8.8
714

815
- Make per-window `restart_core` explicit so app-only windows such as temporary

maintenance_window/DOCS.md

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,9 @@ starts anything. Use this to validate your schedule safely before going live.
109109
When `true`, Home Assistant Core is stopped during the window and restarted
110110
afterward. Set to `false` if you only want to cycle apps.
111111

112-
Set `restart_core` on each window that should stop Core. Leave it off for
113-
app-only windows, such as temporary SSH access.
114-
115-
For compatibility with older configurations, the global value can still be used
116-
as a fallback for windows that do not define their own app actions. For safety,
117-
if a window defines per-window `stop_addons` or `start_addons` but omits
118-
`restart_core`, Core is left running.
112+
Set `restart_core` on each window that should stop Core. Leave it off or omit it
113+
for app-only windows, such as temporary SSH access. For safe upgrades from older
114+
configurations, missing per-window `restart_core` is treated as disabled.
119115

120116
For safety, this option is not enough on its own. Core is only stopped when
121117
`restart_core` is `true`, `core_stop_confirmation` is set exactly to
@@ -276,16 +272,15 @@ A list of maintenance windows. Each entry has:
276272
| `name` | Friendly label used in logs. |
277273
| `start_time` | 24-hour `HH:MM` local time the window begins. |
278274
| `duration_minutes` | How long Core/apps stay stopped (1–1440). |
279-
| `restart_core` | Explicit per-window Core stop/restart setting. Leave off for app-only windows. |
275+
| `restart_core` | Optional per-window Core stop/restart setting. Leave off or omit for app-only windows. |
280276
| `stop_addons` | Optional per-window list of apps to stop. |
281277
| `start_addons` | Optional per-window list of apps to start temporarily. |
282278
| `days` | Optional days of week the window runs (`mon`–`sun`). Leave empty or omit it to run every day. |
283279

284280
If `days` is empty or omitted, the window runs every day.
285281

286282
If a window omits `stop_addons` or `start_addons`, the global setting with the
287-
same name is used. `restart_core` should be set explicitly per window; app-only
288-
windows should leave it off.
283+
same name is used. If a window omits `restart_core`, Core is left running.
289284

290285
Example with two different window actions:
291286

maintenance_window/config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Maintenance Window",
3-
"version": "0.8.8",
3+
"version": "0.8.9",
44
"slug": "maintenance_window",
55
"description": "Scheduled quiet mode: stop Home Assistant Core (and optionally selected apps) for a short maintenance window, then restart automatically.",
66
"url": "https://github.com/sergey-goncharenko/ha-maintenance-window-addon/tree/main/maintenance_window",
@@ -69,7 +69,7 @@
6969
"name": "str",
7070
"start_time": "match(^([01]?[0-9]|2[0-3]):[0-5][0-9]$)",
7171
"duration_minutes": "int(1,1440)",
72-
"restart_core": "bool",
72+
"restart_core": "bool?",
7373
"stop_addons": [
7474
"str?"
7575
],

maintenance_window/rootfs/usr/lib/maintenance-window/scheduler.sh

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,8 @@ window_restart_core_enabled() {
233233
return 1
234234
;;
235235
__missing__)
236-
if window_has_app_action_override "${window_index}"; then
237-
bashio::log.info "Window restart_core is not set but app actions are overridden; leaving Core running."
238-
return 1
239-
fi
240-
241-
bashio::config.true 'restart_core'
242-
return $?
236+
bashio::log.info "Window restart_core is not set; leaving Core running."
237+
return 1
243238
;;
244239
*)
245240
bashio::log.warning "Window restart_core has unexpected value '${value}'; leaving Core running."

0 commit comments

Comments
 (0)