Skip to content

Commit

Permalink
Added Hub 2 Temperature and Humidity Support. (#716)
Browse files Browse the repository at this point in the history
  • Loading branch information
alvst committed Apr 14, 2023
1 parent a0390f6 commit 741cd85
Show file tree
Hide file tree
Showing 4 changed files with 489 additions and 2 deletions.
28 changes: 27 additions & 1 deletion config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@
"title": "Motion Sensor",
"enum": ["Motion Sensor"]
},

{
"title": "Hub 2",
"enum": ["Hub 2"]
},
{
"title": "Contact Sensor",
"enum": ["Contact Sensor"]
Expand Down Expand Up @@ -184,7 +189,7 @@
],
"description": "Bluetooth (BLE) API is only available for the following Device Types: Humidifier, Meter, MeterPlus, Curtain, Bot, Motion Sensor, Contact Sensor, Plug Mini (US), Plug Mini (JP), & Color Bulb",
"condition": {
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device);"
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType !== 'Hub 2');"
}
},
"customBLEaddress": {
Expand All @@ -203,6 +208,25 @@
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].connectionType === 'BLE' || model.options.devices[arrayIndices].connectionType === 'BLE/OpenAPI'));"
}
},
"hidHub": {
"type": "object",
"properties": {
"hide_temperature": {
"title": "Hide Hub 2's Temperature Sensor",
"type": "boolean",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2') && model.options.devices[arrayIndices].deviceId);"
}
},
"hide_humidity": {
"title": "Hide Hub 2's Humidity Sensor",
"type": "boolean",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && (model.options.devices[arrayIndices].configDeviceType === 'Hub 2') && model.options.devices[arrayIndices].deviceId);"
}
}
}
},
"bot": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -1134,6 +1158,8 @@
"options.devices[].hide_device",
"options.devices[].configDeviceType",
"options.devices[].connectionType",
"options.devices[].hidHub.hide_temperature",
"options.devices[].hidHub.hide_humidity",
"options.devices[].scanDuration",
"options.devices[].disableCaching",
"options.devices[].maxRetry",
Expand Down
Loading

0 comments on commit 741cd85

Please sign in to comment.