New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

node-red-contrib-battery

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-contrib-battery

A Node Red node to get information about the battery

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-18.75%
Maintainers
1
Weekly downloads
 
Created
Source

node-red-contrib-battery

A Node Red node to get information about the battery

Install

Run the following npm command in your Node-RED user directory (typically ~/.node-red):

npm install node-red-contrib-battery

Node Usage

Get information about the battery by injecting a random message into this node:

Flow

The msg.payload of the output message contains a lot of data about the battery:

  • hasbattery: indicates presence of battery.
  • cyclecount: numbers of recharges.
  • ischarging: indicates if battery is charging.
  • maxcapacity: max capacity of battery.
  • currentcapacity: current capacity of battery.
  • percent: charging level in percent.
  • timeremaining: minutes left (if discharging).
  • acconnected: AC connected.
  • type: battery type.
  • model: model.
  • manufacturer: manufacturer.
  • serial: battery serial.

Limitation

This node can be run on a number of operating systems, but check this table to make sure the required information is accessible on your platform!

Most systems running Node-RED wil not contain a battery. For example on Raspberry Pi, the msg.payload.hasbattery field will contain false and all other fields will contain no data ...

Keywords

FAQs

Package last updated on 18 Nov 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc