Skip to content

Commit e61983c

Browse files
author
ticaki
committed
Initial commit
0 parents  commit e61983c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1203
-0
lines changed

.create-adapter.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"cli": true,
3+
"target": "directory",
4+
"adapterName": "nspanel-lovelace-ui",
5+
"title": "NSPanel Lovelace UI",
6+
"description": "NsPanel Lovelace UI is a Firmware for the nextion screen inside of NSPanel in the Design of Lovelace UI Design.",
7+
"keywords": ["NSPanel", "Lovelace", "Sonoff", "Lovelace UI", "ioBroker"],
8+
"contributors": ["tt-tom17", "Armilar"],
9+
"expert": "yes",
10+
"features": ["adapter"],
11+
"adminFeatures": [],
12+
"type": "hardware",
13+
"startMode": "daemon",
14+
"connectionType": "local",
15+
"dataSource": "push",
16+
"connectionIndicator": "yes",
17+
"language": "TypeScript",
18+
"nodeVersion": "18",
19+
"adminUi": "json",
20+
"tools": ["ESLint", "Prettier", "code coverage"],
21+
"releaseScript": "yes",
22+
"devServer": "yes",
23+
"devServerPort": 8081,
24+
"indentation": "Space (4)",
25+
"quotes": "single",
26+
"es6class": "yes",
27+
"authorName": "ticaki",
28+
"authorGithub": "ticaki",
29+
"authorEmail": "github@renopoint.de",
30+
"gitRemoteProtocol": "SSH",
31+
"gitCommit": "yes",
32+
"defaultBranch": "main",
33+
"license": "MIT License",
34+
"dependabot": "yes",
35+
"creatorVersion": "2.5.0"
36+
}

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
.prettierrc.js
3+
**/.eslintrc.js
4+
admin/words.js

.eslintrc.js

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module.exports = {
2+
root: true, // Don't look outside this project for inherited configs
3+
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
4+
parserOptions: {
5+
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
6+
sourceType: 'module', // Allows for the use of imports
7+
project: './tsconfig.json',
8+
},
9+
extends: [
10+
'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
11+
'plugin:prettier/recommended', // Enables eslint-plugin-prettier and displays prettier errors as ESLint errors. Make sure this is always the last configuration in the extends array.
12+
],
13+
plugins: [],
14+
rules: {
15+
'@typescript-eslint/no-parameter-properties': 'off',
16+
'@typescript-eslint/no-explicit-any': 'off',
17+
'@typescript-eslint/no-use-before-define': [
18+
'error',
19+
{
20+
functions: false,
21+
typedefs: false,
22+
classes: false,
23+
},
24+
],
25+
'@typescript-eslint/no-unused-vars': [
26+
'error',
27+
{
28+
ignoreRestSiblings: true,
29+
argsIgnorePattern: '^_',
30+
},
31+
],
32+
'@typescript-eslint/explicit-function-return-type': [
33+
'warn',
34+
{
35+
allowExpressions: true,
36+
allowTypedFunctionExpressions: true,
37+
},
38+
],
39+
'@typescript-eslint/no-object-literal-type-assertion': 'off',
40+
'@typescript-eslint/interface-name-prefix': 'off',
41+
'@typescript-eslint/no-non-null-assertion': 'off', // This is necessary for Map.has()/get()!
42+
'no-var': 'error',
43+
'prefer-const': 'error',
44+
'no-trailing-spaces': 'error',
45+
},
46+
overrides: [
47+
{
48+
files: ['*.test.ts'],
49+
rules: {
50+
'@typescript-eslint/explicit-function-return-type': 'off',
51+
},
52+
},
53+
],
54+
};

.github/ISSUE_TEMPLATE/bug_report.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Something is not working as it should
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
---
8+
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '...'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots & Logfiles**
23+
If applicable, add screenshots and logfiles to help explain your problem.
24+
25+
**Versions:**
26+
- Adapter version: <adapter-version>
27+
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
28+
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
29+
- Operating system: <os-name>
30+
31+
**Additional context**
32+
Add any other context about the problem here.

.github/auto-merge.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Configure here which dependency updates should be merged automatically.
2+
# The recommended configuration is the following:
3+
- match:
4+
# Only merge patches for production dependencies
5+
dependency_type: production
6+
update_type: "semver:patch"
7+
- match:
8+
# Except for security fixes, here we allow minor patches
9+
dependency_type: production
10+
update_type: "security:minor"
11+
- match:
12+
# and development dependencies can have a minor update, too
13+
dependency_type: development
14+
update_type: "semver:minor"
15+
16+
# The syntax is based on the legacy dependabot v1 automerged_updates syntax, see:
17+
# https://dependabot.com/docs/config-file/#automerged_updates

