Skip to content

Latest commit

 

History

History
616 lines (442 loc) · 27.4 KB

API.md

File metadata and controls

616 lines (442 loc) · 27.4 KB

Modules

Device
SenseMe

Device

Device~Device

Represents one device on the local network, such as a fan.

Kind: inner class of Device

new Device(opts, messenger)

Create a new device.

Param Type Description
opts Object
opts.name string The advertised name of the new device
opts.id string The MAC address of the new device
opts.type string The type of the new device, such as FAN,HAIKU,HSERIES
opts.ip string The IP address of the new device
messenger EventEmitter An EventEmitter for funneling incoming messages from the discovery process.

device.id : string

The ID (MAC address) of this device.

Kind: instance property of Device
Read only: true

device.ip : string

The IP address of this device.

Kind: instance property of Device
Read only: true

device.name : string

The name of this device

Kind: instance property of Device
Read only: true

device.type : string

The type of this device, such as FAN,HAIKU,HSERIES

Kind: instance property of Device
Read only: true

device.network : NetworkProperties

Kind: instance property of Device
Read only: true

device.fan : FanProperties

Kind: instance property of Device
Read only: true

device.light : LightProperties

Kind: instance property of Device
Read only: true

device.sensor : SensorProperties

Kind: instance property of Device
Read only: true

device.smartMode : SmartModeProperties

Kind: instance property of Device
Read only: true

device.sleepMode : SleepModeProperties

Kind: instance property of Device
Read only: true

device.device : DeviceProperties

Kind: instance property of Device
Read only: true

device.observeAll() ⇒ Observable

Observe changes to any of the properties of this device. This method is only available if your application has an Observable library installed. See https://www.npmjs.com/package/any-observable for details.

Kind: instance method of Device
Returns: Observable - An ES7-compatible obsevable that emits objects of the form { path, value } for each property change.

device.disconnect()

Disconnect from the device.

Kind: instance method of Device

device.listenAll() ⇒ EventEmitter

Listen for changes to any of the properties of this device. Changes are delivered as 'change' events emitted by the returned emitter.

Kind: instance method of Device

device.refreshAll()

Request the current values of all known properties from this device. This method only updates the local state; to be informed of the new values, use Device#listenAll, {@link Device#observeAll}, or the corresponding methods on the individual values of interest.

Kind: instance method of Device

SenseMe

SenseMe.default : SenseMe

Kind: static property of SenseMe

SenseMe~SenseMe

Discover and manage SenseME-enabled devices on the local network.

Kind: inner class of SenseMe

senseMe.getAllDevices() ⇒ Array.<Device>

Get a list of all currently known devices.

Kind: instance method of SenseMe

senseMe.getDeviceById(id) ⇒ Device

Get one discovered device by its ID (usually MAC address).

Kind: instance method of SenseMe

Param Type Description
id string The ID of the requested device.

senseMe.getDeviceByName(name) ⇒ Device

Get one discovered device by its name.

Kind: instance method of SenseMe

Param Type Description
name string The name of the requested device.

senseMe.discover([interval], [missingThreshold])

Begin discovery of all SenseME devices on the local network. Discovery will continue until cancelDiscovery is called.

Kind: instance method of SenseMe
Emits: SenseMe#event:lostdevice

Param Type Default Description
[interval] number 10000 How often (in milliseconds) should a discovery request be sent out?
[missingThreshold] number 3 How many discovery requests must a device miss before being considered no longer on the network?

senseMe.cancelDiscovery()

Cancel an ongoing discovery session.

Kind: instance method of SenseMe

SenseMeProperty

A single property of a SenseME device.

Kind: global interface
Template: T

senseMeProperty.value : T

The value of this property

Kind: instance property of SenseMeProperty

senseMeProperty.refresh()

Re-fetch the value of this property from the device.

Kind: instance method of SenseMeProperty

senseMeProperty.listen() ⇒ EventEmitter

Listen for changes to this property value. Changes are delivered as 'change' events emitted by the returned object.

Kind: instance method of SenseMeProperty

senseMeProperty.observe() ⇒ Observable

Observe this property for changes. Returns an ES7-compatible {Observable}. This method will only be available to applications that include an Observable library. See https://www.npmjs.com/package/any-observable for details.

Kind: instance method of SenseMeProperty

SenseMeReadonlyProperty ⇐ SenseMeProperty<T>

A single read-only property of a SenseME device.

Kind: global interface
Extends: SenseMeProperty<T>
Template: T

senseMeReadonlyProperty.value : T

The value of this property

Kind: instance property of SenseMeReadonlyProperty
Read only: true

SenseMeLevelProperty ⇐ SenseMeProperty<number>

A property of a SenseME device that describes the "level" of something (fan speed, light brightness, etc)

Kind: global interface
Extends: SenseMeProperty<number>

senseMeLevelProperty.minimum : SenseMeReadonlyProperty.<number>

The minimum level for this property

Kind: instance property of SenseMeLevelProperty

senseMeLevelProperty.maximum : SenseMeReadonlyProperty.<number>

The maximum level for this property

Kind: instance property of SenseMeLevelProperty

FanProperties

A collection of the properties of a fan.

Kind: global interface

fanProperties.power : SenseMeProperty.<('on'|'off')>

The power state of the fan.

Kind: instance property of FanProperties

fanProperties.speed : SenseMeLevelProperty

The speed of the fan

