ioBroker / ioBroker.js-controller

ioBroker controller
http://iobroker.net
MIT License
294 stars 58 forks source link

js-controller 3.3 Adapter comaptibility #1301

Closed Apollon77 closed 1 year ago

Apollon77 commented 3 years ago

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

HGlab01 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

jpgorganizer commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

anwa commented 3 years ago

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 commented 3 years ago

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!

foxriver76 commented 2 years ago

Can we close this issue now? ;-)