|
@@ -11,6 +11,7 @@ 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 { httpServer } from './httpServer'
|
|
import { httpServer } from './httpServer'
|
|
|
|
|
|
|
|
export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
@@ -111,6 +112,16 @@ export class domoticaPlatform implements DynamicPlatformPlugin {
|
|
|
.catch((error) => {
|
|
.catch((error) => {
|
|
|
this.log.debug('cameraAccessory.discoverDevices Error ->' + error)
|
|
this.log.debug('cameraAccessory.discoverDevices Error ->' + error)
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
|
|
+ this.discoveryStarted('activityAccessory')
|
|
|
|
|
+ activityAccessory.discoverDevices(this)
|
|
|
|
|
+ .then((devices) => {
|
|
|
|
|
+ this.processDiscoveredDevices(devices)
|
|
|
|
|
+ this.discoveryCompleted('activityAccessory')
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((error) => {
|
|
|
|
|
+ this.log.debug('activityAccessory.discoverDevices Error ->' + error)
|
|
|
|
|
+ })
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
processDiscoveredDevices(domoticaDevices: device[]) {
|
|
processDiscoveredDevices(domoticaDevices: device[]) {
|
|
@@ -143,6 +154,8 @@ 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 {
|
|
} else {
|
|
|
this.log.info('+ ' + device.type + ': ' + device.deviceName)
|
|
this.log.info('+ ' + device.type + ': ' + device.deviceName)
|
|
@@ -164,6 +177,8 @@ 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))
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory])
|
|
this.api.registerPlatformAccessories(PLUGIN_NAME, PLATFORM_NAME, [accessory])
|