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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@maximva/home-automation

v0.8.3

Published

Home automation package

Downloads

12

Readme

Home Automation Package

npm badge ESLint Markdown Linter Tests

The Home Automation Package - HAP for short - has been developed to provide a solid base for developing home automation applications. It is still in the works but as of now it can be used to provide thermostat settings as a JSON string and get a JSON string back with the appropriate action to take for the heating/cooling system in your house. Also, using the HTTPThermostat class a API url can be provided to fetch temperature data.

How to go about installing it

This is a short one:

npm install @maximva/home-automation

Examples

HTTP Thermostat class

import { HTTPThermostat } from '@maximva/home-automation'
import { JSONThermostat } from '@maximva/home-automation'
import {TemperatureConverter } from '@maximva/home-automation'
import { HttpTemperatureSensor } from '@maximva/home-automation'
import httpClient from 'axios'

const settings = {
    temperature : 20,
    range : 2,
    unit : "celsius"
}
const currentTemperature = {
    temperature: 21,
    unit: "celsius"
}

const temperatureConverter = new TemperatureConverter()
const jsonThermostat = new JsonThermostat(settings, temperatureConverter)
const httpSensor = new HttpTemperatureSensor('http://dummy-sensors.azurewebsites.net/api/sensor/abba5', httpClient)
const httpThermostat = new HTTPThermostat(httpSensor, jsonThermostat)

httpThermostat.getStatus()
.then( response => {
    console.log(response)
})

HTTP Temperature Sensor class

import HttpTemperatureSensor from '@maximva/home-automation'
import httpClient from 'axios'

let httpSensor: HttpTemperatureSensor = new HttpTemperatureSensor('http://dummy-sensors.azurewebsites.net/api/sensor/abba5', httpClient)
httpSensor.getTemperature()
.then( response => {
    console.log(response)
})

JSON Thermostat class

import { JSONThermostat } from '@maximva/home-automation'

const settings = {
    temperature : 20,
    range : 2,
    unit : "celsius"
}
const currentTemperature = {
    temperature: 21,
    unit: "celsius"
}
const temperatureConverter = new TemperaturConverter()
const jsonThermostat = new JsonThermostat(settings, temperatureConverter)
console.log(jsonThermostat.update(currentTemperature))

Temperature Converter class

import { TemperatureConverter } from '@maximva/home-automation'

const celsiusTemperature = 20
const temperature_converter = new TemperatureConverter()

console.log(`Temperature in fahrenheit: ${temperature_converter.celsiusToFahrenheit(celsiusTemperature)}`)

License

Have a look here for more information about the license: The Unlicense

Author

Maxim Vanden Abeele - Student at University College Vives, Belgium