Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
codeoverflow-org committed Sep 11, 2024
1 parent 88ab739 commit ac6997e
Show file tree
Hide file tree
Showing 16 changed files with 197 additions and 3 deletions.
Binary file modified nodecg-io-gametts-0.3.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion nodecg-io-gametts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"contributors": [
{
"name": "SteffoSpieler",
"url": "https://about.steffospieler.de"
"url": "https://steffo.dev"
}
],
"repository": {
Expand Down
Binary file modified nodecg-io-google-cast-0.3.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion nodecg-io-google-cast/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"contributors": [
{
"name": "SteffoSpieler",
"url": "https://about.steffospieler.de"
"url": "https://steffo.dev"
}
],
"repository": {
Expand Down
Binary file modified nodecg-io-opentts-0.3.0.tgz
Binary file not shown.
2 changes: 1 addition & 1 deletion nodecg-io-opentts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"contributors": [
{
"name": "SteffoSpieler",
"url": "https://about.steffospieler.de"
"url": "https://steffo.dev"
}
],
"repository": {
Expand Down
Binary file added nodecg-io-pishock-0.3.0.tgz
Binary file not shown.
8 changes: 8 additions & 0 deletions nodecg-io-pishock/extension/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { PiShockDevice, PiShockAuthentication } from "pishock-ts";
export interface PiShockConfig {
authentications: Array<PiShockAuthentication>;
}
export interface PiShockClient {
connectedDevices: Array<PiShockDevice>;
}
//# sourceMappingURL=index.d.ts.map
50 changes: 50 additions & 0 deletions nodecg-io-pishock/extension/index.js

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

1 change: 1 addition & 0 deletions nodecg-io-pishock/extension/index.js.map

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

50 changes: 50 additions & 0 deletions nodecg-io-pishock/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "nodecg-io-pishock",
"version": "0.3.0",
"description": "Allows using the PiShock api.",
"homepage": "https://nodecg.io/RELEASE/samples/pishock",
"author": {
"name": "CodeOverflow team",
"url": "https://github.com/codeoverflow-org"
},
"contributors": [
{
"name": "SteffoSpieler",
"url": "https://steffo.dev"
}
],
"repository": {
"type": "git",
"url": "https://github.com/codeoverflow-org/nodecg-io.git",
"directory": "services/nodecg-io-pishock"
},
"files": [
"**/*.js",
"**/*.js.map",
"**/*.d.ts",
"*.json"
],
"main": "extension/index",
"keywords": [
"nodecg-io",
"nodecg-bundle",
"pishock"
],
"nodecg": {
"compatibleRange": ">=1.1.1 <3.0.0",
"bundleDependencies": {
"nodecg-io-core": "^0.3.0"
}
},
"license": "MIT",
"devDependencies": {
"@types/node": "^20.12.2",
"@nodecg/types": "^2.1.12",
"typescript": "^5.4.3",
"nodecg-io-tsconfig": "^1.0.0"
},
"dependencies": {
"nodecg-io-core": "^0.3.0",
"pishock-ts": "^1.0.1"
}
}
33 changes: 33 additions & 0 deletions nodecg-io-pishock/schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"authentications": {
"type": "array",
"items": {
"type": "object",
"required": ["username", "apiKey", "code"],
"properties": {
"username": {
"type": "string",
"description": "Username you use to log into PiShock.com. Can be found in the Account section of the website."
},
"apiKey": {
"type": "string",
"description": "API Key generated on PiShock.com. Can be found in the Account section of the website."
},
"code": {
"type": "string",
"description": "Sharecode generated on PiShock.com. Limitations can be set when generating the code."
},
"name": {
"type": "string",
"description": "Name of what sent the commands. This will show up in the PiShock logs on the website."
}
}
}
}
},
"required": ["authentications"]
}
8 changes: 8 additions & 0 deletions nodecg-io-pishock/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "nodecg-io-tsconfig",
"references": [
{
"path": "../../nodecg-io-core"
}
]
}
Binary file added pishock-0.3.0.tgz
Binary file not shown.
24 changes: 24 additions & 0 deletions pishock/extension/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import NodeCG from "@nodecg/types";
import { PiShockClient } from "nodecg-io-pishock";
import { requireService } from "nodecg-io-core";

module.exports = function (nodecg: NodeCG.ServerAPI) {
nodecg.log.info("Sample bundle for the PiShock service started.");

const pishock = requireService<PiShockClient>(nodecg, "pishock");

pishock?.onAvailable((client) => {
nodecg.log.info("PiShock client has been updated, printing all device's infos");
client.connectedDevices.forEach(async (device) => {
const info = await device.getInfo();
nodecg.log.info(
`Client ID: ${info.clientId}, ID: ${info.id}, Name: ${info.name}, Paused: ${info.paused}, ` +
`MaxIntensity: ${info.maxIntensity}, MaxDuration: ${info.maxDuration}, Online: ${info.online}`,
);
});
});

pishock?.onUnavailable(() => {
nodecg.log.info("PiShock service unavailable.");
});
};
20 changes: 20 additions & 0 deletions pishock/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "pishock",
"version": "0.3.0",
"private": true,
"nodecg": {
"compatibleRange": ">=1.1.1 <3.0.0",
"bundleDependencies": {
"nodecg-io-pishock": "^0.3.0"
}
},
"license": "MIT",
"dependencies": {
"@types/node": "^20.12.2",
"@nodecg/types": "^2.1.12",
"nodecg-io-core": "^0.3.0",
"nodecg-io-pishock": "^0.3.0",
"typescript": "^5.4.3",
"nodecg-io-tsconfig": "^1.0.0"
}
}

0 comments on commit ac6997e

Please sign in to comment.