abstract-thingsΒΆ
abstract-things is a JavaScript library that provides a simple base for building libraries that interact with physical things, such as IoT-devices, and virtual things.
This library provides a base class named Thing that supports mixins of various types. Things are described using two types of tags, one describing the type of the thing and one describing its capabilities. Things are also expected to describe their public API, to make remote use easier.
Types and capabilities are designed to be stable and to be combined. When combined they describe a thing and what it can do.
Note
This documentation is a work in progress. Things are missing and may sometimes be inaccurate. Please open issues on Github if you find something that seems wrong.
- Common capabilities
cap:children
- access child thingscap:state
- state trackingcap:restorable-state
- capture and restore statecap:nameable
- renameable thingscap:power
- monitor power statecap:switchable-power
- switch power statecap:mode
- monitor modecap:switchable-mode
- switch modecap:error-state
- error reportingcap:battery-level
- monitor battery levelcap:charging-state
- monitor if chargingcap:autonomous-charging
- request charging
- Controllers
- Lights
- Implementing lights
type:light-bulb
- Light bulbstype:light-strip
- Light stripscap:fading
- support for fading changescap:brightness
- read brightnesscap:dimmable
- change brightnesscap:colorable
- coloring of lightscap:color:temperature
- light supports temperaturecap:color:full
- light supports full range of color
- Sensors
cap:atmospheric-pressure
- read atmospheric pressurecap:carbon-dioxide
- read carbon dioxide levelcap:carbon-monoxide
- read carbon monoxide levelcap:contact
- contact sensingcap:illuminance
- read illuminancecap:motion
- motion sensingcap:pm2.5
- read PM2.5 density (air quality)cap:pm10
- read PM10 density (air quality)cap:power-consumed
- read power consumedcap:power-load
- read the current power loadcap:relative-humidity
- read humidity of aircap:temperature
- read temperaturecap:voltage
- read voltage of something
- Climate
- Electrical