feat: add ON/OFF action config for Countdown and Away rules in Homebridge plugin

- Countdown: new 'Action when timer fires' dropdown (Turn ON / Turn OFF);
  scheduler uses rule.countdownAction instead of hardcoded 1/0
- Away Mode: scheduler now reads startAction/endAction from the rule
  (UI already exposed these fields); _stopAwayLoop respects endAction
  instead of always forcing OFF at window end

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
SRS IT
2026-03-28 22:15:01 -04:00
parent 2f9f68eca7
commit 4c09fd0b66
3 changed files with 33 additions and 16 deletions
@@ -398,6 +398,13 @@
<label>Countdown Duration (minutes)</label>
<input type="number" id="dwm-countdown-mins" min="1" max="1440" placeholder="60" />
</div>
<div class="form-group">
<label>Action when timer fires</label>
<select id="dwm-countdown-action">
<option value="1">Turn ON (then auto-OFF after duration)</option>
<option value="0">Turn OFF (then auto-ON after duration)</option>
</select>
</div>
</div>
<div id="dwm-alwayson-info" style="display:none;margin-bottom:12px;padding:10px;background:rgba(48,209,88,.1);border:1px solid rgba(48,209,88,.3);border-radius:6px;font-size:0.82rem;color:#4ade80">