Skip to content

Fix state attribute definitions and build issues - #157

Open
astra0815 wants to merge 7 commits into
DrozmotiX:mainfrom
astra0815:main
Open

Fix state attribute definitions and build issues#157
astra0815 wants to merge 7 commits into
DrozmotiX:mainfrom
astra0815:main

Conversation

@astra0815

Copy link
Copy Markdown

Description
This PR addresses several issues encountered during adapter installation and runtime:

Adds missing state attribute definitions for keyList, lockDeviceId, status, doorState, lockState, onlineStatus, and lockDevicesIds to prevent "State attribute definition missing" warnings.
Fixes TypeScript configuration by updating moduleResolution to "node16" for compatibility.
Adds canvas dependency with version override to avoid compilation issues on ARM platforms.
Updates package.json with proper overrides for canvas to use prebuilt binaries.
Changes
lib/state_attr.js: Added definitions for new state attributes.
tsconfig.json: Changed moduleResolution from "node" to "node16".
package.json: Added canvas to devDependencies and overrides for canvas version.
Testing
Verified that the adapter installs without canvas compilation errors.
Confirmed that state creation warnings are resolved.

astra0815 and others added 7 commits April 26, 2026 13:15
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…igiert

- dataRefresh: setTimeout feuerte nur einmal, da rekursiver Aufruf
  fehlte. Nach jeder Ausführung wird dataRefresh nun erneut aufgerufen,
  sodass der Polling-Zyklus dauerhaft läuft.

- apiCall: HTTP-Antwort-Chunks wurden mit  überschrieben
  statt zusammengeführt. Ersetzt durch chunks-Array mit Buffer.concat(),
  damit auch mehrteilige Antworten korrekt verarbeitet werden.
- intervallSettings: SmartLock und SmartLockUltra ergänzt (Default 30 Min.)
- onReady(): Intervall-Konfiguration für beide Lock-Typen wird geladen
- defineIntervallTime(): Cases für 'Smart Lock' und 'Smart Lock Ultra'
- loadDevices(): lock/unlock Button-States werden beim Start angelegt
- onStateChange(): lock/unlock Kommandos werden an die API gesendet
- state_attr.js: lock und unlock als Button-States definiert
- jsonConfig.json: Intervall-Felder für Smart Lock und Smart Lock Ultra
- io-package.json: Default-Werte (30 Min.) für neue Intervalle

Hinweis: deviceType-Strings 'Smart Lock' / 'Smart Lock Ultra' müssen
ggf. nach erstem API-Test anhand des Debug-Logs verifiziert werden.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant