I have developed a Watchapp with Pebble.js
that fetches a remote file, containing an integer, and emits that many "short" Vibe events.
The trouble is: Vibe events do not happen if one is currently in process. I have resorted to something like this to try to spread them out (where BUMP_COUNT_INT == number of Vibes to emit):
for (var i = 0; i < BUMP_COUNT_INT; i++) {
setTimeout(function(){
Vibe.vibrate('short');
}, 900*i);
However, even the 900ms( * Vibes) isn't consistent. There is sometimes more or less space between them, and they sometimes merge (causing fewer Vibes than expected).
It appears that the C SDK is capable of custom sequences.
I was hoping someone had come across a cleaner workaround, or a more stable way to pull this off using Pebble.js ... ?
Should I just accept that I'll have to spread the Vibes out even further, if I want to continue with Pebble.js?
What would you do?
Custom patterns are not available in Pebble.js but you could easily add a new 'type' of vibe in Pebble.js and implement it as a custom pattern in the C side of Pebble.js.
The steps would be:
Clone the Pebble.js project on GitHub and get a local copy. You will need to download and install the Pebble SDK to compile it locally on your computer (this will not work on CloudPebble).
Declare a new type of vibe command in
src/js/ui/simply-pebble.js
(the Pebble.js JavaScript library):Create a new type of Vibe in
src/simply/simply_msg.c
And then extend the Vibe command handler to support this new type of vibe in
src/simply/simply_msg.c
An even better solution would be to suggest a patch so that any custom pattern could be designed on the JavaScript side and sent to the watch.