Skip to content

Commit

Permalink
Fixed issue where missing state prevented custom parser write
Browse files Browse the repository at this point in the history
  • Loading branch information
crycode-de committed Mar 26, 2021
1 parent 073e9d3 commit 0ed5084
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 8 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@ By writing JSON data to the `raw.send` state you are able to send CAN messages c

## Changelog

### 1.0.2 (2021-03-26)
* (crycode-de) Fixed issue where missing state prevented custom parser write
* (DutchmanNL) Dutch translation updates
* (UncleSamSwiss) French translation updates
* (VeSler) Russian translation updates

### 1.0.1 (2021-03-12)
* (crycode-de) Use a queue to process _parser_ and _send_ state changes in the correct order
* (crycode-de) Fixed some spelling issues
Expand Down
2 changes: 1 addition & 1 deletion admin/build/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion admin/build/index.js.map

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion build/main.js

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

2 changes: 1 addition & 1 deletion build/main.js.map

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "canbus",
"version": "1.0.1",
"version": "1.0.2",
"news": {
"1.0.2": {
"en": "Fixed issue where missing state prevented custom parser write",
"de": "Problem behoben, bei dem ein fehlender State das Schreiben von benutzerdefinierten Parsern verhinderte",
"ru": "Исправлена ошибка, из-за которой отсутствующее состояние препятствовало записи пользовательского парсера.",
"pt": "Corrigido o problema em que o estado ausente impedia a gravação do analisador personalizado",
"nl": "Probleem opgelost waarbij de ontbrekende status het schrijven van de aangepaste parser verhinderde",
"fr": "Correction d'un problème où l'état manquant empêchait l'écriture de l'analyseur personnalisé",
"it": "Risolto il problema per cui lo stato mancante impediva la scrittura del parser personalizzato",
"es": "Se solucionó el problema por el que el estado faltante impedía la escritura del analizador personalizado",
"pl": "Naprawiono problem polegający na tym, że brakujący stan uniemożliwiał zapis niestandardowego parsera",
"zh-cn": "修复了缺少状态阻止自定义解析器写入的问题"
},
"1.0.1": {
"en": "Use a queue to process parser and send state changes in the correct order",
"de": "Verwendung einee Warteschlange, um Parser- und send-State Änderungen in der richtigen Reihenfolge zu verarbeiten",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.canbus",
"version": "1.0.1",
"version": "1.0.2",
"description": "CAN Bus integration",
"author": {
"name": "Peter Müller",
Expand Down
3 changes: 2 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export class CanBusAdapter extends utils.Adapter {
const jsonState = await this.getStateAsync(`${msgCfg.idWithDlc}.json`);
let data: Buffer | Error | null = this.getBufferFromJsonState(jsonState, msgCfg.idWithDlc);
if (data === null) {
return;
// state not found or invalid json in state... create default buffer for the parser
data = Buffer.alloc(msgCfg.dlc >= 0 ? msgCfg.dlc : 8);
}

// write to data using the parser
Expand Down

0 comments on commit 0ed5084

Please sign in to comment.