ioBroker / ioBroker.javascript

Script engine for JavaScript and Blockly
MIT License
320 stars 119 forks source link

[Bug]: Diskrepanz Mehrfach-UND vs. UND #1540

Closed ThalusX closed 3 months ago

ThalusX commented 3 months ago

I'm sure that

Script type

Blockly

The problem

Gleich vorweg, das ist mein erster Bugreport auf Git, bin darin nicht sonderlich geübt.

Ich bekomme bei identen Inhalten unterschiedliche Ergebnisse, je nachdem ob ich einen UND-Block oder einen Mehrfach-UND-Block verwende. Ich vermute, dass es sich hierbei um mögliches Problem mit der Klammersetzung in Kombination mit dem "Prüfe ob falls wahr / falls falsch" des dahinter liegenden JS-Codes handelt. Bitte die Namensgebung zu ignorieren.

grafik

Der JS-Code dazu sieht wie folgt aus: Mehrfach-Und: console.log(((getState('0_userdata.0.Sonnen.Sommermodus').val && getState('javascript.0.variables.isDaylightSaving').val ? compareTime(getAstroDate('sunrise', undefined, 0), '14:00', 'between', null) : compareTime(getAstroDate('sunrise', undefined, 0), '13:00', 'between', null) && getState('sonnen.0.configurations.EM_USOC').val < getState('sonnen.0.status.userSoc').val && getState('sonnen.0.status.userSoc').val <= 99 && getState('0_userdata.0.PV_Netting.Überschuss').val >= getState('sonnen.0.configurations.IC_InverterMaxPower_w').val / 2)));

Und: console.log((getState('0_userdata.0.Sonnen.Sommermodus').val && (getState('javascript.0.variables.isDaylightSaving').val ? compareTime(getAstroDate('sunrise', undefined, 0), '14:00', 'between', null) : compareTime(getAstroDate('sunrise', undefined, 0), '13:00', 'between', null)) && getState('sonnen.0.configurations.EM_USOC').val < getState('sonnen.0.status.userSoc').val && getState('sonnen.0.status.userSoc').val <= 99 && getState('0_userdata.0.PV_Netting.Überschuss').val >= getState('sonnen.0.configurations.IC_InverterMaxPower_w').val / 2));

iobroker.current.log (in debug mode!)

No response

Version of nodejs

20.12.0

Version of ioBroker js-controller

5.0.19

Version of adapter

7.8.0

klein0r commented 3 months ago

Wurde hier schon berichtet

https://forum.iobroker.net/topic/73807/blockly-bug-bei-neuem-multi-and

Und ist im aktuellen Entwicklungszweig bereits gelöst e1c86cab2b835d86e5c9f54ab080577662dd54e2

https://github.com/ioBroker/ioBroker.javascript/blob/bc339baee260c4e8f5665ecc68697a4eca18de9e/README.md?plain=1#L53

ThalusX commented 3 months ago

Sorry, hab ich wohl übersehen! Ist auch nicht so leicht zu finden :-)

klein0r commented 3 months ago

I'm sure that

  • [x] This issue is still present in the current beta version of this adapter

Bitte immer

Wird aber erst mit JavaScript 8.x gefixt sein (also dem nächsten Release)

ThalusX commented 3 months ago

Danke und sorry nochmal!

klein0r commented 3 months ago

Kein Problem, wirklich guter erster Issue mit sehr guter Beschreibung 👍