Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter stops the whole time #1

Closed
radebold opened this issue Jul 6, 2023 · 4 comments
Closed

Adapter stops the whole time #1

radebold opened this issue Jul 6, 2023 · 4 comments
Labels
bug Something isn't working fixed

Comments

@radebold
Copy link

radebold commented Jul 6, 2023

adapter try to start, but the interupted and stoped with error

Terminated (ADAPTER_REQUESTED_TERMINATION): xs1 Initialization Error:TypeError: Cannot read properties of undefined (reading '_subscribeForeignStates') at subscribeStates (/opt/iobroker/node_modules/@iobroker/js-controller-adapter/build/lib/adapter/adapter.js:7387:21) at /opt/iobroker/node_modules/iobroker.xs1/myAdapter.js:709:111 at new Promise (<anonymous>) at /opt/iobroker/node_modules/iobroker.xs1/myAdapter.js:709:20 at /opt/iobroker/node_modules/iobroker.xs1/myAdapter.js:267:81

@SamLowrie
Copy link

Habe jetzt den gleichen Fehler nach Update auf aktuellen Scripting-Host (5.0.8). Adapter started nicht mehr. Meine Javascript-Kentnisse sind leider nicht gut genug um zu verstehen, was an dieser Stelle passiert, bzw. falsch läuft (myAdapter.js, Zeile 709).

@SamLowrie
Copy link

SamLowrie commented Jul 19, 2023

Hab jetzt etwas google recherchiert. Habe einen anderen Adapter gefunden, der das gleiche Problem mit der gleichen Codezeile hatte (km200 Adapter, Commit ).

Wenn man in myAdapter.js die Zeile 267 ersetzt durch die neue Zeile aus dem km200 Adapter startet der Adapter wieder und ich bekomme auch wieder Sensorwerte vom XS1 rein.

//.then(() => stateChange ? MyAdapter.c2p(adapter.subscribeStates)('*') : null)
.then(() => stateChange ? adapter.subscribeStates('*') : null)

Diff

267c267,268
<                 .then(() => stateChange ? MyAdapter.c2p(adapter.subscribeStates)('*') : null)
---
>                 //.then(() => stateChange ? MyAdapter.c2p(adapter.subscribeStates)('*') : null)
>               .then(() => stateChange ? adapter.subscribeStates('*') : null)

Da ich aber nicht wirklich verstehe was in der Zeile passiert kann ich nicht sagen ob daß das Problem wirklich löst oder dadurch andere Probleme entstehen. Daher mach ich mal lieber keinen PR draus.

@descco
Copy link

descco commented Oct 7, 2023

Hallo SamLowrie,

Ich kann den Fix (Workaround) bestätigen.

Siehe auch
https://forum.iobroker.net/topic/3516/mein-erster-adapter-f%C3%BCr-ezcontrol-xs1/100

mcm1957 added a commit that referenced this issue Oct 8, 2023
* (mcm1957) A crash due to incorrect bindings has been fixed. [#1]
* (mcm1957) Standard testennvironment has been added
* (mcm1957) Dependencies have been updated
@mcm1957 mcm1957 changed the title Adapter stopt the whole time Adapter stops the whole time Oct 8, 2023
@mcm1957 mcm1957 added bug Something isn't working fixed labels Oct 8, 2023
@mcm1957
Copy link
Member

mcm1957 commented Oct 8, 2023

fixed with 1.1.1-alpha.0

mcm1957 added a commit that referenced this issue Oct 8, 2023
* (mcm1957) A crash due to incorrect bindings has been fixed. [#1]
* (mcm1957) Standard testennvironment has been added
* (mcm1957) Dependencies have been updated
mcm1957 added a commit that referenced this issue Oct 9, 2023
* (mcm1957) A crash due to incorrect bindings has been fixed. [#1]
* (mcm1957) Standard testennvironment has been added
* (mcm1957) Dependencies have been updated
@mcm1957 mcm1957 closed this as completed Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed
Projects
None yet
Development

No branches or pull requests

4 participants