mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
Make TargetHeatingCoolingState writable
Apparently, if TargetHeatingCoolingState is not writable, you can’t add a thermostat to a scene. This fix makes it writable from HomeKit, but it still always remains set to HEAT.
This commit is contained in:
@@ -458,7 +458,12 @@ ZWayServerAccessory.prototype = {
|
|||||||
debug("Getting value for " + vdev.metrics.title + ", characteristic \"" + cx.displayName + "\"...");
|
debug("Getting value for " + vdev.metrics.title + ", characteristic \"" + cx.displayName + "\"...");
|
||||||
callback(false, Characteristic.TargetHeatingCoolingState.HEAT);
|
callback(false, Characteristic.TargetHeatingCoolingState.HEAT);
|
||||||
});
|
});
|
||||||
cx.writable = false;
|
// Hmm... apparently if this is not setable, we can't add a thermostat change to a scene. So, make it writable but a no-op.
|
||||||
|
cx.writable = true;
|
||||||
|
cx.on('set', function(newValue, callback){
|
||||||
|
debug("WARN: Set of TargetHeatingCoolingState not yet implemented, resetting to HEAT!")
|
||||||
|
callback(undefined, Characteristic.TargetHeatingCoolingState.HEAT);
|
||||||
|
}.bind(this));
|
||||||
return cx;
|
return cx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user