homebridge-bigAssFans
Advanced tools
Comparing version 0.0.2 to 0.0.3
64
index.js
@@ -57,2 +57,35 @@ var bigAssApi = require("BigAssFansAPI"); | ||
/******************************************** | ||
* Wrappers for various get and set functions | ||
********************************************/ | ||
var passThroughWrapper = function(value) { | ||
return value; | ||
} | ||
var boolGetWrapper = function(value) { | ||
return value > 0; | ||
} | ||
var lightSetWrapper = function(value) { | ||
return (value ? this.lightOn : 0); | ||
}.bind(this) | ||
var fanSetWrapper = function(value) { | ||
return (value ? this.fanOn : 0); | ||
}.bind(this) | ||
var fanRotationSetWrapper = function(value) { | ||
return (value == Characteristic.RotationDirection.CLOCKWISE ? true : false); | ||
} | ||
var fanRotationGetWrapper = function(value) { | ||
return (value ? Characteristic.RotationDirection.CLOCKWISE : Characteristic.RotationDirection.COUNTER_CLOCKWISE); | ||
} | ||
var occupancyGetWrapper = function(value) { | ||
return (value ? Characteristic.OccupancyDetected.OCCUPANCY_DETECTED : Characteristic.OccupancyDetected.OCCUPANCY_NOT_DETECTED); | ||
} | ||
this.lightService = new Service.Lightbulb(this.name); | ||
@@ -109,32 +142,1 @@ | ||
/******************************************** | ||
* Wrappers for various get and set functions | ||
********************************************/ | ||
var passThroughWrapper = function(value) { | ||
return value; | ||
} | ||
var boolGetWrapper = function(value) { | ||
return value > 0; | ||
} | ||
var lightSetWrapper = function(value) { | ||
return (value ? this.lightOn : 0); | ||
} | ||
var fanSetWrapper = function(value) { | ||
return (value ? this.fanOn : 0); | ||
} | ||
var fanRotationSetWrapper = function(value) { | ||
return (value == Characteristic.RotationDirection.CLOCKWISE ? true : false); | ||
} | ||
var fanRotationGetWrapper = function(value) { | ||
return (value ? Characteristic.RotationDirection.CLOCKWISE : Characteristic.RotationDirection.COUNTER_CLOCKWISE); | ||
} | ||
var occupancyGetWrapper = function(value) { | ||
return (value ? Characteristic.OccupancyDetected.OCCUPANCY_DETECTED : Characteristic.OccupancyDetected.OCCUPANCY_NOT_DETECTED); | ||
} |
{ | ||
"name": "homebridge-bigAssFans", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "A Homebridge plugin for Big Ass Fans", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
8235