edilkamin 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Andre Miras
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Edilkamin.js
2
+
3
+ [![Tests](https://github.com/AndreMiras/edilkamin.js/workflows/Tests/badge.svg)](https://github.com/AndreMiras/edilkamin.js/actions/workflows/tests.yml)
4
+
5
+ This is a library for the [Reverse Engineered](docs/ReverseEngineering.md) "The Mind" Edilkamin API.
6
+ The Mind offers an app/API to remote control the Edilkamin pellet stoves.
7
+
8
+
9
+ ## Motivations
10
+ - providing an open source web alternative
11
+ to the [proprietary mobile app](https://play.google.com/store/apps/details?id=com.edilkamin.stufe)
12
+ - improving the interoperability (Nest, HomeAssistant...)
13
+
14
+ ## Roadmap
15
+ - [x] AWS Amplify/ Cognito authentication
16
+ - [x] unauthenticated endpoint call
17
+ - [ ] authenticated endpoint call
18
+ - [ ] list stoves
19
+ - [x] turn stove on/off
20
+ - [ ] set temperature
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const assert_1 = require("assert");
13
+ const aws_amplify_1 = require("aws-amplify");
14
+ const amplifyconfiguration = {
15
+ Auth: {
16
+ region: "eu-central-1",
17
+ userPoolId: "eu-central-1_BYmQ2VBlo",
18
+ userPoolWebClientId: "7sc1qltkqobo3ddqsk4542dg2h",
19
+ },
20
+ };
21
+ aws_amplify_1.Amplify.configure(amplifyconfiguration);
22
+ const signIn = (username, password) => __awaiter(void 0, void 0, void 0, function* () {
23
+ try {
24
+ const user = yield aws_amplify_1.Auth.signIn(username, password);
25
+ console.log("user:", user);
26
+ }
27
+ catch (error) {
28
+ console.log("error signing in", error);
29
+ }
30
+ });
31
+ const main = () => {
32
+ const { USERNAME, PASSWORD } = process.env;
33
+ assert_1.ok(USERNAME);
34
+ assert_1.ok(PASSWORD);
35
+ signIn(USERNAME, PASSWORD);
36
+ };
37
+ main();
package/package.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "edilkamin",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "dist/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1",
8
+ "lint": "prettier --check src",
9
+ "format": "prettier --write src",
10
+ "build": "tsc"
11
+ },
12
+ "files": [
13
+ "/dist"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "git+https://github.com/AndreMiras/edilkamin.js.git"
18
+ },
19
+ "author": "Andre Miras",
20
+ "license": "MIT",
21
+ "bugs": {
22
+ "url": "https://github.com/AndreMiras/edilkamin.js/issues"
23
+ },
24
+ "homepage": "https://github.com/AndreMiras/edilkamin.js#readme",
25
+ "dependencies": {
26
+ "@aws-amplify/cli": "^7.6.21",
27
+ "aws-amplify": "^4.3.14"
28
+ }
29
+ }