node.js lib for the Parrot Flower Power
npm install flower-power
var FlowerPower = require('flower-power');
Discover
FlowerPower.discover(callback(flowerPower));
Connect
flowerPower.connect(callback);
Disconnect
flowerPower.disconnect(callback);
Discover Services and Characteristics
flowerPower.discoverServicesAndCharacteristics(callback);
Device Info
flowerPower.readSystemId(callback(systemId));
flowerPower.readSerialNumber(callback(serialNumber));
flowerPower.readFirmwareRevision(callback(firmwareRevision));
flowerPower.readHardwareRevision(callback(hardwareRevision));
Other Info
flowerPower.readFriendlyName(callback(friendlyName));
flowerPower.writeFriendlyName(friendlyName, callback);
flowerPower.readColor(callback(color));
Battery Level
// batteryLevel range is 0 - 100
flowerPower.readBatteryLevel(callback(batteryLevel));
Sunlight
// sunlight units are photons per square meter
flowerPower.readSunlight(callback(sunlight));
Temperature
flowerPower.readTemperature(callback(temperatureC, temperatureF));
Soil Moisture
// soilMoisture units is percentage (%)
flowerPower.readSoilMoisture(callback(soilMoisture));
Live mode
// sunlightChange, temperatureChange, soilMoistureChange events are emitted (see below)
flowerPower.enableLiveMode(callback);
flowerPower.disableLiveMode(callback);
Disconnect
flowerPower.on('disconnect', callback);
Sunlight Change
flowerPower.on('sunlightChange', callback(sunlight));
Temperature Change
flowerPower.on('temperatureChange', callback(temperatureC, temperatureF));
Soil Moisture Change
flowerPower.on('soilMoistureChange', callback(soilMoisture));
discoverconnectdiscoverdiscover services and characteristicsread device infosystem idserial numberfirmware revisionhardware revision
read battery levelread sunlightread temperatureread soil moisturelive modesunlighttemperaturesoil moisture
- read fertilizer
- read historic data
- sunlight
- temperature
- soil moisture
- fertizler
- use calculations to convert values (currently using lookup table)