Skip to content

Commit

Permalink
Merge branch 'feat/integration-system' into feat/connectors-mokosmart…
Browse files Browse the repository at this point in the history
…-pni
  • Loading branch information
mateuscardosodeveloper committed Jun 3, 2024
2 parents bab469c + 4d8c603 commit 1b36554
Show file tree
Hide file tree
Showing 28 changed files with 3,339 additions and 173 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Units Tests

on: push

jobs:
setup:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci

linter:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm run linter

test:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm test

validator:
runs-on: ubuntu-latest
needs: setup
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- run: npm start validator

setup-database:
runs-on: ubuntu-latest
needs: [linter, test, validator]
steps:
- uses: actions/checkout@v4
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: 20.x
- run: npm ci
- name: Generate Database
run: npm start generate
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,6 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# .db file
data
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
27 changes: 25 additions & 2 deletions biome.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"ignore": ["node_modules"],
"enabled": true,
"rules": {
"recommended": false,
"recommended": true,
"complexity": {
"noBannedTypes": "warn",
"noExtraBooleanCast": "error",
Expand Down Expand Up @@ -51,6 +51,7 @@
"useYield": "error"
},
"style": {
"noVar": "error",
"noDefaultExport": "warn",
"noNamespace": "error",
"useAsConstAssertion": "error",
Expand Down Expand Up @@ -102,5 +103,27 @@
"attributePosition": "auto"
},
"globals": ["payload"]
}
},
"overrides": [
{
"include": ["decoders/*.js"],
"linter": {
"rules": {
"recommended": false,
"suspicious": {
"noPrototypeBuiltins": "warn"
},
"correctness": {
"noUnusedVariables": "warn",
"noInnerDeclarations": "warn",
"noUndeclaredVariables": "warn"
},
"style": {
"noVar": "warn",
"useBlockStatements": "warn"
}
}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
payload.forEach((data) => {
if(data.time === null){
console.log("The time is null, the date of now has been placed");
data.time = String(new.Date.now());
data.time = String(Date.now());
}
if (String(data.variable).includes('temperature') ) {
data.value = Number(data.value) - 273.15;
Expand Down
17 changes: 0 additions & 17 deletions functions/header.ts

This file was deleted.

Loading

0 comments on commit 1b36554

Please sign in to comment.