Added serial
This commit is contained in:
parent
3ed830ecee
commit
3d868a5179
7
index.js
7
index.js
@ -142,10 +142,12 @@ SmartHomeNGAccessory.prototype = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// construct service and characteristics according to device type
|
// construct service and characteristics according to device type
|
||||||
|
var serial = "unknown";
|
||||||
switch (this.config.type.toLowerCase()) {
|
switch (this.config.type.toLowerCase()) {
|
||||||
// Lightbulb service
|
// Lightbulb service
|
||||||
case 'fan':
|
case 'fan':
|
||||||
myServices.push(this.getFanService(this.config));
|
myServices.push(this.getFanService(this.config));
|
||||||
|
serial = this.config.onoff;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'temperaturesensor':
|
case 'temperaturesensor':
|
||||||
@ -158,6 +160,7 @@ SmartHomeNGAccessory.prototype = {
|
|||||||
|
|
||||||
case 'lightbulb':
|
case 'lightbulb':
|
||||||
myServices.push(this.getLightbulbService(this.config));
|
myServices.push(this.getLightbulbService(this.config));
|
||||||
|
serial = this.config.onoff;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'windowcovering':
|
case 'windowcovering':
|
||||||
@ -166,10 +169,12 @@ SmartHomeNGAccessory.prototype = {
|
|||||||
|
|
||||||
case 'occupancysensor':
|
case 'occupancysensor':
|
||||||
myServices.push(this.getOccupancySensorService(this.config));
|
myServices.push(this.getOccupancySensorService(this.config));
|
||||||
|
serial = this.config.motiondetected;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'motionsensor':
|
case 'motionsensor':
|
||||||
myServices.push(this.getMotionSensorService(this.config));
|
myServices.push(this.getMotionSensorService(this.config));
|
||||||
|
serial = this.config.motiondetected;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// If no supported type is found warn user and return empty services
|
// If no supported type is found warn user and return empty services
|
||||||
@ -184,7 +189,7 @@ SmartHomeNGAccessory.prototype = {
|
|||||||
informationService
|
informationService
|
||||||
.setCharacteristic(Characteristic.Manufacturer, "Opensource Community")
|
.setCharacteristic(Characteristic.Manufacturer, "Opensource Community")
|
||||||
.setCharacteristic(Characteristic.Model, "SmartHomeNG device")
|
.setCharacteristic(Characteristic.Model, "SmartHomeNG device")
|
||||||
.setCharacteristic(Characteristic.SerialNumber, "beta");
|
.setCharacteristic(Characteristic.SerialNumber, serial);
|
||||||
myServices.push(informationService);
|
myServices.push(informationService);
|
||||||
|
|
||||||
return myServices;
|
return myServices;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user