Skip to content
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

Fix MQTT parsing message and update tools #306

Merged
merged 2 commits into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Update version patch
Expand Down Expand Up @@ -66,12 +66,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
if: github.ref != 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: test backend
Expand All @@ -86,12 +86,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
node-version: [20.x]
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/download-artifact@master
Expand All @@ -116,7 +116,7 @@ jobs:

- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"ts-events": "^3.4.0",
"tsoa": "^3.6.1",
"tuyapi": "^7.4.0",
"unitsnet-js": "^1.0.42",
"unitsnet-js": "^3.0.5",
"winston": "^3.2.1",
"yeelight-awesome": "^1.0.12"
},
Expand Down
3 changes: 3 additions & 0 deletions backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { exec } from 'child-process-promise';
import * as fs from 'fs';
import * as http from 'http';
import * as https from 'https';
import * as ip from 'ip';
import { Configuration } from './config';
import { logger } from './utilities/logger';
import { app } from './app';
Expand Down Expand Up @@ -66,6 +67,7 @@ async function initServices() {
logger.info(`[home-iot-server] ------------------- Initializing HTTP server... -------------------`);
http.createServer(app).listen(Configuration.http.httpPort, () => {
logger.info(`[home-iot-server] ------------------- Initializing HTTP server on port ${Configuration.http.httpPort} succeed -------------------`);
logger.info(`[home-iot-server] ------------------- Swagger UI http:${ip.address()}:${Configuration.http.httpPort}/docs -------------------`);
});

// SSL/HTTPS
Expand All @@ -84,6 +86,7 @@ async function initServices() {

https.createServer(sslOptions, app).listen(Configuration.http.httpsPort, () => {
logger.info(`[home-iot-server] ------------------- Initializing HTTPS server on port ${Configuration.http.httpPort} succeed -------------------`);
logger.info(`[home-iot-server] ------------------- Swagger UI https:${ip.address()}:${Configuration.http.httpPort}/docs -------------------`);
});
} catch (error) {
logger.error(`Failed to load SSL certificate ${error}, exit...`);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/modules/mqtt/mqtt-drivers/casanetMqttDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export class CasanetMqttDriver extends MqttBaseDriver {

public async convertMqttMessage(topic: string, data: string): Promise<ParsedMqttMessage> {
const topics = topic.split('/');
const minionId = topics[1];
const minionId = topics[2];

const minions = await this.retrieveMinions.pull();

Expand Down
8 changes: 4 additions & 4 deletions backend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6141,10 +6141,10 @@ unique-string@^1.0.0:
dependencies:
crypto-random-string "^1.0.0"

unitsnet-js@^1.0.42:
version "1.0.42"
resolved "https://registry.yarnpkg.com/unitsnet-js/-/unitsnet-js-1.0.42.tgz#a21046a8c20ac04718389ace6a643aea165906f5"
integrity sha512-NN5qOnLpg5rC/DoLf+5GSSldNtGvfTGli37dijGedLj2t70Wt8CgGpkNd544NohCTcaL07zEDOq5lSrDQVXzEQ==
unitsnet-js@^3.0.5:
version "3.0.5"
resolved "https://registry.yarnpkg.com/unitsnet-js/-/unitsnet-js-3.0.5.tgz#8e6796edffec045630705a329a00befd1d492d89"
integrity sha512-aYQ1wauYsvrmUI82GpLpOydNdxHUKdZvyU+O8c63Uhp0db5oxe7o3lU20WqtrboaKm8ORhaEpSGVjzDPeFhqvg==

universalify@^0.1.0:
version "0.1.2"
Expand Down
Loading