diff --git a/index.js b/index.js index dc96e7d..a504998 100644 --- a/index.js +++ b/index.js @@ -19,14 +19,15 @@ Configuration example for your Homebridge config.json: "includeActions": true, "includeIds": [ "12345", "67890" ], "excludeIds": [ "98765", "43210" ], - "treatAsSwitchIds": [ "13579", "24680" ], - "treatAsLockIds": [ "112233", "445566" ], + "treatAsContactSensorIds": [ "446688" ], "treatAsDoorIds": [ "224466", "664422" ], + "treatAsFanIds": [ "4444441", "4444442" ], "treatAsGarageDoorIds": [ "223344", "556677" ], + "treatAsLockIds": [ "112233", "445566" ], "treatAsMotionSensorIds": [ "336699" ], - "treatAsContactSensorIds": [ "446688" ], - "treatAsWindowIds": [ "123123", "456456" ], + "treatAsSwitchIds": [ "13579", "24680" ], "treatAsWindowCoveringIds": [ "345345", "678678" ], + "treatAsWindowIds": [ "123123", "456456" ], "invertOnOffIds": [ "234234", "567567" ], "thermostatsInCelsius": false, "accessoryNamePrefix": "", @@ -46,14 +47,15 @@ Fields: "includeActions": If true, creates HomeKit switches for your actions (optional, defaults to false) "includeIds": Array of Indigo IDs to include (optional - if provided, only these Indigo IDs will map to HomeKit devices) "excludeIds": Array of Indigo IDs to exclude (optional - if provided, these Indigo IDs will not be mapped to HomeKit devices) - "treatAsSwitchIds": Array of Indigo IDs to treat as switches (instead of lightbulbs) - devices must support on/off to qualify - "treatAsLockIds": Array of Indigo IDs to treat as locks (instead of lightbulbs) - devices must support on/off to qualify (on = locked) + "treatAsContactSensorIds": Array of Indigo IDs to treat as contact sensors - devices must support on/off to qualify (on = contact detected) "treatAsDoorIds": Array of Indigo IDs to treat as doors (instead of lightbulbs) - devices must support on/off to qualify (on = open) + "treatAsFanIds": Array of Indigo IDs to treat as fans (instead of lightbulbs) = devices must support on/off to qualify. "treatAsGarageDoorIds": Array of Indigo IDs to treat as garage door openers (instead of lightbulbs) - devices must support on/off to qualify (on = open) + "treatAsLockIds": Array of Indigo IDs to treat as locks (instead of lightbulbs) - devices must support on/off to qualify (on = locked) "treatAsMotionSensorIds": Array of Indigo IDs to treat as motion sensors - devices must support on/off to qualify (on = triggered) - "treatAsContactSensorIds": Array of Indigo IDs to treat as contact sensors - devices must support on/off to qualify (on = contact detected) - "treatAsWindowIds": Array of Indigo IDs to treat as windows (instead of lightbulbs) - devices must support on/off to qualify (on = open) + "treatAsSwitchIds": Array of Indigo IDs to treat as switches (instead of lightbulbs) - devices must support on/off to qualify "treatAsWindowCoveringIds": Array of Indigo IDs to treat as window coverings (instead of lightbulbs) - devices must support on/off to qualify (on = open) + "treatAsWindowIds": Array of Indigo IDs to treat as windows (instead of lightbulbs) - devices must support on/off to qualify (on = open) "invertOnOffIds": Array of Indigo IDs where on and off are inverted in meaning (e.g. if a lock, on = unlocked and off = locked) "thermostatsInCelsius": If true, thermostats in Indigo are reporting temperatures in celsius (optional, defaults to false) "accessoryNamePrefix": Prefix all accessory names with this string (optional, useful for testing) @@ -174,6 +176,7 @@ function IndigoPlatform(log, config) { this.treatAsContactSensorIds = config.treatAsContactSensorIds; this.treatAsWindowIds = config.treatAsWindowIds; this.treatAsWindowCoveringIds = config.treatAsWindowCoveringIds; + this.treatAsFanIds = config.treatAsFanIds; this.invertOnOffIds = config.invertOnOffIds; this.thermostatsInCelsius = config.thermostatsInCelsius; @@ -391,6 +394,9 @@ IndigoPlatform.prototype.createAccessoryFromJSON = function(deviceURL, json) { } else if (json.typeSupportsOnOff && this.treatAsSwitchIds && (this.treatAsSwitchIds.indexOf(String(json.id)) >= 0)) { return new IndigoSwitchAccessory(this, deviceURL, json); + } else if (json.typeSupportsOnOff && this.treatAsFanIds && + (this.treatAsFanIds.indexOf(String(json.id)) >= 0)) { + return new IndigoFanAccessory(this, deviceURL, json); } else if (json.typeSupportsOnOff && this.treatAsLockIds && (this.treatAsLockIds.indexOf(String(json.id)) >= 0)) { return new IndigoLockAccessory(this, deviceURL, json);