Skip to content

Commit

Permalink
Merge pull request #2 from Baumert7269/develop
Browse files Browse the repository at this point in the history
New Testversion 0.0.3
  • Loading branch information
Baumert7269 authored Feb 23, 2020
2 parents 7799757 + 22198f2 commit 256b927
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 32 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ Some data points are only created when the 3D printer has been activated or the

## Changelog


### 0.0.3

* (Baumert7269) Bugfixes
- fixed problem "Cannot read property 'val' of null"

### 0.0.2
* (Baumert7269) 3D-Model-Management implemented
- optionally selectable in the configuration
Expand Down
2 changes: 1 addition & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"common": {
"name": "repetierserver",
"version": "0.0.2",
"version": "0.0.3",
"news": {
"0.0.2": {
"en": "ioBroker Adapter for RepetierServer - Server for 3D-printer",
Expand Down
63 changes: 34 additions & 29 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -1772,49 +1772,54 @@ function info(tadapter, status){

// info.connection
tadapter.getState('info.connection', (err, state) => {

// kein Fehler, Wert vorhanden und Wert ungleich status
if (!err && state && state.val != status){
// dann ausgeben
tadapter.setState('info.connection', status, true);
if (state){
// kein Fehler, Wert vorhanden und Wert ungleich status
if (!err && state.val != status){
// dann ausgeben
tadapter.setState('info.connection', status, true);
}
}
});

// info.activeprinter
tadapter.getState('info.activeprinter', (err, state) => {
let aprint='';
for (let p = 0; p < aprinterAktiv.length; p++) {
if (aprinterAktiv[p]["Aktiviert"] == true){
aprint = aprint + aprinterAktiv[p]["Printer"] + '; ';
if (state){
let aprint='';
for (let p = 0; p < aprinterAktiv.length; p++) {
if (aprinterAktiv[p]["Aktiviert"] == true){
aprint = aprint + aprinterAktiv[p]["Printer"] + '; ';
}
}
}

// Sting anpassen
if (aprint.length >0 ){
aprint = aprint.substring(0, aprint.length-2);
}
// Ausgeben
if (aprint != state.val){
tadapter.setState('info.activeprinter', {val: aprint, ack: true});
// Sting anpassen
if (aprint.length >0 ){
aprint = aprint.substring(0, aprint.length-2);
}
// Ausgeben
if (aprint != state.val){
tadapter.setState('info.activeprinter', {val: aprint, ack: true});
}
}
});

// info.activeprintjob
tadapter.getState('info.activeprintjob', (err, state) => {
let pprint='';
for (let p = 0; p < aprinterDruckt.length; p++) {
if (aprinterDruckt[p]["druckt"] == true){
pprint = pprint + aprinterDruckt[p]["Printer"] + '; ';
if (state){
let pprint='';
for (let p = 0; p < aprinterDruckt.length; p++) {
if (aprinterDruckt[p]["druckt"] == true){
pprint = pprint + aprinterDruckt[p]["Printer"] + '; ';
}
}
}

// Sting anpassen
if (pprint.length >0 ){
pprint = pprint.substring(0, pprint.length-2);
}
// Ausgeben
if (pprint != state.val){
tadapter.setState('info.activeprintjob', {val: pprint, ack: true});
// Sting anpassen
if (pprint.length >0 ){
pprint = pprint.substring(0, pprint.length-2);
}
// Ausgeben
if (pprint != state.val){
tadapter.setState('info.activeprintjob', {val: pprint, ack: true});
}
}
});
}
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.repetierserver",
"version": "0.0.2",
"version": "0.0.3",
"description": "ioBroker repetierserver Adapter",
"author": {
"name": "Thomas Baumert",
Expand Down

0 comments on commit 256b927

Please sign in to comment.