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

toString() doesn‘t properly represent Items, Things #197

Closed
florian-h05 opened this issue Dec 18, 2022 · 3 comments
Closed

toString() doesn‘t properly represent Items, Things #197

florian-h05 opened this issue Dec 18, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@florian-h05
Copy link
Contributor

florian-h05 commented Dec 18, 2022

Calling the toString() method on native Java openHAB Items returns a string that represents the Item with it‘s metadata etc. (e.g. F2_Office_Main_Light (Type=SwitchItem, State=OFF, Label=Deckenlampe AZ, Category=light, Tags=[Lightbulb], Groups=[LichterAZ])), but calling toString() on the JS version tries to stringify the object:

{
  "rawItem": {},

  "history": {

    "rawItem": {}

  },

  "semantics": {

    "rawItem": {}

  }

} 

ThingImpl doesn‘t provide a toString method, maybe one should be introduced?

FYI have a look at the toString method of GenericItem.

This issue is just a reminder for myself and to track this.

@stefan-hoehn Das hier ist das Problem wieso das Loggen eines Items von Blockly aus auf JS Scripting nicht mehr so funktioniert wie auf Nashorn.

@florian-h05 florian-h05 added the bug Something isn't working label Dec 18, 2022
@florian-h05 florian-h05 self-assigned this Dec 18, 2022
@florian-h05 florian-h05 changed the title toString() doesn‘t properly represent Items, Things, etc… toString() doesn‘t properly represent Items, Things Dec 18, 2022
@stefan-hoehn
Copy link
Contributor

Thx, @florian-h05 , I appreciate if that would be done. Do you need support here?

@florian-h05
Copy link
Contributor Author

Thanks for asking, I’d need a review for my PR #198.

@florian-h05
Copy link
Contributor Author

Closing as #198 has been merged and I don't see the need in providing a Thing serialization from core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants