Skip to content

Commit

Permalink
Fixed issue #365
Browse files Browse the repository at this point in the history
Fixed issue #363
Updated version of the package ffmpeg-static (5.2.0)
Updated version of the package eufy-security-client (2.8.0)
Further details can be found in the changelog of eufy-security-client (2.8.0)
Updated project to latest create-adapter version (2.5.0)
  • Loading branch information
bropat committed Aug 20, 2023
1 parent 11299ed commit 343f947
Show file tree
Hide file tree
Showing 38 changed files with 5,834 additions and 13,442 deletions.
8 changes: 7 additions & 1 deletion .create-adapter.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,11 @@
1
],
"dependabot": "no",
"creatorVersion": "1.28.0"
"creatorVersion": "2.5.0",
"nodeVersion": "16",
"adminUi": "html",
"i18n": "words.js",
"releaseScript": "no",
"devServer": "no",
"defaultBranch": "master"
}
2 changes: 1 addition & 1 deletion .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Devcontainer readme
This directory allows you to develop your adapter in a dedicated Docker container. To get started and for requirements, please read the getting started section at https://code.visualstudio.com/docs/remote/containers#_getting-started

Once you're done with that, VSCode will prompt you to reopen the adapter directory in a container. This takes a while, afterwards you can access the admin UI at http://localhost:8082. To change that port, edit `nginx.conf` in the `nginx` subdirectory.
Once you're done with that, VSCode will prompt you to reopen the adapter directory in a container. This takes a while, afterwards you can access the admin UI at http://localhost:8082. To change that port, edit `docker-compose.yml` to have a different `ports` configuration for `nginx`.
2 changes: 1 addition & 1 deletion .devcontainer/iobroker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM buanet/iobroker:latest-v8
FROM iobroker/iobroker:latest
RUN ln -s /opt/iobroker/node_modules/ /root/.node_modules
2 changes: 1 addition & 1 deletion .devcontainer/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ http {
proxy_set_header Connection "Upgrade";
}

location /adapter/eufy-security/ {
location /adapter/eusec/ {
alias /workspace/admin/;
}

Expand Down
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build/
**/.eslintrc.js
admin/words.js
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
root: true, // Don't look outside this project for inherited configs
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
project: "./tsconfig.json",
},
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ name: Test and Release
on:
push:
branches:
- "*"
- "master"
tags:
# normal versions
- "v[0-9]+.[0-9]+.[0-9]+"
# pre-releases
- "v[0-9]+.[0-9]+.[0-9]+-**"
pull_request: {}

