I'd like to be able to dynamically control how long a press happens for each push signal.
TL;DR Waiting a period of time between switching it on/off while in Switch mode is not the same as specifying a "Press-hold Time" in the app.
Press-hold Time can be configured in the official app, but via this integration (or even the official app) you can't control this duration for each press.
This behavior could be somewhat achieved with this integration by putting the Bot in Switch mode, sending a signal to turn the switch on, and then waiting a dynamic period of time before sending another signal to turn the switch off. There are two problems with this approach though.
- I believe this would still require use of the app to set the mode and it would be nice to work completely independently of the app.
- The Press-hold Time seems to work independently of whether the button is being pressed where it remains in a depressed state for the period of time specified in the app.
To elaborate on # 2, there seem to be 3 relevant states when in Switch mode:
- The button is in an up state (it's sticking out slightly from the front of the button)
- A press-hold state which it will stay in for the period of time that's specified for the Press-hold Time setting in the app. In this state the lever is depressed slightly below the bottom of the button.
- A hold state where the lever is down and perpendicular to it's default resting position inside the Bot.
Waiting a period of time does not keep the button in a press-hold state where it's depressed, but rather just perpendicular to the Bot. The time the Bot is in a press-hold state is only for the duration of time specified in the app.
So if I want the button to wait in a "held" state for a period of time, there's no way to do this dynamically.
I'm pretty sure this is possible to do client-side because I've done it using their official node-switchbot library. You can see in the example for moving the arm of the Bot where they call switchbot.wait(5000)
after device.down()
. When "down", it's in the fully depressed "press-hold" state.
Sorry if this was a bit long winded. I have a use case where a perpendicular lever is not adequate and I need it to go to the more obtuse angle where it's below the bottom plain of the Bot.
What are your thoughts? Happy to elaborate more if needed :)