Within a room lighting app that uses time periods, I added a new period. I then needed to make additional changes to the periods. When I click on the block for Vary Light Settings Per Time Period I get the message "
Error: Cannot cast object 'null' with class 'java.lang.String' to class 'int'" and cannot get to the time period page.
The corresponding log entry is:
app:9082023-01-07 06:20:49.364 PMerrororg.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object 'null' with class 'java.lang.String' to class 'int' on line 2038 (method onDevicesPage)
Is there any way I can recover this app or will I need to recreate it from scratch? I've tried exporting and re-importing it with no luck.
Just a thought... it would be nice if when you edit a rule that it would keep a copy of what you started with until you saved it. Usually when I hit these errors it's before the final save and if I could just "cancel changes" that would be handy. Or sometimes I'll start making changes and decide against it and then need to put it back. I mean I guess I can just make a backup before I do anything and restore everything if needed. Hey! Maybe an option to restore a specific rule from the last backup would be cool? Probably a pain in the a$$ to do it but it's fun to dream.
Not sure why I didn't think of it before but based on your post I simply restored from my last backup. Lost some changes I'd been working on, but not too much.
Thanks for jogging my old brain.
Still, whoever's lead on the Room Lighting app could take a look into the cause of the error so others don't have this problem.
After restoring I immediately went to add the desired new time periods again. I get the same error now but think I know the cause.
I have multiple time periods simply named a,b,c,d,e,f,g,h,i. I want to slip one in between g and h.
I rename i to j. OK
I rename h to i. Error.
I believe because I renamed to a name already used before saving the routine is what caused the error. I need to restore again now but will continue to test.
Further testing... renaming the period that was originally named "h" to a name not used before also prompts the error "
Cannot cast object 'null' with class 'java.lang.String' to class 'int' on line 2038 (method onDevicesPage)".
This was the first step tried after restoring this time, so it's not because of trying to use a previously used name. Maybe @bravenel could look into this sometime after CES.
Just a quick note... I was able to make the desired changes without errors by adding new time periods and just not renaming any previous periods.
Thanks for tracking this down so well! Found this bug, and it will be fixed in the next release.
Great. Thanks for such a quick response!