Scenes throwing Java errors every minute

I really wish I could get the integer to stick. I kind of guessed this was the problem (was a Sun Certified Have Developer some 20 years ago...) but don't see how I would change it.

But what is the level on the actual lights? If the scene is reading the current level from the lights, and there is a decimal there, that could throw the error too (maybe - no idea what is on line 627 of the scene app code).

image

60, believe it or not...

Not 60... 60.0....

60 = integer
60.0 = decimal, not an integer.

Not saying that is the issue for sure, but very well could be.

Normally a level looks like this (notice no decimal):
image

Good point. So, the problem is that in adjust scene they look like integers (shows 60). When I go into the device itself. Even when I enter an int it looks like a float. I think this is a LIFX driver issue.

That is my GUESS as well. I don't have any LIFX bulbs to test it against though.

That said, I think the scenes app should handle it more gracefully anyway. Similar to the changes Bruce recently put in the Simple Automation Rules app to handle getting floats when integers were expected.

Like this:

Agree. The point of throwing exceptions in Java is that the code can catch them and do something smart when the condition happens. Your code fragment is what they should have done. For now, I'm removing these scenes and hard coding the behavior in a rule.

Would probably be really easy to just change the driver to use int as its event value, too. It can't set that event TOO many places I wouldn't think.

Thanks for taking the time to let me bounce this off of you and help work through it.

Level, saturation and hue are all defined to be integers. Drivers that throw decimals are just wrong, and should be fixed.

I agree, but where is that documented?

Thought of that. The problem is that it will get overwritten if I do a code update using Hubitat Package Manager.

True. Best to feed that back to the dev, and get them to fix the driver permanently. :+1:

I don't know about the documentation. Just that the hub implementation has always expected integers for these values.

:+1:

I agree they should be integers.

My only point is that we can't really blame developers for doing something that isn't documented... The only documentation I know of says NUMBER is a valid attribute variable type, and NUMBER includes floats.

Anyone know how to tag "robheyes" or "Robert Alan Keyes". He seems to be the author of the LIFX code.

I think it is just @rob

Hi @rob. I appreciate your drivers, but if your read this thread, you'll see there's an issue with ints/floats in levels. Thanks!

In the meantime, I will put the fix into Scene-1.2 to make it immune to decimals, as was done with the other apps.

This fix will be in the next hot fix release.