feat: Introduce rule configuration from the status dashboard, allowing storedDuration editing for the water button rule and improving its timer handling.

This commit is contained in:
sebseb7
2026-01-20 04:07:49 -05:00
parent 75a4d1cbc0
commit b6a25a53fc
3 changed files with 103 additions and 7 deletions

View File

@@ -218,6 +218,17 @@ export async function getRulesStatus() {
return statuses;
}
/**
* Set config on a specific rule
*/
export function setRuleConfig(ruleName, key, value) {
const rule = rules.find(r => r._filename === ruleName);
if (rule && typeof rule.setConfig === 'function') {
return rule.setConfig(key, value);
}
return false;
}
/**
* Watch rules directory for changes and auto-reload
*/