Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 45 additions & 15 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@
"sensors": {
"type": "array",
"title": "Sensors",
"default": [],
"minItems": 0,
"description": "Create contact, motion, occupancy, smoke, temperature, humidity, airquality, light, or leak sensors.",
"items": {
"title": "Sensors",
Expand All @@ -84,7 +86,7 @@
"title": "Name",
"type": "string",
"placeholder": "Sensor 1",
"required": false
"required": true
},
"type": {
"title": "Type",
Expand Down Expand Up @@ -119,6 +121,8 @@
"switches": {
"type": "array",
"title": "Switches",
"default": [],
"minItems": 0,
"description": "Turn on and off switches by triggering a URL from any system.",
"items": {
"title": "Switches",
Expand All @@ -134,7 +138,7 @@
"title": "Name",
"type": "string",
"placeholder": "Switch 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -196,6 +200,8 @@
"pushbuttons": {
"type": "array",
"title": "Sensors",
"default": [],
"minItems": 0,
"description": "Push Buttons by triggerring a URL from any system. The button will be released automatically.",
"items": {
"title": "Sensors",
Expand All @@ -211,7 +217,7 @@
"title": "Name",
"type": "string",
"placeholder": "Push Button 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -249,6 +255,8 @@
"doorbells": {
"type": "array",
"title": "Doorbells",
"default": [],
"minItems": 0,
"description": "Ring doorbells via a URL from any system.",
"items": {
"title": "Doorbells",
Expand All @@ -264,7 +272,7 @@
"title": "Name",
"type": "string",
"placeholder": "Doorbell 1",
"required": false
"required": true
},
"double_press": {
"title": "Enable Double Press",
Expand All @@ -282,6 +290,8 @@
"lights": {
"type": "array",
"title": "Lights",
"default": [],
"minItems": 0,
"description": "Turn on and off Lights by triggering a URL from any system.",
"items": {
"title": "Lights",
Expand All @@ -297,7 +307,7 @@
"title": "Name",
"type": "string",
"placeholder": "Light 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -394,6 +404,8 @@
"co2sensors": {
"type": "array",
"title": "CO2 Sensor",
"default": [],
"minItems": 0,
"description": "Control a CO2 sensor by updating the PPM value.",
"items": {
"title": "CO2 Sensors",
Expand All @@ -409,7 +421,7 @@
"title": "Name",
"type": "string",
"placeholder": "CO2 sensor 1",
"required": false
"required": true
},
"co2_peak_level": {
"title": "CO2 peak level",
Expand All @@ -422,6 +434,8 @@
"thermostats": {
"type": "array",
"title": "Thermostats",
"default": [],
"minItems": 0,
"description": "Control a thermostat by updating four different values.",
"items": {
"title": "Thermostats",
Expand All @@ -437,7 +451,7 @@
"title": "Name",
"type": "string",
"placeholder": "Thermostat 1",
"required": false
"required": true
},
"minTemp": {
"title": "Lower bound for the temperature selector in the Home app",
Expand Down Expand Up @@ -517,6 +531,8 @@
"outlets": {
"type": "array",
"title": "Outlets",
"default": [],
"minItems": 0,
"description": "Turn on and off Outlets by triggering a URL from any system.",
"items": {
"title": "Outlets",
Expand All @@ -532,7 +548,7 @@
"title": "Name",
"type": "string",
"placeholder": "Outlet 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -594,6 +610,8 @@
"security": {
"type": "array",
"title": "Security",
"default": [],
"minItems": 0,
"description": "Control a security system by updating two different values.",
"items": {
"title": "Security",
Expand All @@ -609,7 +627,7 @@
"title": "Name",
"type": "string",
"placeholder": "Security 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -647,6 +665,8 @@
"garagedooropeners": {
"type": "array",
"title": "Garage Door Openers",
"default": [],
"minItems": 0,
"description": "Control a garage door opener by updating three different values.",
"items": {
"title": "Garage Door Openers",
Expand All @@ -662,7 +682,7 @@
"title": "Name",
"type": "string",
"placeholder": "Garage Door Opener 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -724,6 +744,8 @@
"statelessswitches": {
"type": "array",
"title": "Stateless Switches",
"default": [],
"minItems": 0,
"description": "Stateless switches requires 3 parameters accessoryId, buttonName and the event to trigger: Single press = 0, Double press = 1, Long press = 2.",
"items": {
"title": "Stateless Switches",
Expand All @@ -739,7 +761,7 @@
"title": "Name",
"type": "string",
"placeholder": "Stateless Switch 1",
"required": false
"required": true
},
"buttons": {
"type": "array",
Expand Down Expand Up @@ -773,6 +795,8 @@
"windowcoverings": {
"type": "array",
"title": "Window Coverings",
"default": [],
"minItems": 0,
"description": "Control a window coverings by updating three different values.",
"items": {
"title": "Window Coverings",
Expand All @@ -788,7 +812,7 @@
"title": "Name",
"type": "string",
"placeholder": "Window Covering 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -952,6 +976,8 @@
"lockmechanisms": {
"type": "array",
"title": "Lock Mechanisms",
"default": [],
"minItems": 0,
"description": "Control a lock mechanism by updating two different values.",
"items": {
"title": "Lock Mechanisms",
Expand All @@ -967,7 +993,7 @@
"title": "Name",
"type": "string",
"placeholder": "Lock 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -1029,6 +1055,8 @@
"fanv2s": {
"type": "array",
"title": "Fanv2",
"default": [],
"minItems": 0,
"description": "Turn on and off Fanv2s by triggering a URL from any system.",
"items": {
"title": "Fanv2s",
Expand All @@ -1044,7 +1072,7 @@
"title": "Name",
"type": "string",
"placeholder": "Fanv2 1",
"required": false
"required": true
},
"rejectUnauthorized": {
"title": "Reject Unauthorized SSL Certificate",
Expand Down Expand Up @@ -1276,6 +1304,8 @@
"valves": {
"type": "array",
"title": "Valves",
"default": [],
"minItems": 0,
"description": "Turn on and off valves by triggering a URL from any system.",
"items": {
"title": "Valves",
Expand All @@ -1291,7 +1321,7 @@
"title": "Name",
"type": "string",
"placeholder": "Valve 1",
"required": false
"required": true
},
"type": {
"title": "Type",
Expand Down
32 changes: 16 additions & 16 deletions src/homekit/HttpWebHooksPlatform.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ function HttpWebHooksPlatform(log, config, homebridge) {
dir : this.cacheDirectory
});

this.sensors = config["sensors"] || [];
this.switches = config["switches"] || [];
this.pushButtons = config["pushbuttons"] || [];
this.doorbells = config["doorbells"] || [];
this.lights = config["lights"] || [];
this.thermostats = config["thermostats"] || [];
this.outlets = config["outlets"] || [];
this.security = config["security"] || [];
this.garageDoorOpeners = config["garagedooropeners"] || [];
this.statelessSwitches = config["statelessswitches"] || [];
this.windowCoverings = config["windowcoverings"] || [];
this.lockMechanisms = config["lockmechanisms"] || [];
this.fanv2s = config["fanv2s"] || [];
this.co2sensors = config["co2sensors"] || [];
this.valves = config["valves"] || [];

this.sensors = (config["sensors"] || []).filter(x => x && x.name);
this.switches = (config["switches"] || []).filter(x => x && x.name);
this.pushButtons = (config["pushbuttons"] || []).filter(x => x && x.name);
this.doorbells = (config["doorbells"] || []).filter(x => x && x.name);
this.lights = (config["lights"] || []).filter(x => x && x.name);
this.thermostats = (config["thermostats"] || []).filter(x => x && x.name);
this.outlets = (config["outlets"] || []).filter(x => x && x.name);
this.security = (config["security"] || []).filter(x => x && x.name);
this.garageDoorOpeners = (config["garagedooropeners"] || []).filter(x => x && x.name);
this.statelessSwitches = (config["statelessswitches"] || []).filter(x => x && x.name);
this.windowCoverings = (config["windowcoverings"] || []).filter(x => x && x.name);
this.lockMechanisms = (config["lockmechanisms"] || []).filter(x => x && x.name);
this.fanv2s = (config["fanv2s"] || []).filter(x => x && x.name);
this.co2sensors = (config["co2sensors"] || []).filter(x => x && x.name);
this.valves = (config["valves"] || []).filter(x => x && x.name);
this.server = new Server(Service, Characteristic, this, config);
};

Expand Down