Skip to content

Commit

Permalink
v1.8.0 (#196)
Browse files Browse the repository at this point in the history
## [Version 1.8.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.8.0) (2022-01-14)

## What's Changed
* Added option to display Bot a Stateful Programmable Switch.
    * This will only Works in 3rd Party Home App, Like [Eve](https://apps.apple.com/us/app/eve-for-homekit/id917695792) or [Home+ 5](https://apps.apple.com/us/app/home-5/id995994352)
* Add option to Hide Motion Sensor's Light Sensor.
* Add option to Set Motion Sensor's Light Sensor `set_minLux` and `set_maxLux`.
* Fixed Bug: Where BLE config would show for devices that don't support BLE.
* Fixed Bug: Contact Sensors's Motion Sensor and Light Sensor showing undefined values.
* Fixed Bug: Motion Sensors's Light Sensor showing undefined values.
* Fixed Bug: Battery Service wouldn't be removed from Curtain, Contact Sensor, or Motion Sensor when switching from BLE to OpenAPI.
* Enhancments: Made some improvemnt on the switch from BLE to OpenAPI when BLE connection fails.
* Enhancments: Made Optional Switchbot Device Settings and Optional IR Device Settings more managable by using Tabs.
* Change: Changed Curtain `refreshRate` to `updateRate`.
    * You will have to update your config for it to pickup the new `updateRate`.
* Housekeeping and updated dependencies.

**Full Changelog**: v1.7.0...v1.8.0
  • Loading branch information
donavanbecker authored Jan 15, 2022
1 parent 5ecd084 commit ccce7e1
Show file tree
Hide file tree
Showing 23 changed files with 1,262 additions and 845 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/)

## [Version 1.8.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.8.0) (2022-01-14)

## What's Changed
* Added option to display Bot a Stateful Programmable Switch.
* This will only Works in 3rd Party Home App, Like [Eve](https://apps.apple.com/us/app/eve-for-homekit/id917695792) or [Home+ 5](https://apps.apple.com/us/app/home-5/id995994352)
* Add option to Hide Motion Sensor's Light Sensor.
* Add option to Set Motion Sensor's Light Sensor `set_minLux` and `set_maxLux`.
* Fixed Bug: Where BLE config would show for devices that don't support BLE.
* Fixed Bug: Contact Sensors's Motion Sensor and Light Sensor showing undefined values.
* Fixed Bug: Motion Sensors's Light Sensor showing undefined values.
* Fixed Bug: Battery Service wouldn't be removed from Curtain, Contact Sensor, or Motion Sensor when switching from BLE to OpenAPI.
* Enhancments: Made some improvemnt on the switch from BLE to OpenAPI when BLE connection fails.
* Enhancments: Made Optional Switchbot Device Settings and Optional IR Device Settings more managable by using Tabs.
* Change: Changed Curtain `refreshRate` to `updateRate`.
* You will have to update your config for it to pickup the new `updateRate`.
* Housekeeping and updated dependencies.

**Full Changelog**: https://github.com/OpenWonderLabs/homebridge-switchbot/compare/v1.7.0...v1.8.0

## [Version 1.7.0](https://github.com/OpenWonderLabs/homebridge-switchbot/releases/tag/v1.7.0) (2022-01-05)

## What's Changed
Expand Down
140 changes: 104 additions & 36 deletions config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,27 +11,28 @@
"name": {
"type": "string",
"title": "Name",
"default": "SwitchBot",
"required": true
"default": "SwitchBot"
},
"credentials": {
"type": "object",
"properties": {
"openToken": {
"title": "Token",
"type": "string",
"required": true,
"x-schema-form": {
"type": "password"
}
},
"notice": {
"title": "Notice",
"type": "string",
"required": true,
"default": "Keep your token a secret!"
}
}
},
"required": [
"openToken",
"notice"
]
},
"options": {
"type": "object",
Expand All @@ -52,7 +53,7 @@
"type": "string",
"placeholder": "SwitchBot",
"condition": {
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId && model.options.devices[arrayIndices].ble && !model.options.devices[arrayIndices].hide_device);"
"functionBody": "return (model.options && model.options.devices && model.options.devices[arrayIndices].deviceId);"
}
},
"hide_device": {
Expand Down Expand Up @@ -137,11 +138,11 @@
"title": "Enable Bluetooth Low Energy (BLE) Connection",
"type": "boolean",
"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 === 'Humidifier' || model.options.devices[arrayIndices].configDeviceType === 'Meter' || model.options.devices[arrayIndices].configDeviceType === 'Curtain' || model.options.devices[arrayIndices].configDeviceType === 'Bot'));"
}
},
"scanDuration": {
"title": "Scan Duration (Default is 1 Second)",
"title": "BLE Scan Duration (Default is 1 Second)",
"type": "number",
"placeholder": 1,
"condition": {
Expand Down Expand Up @@ -224,6 +225,12 @@
"windowcovering"
]
},
{
"title": "Stateful Programmable Switch (Only Works in 3rd Party Home Apps)",
"enum": [
"stateful"
]
},
{
"title": "Switch",
"enum": [
Expand Down Expand Up @@ -315,8 +322,8 @@
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Curtain' && model.options.devices[arrayIndices].deviceId);"
}
},
"refreshRate": {
"title": "Curtain Refresh Rate",
"updateRate": {
"title": "Curtain Update Rate",
"type": "number",
"minimum": 1,
"placeholder": 5,
Expand Down Expand Up @@ -367,6 +374,22 @@
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId);"
}
},
"set_minlux": {
"title": "Set Min Lux",
"type": "number",
"placeholder": "1",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].contact.hide_lightsensor);"
}
},
"set_maxlux": {
"title": "Set Max Lux",
"type": "number",
"placeholder": "6001",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Contact Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].contact.hide_lightsensor);"
}
},
"hide_motionsensor": {
"title": "Hide Contact Sensor's Motion Sensor",
"type": "boolean",
Expand All @@ -376,6 +399,34 @@
}
}
},
"motion": {
"type": "object",
"properties": {
"hide_lightsensor": {
"title": "Hide Motion Sensor's Light Sensor",
"type": "boolean",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId);"
}
},
"set_minlux": {
"title": "Set Min Lux",
"type": "number",
"placeholder": "1",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].motion.hide_lightsensor);"
}
},
"set_maxlux": {
"title": "Set Max Lux",
"type": "number",
"placeholder": "6001",
"condition": {
"functionBody": "return (model.options && model.options.devices && !model.options.devices[arrayIndices].hide_device && model.options.devices[arrayIndices].configDeviceType === 'Motion Sensor' && model.options.devices[arrayIndices].deviceId && !model.options.devices[arrayIndices].motion.hide_lightsensor);"
}
}
}
},
"colorbulb": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -405,7 +456,7 @@
"placeholder": 360,
"description": "Indicates the number of seconds between polls of SwitchBot API.",
"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);"
}
},
"logging": {
Expand All @@ -432,11 +483,17 @@
}
],
"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);"
}
}
}
}
},
"required": [
"deviceId",
"configDeviceType",
"configDeviceName"
]
},
"uniqueItems": true
},
"irdevices": {
"type": "array",
Expand Down Expand Up @@ -754,11 +811,16 @@
}
],
"condition": {
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device);"
"functionBody": "return (model.options && model.options.irdevices && model.options.irdevices[arrayIndices].deviceId && !model.options.irdevices[arrayIndices].hide_device && model.options.irdevices[arrayIndices].configRemoteType);"
}
}
}
}
},
"required": [
"deviceId",
"configRemoteType"
]
},
"uniqueItems": true
},
"refreshRate": {
"title": "Refresh Rate",
Expand Down Expand Up @@ -799,7 +861,10 @@
}
}
}
}
},
"required": [
"name"
]
},
"layout": [
{
Expand All @@ -812,28 +877,27 @@
]
},
{
"key": "options.devices",
"notitle": false,
"add": "Add Another Device",
"type": "fieldset",
"title": "Optional SwitchBot Device Settings",
"expandable": true,
"expanded": false,
"orderable": false,
"buttonText": "Add Device",
"items": [
{
"type": "div",
"displayFlex": true,
"flex-direction": "column",
"key": "options.devices",
"notitle": false,
"type": "tabarray",
"title": "{{ value.configDeviceName || value.deviceId || 'New SwitchBot Device' }}",
"expandable": true,
"expanded": false,
"orderable": false,
"items": [
"options.devices[].configDeviceName",
"options.devices[].deviceId",
"options.devices[].hide_device",
"options.devices[].configDeviceType",
"options.devices[].offline",
"options.devices[].ble",
"options.devices[].scanDuration",
"options.devices[].configDeviceType",
"options.devices[].bot.mode",
"options.devices[].bot.deviceType",
"options.devices[].bot.doublePress",
Expand All @@ -844,13 +908,18 @@
"options.devices[].curtain.set_minStep",
"options.devices[].curtain.set_min",
"options.devices[].curtain.set_max",
"options.devices[].curtain.refreshRate",
"options.devices[].curtain.updateRate",
"options.devices[].curtain.disable_group",
"options.devices[].curtain.hide_lightsensor",
"options.devices[].curtain.set_minlux",
"options.devices[].curtain.set_maxlux",
"options.devices[].contact.hide_lightsensor",
"options.devices[].contact.set_minlux",
"options.devices[].contact.set_maxlux",
"options.devices[].contact.hide_motionsensor",
"options.devices[].motion.hide_lightsensor",
"options.devices[].motion.set_minlux",
"options.devices[].motion.set_maxlux",
"options.devices[].colorbulb.set_minStep",
"options.devices[].colorbulb.adaptiveLightingShift",
"options.devices[].refreshRate",
Expand All @@ -860,20 +929,19 @@
]
},
{
"key": "options.irdevices",
"notitle": false,
"add": "Add Another IR Device",
"type": "fieldset",
"title": "Optional IR Device Settings",
"expandable": true,
"expanded": false,
"orderable": false,
"buttonText": "Add IR Device",
"items": [
{
"type": "div",
"displayFlex": true,
"flex-direction": "column",
"key": "options.irdevices",
"notitle": false,
"type": "tabarray",
"title": "{{ value.configDeviceName || value.deviceId || 'New IR Device' }}",
"expandable": true,
"expanded": false,
"orderable": false,
"items": [
"options.irdevices[].deviceId",
"options.irdevices[].hide_device",
Expand Down
Loading

0 comments on commit ccce7e1

Please sign in to comment.