
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
homebridge-gpio-onoff
Advanced tools
GPIO onoff plugin for Homebridge: https://github.com/nfarina/homebridge
Supports triggering General Purpose Input Output (GPIO) pins on platforms supporting the onoff package. It is based on homebridge-gpio, but using the onoff package instead of pi-gpio to be able to listen for changes in pin values.
npm install -g homebridge
npm install -g homebridge-gpio-onoff
Example config.json
, creating a switch accessory that the user can switch on and off, setting the GPIO pin value to '1' or '0', respectively:
{
"accessories": [
{
"accessory": "GPIO-OnOff",
"name": "GPIO-7",
"pin": 7,
"direction": "out"
}
]
}
accessory
should be set to GPIO-OnOff
for this plugin.
name
is the accessory's name, which is shown in HomeKit.
pin
is the physical GPIO pin number.
direction
can be set to either in
to read from the GPIO pin or out
to write to the pin. If set to in
, the edge
property can be set to rising
, falling
or both
to have a changing GPIO pin value trigger an accessory value change (it is set to none
by default).
By default, a simple 'Switch' accessory is created, which will be set to 'On' or 'Off' by a change in the input value. It is possible to change the service type and even the true
and false
values. For example, to have it act like a light sensor, you can specify:
{
"accessories": [
{
"accessory": "GPIO-OnOff",
"name": "GPIO-7",
"pin": 7,
"direction": "in",
"edge": "both",
"activeLow": true,
"hapService": "LightSensor",
"hapCharacteristic": "CurrentAmbientLightLevel",
"trueValue": 100000,
"falseValue": 0.0001
}
]
}
activeLow
will treat '0' as the true
value and '1' as the false
value.
hapService
can be set to one of the defined services in HomeKitTypes.js and hapCharacteristic
to one of the characteristics defined for the service.
If the characteristic values are not boolean, you can specify the values for true
and false
by setting trueValue
and falseValue
, respectively.
FAQs
GPIO onoff plugin for Homebridge: https://github.com/nfarina/homebridge
The npm package homebridge-gpio-onoff receives a total of 3 weekly downloads. As such, homebridge-gpio-onoff popularity was classified as not popular.
We found that homebridge-gpio-onoff demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.