domoja-sample

A sample Domoja module skeleton

Usage no npm install needed!

<script type="module">
  import domojaSample from 'https://cdn.skypack.dev/domoja-sample';
</script>

README

NPM

NPM version Node.js CI CodeQL Coverage Status

domoja-sample

This is a skeleton for developing a new domoja module.

A module extend Domoja functionality, by adding new sources, devices, etc. It is essentially an npm module following particular specifications:

  • its name must start with domoja-
  • it must derive from domoModule

Sources

A source derives from the Source class and implements the following methods:

  • createInstance: create an instance of the source, taking into account the requested configuration
  • getParameters: describes the parameters supported by the source
  • doSetAttribute: implements a requested change of value of an attribute of a device managed by the source
  • release: releases a source to free any used resource
  • registerDeviceTypes: a static method to declare which device types are supported by the source