@seydx/fritzbox

2.3.1 • Public • Published

@seydx/fritzbox

A promise based library for accessing a fritzbox via TR-064 API of an AVM Fritz!Box. Forked from @ulfalfa

Features

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

Install

npm install @seydx/fritzbox

Usage

Getting the info about the 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);
  }
}

Getting all currently known hosts by Fritz!Box

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);
  }
}

Retrieving all services with their corresponding actions

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);
  }
}

Dependencies (7)

Dev Dependencies (8)

Package Sidebar

Install

npm i @seydx/fritzbox

Weekly Downloads

68

Version

2.3.1

License

MIT

Unpacked Size

42.3 kB

Total Files

9

Last publish

Collaborators

  • seydx