Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

knx-datapoints

Rafelder58MIT1.1.2

Decode and encode knx datapoint according to the knx datapoint types standard 2.1

knx, dpt, datapoint, home-automation

readme

knx-datapoints

NPM version NPM downloads per month NPM downloads total MIT License JavaScript Style Guide

A library to encode and decode knx datapoint types as described in the KNX Specifications v2.1

So far not all but the most common datapoint types are supported.
The supported datapoint types are documented in the dpt overview table.

Changelog

Usage

npm install --save knx-datapoints
const knxDatapoints = require('knx-datapoints')

// Encode a value
knxDatapoints.encode('1.001', true) // Buffer[01]

// Decode a buffer
knxDatapoints.decode('1.001', Buffer.from('01', 'hex')) // true

// Check if a dpt is valid
knxDatapoints.isValid('1.001') // true
knxDatapoints.isValid('255.000') // false

// Check if a dpt is supported
knxDatapoints.isSupported('1.001') // true
knxDatapoints.isSupported('241.800') // false

You can read further information in the usage documentation.

Contribute

  • Always write tests and make sure all tests run fine
  • Always lint
  • Try to cover all of your code in tests
npm install

# testing
npm test

# linting
npm run lint

# check coverage
npm run coverage

License

knx-datapoints is freely distributable under the terms of the MIT license.

changelog

Changelog

1.1.2

  • Release Feb 17, 2021
  • Fixed month conversion in DPT11
  • Updated dependencies

1.1.1

  • Release Aug 03, 2018
  • Fixed implementation of DPT6, DPT8 and DPT13
  • Fixed documentation of DPT19
  • Fixed tests for Node.js 10

1.1.0

  • Release Sep 18, 2017
  • Added datapoint types 20.0XX and 20.1XX

1.0.0

  • Release Sep 09, 2017