Skip to content

Commit

Permalink
Fix type assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
DEV2DEV-DE committed Nov 29, 2023
1 parent cf69aac commit bfe3b1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ Connects to the Jablotron cloud to access your security system.
Currently the adapter is **read-only**! It's only possible to read the states. Switching will be implemented later!

## Changelog
### **WORK IN PROGRESS**
* Handle unknown state types

### 0.0.2-beta.4 (2023-11-29)**
* Switched recurring refresh from interval to timeout
* Manage internal list of already created states
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,9 @@ class Jablotron extends utils.Adapter {
break;
case 'boolean': type = 'boolean';
break;
default: type = 'number';
case 'number': type = 'number';
break;
default: throw new Error('Unknown type for value "' + name + '"');
}
if (!this.existsState(id)) {
await this.extendObjectAsync(id, { type: 'state', common: { name: `${name}`, type: `${type}`, role: 'state', read: read, write: write }, native: {}, });
Expand Down

0 comments on commit bfe3b1a

Please sign in to comment.