Skip to content

Commit

Permalink
Merged in v2.x from homebridge-smartthings-v2 repo
Browse files Browse the repository at this point in the history
  • Loading branch information
tonesto7 committed May 17, 2020
1 parent 8e57cd7 commit 34a42e3
Show file tree
Hide file tree
Showing 82 changed files with 15,586 additions and 1,892 deletions.
33 changes: 33 additions & 0 deletions .esformatter
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"plugins": [
"esformatter-quotes",
"esformatter-braces",
"esformatter-semicolons"
],
"quotes": {
"type": "single",
"avoidEscape": false
},
"whiteSpace": {
"before": {
"ParameterList": -1,
"ParameterComma": -1,
"FunctionDeclarationOpeningBrace": -1,
"FunctionDeclarationClosingBrace": -1,
"ForStatementExpressionOpening": -1
},
"after": {
"FunctionName": -1,
"ParameterComma": 1,
"FunctionReservedWord": -1,
"ParameterList": -1,
"FunctionDeclarationOpeningBrace": -1,
"PropertyName": -1
}
},
"lineBreak": {
"before": {
"EndOfFile": 1
}
}
}
29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"env": {
"es6": true,
"node": true
},
"parserOptions": {
"ecmaVersion": 9,
"ecmaFeatures": {
"jsx": true
},
"sourceType": "module"
},
"rules": {
"semi": "error",
"eqeqeq": "error",
"no-const-assign": "warn",
"no-this-before-super": "warn",
"no-undef": "warn",
"no-unreachable": "warn",
"no-unused-vars": "warn",
"constructor-super": "warn",
"valid-typeof": "warn"
},
"extends": [
"eslint:recommended",
"prettier"
]
}
81 changes: 78 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,33 +1,108 @@
.vscode/*
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directory
node_modules
# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

tempCodeRunnerFile.js
AWS_Files/Testing/input.json
.vscode/settings.json
website/

config.json
accessories
auth.json
persist
.uix-secrets
auth.json

.uix-secrets
smartthings_rsa.pub
logaudit.json
homebridge-smartthings-v2-logaudit.json
accessories/cachedAccessories
12 changes: 12 additions & 0 deletions .snyk
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.14.1
ignore: {}
# patches apply the minimum changes required to fix a vulnerability
patch:
SNYK-JS-LODASH-567746:
- lodash:
patched: '2020-05-01T01:44:59.218Z'
- winston > async > lodash:
patched: '2020-05-01T01:44:59.218Z'
- portfinder-sync > portfinder > async > lodash:
patched: '2020-05-01T01:44:59.218Z'
56 changes: 56 additions & 0 deletions CHANGELOG-app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Changelog

## v2.3.3

- [FIX] Minor bugs and icons squashed.

## v2.3.2

- [NEW] Added support for bringing acceleration sensors into homekit as motion sensors.
- [FIX] Fixed issue with new Garage and Thermostat define type inputs from actually bringing in the devices.

## v2.3.1

- [FIX] Typo `?.` in code preventing saving in IDE.
- [NEW] Fixed new version info when using beta version of plugin.

## v2.3.0

- [REMOVE] Support for Local Commands removed (It doesn't really speed up anything anyways)
- [NEW] Added garage door, thermostat inputs to define device types
- [FIX] Minor bugfixes and optimizations.

## v2.2.1

- [FIX] Minor tweaks to support shades fixes in the plugin.

## v2.2.0

- [UPDATE] Added support for passing the pressed button number when provided.
- [FIX] Other minor bugfixes and optimizations.
- [REMOVE] Support for Energy and Power capabilities removed (for now).

## v2.1.1

- [UPDATE] The app now validates the appId on all local commands made to ST app so if you have more than one instance of the homebridge smartapp it doesn't start sending events to wrong plugin.

## v2.1.0

- [NEW] Added a Device Event and Command history page to review events and commands sent and received by the plugin.
- [UPDATE] Cleaned up some of the unnecessary attributes from the subscription logic.
- [FIX] Refactored the accessToken logic to be more consistent. #38
- [UPDATE] Modified the device event subscription process to reduce timeouts.
- [FIX] Other bug fixes, cleanups, and optimizations.

## v2.0.3

- [NEW] Added a new device data input where you can select a device and see all available attributes, capabilities, commands, and the last 30 events.
- [FIX] Other bug fixes and cleanups.

## v2.0.1

- [UPDATE] Reworked and cleaned up the UI so it's now more organized and easier to follow.
- [NEW] Added new capability filter options.
- [UPDATE] Optimized the command/event streaming system to perform faster and more reliably.
- [NEW] Added duplicate device detection cleanups so Homekit doesn't try to create duplicate devices and throw an error.
- [FIX] Many, many other bug fixes and cleanups.
103 changes: 103 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
## v2.3.4

- [REMOVE] Removing Sentry error reporting module prior to submitting plugin for verification under homebridge.

## v2.3.3

- [FIX] Packages updates.

## v2.3.2

- [NEW] Added support for bringing acceleration sensors into homekit as motion sensors.

## v2.3.1

- [FIX] Plugin wasn't sending pluginstatus and enable direct messages to SmartApp, so device events weren't being sent to the plugin
- [NEW] Changed some of the plugin version check logic. I also runs after every device refresh (~1 hour)

## v2.3.0

- [REMOVE] Support for Local Commands removed (It doesn't really speed up anything anyways)
- [NEW] Rate-Limiting of commands (debounce)
- [UPDATE] Command optimizations.
- [NEW] Switched web request library from Request-Promise to Axios.
- [FIX] StatusActive characteristic now reports correctly.
- [FIX] Minor bugfixes and optimizations.

## v2.2.1

- [FIX] Resolved the issue with Window Shades not working #71.
- [FIX] Resolve null Service types issue #74.

## v2.2.0

- [UPDATE] Button logic now generates the push/held actions for every button available on the remote now. Meaning you can select the parent remote and have it show actions for each button on the remote. NOTE: I've noticed that I need to open the home app once after adding the buttons to create the event connection.
- [FIX] Buttons should now work 100% again. Sorry about the issues.
- [FIX] Fixed the cannot read property of 'includes' and '\_events' errors.
- [FIX] Fixed some rare issues with requestPromises on device commands.
- [FIX] Lot's of other minor cleanup.
- [NEW] Direct port is now selected automatically using the direct_port config value as the start point for available port detection.
- [NEW] Logs now alert you when your local ST hub endpoint can't be reached.
- [NEW] Added a new config item to define your ST Community username in the error reporting so if you want me to be able to review your issues.
- [NEW] Added config item to allow you to disable error reporting.
- [UPDATE] Modified the point when the Sentry IO Error collector is loaded so it doesn't collect other plugin exceptions.replace
- [UPDATE] Updated Sentry.IO library to v5.11.1.
- [UPDATE] Changed the plugin to not list every single device loaded from cache and every device updated in the logs. They are only visible when debug option is enabled.
- [REMOVE] Support for Energy and Power capabilities removed (for now).

## v2.1.14 - v2.1.16

- [FIX] Thermostats should now update the state correctly and also auto mode is working again.

## v2.1.13

- [NEW] Added Sentry library to help collect/report anonymous error/exception data (absolutely no person data is shared with the exception of maybe a device label in the logs).
- [FIX] Thermostats should now update the state correctly.
- [FIX] Resolved the issue with Buttons crashing your entire HomeKit Instance.

## v2.1.1 - v2.1.12

- [UPDATE] Updated winston logger from v2 to v3 to help with issues running on Hoobs.
- [UPDATE] Added app id header to all local commands made to ST app so if you have more than one instance of the homebridge smartapp it doesn't start sending events to wrong plugin.
- [UPDATE] Updated the app config to allow setting the local_commands value.

## v2.1.0

- [UPDATE] Refactored the device service and characteristic logic so it's cleaner, more modular, and easier to maintain.
- [NEW] Device services and characteristics are now cleaned up when they are no longer used.
- [FIX] Lot's of fixes for device state updates and device commands.
- [FIX] Button events should now work again.
- [FIX] Updated the Hoobs config file (Plugin will be undergoing review by Hoobs to be certified soon) (@mkellsy)
- [FIX] Added support for AirPurifier & AirQuality (@danielskowronski)
- [FIX] Delays on device event updates resolved. (@devarshi) #33 #40
- [FIX] Thermostat Mode fixes (@torandreroland)
- [FIX] Dozens of other minor bugfixes and tweaks.

## v2.0.5 - v2.0.10

- [FIX] Fixed thermostat temp unit error.
- [FIX] removed token/id validation by default to prevent error with mismatched access_token | app_id.
- [FIX] Other minor bugfixes and tweaks.

## v2.0.4

- [FIX] Fixed AlarmStatus updates not being shown in the Home app when changed from ST side.
- [FIX] Fixed issues with local_commands option.
- [FIX] Fix for Celcius temperature conversions.
- [NEW] Added support for new 'temperature_unit' config option using either the smartapp or config.json file.
- [FIX] Other minor bugfixes and tweaks.

## v2.0.1

- [NEW] Completely rewrote the entire plugin using modern javascript structure.
- [NEW] The code is now much cleaner, easier to update/maintain, and easier for others to follow.
- [NEW] This translates into a faster/leaner and way more stable plugin than previous versions.
- [NEW] The plugin now uses the Homebridge Dynamic platform API, meaning it no longer requires a restart of the Homebridge service for device changes to occur.
- [NEW] The plugin now utilizes the device cache on service restart to prevent losing all of your devices when the plugin fails to start for an extended period of time.
- [NEW] It will now remove devices no longer selected under SmartThings.
- [NEW] Introduced an all-new logging system to provide more insight into issues and status, as well as write them to a file.
- [NEW] I used all of the issues from my existing plugin to repair this new version.
- [NEW] Many, many other bug fixes for devices, commands and many other items.
- [NEW] **_Important NOTICE:_**
- **Due to the changes in the plugin API you can not directly update the plugin from v1, you will need to add as a new accessory and setup your devices/automations/scenes again.
On a positive note, you can use the same SmartApp instance though as long as you update to the latest code.**
Loading

0 comments on commit 34a42e3

Please sign in to comment.