mirror of
https://github.com/mtan93/homebridge.git
synced 2026-04-04 22:04:27 +01:00
add onRead functions to fetch state
This commit is contained in:
@@ -209,6 +209,11 @@ WinkAccessory.prototype = {
|
|||||||
},{
|
},{
|
||||||
cType: types.POWER_STATE_CTYPE,
|
cType: types.POWER_STATE_CTYPE,
|
||||||
onUpdate: function(value) { that.setPowerState(value); },
|
onUpdate: function(value) { that.setPowerState(value); },
|
||||||
|
onRead: function(callback) {
|
||||||
|
that.getPowerState(function(powerState){
|
||||||
|
callback(powerState);
|
||||||
|
});
|
||||||
|
},
|
||||||
perms: ["pw","pr","ev"],
|
perms: ["pw","pr","ev"],
|
||||||
format: "bool",
|
format: "bool",
|
||||||
initialValue: 0,
|
initialValue: 0,
|
||||||
@@ -219,6 +224,11 @@ WinkAccessory.prototype = {
|
|||||||
},{
|
},{
|
||||||
cType: types.BRIGHTNESS_CTYPE,
|
cType: types.BRIGHTNESS_CTYPE,
|
||||||
onUpdate: function(value) { that.setBrightness(value); },
|
onUpdate: function(value) { that.setBrightness(value); },
|
||||||
|
onRead: function(callback) {
|
||||||
|
that.getBrightness(function(level){
|
||||||
|
callback(level);
|
||||||
|
});
|
||||||
|
},
|
||||||
perms: ["pw","pr","ev"],
|
perms: ["pw","pr","ev"],
|
||||||
format: "int",
|
format: "int",
|
||||||
initialValue: 0,
|
initialValue: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user