refactor: rename watterButtonLearnAndCall.js to waterButtonLearnAndCall.js

This commit is contained in:
sebseb7
2026-01-17 00:31:13 -05:00
parent cecdcb8c25
commit 8d42256bb8

View File

@@ -71,6 +71,13 @@ function getState(mac) {
export default {
async run(ctx) {
// Auto-on for water button when it connects
if (ctx.trigger.mac === '08A6F773510C' && ctx.trigger.field === 'connected' && ctx.trigger.value === true) {
ctx.log('Water button connected - turning light on');
await setLight(ctx, ctx.trigger.mac, true, 20);
return;
}
if (ctx.trigger.field !== 'button') return;
const mac = ctx.trigger.mac;