isy-nodejs 0.5.0-beta.55 → 0.5.0-beta.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/lib/Devices/ISYDevice.js +1 -2
  2. package/lib/ISY.d.ts +2 -0
  3. package/lib/ISY.js +28 -4
  4. package/lib/ISYNode.d.ts +2 -1
  5. package/lib/ISYNode.js +4 -3
  6. package/package.json +9 -1
  7. package/.babelrc +0 -12
  8. package/.travis.yml +0 -8
  9. package/ISYNodesDump.json +0 -1368
  10. package/isySampleOutput/config.json +0 -1825
  11. package/scratch.js +0 -95
  12. package/src/Categories.ts +0 -19
  13. package/src/Devices/DeviceFactory.ts +0 -20
  14. package/src/Devices/Elk/ElkAlarmPanelDevice.ts +0 -190
  15. package/src/Devices/Elk/ElkAlarmSensorDevice.ts +0 -104
  16. package/src/Devices/ISYDevice.ts +0 -282
  17. package/src/Devices/Insteon/InsteonBallastDimmerDevice.ts +0 -6
  18. package/src/Devices/Insteon/InsteonBaseDevice.ts +0 -43
  19. package/src/Devices/Insteon/InsteonCOSensorDevice.ts +0 -12
  20. package/src/Devices/Insteon/InsteonDeviceFactory.ts +0 -823
  21. package/src/Devices/Insteon/InsteonDimmableDevice.ts +0 -16
  22. package/src/Devices/Insteon/InsteonDimmerOutletDevice.ts +0 -7
  23. package/src/Devices/Insteon/InsteonDimmerSwitchDevice.ts +0 -8
  24. package/src/Devices/Insteon/InsteonDoorWindowSensorDevice.ts +0 -12
  25. package/src/Devices/Insteon/InsteonFanDevice.ts +0 -73
  26. package/src/Devices/Insteon/InsteonKeypadDevice.ts +0 -9
  27. package/src/Devices/Insteon/InsteonKeypadDimmerDevice.ts +0 -10
  28. package/src/Devices/Insteon/InsteonKeypadRelayDevice.ts +0 -7
  29. package/src/Devices/Insteon/InsteonLeakSensorDevice.ts +0 -12
  30. package/src/Devices/Insteon/InsteonLockDevice.ts +0 -42
  31. package/src/Devices/Insteon/InsteonMotionSensorDevice.ts +0 -43
  32. package/src/Devices/Insteon/InsteonOnOffOutletDevice.ts +0 -22
  33. package/src/Devices/Insteon/InsteonRelayDevice.ts +0 -21
  34. package/src/Devices/Insteon/InsteonRelaySwitchDevice.ts +0 -8
  35. package/src/Devices/Insteon/InsteonSmokeSensorDevice.ts +0 -12
  36. package/src/Devices/Insteon/InsteonThermostatDevice.ts +0 -39
  37. package/src/Devices/Insteon/insteondevice.ts +0 -41
  38. package/src/Events/EventType.ts +0 -27
  39. package/src/Events/ISYEvent.ts +0 -9
  40. package/src/Events/NodeEvent.ts +0 -9
  41. package/src/Events/PropertyChangedEvent.ts +0 -11
  42. package/src/Families.ts +0 -30
  43. package/src/ISY.ts +0 -768
  44. package/src/ISYConstants.ts +0 -182
  45. package/src/ISYNode.ts +0 -195
  46. package/src/ISYScene.ts +0 -120
  47. package/src/ISYVariable.ts +0 -49
  48. package/src/isyproductinfo.json +0 -378
  49. package/src/utils.ts +0 -108
  50. package/test/testsuite.js +0 -607
  51. package/tsconfig.json +0 -27
  52. package/tslint.json +0 -28
