refactor: rename watterButtonLearnAndCall.js to waterButtonLearnAndCall.js
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user