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:
S'pht'Kr
2015-09-14 05:43:11 +02:00
parent 80f73f8324
commit b39b33726d

View File

@@ -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;
} }