@@ -1,16 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { ISYUpdateableLevelDevice } from '../ISYDevice';
3
- import { InsteonRelayDevice } from './InsteonRelayDevice';
4
-
5
- export class InsteonDimmableDevice extends ISYUpdateableLevelDevice(InsteonRelayDevice) {
6
- constructor (isy: ISY, node: any) {
7
- super(isy, node);
8
- this.isDimmable = true;
9
- }
10
- get brightnessLevel() {
11
- return this.level;
12
- }
13
- public async updateBrightnessLevel(level: number): Promise<{}> {
14
- return super.updateLevel(level);
15
- }
16
- }
@@ -1,7 +0,0 @@
1
- import { InsteonDimmableDevice } from './InsteonDimmableDevice';
2
-
3
- export class InsteonDimmerOutletDevice extends InsteonDimmableDevice {
4
- constructor (isy: any, deviceNode: any) {
5
- super(isy, deviceNode);
6
- }
7
- }
@@ -1,8 +0,0 @@
1
- import { InsteonSwitchDevice } from './InsteonDevice';
2
- import { InsteonDimmableDevice } from './InsteonDimmableDevice';
3
-
4
- export class InsteonDimmerSwitchDevice extends InsteonSwitchDevice(InsteonDimmableDevice) {
5
- constructor (isy: any, deviceNode: any) {
6
- super(isy, deviceNode);
7
- }
8
- }
@@ -1,12 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { ISYUpdateableBinaryStateDevice, ISYBinaryStateDevice } from '../ISYDevice';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonDoorWindowSensorDevice extends ISYBinaryStateDevice(InsteonBaseDevice) {
6
- constructor (isy: ISY, deviceNode) {
7
- super(isy, deviceNode);
8
- }
9
- get isOpen() {
10
- return this.state;
11
- }
12
- }
@@ -1,73 +0,0 @@
1
- import { Family } from '../../Families';
2
- import { ISY, ISYNode } from '../../ISY';
3
- import { States } from '../../ISYConstants';
4
- import { ISYUpdateableBinaryStateDevice, ISYDevice, ISYUpdateableLevelDevice } from '../ISYDevice';
5
- import { InsteonBaseDevice } from './InsteonBaseDevice';
6
- import { InsteonDimmableDevice } from './InsteonDimmableDevice';
7
-
8
- export class InsteonFanMotorDevice extends ISYUpdateableLevelDevice(ISYUpdateableBinaryStateDevice(InsteonBaseDevice)) {
9
- constructor (isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
10
- super(isy, deviceNode);
11
- this.hidden = true;
12
- }
13
-
14
- get isOn() {
15
- return this.state;
16
- }
17
- get fanSpeed() {
18
- return this.level;
19
- }
20
-
21
- public async updateFanSpeed(level: number) {
22
- return this.updateLevel(level);
23
- }
24
- public async updateIsOn(isOn: boolean) {
25
- if (!isOn) {
26
- return this.updateLevel(States.Level.Min);
27
- } else {
28
- return this.updateLevel(States.Level.Max);
29
- }
30
- }
31
-
32
- }
33
-
34
- export class InsteonFanDevice extends InsteonBaseDevice {
35
- public light: InsteonDimmableDevice;
36
- public motor: InsteonFanMotorDevice;
37
- constructor(isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
38
- super(isy, deviceNode);
39
- this.light = new InsteonDimmableDevice(isy, deviceNode);
40
- this.light.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `light.${a}`, b, c, d); }).bind(this));
41
- this.addChild(this.light);
42
- }
43
-
44
- public handleEvent(event: { control?: string; data?: any; node?: any; }): boolean {
45
- this.isy.logger(JSON.stringify(event));
46
- const child = this.children.find((p) => p.address === event.node);
47
- if (child !== undefined) {
48
- return child.handleEvent(event);
49
- }
50
- return false;
51
- }
52
-
53
- public addChild(childDevice: ISYDevice<Family.Insteon>) {
54
- super.addChild(childDevice);
55
- if (childDevice instanceof InsteonFanMotorDevice) {
56
- this.logger('Fan Motor Found');
57
- this.motor = childDevice as InsteonFanMotorDevice;
58
- this.motor.on('PropertyChanged', ((a: any, b: any, c: any, d: string) => { this.emit('PropertyChanged', `motor.${a}`, b, c, d); }).bind(this));
59
- }
60
- }
61
-
62
- public async updateFanSpeed(level: number) {
63
- return this.motor.updateLevel(level);
64
- }
65
- public async updatFanIsOn(isOn: boolean) {
66
- if (!isOn) {
67
- this.motor.updateLevel(States.Level.Min);
68
- } else {
69
- this.motor.updateLevel(States.Fan.High);
70
- }
71
- }
72
-
73
- }
@@ -1,9 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { InsteonRelayDevice } from './InsteonRelayDevice';
3
-
4
-
5
- export class InsteonKeypadButtonDevice extends InsteonRelayDevice {
6
- constructor (isy: ISY, deviceNode: any) {
7
- super(isy, deviceNode);
8
- }
9
- }
@@ -1,10 +0,0 @@
1
- import { KeypadDevice } from './InsteonDevice';
2
- import { InsteonDimmableDevice } from './InsteonDimmableDevice';
3
-
4
- export class InsteonKeypadDimmerDevice extends KeypadDevice(InsteonDimmableDevice) {
5
- constructor (isy: any, deviceNode: any) {
6
- super(isy, deviceNode);
7
- }
8
- }
9
-
10
-
@@ -1,7 +0,0 @@
1
- import { KeypadDevice } from './InsteonDevice';
2
- import { InsteonRelayDevice } from './InsteonRelayDevice';
3
- export class InsteonKeypadRelayDevice extends KeypadDevice(InsteonRelayDevice) {
4
- constructor (isy: any, deviceNode: any) {
5
- super(isy, deviceNode);
6
- }
7
- }
@@ -1,12 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { ISYUpdateableBinaryStateDevice, ISYBinaryStateDevice } from '../ISYDevice';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonLeakSensorDevice extends ISYBinaryStateDevice(InsteonBaseDevice) {
6
- constructor (isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
7
- super(isy, deviceNode);
8
- }
9
- get leakDetected() {
10
- return this.state;
11
- }
12
- }
@@ -1,42 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { Commands, States } from '../../ISYConstants';
3
- import { ISYUpdateableBinaryStateDevice } from '../ISYDevice';
4
- import { InsteonBaseDevice } from './InsteonBaseDevice';
5
-
6
- export class InsteonLockDevice extends ISYUpdateableBinaryStateDevice(InsteonBaseDevice) {
7
- constructor (isy: ISY, deviceNode: any
8
- ) {
9
- super(isy, deviceNode);
10
- }
11
- public sendLockCommand(lockState: any, resultHandler: any) {
12
-
13
- this.sendNonSecureLockCommand(lockState);
14
-
15
- this.sendSecureLockCommand(lockState);
16
-
17
- }
18
- get isLocked() {
19
- return this.state;
20
- }
21
-
22
- public async updateIsLocked(isLocked: boolean) {
23
- return super.updateState(isLocked);
24
- }
25
-
26
- public async sendNonSecureLockCommand(lockState: any) {
27
- if (lockState) {
28
- return this.isy.sendNodeCommand(this, Commands.Lock.Lock);
29
- }
30
- else {
31
- return this.isy.sendNodeCommand(this, Commands.Lock.Unlock);
32
- }
33
- }
34
- public async sendSecureLockCommand(lockState: any) {
35
- if (lockState) {
36
- return this.isy.sendNodeCommand(this, Commands.On, States.SecureLock.Secured);
37
- }
38
- else {
39
- return this.isy.sendNodeCommand(this, Commands.On, States.SecureLock.NotSecured);
40
- }
41
- }
42
- }
@@ -1,43 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { Commands } from '../../ISYConstants';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonMotionSensorDevice extends InsteonBaseDevice {
6
- constructor (isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
7
- super(isy, deviceNode);
8
- this._isMotionDetected = false;
9
- }
10
-
11
- public handleControlTrigger(controlName: string) {
12
-
13
- if (controlName === Commands.On) {
14
- this.logger('Motion detected.');
15
- this._isMotionDetected = true;
16
- this.emit('ControlTriggered',controlName);
17
- this.emit('PropertyChanged', 'motionDetected', true, false, "true");
18
-
19
- setTimeout(() => {
20
- this.logger('No motion detected in last 30 seconds.');
21
- this._isMotionDetected = false;
22
- this.emit('PropertyChanged', 'motionDetected', false, true, "false"); /*Included for compatiblity purposes*/
23
- }, 30000);
24
- return true;
25
- }
26
-
27
- else if (controlName === Commands.Off) {
28
- this._isMotionDetected = false;
29
- this.logger('No motion detected.');
30
- this.emit('ControlTriggered',controlName);
31
- this.emit('PropertyChanged', 'motionDetected', false, true, "false");
32
- return true;
33
- }
34
-
35
- return false;
36
- }
37
- get motionDetected (): boolean{
38
- return this._isMotionDetected;
39
- }
40
-
41
-
42
-
43
- }
@@ -1,22 +0,0 @@
1
- import { ISY, ISYDevice, Family } from '../../ISY';
2
- import { InsteonRelayDevice } from './InsteonRelayDevice';
3
-
4
- export class InsteonOnOffOutletDevice extends InsteonRelayDevice {
5
-
6
- public outlet1: InsteonRelayDevice;
7
- public outlet2: InsteonRelayDevice;
8
-
9
- constructor(isy: ISY, deviceNode: any) {
10
- super(isy, deviceNode);
11
- this.outlet1 = new InsteonRelayDevice(isy, deviceNode);
12
- this.outlet1.on('PropertyChanged',(p,v,f) => this.handlePropertyChange("outlet1."+ p, v, f));
13
- super.addChild(this.outlet1);
14
-
15
- }
16
- public addChild(childDevice: ISYDevice<Family.Insteon>) {
17
- super.addChild(childDevice);
18
- this.outlet2 = childDevice as InsteonRelayDevice;
19
- this.outlet2.on('PropertyChanged', (p, v, f) => this.handlePropertyChange("outlet2." + p, v, f));
20
- // if(childDevice)
21
- }
22
- }
@@ -1,21 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { ISYUpdateableBinaryStateDevice } from '../ISYDevice';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonRelayDevice extends ISYUpdateableBinaryStateDevice(InsteonBaseDevice) {
6
- constructor (isy: ISY, node: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
7
-
8
- super(isy, node);
9
- }
10
- get isOn() {
11
- return this.state;
12
- }
13
- public async updateIsOn(isOn: boolean): Promise<any> {
14
- if (this.isOn !== isOn) {
15
- return super.updateState(isOn);
16
- }
17
- else {
18
- return Promise.resolve();
19
- }
20
- }
21
- }
@@ -1,8 +0,0 @@
1
- import { InsteonSwitchDevice } from './InsteonDevice';
2
- import { InsteonRelayDevice } from './InsteonRelayDevice';
3
-
4
- export class InsteonRelaySwitchDevice extends InsteonSwitchDevice(InsteonRelayDevice) {
5
- constructor (isy: any, deviceNode: any) {
6
- super(isy, deviceNode);
7
- }
8
- }
@@ -1,12 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { ISYBinaryStateDevice } from '../ISYDevice';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonSmokeSensorDevice extends ISYBinaryStateDevice(InsteonBaseDevice) {
6
- constructor(isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; } ) {
7
- super(isy, deviceNode);
8
- }
9
- get smokeDetected() {
10
- return this.state;
11
- }
12
- }
@@ -1,39 +0,0 @@
1
- import { ISY } from '../../ISY';
2
- import { Props } from '../../ISYConstants';
3
- import { InsteonBaseDevice } from './InsteonBaseDevice';
4
-
5
- export class InsteonThermostatDevice extends InsteonBaseDevice {
6
- constructor (isy: ISY, deviceNode: { family: any; type?: string; enabled: any; deviceClass?: any; pnode?: any; property?: any; flag?: any; nodeDefId?: string; address?: string; name?: string; parent?: any; ELK_ID?: string; }) {
7
- super(isy, deviceNode);
8
- }
9
- get currentTemperature() {
10
- return this.ST;
11
- }
12
- get coolSetPoint() {
13
- return this[Props.Climate.CoolSetPoint];
14
- }
15
- get heatSetPoint() {
16
- return this[Props.Climate.HeatSetPoint];
17
- }
18
- get mode() {
19
- return this[Props.Climate.Mode];
20
- }
21
- get operatingMode() {
22
- return this[Props.Climate.OperatingMode];
23
- }
24
- get fanMode() {
25
- return this[Props.Climate.FanMode];
26
- }
27
- get humidity() {
28
- return this[Props.Climate.Humidity];
29
- }
30
- public async updateCoolSetPoint(value: string) {
31
- return this.updateProperty(Props.Climate.CoolSetPoint, value);
32
- }
33
- public async updateHeatSetPoint(value: string) {
34
- return this.updateProperty(Props.Climate.HeatSetPoint, value);
35
- }
36
- public async updateMode(value: string) {
37
- return this.updateProperty(Props.Climate.Mode, value);
38
- }
39
- }
@@ -1,41 +0,0 @@
1
- import { Family, InsteonBaseDevice, ISY, ISYDevice } from '../../ISY';
2
-
3
- import { Insteon } from '../../Families';
4
- import { Commands } from '../../ISYConstants';
5
- import { Constructor } from '../ISYDevice';
6
- import { InsteonKeypadButtonDevice } from './InsteonKeypadDevice';
7
- import { InsteonRelayDevice } from './InsteonRelayDevice';
8
-
9
- export const InsteonLampDevice = <T extends Constructor<InsteonBaseDevice>>(IB: T) => (class extends IB {
10
-
11
- constructor(...args: any[]) {
12
- super(args[0], args[1]);
13
- this.isDimmable = true;
14
- }
15
-
16
- });
17
-
18
- // tslint:disable-next-line: variable-name
19
- export const InsteonSwitchDevice = <T extends Constructor<InsteonBaseDevice>>(IB: T) => (class extends IB {
20
-
21
- constructor (...args: any[]) {
22
- super(args[0], args[1]);
23
- this.isDimmable = true;
24
- }
25
-
26
- });
27
-
28
- export const KeypadDevice = <T extends Constructor<InsteonBaseDevice>>(IB: T) => (class extends IB {
29
-
30
- public addChild(childDevice: ISYDevice<Family.Insteon>)
31
- {
32
- super.addChild(childDevice);
33
- }
34
- });
35
-
36
-
37
- export class InsteonOutletDevice extends InsteonRelayDevice {
38
- constructor(isy: ISY, deviceNode: any) {
39
- super(isy, deviceNode);
40
- }
41
- }
@@ -1,27 +0,0 @@
1
- export enum EventType {
2
- PropertyChanged = -1,
3
- Heartbeat = 0,
4
- Trigger = 1,
5
- DriverSpecific = 2,
6
- NodeChanged = 3,
7
- SystemConfigChanged = 4,
8
- SystemStatusChanged = 5,
9
- InternetAccessChanged = 6,
10
- ProgressReport = 7,
11
- SecuritySystem = 8,
12
- SystemAlert = 9,
13
- OpenADR = 10,
14
- Climate = 11,
15
- APISEP = 12,
16
- EnergyMonitoring = 13,
17
- UPBLinker = 14,
18
- UPBDeviceAdder = 15,
19
- UPBDeviceStatus = 16,
20
- GasMeter = 17,
21
- ZigBee = 18,
22
- Elk = 19,
23
- DeviceLinker = 20,
24
- ZWave = 21,
25
- Billing = 22,
26
- Portal = 23
27
- }
@@ -1,9 +0,0 @@
1
- import { EventType } from './EventType';
2
- export class ISYEvent<TAction, TEventType extends EventType> {
3
- action: TAction;
4
- eventInfo: any;
5
- constructor (eventData: any) {
6
- this.action = eventData.action;
7
- this.eventInfo = eventData.eventInfo;
8
- }
9
- }
@@ -1,9 +0,0 @@
1
- import { ISYEvent } from './ISYEvent';
2
- import { t } from '../Families';
3
- export class NodeEvent<TActionType, TEventType extends t> extends ISYEvent<TActionType, TEventType> {
4
- nodeAddress: string;
5
- constructor (eventData: any) {
6
- super(eventData);
7
- this.nodeAddress = eventData.node;
8
- }
9
- }
@@ -1,11 +0,0 @@
1
- import { EventType } from './EventType';
2
- import { NodeEvent } from './NodeEvent';
3
- class PropertyChangedEvent extends NodeEvent<string, EventType.PropertyChanged> {
4
- property: string;
5
- formattedValue: string;
6
- constructor (eventData: any) {
7
- super(eventData);
8
- this.property = eventData.control;
9
- this.formattedValue = eventData.fmtAct;
10
- }
11
- }
package/src/Families.ts DELETED
@@ -1,30 +0,0 @@
1
- import { ISYUpdateableBinaryStateDevice } from './Devices/ISYDevice';
2
- import { InsteonBaseDevice } from './ISY';
3
- import { EventType } from './Events/EventType';
4
- import { ISYEvent } from './Events/ISYEvent';
5
-
6
-
7
- export enum Family {
8
- Elk = 0,
9
- Insteon = 1,
10
- UPB = 2,
11
- ZigBee = 3,
12
- ZWave = 4,
13
- AutoDR = 5,
14
- Scene = 6,
15
- UDI = 7,
16
- Brultech = 8,
17
- NCD = 9,
18
- Poly = 10
19
- }
20
-
21
- export interface Insteon {
22
- family: Family.Insteon;
23
- }
24
-
25
- class GenericEvent extends ISYEvent<string, EventType>
26
- {
27
-
28
- }
29
-
30
- export type t = EventType.NodeChanged | EventType.PropertyChanged | EventType.ZWave | EventType.ZigBee;