Update Accessories
This commit is contained in:
+4
-14
@@ -23,9 +23,9 @@ export class activityAccessory extends accessory {
|
||||
typeId: device.id,
|
||||
uniqueId: "Activity." + device.id,
|
||||
deviceName: device.name,
|
||||
switchable: device.switchable,
|
||||
dimmable: "true",
|
||||
detailedType: device.type
|
||||
switchable: "false",
|
||||
dimmable: "false",
|
||||
detailedType: ""
|
||||
}
|
||||
activityDevices.push(object)
|
||||
}
|
||||
@@ -49,22 +49,12 @@ export class activityAccessory extends accessory {
|
||||
.setCharacteristic(this.platform.Characteristic.Model, 'Domotica-Activity')
|
||||
.setCharacteristic(this.platform.Characteristic.SerialNumber, '08000' + accessory.context.device.typeId)
|
||||
|
||||
//*
|
||||
this.service = this.accessory.getService(this.platform.Service.Switch) || this.accessory.addService(this.platform.Service.Switch)
|
||||
|
||||
this.service.getCharacteristic(this.platform.Characteristic.On)
|
||||
.onGet(this.getOn.bind(this))
|
||||
.onSet(this.setOn.bind(this));
|
||||
/*/
|
||||
this.service = this.accessory.getService(this.platform.Service.StatefulProgrammableSwitch) || this.accessory.addService(this.platform.Service.StatefulProgrammableSwitch)
|
||||
|
||||
this.service.getCharacteristic(this.platform.Characteristic.ProgrammableSwitchEvent)
|
||||
.onGet(this.getOn.bind(this));
|
||||
|
||||
this.service.getCharacteristic(this.platform.Characteristic.ProgrammableSwitchOutputState)
|
||||
.onGet(this.getOn.bind(this))
|
||||
.onSet(this.setOn.bind(this));
|
||||
//*/
|
||||
this.setName(accessory.context.device.deviceName)
|
||||
}
|
||||
|
||||
@@ -85,7 +75,7 @@ export class activityAccessory extends accessory {
|
||||
|
||||
async setOn(value: CharacteristicValue) {
|
||||
// http://$domoticaIP/external/WebUpdate.php?data=Activity/$id/
|
||||
httpRequest("http://" + this.platform.config.hostname + '/external/WebUpdate.php?data=Activity/' + this.accessory.context.device.typeId + '/')
|
||||
httpRequest("http://" + 'administration-container:8080' + '/external/WebUpdate.php?data=Activity/' + this.accessory.context.device.typeId + '/')
|
||||
.catch((error) => {
|
||||
this.platform.log.debug('activityAccessory::setOn Error ->' + error)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user