-
-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extensive Refactoring #175
Merged
Merged
Changes from 75 commits
Commits
Show all changes
94 commits
Select commit
Hold shift + click to select a range
0c95a3e
Add Sensor device type
michikrug 5a2068e
Add support for Contact items for Locks and OpenClose devices
michikrug ddb25b8
Add attributes for OpenClose devices
michikrug b1aa4a3
Add and update tests
michikrug 77e07bf
Remove unnecessary customData, Rename tfaAck & tfaPin
michikrug e694ffe
Add note about tags to docu
michikrug 0e1dc7b
Improve efficiency of getting items, fix synonyms
michikrug dfd68cb
Refactor code, increase robustness
michikrug 11e832c
Restructure devices into single files
michikrug 69c204c
Restructure commands into single files
michikrug 55be634
Update dependencies, increase version
michikrug 458fa03
Minor fixes
michikrug bfe28fe
Add TV device
michikrug a75d781
Fix select channel
michikrug 99feb95
Fix volume relative, add onoff for TV
michikrug 78cc754
Update documentation
michikrug d391504
Add temperature sensor
michikrug 1580340
Check type attribute for sensors
michikrug f396de0
Change device filter logic
michikrug 86bbfb4
Fix copy paste error
michikrug 8bc7021
Move conversions to utilities file
michikrug ecf8e1f
Add tests for temperature sensor
michikrug 42cca60
Update documentation
michikrug 661a763
Add special color light device
michikrug 3103582
Fix typo
michikrug 02e5861
Minor refactoring
michikrug 6c757cf
Fix brightness command
michikrug 59fd3c2
Invert percentage of color temperature
michikrug 323bcac
Make requiresItem dynamic
michikrug 2f308df
SpecialColorLight extends Default instead of ColorLight
michikrug e31f8ee
Move color conversion functions to utilities
michikrug f4aee7a
Support OnOff for TV
michikrug 4a70128
Fix typo
michikrug 69470c6
Adjust volumeRelative parameter
michikrug 5715804
Fix SpecialColorLight attributes
michikrug f08f7bc
Add mute command
michikrug 149a019
Add volumeCanMuteAndUnmute for TV
michikrug 93fe4de
Rework test structure (WIP)
michikrug 7059c99
Make traits a function
michikrug abef64c
Update dependencies
michikrug 41455e5
Add new attributes to speaker
michikrug 2b1bed9
Fix specialcolorlight check
michikrug 024d1c7
Remove old code
michikrug bd0e9fe
Make check for sensor more strict
michikrug 81a49b9
Make check for thermostat more strict
michikrug 54d40a3
Add alternative temperature unit attribute
michikrug 7c63583
Remove or disable old tests
michikrug bd0a8a1
Extend utilities tests
michikrug bb94a7e
Refactor TV device
michikrug 2ea1ee2
Add or extend tests for devices
michikrug 6e71674
Minor fixes
michikrug cbbc701
Add tests for commands (WIP)
michikrug 351a565
Add JSDoc, Remove unused defaults
michikrug e456046
Make mute invertable
michikrug c9f562c
Rework OpenClose and StartStop default conversion
michikrug b531aab
Add pausable attribute
michikrug 060c21c
Add volume attributes to TV
michikrug 90bd0fa
Update device tests
michikrug 5e6ec44
Refactor color command tests
michikrug ef44d09
Add a lot of command tests
michikrug a145eb6
Set Volume trait when tvMute is provided
michikrug 1c3b8ec
Add tests for default command
michikrug 41c06dc
Add new tests for OpenHAB class
michikrug abfe9f2
Add tests for config
michikrug 0e37102
Replace tab with two spaces
michikrug 8422e02
Add ApiHandler tests
michikrug 72aafdc
Create codeql-analysis.yml
michikrug e21b3e4
Rework index & openhab to be more testable
michikrug 638f17e
Add test workflow
michikrug 8f10aeb
Upload coverage as artifact
michikrug f385984
Fix intent handler calls
michikrug e9e7049
Only run workflows for pushes on master and PRs, Comment test coverag…
michikrug 22a7d47
Update jest dependency
michikrug 7c365cc
Do not use matrix builds
michikrug a381246
Use Node 12.x explicitly for tests
michikrug ce2d866
Fix two-factor auth
michikrug 01716ee
Adjust test for two-factor auth
michikrug 98c56b2
Add useKelvin option for SpecialColorLight
michikrug 3894cd5
Update documentation
michikrug 7806b39
Consistent naming of useFahrenheit
michikrug 822bd0c
Refactor commands
michikrug 6c22c93
Update dependencies, add linting
michikrug c93725b
Adjust thermostat modes to use array
michikrug a0c58d5
Fix test workflow
michikrug e1340eb
Udate codeql workflow
michikrug 4f1ca5a
Update workflows
michikrug 4fa6861
Update documentation
michikrug 6ffa1c7
Change test-ci script command
michikrug ea69f4e
Make colorTemperatureRange optional if useKelvin is set
michikrug fa6c605
Switch workflows to main branch
michikrug b31d037
Add prettier for code formatting
michikrug cd6b822
Apply code formatting
michikrug ae6055d
Add compatibility for previous tfa attributes
michikrug d78b302
Update dependencies
michikrug File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"extends": "standard" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: CodeQL | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
analyze: | ||
name: Analyze | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Override automatic language detection by changing the below list | ||
# Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] | ||
language: ["javascript"] | ||
# Learn more... | ||
# https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
with: | ||
# We must fetch at least the immediate parents so that if this is | ||
# a pull request then we can checkout the head. | ||
fetch-depth: 2 | ||
|
||
# If this run was triggered by a pull request event, then checkout | ||
# the head of the pull request instead of the merge commit. | ||
- run: git checkout HEAD^2 | ||
if: ${{ github.event_name == 'pull_request' }} | ||
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
# By default, queries listed here will override any specified in a config file. | ||
# Prefix the list here with "+" to use these queries and those in the config file. | ||
# queries: ./path/to/local/query, your-org/your-repo/queries@main | ||
|
||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
- name: Autobuild | ||
uses: github/codeql-action/autobuild@v1 | ||
|
||
# ℹ️ Command-line programs to run using the OS shell. | ||
# 📚 https://git.io/JvXDl | ||
|
||
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines | ||
# and modify them (or add more) to build your code if your project | ||
# uses a compiled language | ||
|
||
#- run: | | ||
# make bootstrap | ||
# make release | ||
|
||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js 12.x | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12.x | ||
- run: npm ci | ||
- run: npm run build --if-present | ||
- run: npm test | ||
- name: Upload Test Coverage | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: coverage | ||
path: coverage/ | ||
- name: Comment Test Coverage | ||
if: ${{ github.event_name == 'pull_request' }} | ||
uses: romeovs/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not run the tests when pushing to a new branch without an open pull request?
And why only run the tests on pull requests into master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should we?
If you push to a PR'd branch it is run every time and can be used to properly review and approve changes.
All branch pushes and PRs not going into master are not of interest and can be run during development locally. (Think green, safe resources :D)
What would be your reasoning to do it every time?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah saving resources makes sense. I just thought about a more flexible setup which ensures the tests are always executed regardless of the branch and pull request. GitHub makes it too cheap running too many tests.