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

flower-power

v0.3.0

Published

node.js lib for the Parrot Flower Power

Downloads

14

Readme

node-flower-power

Analytics

node.js lib for the Parrot Flower Power

Install

npm install flower-power

Usage

var FlowerPower = require('flower-power');

Discover

// Discover one Flower Power
FlowerPower.discover(callback(flowerPower));

// Discover all Flower Power's
FlowerPower.discoverAll(callback(flowerPower));

Connect and Setup

flowerPower.connectAndSetup(callback(error));

Disconnect

flowerPower.disconnect(callback(error));

Device Info

flowerPower.readSystemId(callback(error, systemId));

flowerPower.readSerialNumber(callback(error, serialNumber));

flowerPower.readFirmwareRevision(callback(error, firmwareRevision));

flowerPower.readHardwareRevision(callback(error, hardwareRevision));

flowerPower.readManufacturerName(callback(error, manufacturerName));

Other Info

flowerPower.readFriendlyName(callback(error, friendlyName));

flowerPower.writeFriendlyName(friendlyName, callback(error));


flowerPower.readColor(callback(error, color));

Battery Level

// batteryLevel range is 0 - 100
flowerPower.readBatteryLevel(callback(error, batteryLevel));

Sunlight

// sunlight units are photons per square meter
flowerPower.readSunlight(callback(error, sunlight));

Soil Temperature

flowerPower.readSoilTemperature(callback(error, temperature)); // C

Air Temperature

flowerPower.readAirTemperature(callback(error, temperature)); // C

Soil Moisture

// soilMoisture units is percentage (%)
flowerPower.readSoilMoisture(callback(error, soilMoisture));

Calibrated

// firmware versions 1.1 and above

flowerPower.readCalibratedSoilMoisture(callback(error, soilMoisture)); // %

flowerPower.readCalibratedAirTemperature(callback(error, temperature)); // C

flowerPower.readCalibratedSunlight(callback(error, sunlight)); // photons per square meter (mol/m²/d)

flowerPower.readCalibratedEa(callback(error, ea)); // no units

flowerPower.readCalibratedEcb(callback(error, ecb)); // dS/m

flowerPower.readCalibratedEcPorous(callback(error, ecPorous)); // dS/m

Live mode

// sunlightChange, soilTemperatureChange, airTemperatureChange,
// soilMoistureChange events are emitted (see below)

flowerPower.enableLiveMode(callback(error));

flowerPower.disableLiveMode(callback(error));

Calibrated live mode

// firmware versions 1.1 and above

// calibratedSoilMoistureChange, calibratedAirTemperatureChange,
// calibratedSunlightChange, calibratedEaChange, calibratedEcbChange,
// calibratedEcPorousChange events are emitted (see below)

flowerPower.enableCalibratedLiveMode(callback(error));

flowerPower.disableCalibratedLiveMode(callback(error));

LED

flowerPower.ledFade(callback(error));

flowerPower.ledOff(callback(error));

Events

Disconnect

flowerPower.on('disconnect', callback);

Sunlight Change

flowerPower.on('sunlightChange', callback(sunlight));

Soil Temperature Change

flowerPower.on('soilTemperatureChange', callback(soilTemperature));

Air Temperature Change

flowerPower.on('airTemperatureChange', callback(airTemperature));

Soil Moisture Change

flowerPower.on('soilMoistureChange', callback(soilMoisture));

Calibrated Change

flowerPower.on('calibratedSoilMoistureChange', callback(soilMoisture));
flowerPower.on('calibratedAirTemperatureChange', callback(temperature));
flowerPower.on('calibratedSunlightChange', callback(sunlight));
flowerPower.on('calibratedEaChange', callback(ea));
flowerPower.on('calibratedEcbChange', callback(ecb));
flowerPower.on('calibratedEcPorousChange', callback(ecPorous));

TODO

  • ~~discover~~
  • ~~connect~~
  • ~~discover~~
  • ~~discover services and characteristics~~
  • ~~read device info~~
    • ~~system id~~
    • ~~serial number~~
    • ~~firmware revision~~
    • ~~hardware revision~~
  • ~~read battery level~~
  • ~~read sunlight~~
  • ~~read temperature~~
  • ~~read soil moisture~~
  • ~~live mode~~
    • ~~sunlight~~
    • ~~temperature~~
    • ~~soil moisture~~
  • ~~read fertilizer~~
  • read historic data
    • sunlight
    • temperature
    • soil moisture
    • fertizler
  • ~~use calculations to convert values (currently using lookup table)~~