0.0.0 • Published 5 years ago

ftrm-homekit v0.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Footurama Package: Homekit

This is glue code to HAP-NodeJS.

API

Requiring an accessory factory:

require('ftrm-homekit')(serviceName)

The serviceName can be looked up here: https://github.com/KhaosT/HAP-NodeJS/blob/v0.4.41/lib/gen/HomeKitTypes.js.

Each service definition includes mandatory and optional characteristics. They are wired up to inputs and outputs with the same name.

Configuration:

  • input: An Array of objects:
    • name: The characteristic's name. This might be a read-only characteristic or a read/writable. Mandatory.
    • pipe: The pipe to wire up the characteristic.
    • value: Default value.
  • output: An Array of objects:
    • name: The characteristic's name. This must be a read/writable characteristic. Mandatory.
    • pipe: The pipe to wire up the characteristic.
  • displayName: The accessory's displayed name. Mandatory.
  • manufacturer: The manufacturer's name.
  • model: The model's name.
  • pin: The paring pin. Must be in the format: /[0-9]{3}-[0-9]{2}-[0-9]{3}/

Example

module.exports = [require('ftrm-homekit')('TemperatureSensor'), {
	input: [{name: 'CurrentTemperature', pipe: 'temperture'}],
	output: [],
	displayName: 'Room Temperature'
}];
0.0.0

5 years ago