homebridge-plugin-utils
is a utility library for Homebridge plugins that aims to provide a set of common core capabilities that can accelerate and streamline plugin development. It's opinionated and largely derived from my other plugins and my desire to increase code reuse and make it easier to provide rich capabilities across all my plugins so that each of my plugins can focus on providing their unique capabilities rather than copying over the same capabilities (feature options, MQTT support, and a rich webUI interface to name a few) time after time.
The design decisions are driven by my own needs as I continue to create, evolve, and maintain my plugins but I also wanted to provide these as a resource to others, should it be of interest.
-
Feature options. Feature options are a hierarchical configuration system and matching webUI that allows users to set global defaults and override them at a granular level, enabling easier mass-customization of capabilities. For plugins that can potentially enumerate dozens of devices, this comes in quite handy so you don't need to configure each and every device, and instead you can focus on the exceptions.
-
Configuration webUI. This a rich, custom webUI for enumerating all the devices a plugin knows about, and configuring feature options.
-
FFmpeg process utilities. A rich set of classes that abstract away the complexity of FFmpeg and have builtin capabilities to enable livestreaming, HomeKit Secure Video (HKSV) event recording, and more. Includes hardware acceleration support among it's many features.
-
MQTT client. Building in MQTT client capabilities is made easier through a set of utilities that allow you to easily publish and subscribe to events.
-
And more...
Documentation and examples for using this library to simplify and enhance Homebridge plugin development, especially camera-related plugins, is available here. Additionally, if you'd like to see this library being used n a well-documented, real-world example, please take a good look at my homebridge-unifi-protect project. It relies heavily on this library for much of the functionality it provides.
This is mostly of interest to the true developer nerds amongst us.