Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the vis-functions are not called #454

Open
oweitman opened this issue Feb 8, 2022 · 7 comments
Open

the vis-functions are not called #454

oweitman opened this issue Feb 8, 2022 · 7 comments
Labels
bug recheck-with-vis2 Issue from vis1 shall be rechecked with vis2

Comments

@oweitman
Copy link
Contributor

oweitman commented Feb 8, 2022

Describe the bug
in some cases the binding expression is interpreted as eval. then, the resulting javascript want to call the vis function which is not available.

To Reproduce
Steps to reproduce the behavior:

  1. create a datapoint with name 0_userdata.0.test1
  2. set value to ""181.3999999"" or "181.3999999"
  3. in vis create a html-widget
  4. as html insert the following expression
    {v1:0_userdata.0.test1;parseFloat(v1);round(1)}
  5. in runtime, the result is 0

Expected behavior
the result should be 181.4

Screenshots & Logfiles
browser log (callstack removed)

instrument.ts:129 Error in eval[value]     : {v1:0_userdata.0.test1;parseFloat(v1);round(1)}
instrument.ts:129 Error in eval[script]: var v1 = "181.3999999";return round(1);
instrument.ts:129 Error in eval[error] : ReferenceError: round is not defined

Versions:
vis 1.3.4

https://forum.iobroker.net/topic/12319/rechnen-in-widgets/50?_=1644327092076

@Apollon77
Copy link
Collaborator

Yes, the function is called Math.round ... there is no "round" in Javascript

@Apollon77
Copy link
Collaborator

An in fact yes bindings are converted into mini javsscripts and eval'ed ...

@oweitman
Copy link
Contributor Author

oweitman commented Feb 8, 2022

yes, there is no round in javascript, but vis owns a binding-function named round
image
and these functions should be usable as described in the documentation
i guess the same is with the other functions
https://github.com/ioBroker/ioBroker.vis#bindings-of-objects -> Following operations are supported
please reopen

@Apollon77 Apollon77 reopened this Feb 9, 2022
@Apollon77
Copy link
Collaborator

Oohh, ok learned something new :-)) @GermanBluefox ?

@stale
Copy link

stale bot commented Jun 13, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

@stale stale bot added the wontfix label Jun 13, 2022
@oweitman
Copy link
Contributor Author

Still relevant

@stale stale bot removed the wontfix label Jun 13, 2022
@stale
Copy link

stale bot commented Sep 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days. Please check if the issue is still relevant in the most current version of the adapter and tell us. Also check that all relevant details, logs and reproduction steps are included and update them if needed. Thank you for your contributions.
Dieses Problem wurde automatisch als veraltet markiert, da es in letzter Zeit keine Aktivitäten gab. Es wird geschlossen, wenn nicht innerhalb der nächsten 7 Tage weitere Aktivitäten stattfinden. Bitte überprüft, ob das Problem auch in der aktuellsten Version des Adapters noch relevant ist, und teilt uns dies mit. Überprüft auch, ob alle relevanten Details, Logs und Reproduktionsschritte enthalten sind bzw. aktualisiert diese. Vielen Dank für Eure Unterstützung.

@stale stale bot added the wontfix label Sep 21, 2022
@Feuer-sturm Feuer-sturm added the recheck-with-vis2 Issue from vis1 shall be rechecked with vis2 label Nov 17, 2022
@stale stale bot removed the wontfix label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug recheck-with-vis2 Issue from vis1 shall be rechecked with vis2
Projects
None yet
Development

No branches or pull requests

3 participants