Skip to content

Commit

Permalink
Merge pull request #34 from EdgePi-Cloud/dev-update-tc
Browse files Browse the repository at this point in the history
update tc HTML guide & packages' versions
  • Loading branch information
bot-edgepi authored Jan 23, 2024
2 parents 9be187b + 1a96b34 commit bc7e608
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 51 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/create-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Create Release Tag
on:
push:
branches:
- main

jobs:
build-and-publish:
name: Create Release Tag
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
- name: Get Current Version
run: echo "current_version=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV
- name: Create Release Tag
env:
commit_name: bot-edgepi
commit_email: [email protected]
username: bot-edgepi
run: |
git config user.name ${{ env.commit_name }}
git config user.email ${{ env.commit_email }}
git tag -a release/v${{ env.current_version }} -m "tag release version ${{ env.current_version }}"
git push origin release/v${{ env.current_version }}
25 changes: 17 additions & 8 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@ on:
push:
branches:
- main
tags:
- release/*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
node-version: "16.x"
registry-url: "https://registry.npmjs.org"

- name: Release Package
uses: ncipollo/[email protected]

- name: Publish Package to npm
run: |
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/versioning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14 # Adjust this to your desired Node.js version
node-version: 16 # Adjust this to your desired Node.js version

- name: Set Git user information
run: |
Expand Down Expand Up @@ -59,7 +59,6 @@ jobs:
version=$(cat package.json | jq -r '.version')
git add .
git commit -m "Bump version to $version"
git push --follow-tags
git push --force origin "$branch_name":dev
- name: Delete versioned branch
Expand Down
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/
21 changes: 11 additions & 10 deletions edgepi-thermocouple.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
transport: { value: "Local" },
tcpAddress: { value: "" },
tcpPort: { value: "" },
output: { value: "lin" },
},
inputs: 1,
outputs: 1,
Expand All @@ -16,20 +15,18 @@
return this.name || "thermocouple";
},
oneditprepare: function () {
const configTransportSelect = document.getElementById(
"node-input-transport"
);
const tcpField = document.querySelector(".form-row.tcp");
const transportType = document.getElementById("node-input-transport");
const tcpTransportInputs = document.querySelector(".form-row.tcp");

function updateEditor() {
if (configTransportSelect.value === "Network") {
tcpField.style.display = "flex";
if (transportType.value === "Network") {
tcpTransportInputs.style.display = "flex";
} else {
tcpField.style.display = "none";
tcpTransportInputs.style.display = "none";
}
}
updateEditor();
configTransportSelect.addEventListener("change", updateEditor);
transportType.addEventListener("change", updateEditor);
},
});
</script>
Expand Down Expand Up @@ -104,7 +101,11 @@
<h3>Properties</h3>
<dl class="message-properties">
<dt>RPC Server</dt>
<dd>The connection to your EdgePi's RPC Server.</dd>
<dd>
The connection to your EdgePi's RPC Server. Use <strong>Local</strong> if
node-red is running on EdgePi. Otherwise use the
<strong>Network</strong> option and enter EdgePi's IP address / Hostname.
</dd>
<dt>Output</dt>
<dd>What temperature reading(s) will be be sent out through the flow.</dd>
</dl>
Expand Down
2 changes: 0 additions & 2 deletions edgepi-thermocouple.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ module.exports = function (RED) {
function ThermocoupleNode(config) {
RED.nodes.createNode(this, config);
const node = this;
let output = config.output;

initializeNode(config).then((tc) => {
this.on("input", async function (msg, send, done) {
node.status({ fill: "green", shape: "dot", text: "input received" });
try {
output = msg.payload || output;
let temps = await tc.singleSample();
msg.payload = temps[1];
} catch (err) {
Expand Down
54 changes: 27 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
},
"homepage": "https://github.com/EdgePi-Cloud/node-red-edgepi-thermocouple#readme",
"dependencies": {
"@edgepi-cloud/edgepi-rpc": "^1.1.0"
"@edgepi-cloud/edgepi-rpc": "^1.1.1"
},
"devDependencies": {
"node-red": "^3.0.2"
"node-red": "^3.1.3"
}
}

0 comments on commit bc7e608

Please sign in to comment.