npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

pebble-connection-vibes

v1.1.0

Published

Easily vibe when connection to Pebble app is lost

Downloads

2

Readme

pebble-connection-vibes

pebble-connection-vibes wraps the ConnectionService and the Vibes API (and optionally Pebble Health on supported platforms) together. It takes a lot of boilerplate code to implement a service that triggers a vibe on loss of connection to the Pebble app. pebble-connection-vibes reduces that boilerplate to a few lines of code.

Note that pebble-connection-vibes listens soley to connection events for the Pebble App connection. Listening to a PebbleKit connection is pretty app specific and it's unlikely you'd want to vibe if the PebbleKit connection is lost.

Installation

pebble package pebble-connection-vibes

You must be using a new-style project; install the latest pebble tool and SDK and run pebble convert-project on your app if you aren't.

Usage

// This is not a complete example, but should demonstrate the basic usage

#include <pebble-connection-vibes/connection-vibes.h>

...

static void init(void) {
  connection_vibes_init();
  ...
}

static void deinit(void) {
  connection_vibes_deinit();
  ...
}

After calling connection_vibes_init() you may set additional options such as vibing on disconnect or on disconnect and reconnect (or no vibes at all), a custom vibe pattern, or using Pebble Health.

pebble-connection-vibes API

| Method | Description | |--------|---------| | void connection_vibes_init(void) | Initialize everything by subscribing to the ConnectionService | | void connection_vibes_deinit(void) | Deinitialize everything: unsubscribe from services, free memory, etc. | | void connection_vibes_set_state(ConnectionVibesState state) | Set the vibration state to the specified enum value | | void connection_vibes_set_pattern(VibePattern pattern) | Set a custom VibePattern. By default a double pulse is used | | void connection_vibes_enable_health(bool enable) | Register/unregister with Pebble Health |

pebble-connection-vibes enums

ConnectionVibesState

| Value | Description | |--------|---------| | ConnectionVibesStateNone | No vibes at all. Useful if want to make vibing user configurable | | ConnectionVibesStateDisconnect | Vibe only on disconnect | | ConnectionVibesStateDisconnectAndReconnect | Vibe on disconnect and reconnect |

Note on Pebble Health

On platforms that support Pebble Health, pebble-connection-vibes can subscribe to health events and detect when the user is asleep. Vibes will happen only if the user is awake. This avoids awkward vibes at 0200 that could awaken a user. To enable this, just call connection_vibes_enable_health(true) sometime after calling connection_vibes_init().

Pebble Health integration is turned off by default so apps and watchfaces that don't want to integrate with Pebble Health won't get the nag screen thrown up by the watch if the user doesn't have Pebble Health enabled.

Note on Quiet Time

Starting with Pebble SDK 4.3 the current state of the system quiet time is available. pebble-connection-vibes will respect this on every platform but aplite. On aplite quiet_time_is_active() is actually a #define that aways evaluates to false.