Skip to content

Commit

Permalink
Merge pull request #136 from athombv/master
Browse files Browse the repository at this point in the history
Merge master into production (#patch)
  • Loading branch information
RobinBol authored Nov 9, 2023
2 parents 3bcf426 + 69bc983 commit 28ea75d
Show file tree
Hide file tree
Showing 8 changed files with 427 additions and 892 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,20 @@ on:
workflow_dispatch:
inputs:
versionBumpType:
description: 'Version bump (major, minor or patch)'
description: "Version bump (major, minor or patch)"
required: true

jobs:
deploy_to_npm:
name: Version Bump & Deploy to NPM

# Only run this job if initiator is not the Homey Github Actions Bot to prevent loops and check if if a version bump is provided and current branch is production or testing
if: github.actor != 'HomeyGithubActionsBot'
&& (github.ref == 'refs/heads/production' || github.ref == 'refs/heads/testing')
&& (github.event.inputs.versionBumpType == 'patch' || github.event.inputs.versionBumpType == 'minor' || github.event.inputs.versionBumpType == 'major' || contains(github.event.head_commit.message, '#patch') || contains(github.event.head_commit.message, '#minor') || contains(github.event.head_commit.message, '#major'))
if: github.actor != 'homey-bot'
&& (github.ref == 'refs/heads/production' || github.ref == 'refs/heads/testing')
&& (github.event.inputs.versionBumpType == 'patch' || github.event.inputs.versionBumpType == 'minor' || github.event.inputs.versionBumpType == 'major' || contains(github.event.head_commit.message, '#patch') || contains(github.event.head_commit.message, '#minor') || contains(github.event.head_commit.message, '#major'))

runs-on: ubuntu-latest
steps:

# Checks out the current repository.
- name: Checkout git repository
uses: actions/checkout@v2
Expand All @@ -58,15 +57,17 @@ jobs:
- name: Set up node 12 environment
uses: actions/setup-node@v1
with:
node-version: '12'
node-version: "12"
# Needed for publishing to npm
registry-url: 'https://registry.npmjs.org'
registry-url: "https://registry.npmjs.org"

# Run `npm ci && npm run build` to re-create your local environment (make sure to commit your - package-lock.json!).
- name: Build
run: |
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

- name: Version bump patch
if: github.event.inputs.versionBumpType == 'patch' || contains(github.event.head_commit.message, '#patch') && !contains(github.event.head_commit.message, '#minor') && !contains(github.event.head_commit.message, '#major')
Expand Down
43 changes: 23 additions & 20 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,33 @@ name: Deploy Documentation To GitHub Pages

on:
push:
branches: [ production ]
branches: [production]
workflow_dispatch:

jobs:
deploy:
name: Build & Deploy to GitHub Pages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: '12'

# Build
- name: Build
run: |
npm ci
npm run build
# Deploy
- name: Deploy To GitHub Pages
uses: peaceiris/[email protected]
with:
personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "12"
registry-url: https://npm.pkg.github.com

# Build
- name: Build
run: |
npm ci
npm run build
env:
NODE_AUTH_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

# Deploy
- name: Deploy To GitHub Pages
uses: peaceiris/[email protected]
with:
personal_token: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}
publish_dir: ./build
7 changes: 5 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,19 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:

# Checks out the current repository.
- uses: actions/checkout@v2

# Configures a Node.js environment.
- uses: actions/setup-node@v1
with:
node-version: '12'
node-version: "12"
registry-url: https://npm.pkg.github.com

# Run `npm ci` to re-create your local environment (make sure to commit your package-lock.json!).
# Finally run `npm run lint` (make sure you have defined a lint command in package.json e.g. "lint": "eslint .").
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

- run: npm run lint
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }} # Important: use the matrix.node property when using a matrix strategy
registry-url: https://npm.pkg.github.com

# Run `npm ci` to re-create your local environment (make sure to commit your package-lock.json!).
# Finally run `npm test` (make sure you have defined a proper test command in package.json).
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.HOMEY_GITHUB_ACTIONS_BOT_PERSONAL_ACCESS_TOKEN }}

- run: npm test
2 changes: 1 addition & 1 deletion docs/jsdoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"opts": {
"simpleAnalyticsHost": "sa.athom.com",
"mainpagetitle": "Homey ZWaveDriver",
"template": "./node_modules/homey-jsdoc-template",
"template": "./node_modules/@athombv/jsdoc-template",
"readme": "./README.md",
"destination": "./build"
},
Expand Down
3 changes: 3 additions & 0 deletions lib/ZwaveDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -1061,6 +1061,9 @@ class ZwaveDevice extends Homey.Device {
if (commandClassMeter && commandClassMeter.hasOwnProperty('METER_RESET')) {

Check warning on line 1061 in lib/ZwaveDevice.js

View workflow job for this annotation

GitHub Actions / Lint

Do not access Object.prototype method 'hasOwnProperty' from target object
const result = await commandClassMeter.METER_RESET({});
if (result !== 'TRANSMIT_COMPLETE_OK') throw result;

// Return if reset was successful
return;
}
throw new Error('missing_meter_reset_command');
}
Expand Down
Loading

0 comments on commit 28ea75d

Please sign in to comment.