homebridge-syntex-dynamic-platform
Advanced tools
Comparing version 1.0.8-b83 to 1.0.8-b84
30
main.js
@@ -220,3 +220,3 @@ const fs = require('fs'), path = require('path'); | ||
{ | ||
response.end('Error'); | ||
response.end(JSON.stringify(this._getAccessoryStates())); | ||
} | ||
@@ -558,4 +558,32 @@ }); | ||
} | ||
_getAccessoryStates() | ||
{ | ||
var states = {}; | ||
for(const accessory of this.accessories) | ||
{ | ||
if(accessory[1].services != null) | ||
{ | ||
for(const service of accessory[1].service) | ||
{ | ||
if(service.letters != null) | ||
{ | ||
var state = this.readAccessoryService(accessory[1].id, service.letters, false); | ||
if(states[accessory[1].id] == null) | ||
{ | ||
states[accessory[1].id] = {}; | ||
} | ||
states[accessory[1].id][service.letters] = state; | ||
} | ||
} | ||
} | ||
} | ||
return states; | ||
} | ||
} | ||
module.exports = { DynamicPlatform, UniversalAccessory, AccessoryInformationService, DebugService, OutletService, SwitchService, LightBulbService, DimmedBulbService, ColoredBulbService, ContactService, LightService, MotionService, TemperatureService, HumidityService, LeakService, OccupancyService, StatelessSwitchService, SmokeService, AirQualityService, BlindService, ThermostatService, FanService }; |
{ | ||
"name": "homebridge-syntex-dynamic-platform", | ||
"version": "1.0.8-b83", | ||
"version": "1.0.8-b84", | ||
"description": "A Dynamic Platform Accessory", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -214,4 +214,9 @@ module.exports = class BaseService | ||
{ | ||
var state = {}; | ||
var characteristics = this.TypeManager.getCharacteristics({ letters : this.letters }), state = {}; | ||
for(const key in characteristics) | ||
{ | ||
state[key] = characteristics[key].default; | ||
} | ||
if(this.homebridgeAccessory != null | ||
@@ -224,9 +229,2 @@ && this.homebridgeAccessory.context != null | ||
{ | ||
var characteristic = this.TypeManager.getCharacteristic(key, { letters : this.letters }); | ||
if(characteristic != null) | ||
{ | ||
state[key] = characteristic.default; | ||
} | ||
if(this.homebridgeAccessory.context.data[this.letters][key] != null) | ||
@@ -233,0 +231,0 @@ { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103528
3036