Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/armetiz/node-freebox-sdk
SDK to manage Freebox v6
https://github.com/armetiz/node-freebox-sdk
Last synced: about 1 month ago
JSON representation
SDK to manage Freebox v6
- Host: GitHub
- URL: https://github.com/armetiz/node-freebox-sdk
- Owner: armetiz
- License: mit
- Created: 2012-08-31T07:40:47.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2013-07-10T09:44:04.000Z (over 11 years ago)
- Last Synced: 2024-09-14T16:26:20.879Z (2 months ago)
- Language: JavaScript
- Size: 148 KB
- Stars: 6
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
node-freebox-sdk
================SDK to manage Freebox v6. Caution, work only with firmware 1.x.x
**Right now, only wifi is manageable. Stay tuned.**
## Quick Examples
Toggle wifi connection and get wifi informations.```js
var Freebox = require("freebox-sdk");
var freebox = new Freebox({
password: "my_password",
wifiChannel: 11,
wifiHtMode: "disabled" //disabled, 20, 40_lower, 40_upper
});freebox.on("connect", function() {
console.log("Connected");
var getInformations = function () {
freebox.wifiStations(function (result) {
console.log("stations: " + result);
});
freebox.wifiStatus(function (result) {
console.log("status: " + result);
});
freebox.wifiConfig(function (result) {
console.log("config: " + result);
});
}
freebox.wifiStatus(function (status) {
if(status.active) {
console.log("wifi is on");
freebox.wifiOff(function (result) {
console.log("wifi turns off");
getInformations();
});
}
else {
console.log("wifi is off");
freebox.wifiOn(function (result) {
console.log("wifi turns on");
getInformations();
});
}
});
});freebox.on("error", function(message) {
console.log("error: " + message);
});freebox.connect();
```API
---### new Freebox(options)
Password is the only mandatory option.
```js
var options = {};options.password; //default value: ""
options.hostname; //default value: "mafreebox.free.fr";
options.port //default value: 80
options.login //default value: "freebox";
options.wifiChannel //default value: 9;
options.wifiHtMode //default value: "disabled";
```wifiHtMode allowed values : "disabled", 20, "40_lower", "40_upper"
### freebox.connect()
Start a connection between Node and Freebox.
### freebox.wifiStations(callback)
Get wifi connected stations.
Callback take one "result" argument.### freebox.wifiStatus(callback)
Get wifi status.
Callback take one "result" argument.### freebox.wifiConfig(callback)
Get wifi configuration.
Callback take one "result" argument.### freebox.wifiOn(callback)
Switch on WiFi.
Callback take one "result" argument.### freebox.wifiOff(callback)
Switch off WiFi.
Callback take one "result" argument.