Skip to content

Commit f868990

Browse files
authored
Merge pull request #31 from EdgePi-Cloud/dev
merge dev to main
2 parents 3f74f66 + 3d929cc commit f868990

File tree

9 files changed

+107
-64
lines changed

9 files changed

+107
-64
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create Release Tag
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-publish:
9+
name: Create Release Tag
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
with:
15+
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
16+
- name: Get Current Version
17+
run: echo "current_version=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
18+
- name: Create Release Tag
19+
env:
20+
commit_name: bot-edgepi
21+
commit_email: [email protected]
22+
username: bot-edgepi
23+
run: |
24+
git config user.name ${{ env.commit_name }}
25+
git config user.email ${{ env.commit_email }}
26+
git tag -a release/v${{ env.current_version }} -m "tag release version ${{ env.current_version }}"
27+
git push origin release/v${{ env.current_version }}

.github/workflows/npm-publish.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,26 @@ on:
33
push:
44
branches:
55
- main
6+
tags:
7+
- release/*
68
jobs:
79
build:
810
runs-on: ubuntu-latest
911
steps:
10-
- uses: actions/checkout@v3
11-
# Setup .npmrc file to publish to npm
12-
- uses: actions/setup-node@v3
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v3
1317
with:
14-
node-version: '16.x'
15-
registry-url: 'https://registry.npmjs.org'
16-
- run: npm ci
17-
- run: npm publish --access public
18+
node-version: "16.x"
19+
registry-url: "https://registry.npmjs.org"
20+
21+
- name: Release Package
22+
uses: ncipollo/[email protected]
23+
24+
- name: Publish Package to npm
25+
run: |
26+
npm publish --access public
1827
env:
19-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/versioning.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Set up Node.js
3131
uses: actions/setup-node@v2
3232
with:
33-
node-version: 14 # Adjust this to your desired Node.js version
33+
node-version: 16 # Adjust this to your desired Node.js version
3434

3535
- name: Set Git user information
3636
run: |
@@ -59,7 +59,6 @@ jobs:
5959
version=$(cat package.json | jq -r '.version')
6060
git add .
6161
git commit -m "Bump version to $version"
62-
git push --follow-tags
6362
git push --force origin "$branch_name":dev
6463
6564
- name: Delete versioned branch

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.github/

branch-name.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version-20240115225852-806da137
1+
version-20240122235501-7f12decb

edgepi-digital-out.html

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,18 @@
1717
return this.name || "digial-out";
1818
},
1919
oneditprepare: function () {
20-
const configTransportSelect = document.getElementById(
21-
"node-input-transport"
22-
);
23-
const tcpField = document.querySelector(".form-row.tcp");
20+
const transportType = document.getElementById("node-input-transport");
21+
const tcpTransportInputs = document.querySelector(".form-row.tcp");
2422

2523
function updateEditor() {
26-
if (configTransportSelect.value === "Network") {
27-
tcpField.style.display = "flex";
24+
if (transportType.value === "Network") {
25+
tcpTransportInputs.style.display = "flex";
2826
} else {
29-
tcpField.style.display = "none";
27+
tcpTransportInputs.style.display = "none";
3028
}
3129
}
3230
updateEditor();
33-
configTransportSelect.addEventListener("change", updateEditor);
31+
transportType.addEventListener("change", updateEditor);
3432
},
3533
});
3634
</script>
@@ -100,14 +98,14 @@
10098
<div class="form-row">
10199
<label for="node-input-DoutPin">Channel:</label>
102100
<select id="node-input-DoutPin">
103-
<option value=1>D-OUT1</option>
104-
<option value=2>D-OUT2</option>
105-
<option value=3>D-OUT3</option>
106-
<option value=4>D-OUT4</option>
107-
<option value=5>D-OUT5</option>
108-
<option value=6>D-OUT6</option>
109-
<option value=7>D-OUT7</option>
110-
<option value=8>D-OUT8</option>
101+
<option value="1">D-OUT1</option>
102+
<option value="2">D-OUT2</option>
103+
<option value="3">D-OUT3</option>
104+
<option value="4">D-OUT4</option>
105+
<option value="5">D-OUT5</option>
106+
<option value="6">D-OUT6</option>
107+
<option value="7">D-OUT7</option>
108+
<option value="8">D-OUT8</option>
111109
</select>
112110
</div>
113111
<div class="form-row">
@@ -128,7 +126,11 @@
128126
<h3>Properties</h3>
129127
<dl class="message-properties">
130128
<dt>RPC Server</dt>
131-
<dd>The connection to your EdgePi's RPC Server.</dd>
129+
<dd>
130+
The connection to your EdgePi's RPC Server. Use <strong>Local</strong> if
131+
node-red is running on EdgePi. Otherwise use the
132+
<strong>Network</strong> option and enter EdgePi's IP address / Hostname.
133+
</dd>
132134
<dt>Channel</dt>
133135
<dd>The channel being configured.</dd>
134136
<dt>State</dt>

edgepi-digital-out.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@ module.exports = function (RED) {
44
function DigitalOutNode(config) {
55
RED.nodes.createNode(this, config);
66
const node = this;
7-
let channel = config.channel;
8-
let doutState = config.doutState;
7+
8+
let { channel, doutState } = config;
99

1010
initializeNode(config).then((dout) => {
1111
node.on("input", async function (msg, send, done) {
12-
node.status({ fill: "green", shape: "dot", text: "input recieved" });
12+
node.status({ fill: "green", shape: "dot", text: "input received" });
1313
try {
14-
channel = msg.channel || channel;
15-
doutState = msg.payload || doutState;
14+
if (msg.channel) {
15+
channel = msg.channel;
16+
}
17+
if (msg.payload) {
18+
doutState = msg.payload;
19+
}
20+
1621
msg = {
1722
payload: await dout.setDoutState(
1823
channel - 1,

package-lock.json

Lines changed: 28 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"edgepi-digital-out": "edgepi-digital-out.js"
66
}
77
},
8-
"version": "1.0.10",
8+
"version": "1.0.11",
99
"description": "node-red node for edgepi digital output module utilizing remote procedure calls",
1010
"main": "index.js",
1111
"scripts": {
@@ -27,9 +27,9 @@
2727
},
2828
"homepage": "https://github.com/EdgePi-Cloud/node-red-edgepi-digital-out#readme",
2929
"dependencies": {
30-
"@edgepi-cloud/edgepi-rpc": "^1.1.0"
30+
"@edgepi-cloud/edgepi-rpc": "^1.1.1"
3131
},
3232
"devDependencies": {
33-
"node-red": "^3.0.2"
33+
"node-red": "^3.1.3"
3434
}
3535
}

0 commit comments

Comments
 (0)