# Cancel previous PR/branch runs when a new commit is pushed
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
# Performs quick checks before the expensive test runs
check-and-lint:
Expand All @@ -23,7 +28,7 @@ jobs:
steps:
- uses: ioBroker/testing-action-check@v1
with:
node-version: '16.x'
node-version: '18.x'
# Uncomment the following line if your adapter cannot be installed using 'npm ci'
# install-command: 'npm install'
type-checking: true
Expand All @@ -36,7 +41,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [16.x, 18.x, 20.x]
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
Expand Down Expand Up @@ -64,10 +69,14 @@ jobs:
#
# runs-on: ubuntu-latest
#
# # Write permissions are required to create Github releases
# permissions:
# contents: write
#
# steps:
# - uses: ioBroker/testing-action-deploy@v1
# with:
# node-version: '16.x'
# node-version: '18.x'
# # Uncomment the following line if your adapter cannot be installed using 'npm ci'
# # install-command: 'npm install'
# build: true
Expand All @@ -80,8 +89,8 @@ jobs:
# # Then uncomment and customize the following block:
# sentry: true
# sentry-token: ${{ secrets.SENTRY_AUTH_TOKEN }}
# sentry-project: "iobroker-template"
# sentry-version-prefix: "iobroker.template"
# sentry-project: "iobroker-eusec"
# sentry-version-prefix: "iobroker.eusec"
# sentry-sourcemap-paths: "build/"
# # If your sentry project is linked to a GitHub repository, you can enable the following option
# # sentry-github-integration: true
# # sentry-github-integration: true
18 changes: 17 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.enable": true,
"files.eol": "\n"
"files.eol": "\n",
"json.schemas": [
{
"fileMatch": [
"io-package.json"
],
"url": "https://raw.githubusercontent.com/ioBroker/ioBroker.js-controller/master/schemas/io-package.json"
},
{
"fileMatch": [
"admin/jsonConfig.json",
"admin/jsonCustom.json",
"admin/jsonTab.json"
],
"url": "https://raw.githubusercontent.com/ioBroker/adapter-react-v5/main/schemas/jsonConfig.json"
}
]
}
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,14 @@ Best is to set the adapter to Debug log mode (see [here](https://bropat.github.i

## Changelog

### 1.1.1 (2023-08-20)

* (bropat) Fixed issue #365
* (bropat) Fixed issue #363
* (bropat) Updated version of the package ffmpeg-static (5.2.0)
* (bropat) Updated version of the package eufy-security-client (2.8.0)
* (bropat) Further details can be found in the changelog of eufy-security-client (2.8.0)

### 1.1.0 (2023-08-08)

* (bropat) Added support for Wired Wall Light Cam S100 (T84A1; #332)
Expand Down
93 changes: 93 additions & 0 deletions admin/admin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
declare let systemDictionary: Record<string, Record<string, string>>;

declare let load: (settings: Record<string, unknown>, onChange: (hasChanges: boolean) => void) => void;
declare let save: (callback: (settings: Record<string, unknown>) => void) => void;

// make load and save exist on the window object
interface Window {
load: typeof load;
save: typeof save;
}

declare const instance: number;
declare const adapter: string;
/** Translates text */
declare function _(text: string, arg1?: string, arg2?: string, arg3?: string): string;
declare const socket: ioBrokerSocket;
declare function sendTo(
instance: any | null,
command: string,
message: any,
callback: (result: SendToResult) => void | Promise<void>,
): void;

interface SendToResult {
error?: string | Error;
result?: any;
}

// tslint:disable-next-line:class-name
interface ioBrokerSocket {
emit(
command: "subscribeObjects",
pattern: string,
callback?: (err?: string) => void | Promise<void>,
): void;
emit(
command: "subscribeStates",
pattern: string,
callback?: (err?: string) => void | Promise<void>,
): void;
emit(
command: "unsubscribeObjects",
pattern: string,
callback?: (err?: string) => void | Promise<void>,
): void;
emit(
command: "unsubscribeStates",
pattern: string,
callback?: (err?: string) => void | Promise<void>,
): void;

emit(
event: "getObjectView",
view: "system",
type: "device",
options: ioBroker.GetObjectViewParams,
callback: (
err: string | undefined,
result?: any,
) => void | Promise<void>,
): void;
emit(
event: "getStates",
callback: (
err: string | undefined,
result?: Record<string, any>,
) => void,
): void;
emit(
event: "getState",
id: string,
callback: (err: string | undefined, result?: ioBroker.State) => void,
): void;
emit(
event: "setState",
id: string,
state: unknown,
callback: (err: string | undefined, result?: any) => void,
): void;

on(event: "objectChange", handler: ioBroker.ObjectChangeHandler): void;
on(event: "stateChange", handler: ioBroker.StateChangeHandler): void;
removeEventHandler(
event: "objectChange",
handler: ioBroker.ObjectChangeHandler,
): void;
removeEventHandler(
event: "stateChange",
handler: ioBroker.StateChangeHandler,
): void;

// TODO: other events
}
11 changes: 11 additions & 0 deletions admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../tsconfig.json",
"include": [
"./admin.d.ts",
"./**/*.js",
// Include the adapter-config definition if it exists.
// It should be at either on of these paths:
"../lib/adapter-config.d.ts", // JS
"../src/lib/adapter-config.d.ts", // TS
]
}
18 changes: 16 additions & 2 deletions build/lib/interfaces.js

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

8 changes: 7 additions & 1 deletion build/lib/interfaces.js.map

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

Loading

0 comments on commit 343f947

Please sign in to comment.