Kind: instance property of FanProperties

fanProperties.automaticOn : SenseMeProperty.<('on'|'off')>

The state of the fan's motion sensor. This is for the purposes of turning the fan on and off automatically; setting this to 'off' will not disable the presence sensor.

Kind: instance property of FanProperties

fanProperties.whooshMode : SenseMeProperty.<('on'|'off')>

Is whoosh mode enabled?

Kind: instance property of FanProperties

fanProperties.direction : SenseMeProperty.<('forward'|'reverse')>

The fan's direction of spin

Kind: instance property of FanProperties

LightProperties

A collection of the properties of a light.

Kind: global interface

lightProperties.power : SenseMeProperty.<('on'|'off')>

The power state of the light.

Kind: instance property of LightProperties

lightProperties.brightness : SenseMeLevelProperty

The brightness of the light

Kind: instance property of LightProperties

lightProperties.automaticOn : SenseMeProperty.<('on'|'off')>

The state of the light's motion sensor. This is for the purposes of turning the light on and off automatically; setting this to 'off' will not disable the presence sensor.

Kind: instance property of LightProperties

SensorProperties

A collection of the device's properties related to the occupancy sensor.

Kind: global interface

sensorProperties.isRoomOccupied : SenseMeProperty.<boolean>

Is the room occupied?

Kind: instance property of SensorProperties

sensorProperties.timeout : SenseMeLevelProperty

The occupancy sensor timeout (in milliseconds). The device will turn itself off automatically after this much time has passed.

Kind: instance property of SensorProperties

SmartModeProperties

A collection of the device's properties related to Smart mode.

Kind: global interface

smartModeProperties.actual : SenseMeReadonlyProperty.<('cooling'|'heating'|'off')>

The current actual smart mode setting.

Kind: instance property of SmartModeProperties

smartModeProperties.state : SenseMeProperty.<('followThermostat'|'cooling'|'heating'|'off')>

The current desired smart mode setting.

Kind: instance property of SmartModeProperties

smartModeProperties.minimumSpeed : SenseMeProperty.<number>

The minimum speed of the fan in smart mode

Kind: instance property of SmartModeProperties

smartModeProperties.maximumSpeed : SenseMeProperty.<number>

The maximum speed of the fan in smart mode

Kind: instance property of SmartModeProperties

smartModeProperties.idealTemperatureC : SenseMeProperty.<number>

The ideal smart mode temperature in degrees Celsius

Kind: instance property of SmartModeProperties

smartModeProperties.idealTemperatureF : SenseMeProperty.<number>

The ideal smart mode temperature in degrees Fahrenheit

Kind: instance property of SmartModeProperties

SleepModeProperties

A collection of the device's properties related to sleep mode.

Kind: global interface

sleepModeProperties.status : SenseMeProperty.<('on'|'off')>

Is sleep mode on?

Kind: instance property of SleepModeProperties

sleepModeProperties.idealTemperatureC : SenseMeProperty.<number>

The ideal sleep mode temperature in degrees Celsius

Kind: instance property of SleepModeProperties

sleepModeProperties.idealTemperatureF : SenseMeProperty.<number>

The ideal sleep mode temperature in degrees Fahrenheit

Kind: instance property of SleepModeProperties

sleepModeProperties.minimumFanSpeed : SenseMeProperty.<number>

The minimum speed of the fan in sleep mode

Kind: instance property of SleepModeProperties

sleepModeProperties.maximumFanSpeed : SenseMeProperty.<number>

The maximum speed of the fan in sleep mode

Kind: instance property of SleepModeProperties

DeviceProperties

A collection of properties related to the device itself.

Kind: global interface

deviceProperties.hasLight : SenseMeReadonnlyProperty.<boolean>

Does the fan have a light kit attached?

Kind: instance property of DeviceProperties

deviceProperties.beeperStatus : SenseMeProperty.<('on'|'off')>

The power status of the confirmation beep heard when changing settings.

Kind: instance property of DeviceProperties

deviceProperties.indicatorsStatus : SenseMeProperty.<('on'|'off')>

The power status of the indicator lights on the fan

Kind: instance property of DeviceProperties

deviceProperties.winterMode : SenseMeProperty.<('on'|'off')>

The current state of Winter mode

Kind: instance property of DeviceProperties

deviceProperties.heightInMeters : SenseMeProperty.<number>

The height of the device abvoe the floor in meters.

Kind: instance property of DeviceProperties

deviceProperties.heightInFeet : SenseMeProperty.<number>

The height of the device abvoe the floor in feet.

Kind: instance property of DeviceProperties

NetworkProperties

A collection of properties related to the device's network connection

Kind: global interface

networkProperties.token : SenseMeReadonlyProperty.<number>

A network token GUID. It's currently not known what this token is useful for.

Kind: instance property of NetworkProperties

networkProperties.dhcpStatus : SenseMeReadonlyProperty.<('on'|'off')>

DHCP status

Kind: instance property of NetworkProperties

networkProperties.ssid : SenseMeReadonlyProperty.<string>

The SSID of the currently associated wireless network.

Kind: instance property of NetworkProperties

networkProperties.accessPointStatus : SenseMeReadonlyProperty.<('on'|'off')>

The power status of the device's internal access point. It's possible to configure the fan to act as its own wireless access point. This property indicates whether it's in that mode or not.

Kind: instance property of NetworkProperties