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 🙏

© 2026 – Pkg Stats / Ryan Hefner

homebridge-mast

v0.1.2

Published

Homebridge plugin for Mast flag half-mast status.

Readme

homebridge-mast

Homebridge plugin for the Mast flag status API.

It exposes a HomeKit contact sensor that is Closed at full staff (nominal) and Open at half-mast / half-staff (exception). It also exposes three mutually-exclusive override switches:

  • Automatic: use the Mast API
  • Force Half Staff: force half-mast
  • Force Full Staff: force full-staff

HomeKit does not provide a native single tri-state switch control, so the three switch services represent the three override states.

Configuration

{
  "platform": "Mast",
  "name": "Mast Flag Status",
  "apiKey": "YOUR_MAST_LICENSE_KEY",
  "countryCode": "US",
  "stateCode": "AZ",
  "pollIntervalSeconds": 900
}

Head over to MAST API to obtain a Free Mast API License.

apiKey is sent to Mast as the x-mast-license-key header. Requests identify themselves with the user agent Homebridge (homebridge-mast; +https://github.com/joshuaforehand/homebridge-mast).

Leave stateCode blank to use national status only.

Development

Use npm ci, npm run lint, and npm test to install dependencies, lint the TypeScript source, and run the regression tests. Tests exercise Homebridge's actual HomeKit characteristic handlers as well as API failures and accessory restoration. A paired Homebridge/HomeKit installation is still needed for end-to-end verification in Apple's Home app.

Selecting an override saves it to the Homebridge accessory cache. Turning off the selected switch restores it to On; select a different mode to change modes. API requests time out after 10 seconds, and overlapping refreshes share a request. Changing the configured location removes the previous location's accessory; HomeKit automations targeting that accessory may need updating.

Publishing

The npm trusted publisher must use:

  • Organization or user: joshuaforehand
  • Repository: homebridge-mast
  • Workflow filename: publish.yml
  • Environment name: leave blank
  • Allow npm publish: enabled

After merging the release changes, create a GitHub release with a tag matching package.json, for example v0.1.1. The publishing workflow builds, lints, and tests before publishing through npm OIDC. It skips prereleases and rejects tags that do not match the package version. No npm token secret is needed.

Names in Apple Home

The accessory contains Automatic, Force Half Staff, and Force Full Staff switches, plus a Flag Half Staff contact sensor. Only one mode is selected. The overrides change the reported status; they do not physically move a flag.

Apple Home uses its built-in contact sensor wording: Closed means full-staff; Open means half-staff. In Automatic mode, check for a fault if API data is unavailable; Closed alone does not prove a successful API refresh.

After updating, restart the Mast child bridge to add the names to existing services. Service identities are preserved, so re-pairing is not required by this change. Apple Home may retain names saved locally; if generic names remain, edit the individual tile names in Home. Names already stored in ConfiguredName are preserved on restart.

This reverses the original contact sensor mapping. Update existing HomeKit automations to trigger on Open for half-staff and Closed for full-staff.