|
@@ -11,7 +11,10 @@ import { environmentSensorAccessory } from './environmentSensorAccessory'
|
|
|
import { doorWindowSensorAccessory } from './doorWindowSensorAccessory'
|
|
import { doorWindowSensorAccessory } from './doorWindowSensorAccessory'
|
|
|
import { motionSensorAccessory } from './motionSensorAccessory'
|
|
import { motionSensorAccessory } from './motionSensorAccessory'
|
|
|
import { cameraAccessory } from './cameraAccessory'
|
|
import { cameraAccessory } from './cameraAccessory'
|
|
|
|
|
+//import { activityAccessory } from './activityAccessory'
|
|
|
import { thermostatAccessory } from './thermostatAccessory'
|
|
import { thermostatAccessory } from './thermostatAccessory'
|
|
|
|
|
+import { smokeDetectorAccessory } from './smokeDetectorAccessory'
|
|
|
|
|
+import { securitySystemAccessory } from './securitySystemAccessory'
|
|
|
import { httpServer } from './httpServer'
|
|
import { httpServer } from './httpServer'
|
|
|
|
|
|
|
|
export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
@@ -113,24 +116,44 @@ export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
|
this.log.debug('cameraAccessory.discoverDevices Error ->' + error)
|
|
this.log.debug('cameraAccessory.discoverDevices Error ->' + error)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- this.discoveryStarted('activityAccessory')
|
|
|
|
|
- activityAccessory.discoverDevices(this)
|
|
|
|
|
|
|
+// this.discoveryStarted('activityAccessory')
|
|
|
|
|
+// activityAccessory.discoverDevices(this)
|
|
|
|
|
+// .then((devices) => {
|
|
|
|
|
+// this.processDiscoveredDevices(devices)
|
|
|
|
|
+// this.discoveryCompleted('activityAccessory')
|
|
|
|
|
+// })
|
|
|
|
|
+// .catch((error) => {
|
|
|
|
|
+// this.log.debug('activityAccessory.discoverDevices Error ->' + error)
|
|
|
|
|
+// })
|
|
|
|
|
+
|
|
|
|
|
+ this.discoveryStarted('thermostatAccessory')
|
|
|
|
|
+ thermostatAccessory.discoverDevices(this)
|
|
|
.then((devices) => {
|
|
.then((devices) => {
|
|
|
this.processDiscoveredDevices(devices)
|
|
this.processDiscoveredDevices(devices)
|
|
|
- this.discoveryCompleted('activityAccessory')
|
|
|
|
|
|
|
+ this.discoveryCompleted('thermostatAccessory')
|
|
|
})
|
|
})
|
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
|
- this.log.debug('activityAccessory.discoverDevices Error ->' + error)
|
|
|
|
|
|
|
+ this.log.debug('thermostatAccessory.discoverDevices Error ->' + error)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- this.discoveryStarted('thermostatAccessory')
|
|
|
|
|
- thermostatAccessory.discoverDevices(this)
|
|
|
|
|
|
|
+ this.discoveryStarted('smokeDetectorAccessory')
|
|
|
|
|
+ smokeDetectorAccessory.discoverDevices(this)
|
|
|
.then((devices) => {
|
|
.then((devices) => {
|
|
|
this.processDiscoveredDevices(devices)
|
|
this.processDiscoveredDevices(devices)
|
|
|
- this.discoveryCompleted('thermostatAccessory')
|
|
|
|
|
|
|
+ this.discoveryCompleted('smokeDetectorAccessory')
|
|
|
})
|
|
})
|
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
|
- this.log.debug('thermostatAccessory.discoverDevices Error ->' + error)
|
|
|
|
|
|
|
+ this.log.debug('smokeDetectorAccessory.discoverDevices Error ->' + error)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ this.discoveryStarted('securitySystemAccessory')
|
|
|
|
|
+ securitySystemAccessory.discoverDevices(this)
|
|
|
|
|
+ .then((devices) => {
|
|
|
|
|
+ this.processDiscoveredDevices(devices)
|
|
|
|
|
+ this.discoveryCompleted('securitySystemAccessory')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this.log.debug('securitySystemAccessory.discoverDevices Error ->' + error)
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -164,8 +187,14 @@ export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
|
this.accessories.push(new motionSensorAccessory(this, existingAccessory))
|
|
this.accessories.push(new motionSensorAccessory(this, existingAccessory))
|
|
|
} else if (existingAccessory.context.device.type == 'Camera') {
|
|
} else if (existingAccessory.context.device.type == 'Camera') {
|
|
|
this.accessories.push(new cameraAccessory(this, existingAccessory))
|
|
this.accessories.push(new cameraAccessory(this, existingAccessory))
|
|
|
|
|
+// } else if (existingAccessory.context.device.type == 'Activity') {
|
|
|
|
|
+// this.accessories.push(new activityAccessory(this, existingAccessory))
|
|
|
} else if (existingAccessory.context.device.type == 'Thermostat') {
|
|
} else if (existingAccessory.context.device.type == 'Thermostat') {
|
|
|
this.accessories.push(new thermostatAccessory(this, existingAccessory))
|
|
this.accessories.push(new thermostatAccessory(this, existingAccessory))
|
|
|
|
|
+ } else if (existingAccessory.context.device.type == 'SmokeDetector') {
|
|
|
|
|
+ this.accessories.push(new smokeDetectorAccessory(this, existingAccessory))
|
|
|
|
|
+ } else if (existingAccessory.context.device.type == 'SecuritySystem') {
|
|
|
|
|
+ this.accessories.push(new securitySystemAccessory(this, existingAccessory))
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
this.log.info('+ ' + device.type + ': ' + device.deviceName)
|
|
this.log.info('+ ' + device.type + ': ' + device.deviceName)
|
|
@@ -187,8 +216,14 @@ export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
|
this.accessories.push(new motionSensorAccessory(this, accessory))
|
|
this.accessories.push(new motionSensorAccessory(this, accessory))
|
|
|
} else if (accessory.context.device.type == 'Camera') {
|
|
} else if (accessory.context.device.type == 'Camera') {
|
|
|
this.accessories.push(new cameraAccessory(this, accessory))
|
|
this.accessories.push(new cameraAccessory(this, accessory))
|
|
|
|
|
+// } else if (accessory.context.device.type == 'Activity') {
|
|
|
|
|
+// this.accessories.push(new activityAccessory(this, accessory))
|
|
|
} else if (accessory.context.device.type == 'Thermostat') {
|
|
} else if (accessory.context.device.type == 'Thermostat') {
|
|
|
this.accessories.push(new thermostatAccessory(this, accessory))
|
|
this.accessories.push(new thermostatAccessory(this, accessory))
|
|
|
|
|
+ } else if (accessory.context.device.type == 'SmokeDetector') {
|
|
|
|
|
+ this.accessories.push(new smokeDetectorAccessory(this, accessory))
|
|
|
|
|
+ } else if (accessory.context.device.type == 'SecuritySystem') {
|
|
|
|
|
+ this.accessories.push(new securitySystemAccessory(this, accessory))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory])
|
|
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory])
|