Page 1 of 1

Need help with tdDim from NodeJS call

Posted: Sun Dec 08, 2019 1:52 pm
by dagalufh
Hi,

I am trying to call tdDim from NodeJS, but i'm unable to get the device to actually change the dim value.

According to documentation, i have defined it as such:

tdDim: ['int', ['int','char']]
- Should i use something different than char?

But I can't figure out what values to pass as the "char" one?
The definition in the documentation is:
______________________________________________________________________
int WINAPI tdDim ( int intDeviceId,
unsigned char level
)
Dims a device. Make sure the device supports this by calling tdMethods() before any call to this function.

Parameters:
intDeviceId The device id to dim.
level The level the device should dim to. This value should be 0 - 255.
Returns:
TELLSTICK_SUCCESS on success or appropriate error code on failure.
Since:
Version 2.0.0
______________________________________________________________________

I have tried to send pure integer value 0-255, but it said it was to high above 100. (This could be a NodeJS error and not a Telldus error, unsure.. And this resulted in no change on the actual device)

I can set specific dim levels through the Telldus Center, 20% 50% and so on through the buttons there, so the support on the device should be correct for specifying dim levels.

What sort of values should I pass? For example if i want to have it set on 50% or 100%?
I have checked and i get a 0 in return value..


Any assistance would be helpful, unsure where to go from here at this point in time.

BR
Mikael

Re: Need help with tdDim from NodeJS call

Posted: Sun Dec 08, 2019 2:22 pm
by dagalufh
Ändrade till int istället för char på functionsdefinitionen, nu verkar det fungera.

Ska bara komma på något bra sätt att presentera procentalternativen.