Skip to content

Commit

Permalink
smarthome button longPress
Browse files Browse the repository at this point in the history
  • Loading branch information
seydx committed Jun 22, 2021
1 parent 7edcbbc commit 5d12e66
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1745,8 +1745,8 @@
"smarthome[].brightness",
"smarthome[].color",
"smarthome[].battery",
"smarthome[].buttons",
"smarthome[].longPress"
"smarthome[].longPress",
"smarthome[].buttons"
]
}
]
Expand Down
2 changes: 1 addition & 1 deletion src/accessories/smarthome/smarthome-button.handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class Handler {
}
}

if (device.button.long) {
if (device.button.long && accessory.context.config.longPress) {
if (accessory.context.lastpressedLong) {
const oldTimestamp = accessory.context.lastpressedLong;
const newTimestamp = parseInt(device.button.long.lastpressedtimestamp) * 1000;
Expand Down

0 comments on commit 5d12e66

Please sign in to comment.