Skip to content

Commit

Permalink
Added Freezer Simulator plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bgelatti committed Oct 14, 2024
1 parent 39de83e commit e9f580f
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 6,015 deletions.
30 changes: 30 additions & 0 deletions package-lock.json

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

File renamed without changes.
File renamed without changes.
File renamed without changes
30 changes: 30 additions & 0 deletions plugins/freezer-simulator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@tago-io/tcore-plugin-freezer-simulator",
"version": "0.7.0",
"private": false,
"main": "./src/index.ts",
"type": "module",
"engines": {
"tcore": ">= 0.7.0 <= 1.0.0"
},
"files": [
"build/**"
],
"tcore": {
"name": "Freezer Simulator",
"short_description": "Ice cream freezer that simulates internal temperature, door and compressor status",
"full_description": "./README.md",
"icon": "./assets/icon.png",
"keywords": [
"Raspberry",
"action"
],
"types": ["action-type", "action-trigger", "service"],
"permissions": ["device", "device-data"]
},
"dependencies": {
"csv-parser": "3.0.0"
},
"devDependencies": {
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import path from "path";
import fs from "fs";
import path from "node:path";
import fs from "node:fs";
import csv from "csv-parser";
import { IDeviceDataCreate, IDevice } from "@tago-io/tcore-sdk/types";
import type { IDeviceDataCreate, IDevice } from "@tago-io/tcore-sdk/types";
import { core } from "@tago-io/tcore-sdk";
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';

const __filename = fileURLToPath(import.meta.url);
const dirname__ = dirname(__filename);

/**
* Simulated data inside the .csv file.
Expand All @@ -26,7 +31,7 @@ let csvData: ICsvData[] = [];
async function loadCsvData() {
return new Promise((resolve) => {
csvData = [];
const filePath = path.join(__dirname, "../assets/data.csv");
const filePath = path.join(dirname__, "../assets/data.csv");

// read file csv
fs.createReadStream(filePath)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ServiceModule } from "@tago-io/tcore-sdk";
import { startSendingData, stopSendingData } from "./data";
import { startSendingData, stopSendingData } from "./data.ts";

/**
* Configuration values for this service.
Expand Down
12 changes: 0 additions & 12 deletions plugins/network-chirpstack/.editorconfig

This file was deleted.

1 change: 0 additions & 1 deletion plugins/network-chirpstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"tcore": ">= 0.7.0 < 1.0.0"
},
"files": [
"build/**/*",
"assets/**/*"
],
"tcore": {
Expand Down
1 change: 1 addition & 0 deletions plugins/sqlite/src/Helpers/DeviceDatabase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export async function createDeviceConnection(
table.timestamp("created_at");
table.timestamp("chunk_timestamp_start");
table.timestamp("chunk_timestamp_end");
table.string("serie", 100);

if (type === "mutable") {
// added for version 0.3.3
Expand Down
12 changes: 0 additions & 12 deletions standalone-plugins/freezer-simulator/.editorconfig

This file was deleted.

10 changes: 0 additions & 10 deletions standalone-plugins/freezer-simulator/.eslintignore

This file was deleted.

29 changes: 0 additions & 29 deletions standalone-plugins/freezer-simulator/.eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions standalone-plugins/freezer-simulator/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions standalone-plugins/freezer-simulator/.prettierrc

This file was deleted.

8 changes: 0 additions & 8 deletions standalone-plugins/freezer-simulator/.vscode/settings.json

This file was deleted.

29 changes: 0 additions & 29 deletions standalone-plugins/freezer-simulator/esbuild/build.js

This file was deleted.

Loading

0 comments on commit e9f580f

Please sign in to comment.