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

homespot-api

v1.0.5

Published

An API for the o2 HomeSpot

Downloads

9

Readme

An API for the o2 HomeSpot

I won't continue this, because I no longer own a o2 Homespot, since they destroyed the Firmware with the "DE_g34.0_RTL0080.D112.DE.21.13.115 [2020-10-15 12:14:02]" Update.

Does not support all functions yet. Feel free to contribute. This package uses node-fetch for requests.

CORS PROXY IS REQUIRED

This API probably won't work, if you don't use a proxy. CORS errors will occur. Use for example local-cors-proxy. Start it like this lcp --proxyUrl http://192.168.1.1 (http://192.168.1.1 should be the ip of the router)

Then call the constructor with the url provided from lcp as the base url. Like const api = new HomeSpotApi("http://localhost:8010/proxy");

Installation

$ npm install homespot-api --save

Usage

const { HomespotApi } = require("homespot-api");
// import { HomespotApi } from "homespot-api"; ES6 import

const api = new HomespotApi("http://192.168.1.1");

api.login("Password").then((result) =>
{
    if (result)
    {
        console.log("Login successful");
    }
});

Methods

login(password: string): Promise<boolean>

getMainStatus(): Promise<HomespotMainInfo>

getSystemInformation(): Promise<HomespotSystemInformation>

getWifiInformation(): Promise<HomespotWifiResult>

getWifiPlusInformation(): Promise<HomespotWifiPlusResult>

getPreferedConnectionType(): Promise<HomespotPreferedConnectionType>

setPreferedConnectionType(value: HomespotPreferedConnectionType): Promise<boolean>

getLocalNetworkInformation(): Promise<HomespotLocalNetworkInfo>

restart(): void

login(password: string): Promise<boolean>

Logs you into the homespot. The Password is the same you would use on the default router page (e.g "o2.spot" or "192.168.1.1")

api.login("Password").then((result) =>
{
    if (result)
    {
        console.log("Login successful");
    }
});

getMainStatus(): Promise<HomespotMainInfo>

Returns a Promise with HomespotMainInfo:

export class HomespotMainInfo
{
    public CellInfo: HomespotCellInfo;
    public RadioStatus: HomespotRadioStatus;
}

interface HomespotCellInfo
{
    RSRP: string;
    RSRQ: string;
    RSSI: string;
    TAC: string;
    PCI: string;
    CellId: string;
    EARFCN: string;
}

interface HomespotRadioStatus
{
    Provider: string;
    RadioStation: string;
    SignalStrength: string;
}

getSystemInformation(): Promise<HomespotSystemInformation>

Returns a Promise with HomespotSystemInformation

{
    FirmwareName: string;
    FirmwareUpdateTime: string;
    HwVersion: string;
    DevManufacturer: string;
    Imei: string;
    SerialNumber: string;
    Uptime: string;
}

getWifiInformation(): Promise<HomespotWifiResult>

Returns a Promise with HomespotWifiResult

{
    Active: boolean;
    SSID: string;
    Mac: string;
    Encryption: string;
    BroadcastSSID: boolean;
    Channel: number | string; // just returns a string when the number conversion returns NaN
    ConnectedDevices: number | string; // just returns a string when the number conversion returns NaN
}

getWifiPlusInformation(): Promise<HomespotWifiPlusResult>

Returns a Promise with HomespotWifiPlusResult

{
    Active: boolean;
    SSID: string;
    Mac: string;
    Mode: string;
    Encryption: string;
    Channel: number | string; // just returns a string when the number conversion returns NaN
    ConnectedDevices: number | string; // just returns a string when the number conversion returns NaN
}

getPreferedConnectionType(): Promise<HomespotPreferedConnectionType>

Returns a Promise with HomespotPreferedConnectionType (enum)

export enum HomespotPreferedConnectionType
{
    Both = 0,
    LTE,
    ThirdGeneration
}

setPreferedConnectionType(value: HomespotPreferedConnectionType): Promise<boolean>

Returns a boolean Promise. true if the action was successful.

Parameters: value: HomespotPreferedConnectionType

const { HomespotPreferedConnectionType } = require("homespot-api") 
// import { HomespotPreferedConnectionType } from "homespot-api" ES6 import

api.setPreferedConnectionType(HomespotPreferedConnectionType.LTE).then((result) =>
{
    if (result)
    {
        console.log("action successful");
    }
});

getLocalNetworkInformation(): Promise<HomespotLocalNetworkInfo>

Returns a Promise with HomespotLocalNetworkInfo

{
    LanIpAddress: string;
    Netmask: string;
    DHCPLeaseTime: string;
    DHCPStart: string;
    DHCPEnd: string;
    DHCPServerEnabled: boolean;
    EthernetMacAddress: string;
}

restart(): void

Reboots the router. Returns nothing.