From b39b33726d2ad1fb6ad6459b7c7d1e2013b4f41b Mon Sep 17 00:00:00 2001 From: S'pht'Kr Date: Mon, 14 Sep 2015 05:43:11 +0200 Subject: [PATCH] Make TargetHeatingCoolingState writable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- platforms/ZWayServer.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platforms/ZWayServer.js b/platforms/ZWayServer.js index 322b9fb..5b79c8e 100644 --- a/platforms/ZWayServer.js +++ b/platforms/ZWayServer.js @@ -458,7 +458,12 @@ ZWayServerAccessory.prototype = { debug("Getting value for " + vdev.metrics.title + ", characteristic \"" + cx.displayName + "\"..."); 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; }