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

js-controller 3.3 Adapter comaptibility #1301

Closed
Apollon77 opened this issue Apr 30, 2021 · 11 comments
Closed

js-controller 3.3 Adapter comaptibility #1301

Apollon77 opened this issue Apr 30, 2021 · 11 comments

Comments

@Apollon77
Copy link
Collaborator

With js-controller 3.2 and js-controller 3.3 some additional checks were added to make sure that created objects match to the specifications and also written state values match to the object definition.

If something is not correct this is logged as "warning" log.

Please take the time to verify your adapter by ideally starting with a fresh instance and do some actions and verify the log. If you see a warn log there from these checks please adjust the adapter and fix the relevant cases.

This thread is for tracking purposes and allows questions and discussions

@Apollon77 Apollon77 added this to Planned in Next version 3.3.x (Hannah) via automation Apr 30, 2021
@HGlab01
Copy link

HGlab01 commented Apr 30, 2021

I think the log-message is missleading, e.g.
.serialNo" has wrong type "string" but has to be "number"
This state is currently defined as number, so the message should be
has wrong type "number" but has to be "string"
isn't it?

@Apollon77
Copy link
Collaborator Author

read full message :)

State value to set for "${id}" has wrong type "${typeof state.val}" but has to be "${obj.common.type}"

"State value to set" means the value that someone wants to write

@phifogg
Copy link

phifogg commented May 1, 2021

I am with HGlab01 on this.. my first interpretation was my states are wrongly defined. But it seems my adapter is setting wrong values rather. This could be more explicit.

@Apollon77
Copy link
Collaborator Author

Ok then please propse a better log message :-) In my eyes when reading the full message it should be clear :-)

@Apollon77 Apollon77 moved this from Planned to In progress in Next version 3.3.x (Hannah) May 1, 2021
This was referenced May 5, 2021
This was referenced May 5, 2021
@jpgorganizer
Copy link

jpgorganizer commented May 5, 2021

With js-controller 3.2 and js-controller 3.3 some additional checks were added

do you have a list of that changes? which have been in 3.2 and which in 3.3?

I cannot see the message State value to set for "xxx" has to be type "string" but received type "number" with js-controller 3.2, but I've seen it in another log, but don't know which js-c version is running there.

How can I update to js-c v3.3? I've v 3.2.16 installed and this seems to be the actual version. At least my installations do say that.
Sorry, even I'm an adapter developer, I'm not very familiar with core ioBroker things :-)

Edit: Do you have a time schedule for that changes?

@Apollon77
Copy link
Collaborator Author

The changelog should give you all infos ;-)) Especially check the Developer sections https://github.com/ioBroker/ioBroker.js-controller/blob/master/CHANGELOG.md

"State value to set ..." error are new in js.controller 3.3.

js-controller 3.3 instructions and test thread in forum https://forum.iobroker.net/topic/44624/js-controller-3-3-jetzt-im-latest

What you mean with "Time schedule"? We work in an agile way and use GitHub projects where plans can be seen as tickets, also the upcomig 3.4 is listed there ... but from time to time we add new stuff, so monitoring js.contrller PRs is the best way to go if you want to know what will come i advance

@phifogg
Copy link

phifogg commented May 6, 2021

Ok then please propse a better log message :-) In my eyes when reading the full message it should be clear :-)

The issue you are trying to solve for is lazy programmers (like me) relying on javascripts automatic type cast. I would assume that most folks have set the state properties correctly but don't care when setting values.

Reading it again a few times your message does make sense %/ Maybe make it a bit more explicit:

State value to set for "${id}" has wrong type "${typeof state.val}" but state is defined to be "${obj.common.type}"

Or

Setting state value for "${id}" called with wrong type "${typeof state.val}", expected "${obj.common.type}"

@Apollon77
Copy link
Collaborator Author

We adjusted in js.controller 3.3.8 alreayd when I remember correctly ...

@anwa
Copy link

anwa commented May 7, 2021

I already made PR for tankerkoenig, unifi and weatherunderground. But there are so many :(
Unfortunately not all adapters are well supported by there authors. And sometimes the Problem is more complex like in sonoff or unifi.
For example unifi: The API responds some number values as string??? So we have to check and convert the values back to numbers...

@Apollon77
Copy link
Collaborator Author

Thank you for our support here and yes some are easy, some requires deeper checks.
We can only work on them one after the other :-(

Any PR is highly appreciated!

@Apollon77 Apollon77 moved this from In progress to Done in Next version 3.3.x (Hannah) Dec 4, 2021
@foxriver76
Copy link
Collaborator

Can we close this issue now? ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants