A promise based library for accessing a fritzbox via TR-064 API of an AVM Fritz!Box. Forked from @ulfalfa
This library is capable of:
- Supports the complete command language of the TR-064 API of an Fritz!Box
- No callback, only promises
- SSL encryption and authentication
npm install @seydx/fritzbox
With the method exec
you can access all services and actions in the fritz box even with parameters
const Fritzbox = require('@seydx/fritzbox');
const fritzbox = new Fritzbox({ username: 'test', password: 'testPwd123' });
// Async/Await:
async function getDeviceInfo () {
try {
const info = await fritzbox.exec(
'urn:DeviceInfo-com:serviceId:DeviceInfo1',
'GetInfo'
);
console.log(info);
} catch (err) {
console.error(err);
}
}
const Fritzbox = require('@seydx/fritzbox');
const fritzbox = new Fritzbox({ username: 'test', password: 'testPwd123' });
// Async/Await:
async function getHosts () {
try {
const allHosts = await fritzbox.getAllHosts();
console.log(allHosts);
} catch (err) {
console.error(err);
}
}
const Fritzbox = require('@seydx/fritzbox');
const fritzbox = new Fritzbox({ username: 'test', password: 'testPwd123' });
// Async/Await:
async function getServices () {
try {
const services = await fritzbox.describe();
console.log(services);
} catch (err) {
console.error(err);
}
}