.github/dependabot.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "04:00"
8+
timezone: Europe/Berlin
9+
open-pull-requests-limit: 5
10+
assignees:
11+
- ticaki
12+
versioning-strategy: increase
13+
14+
- package-ecosystem: github-actions
15+
directory: "/"
16+
schedule:
17+
interval: monthly
18+
time: "04:00"
19+
timezone: Europe/Berlin
20+
open-pull-requests-limit: 5
21+
assignees:
22+
- ticaki
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Automatically merge Dependabot PRs when version comparison is within the range
2+
# that is configured in .github/auto-merge.yml
3+
4+
name: Auto-Merge Dependabot PRs
5+
6+
on:
7+
# WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action
8+
# details under https://github.blog/changelog/2021-02-19-github-actions-workflows-triggered-by-dependabot-prs-will-run-with-read-only-permissions/
9+
pull_request_target:
10+
11+
jobs:
12+
auto-merge:
13+
if: github.actor == 'dependabot[bot]'
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Check if PR should be auto-merged
20+
uses: ahmadnassri/action-dependabot-auto-merge@v2
21+
with:
22+
# In order to use this, you need to go to https://github.com/settings/tokens and
23+
# create a Personal Access Token with the permission "public_repo".
24+
# Enter this token in your repository settings under "Secrets" and name it AUTO_MERGE_TOKEN
25+
github-token: ${{ secrets.AUTO_MERGE_TOKEN }}
26+
# By default, squash and merge, so Github chooses nice commit messages
27+
command: squash and merge
+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Test and Release
2+
3+
# Run this job on all pushes and pull requests
4+
# as well as tags with a semantic version
5+
on:
6+
push:
7+
branches:
8+
- "main"
9+
tags:
10+
# normal versions
11+
- "v[0-9]+.[0-9]+.[0-9]+"
12+
# pre-releases
13+
- "v[0-9]+.[0-9]+.[0-9]+-**"
14+
pull_request: {}
15+
16+
# Cancel previous PR/branch runs when a new commit is pushed
17+
concurrency:
18+
group: ${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
jobs:
22+
# Performs quick checks before the expensive test runs
23+
check-and-lint:
24+
if: contains(github.event.head_commit.message, '[skip ci]') == false
25+
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: ioBroker/testing-action-check@v1
30+
with:
31+
node-version: '18.x'
32+
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
33+
# install-command: 'npm install'
34+
type-checking: true
35+
lint: true
36+
37+
# Runs adapter tests on all supported node versions and OSes
38+
adapter-tests:
39+
if: contains(github.event.head_commit.message, '[skip ci]') == false
40+
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
matrix:
44+
node-version: [16.x, 18.x, 20.x]
45+
os: [ubuntu-latest, windows-latest, macos-latest]
46+
47+
steps:
48+
- uses: ioBroker/testing-action-adapter@v1
49+
with:
50+
node-version: ${{ matrix.node-version }}
51+
os: ${{ matrix.os }}
52+
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
53+
# install-command: 'npm install'
54+
build: true
55+
56+
# TODO: To enable automatic npm releases, create a token on npmjs.org
57+
# Enter this token as a GitHub secret (with name NPM_TOKEN) in the repository options
58+
# Then uncomment the following block:
59+
60+
# # Deploys the final package to NPM
61+
# deploy:
62+
# needs: [check-and-lint, adapter-tests]
63+
#
64+
# # Trigger this step only when a commit on any branch is tagged with a version number
65+
# if: |
66+
# contains(github.event.head_commit.message, '[skip ci]') == false &&
67+
# github.event_name == 'push' &&
68+
# startsWith(github.ref, 'refs/tags/v')
69+
#
70+
# runs-on: ubuntu-latest
71+
#
72+
# # Write permissions are required to create Github releases
73+
# permissions:
74+
# contents: write
75+
#
76+
# steps:
77+
# - uses: ioBroker/testing-action-deploy@v1
78+
# with:
79+
# node-version: '18.x'
80+
# # Uncomment the following line if your adapter cannot be installed using 'npm ci'
81+
# # install-command: 'npm install'
82+
# build: true
83+
# npm-token: ${{ secrets.NPM_TOKEN }}
84+
# github-token: ${{ secrets.GITHUB_TOKEN }}
85+
#
86+
# # When using Sentry for error reporting, Sentry can be informed about new releases
87+
# # To enable create a API-Token in Sentry (User settings, API keys)
88+
# # Enter this token as a GitHub secret (with name SENTRY_AUTH_TOKEN) in the repository options
89+
# # Then uncomment and customize the following block:
90+
# sentry: true
91+
# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
92+
# sentry-project: "iobroker-nspanel-lovelace-ui"
93+
# sentry-version-prefix: "iobroker.nspanel-lovelace-ui"
94+
# sentry-sourcemap-paths: "build/"
95+
# # If your sentry project is linked to a GitHub repository, you can enable the following option
96+
# # sentry-github-integration: true

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# No dot-directories except github/vscode
2+
.*/
3+
!.vscode/
4+
!.github/
5+
6+
*.code-workspace
7+
node_modules
8+
nbproject
9+
10+
# npm package files
11+
iobroker.*.tgz
12+
13+
Thumbs.db
14+
15+
# NYC coverage files
16+
coverage
17+
18+
# i18n intermediate files
19+
admin/i18n/flat.txt
20+
admin/i18n/*/flat.txt

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
package.json
2+
package-lock.json
3+
build/

.prettierrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
semi: true,
3+
trailingComma: 'all',
4+
singleQuote: true,
5+
printWidth: 120,
6+
useTabs: false,
7+
tabWidth: 4,
8+
endOfLine: 'lf',
9+
};

.releaseconfig.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"plugins": ["iobroker", "license", "manual-review"],
3+
"exec": {
4+
"before_commit": "npm run build"
5+
}
6+
}

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}

.vscode/settings.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib",
3+
"eslint.enable": true,
4+
"editor.formatOnSave": true,
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"[typescript]": {
7+
"editor.codeActionsOnSave": {
8+
"source.organizeImports": true
9+
}
10+
},
11+
"json.schemas": [
12+
{
13+
"fileMatch": ["io-package.json"],
14+
"url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json"
15+
},
16+
{
17+
"fileMatch": ["admin/jsonConfig.json", "admin/jsonCustom.json", "admin/jsonTab.json"],
18+
"url": "https://raw.githubusercontent.com/ioBroker/adapter-react-v5/main/schemas/jsonConfig.json"
19+
}
20+
]
21+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ticaki <github@renopoint.de>
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.

0 commit comments

Comments
 (0)