Closed lightbow closed 10 years ago
Though maybe it's possible the scene isn't getting saved properly. Is it a reasonable practice to create a scene, save out the necessary light states, and create a new schedule all in the same run loop? No errors are reported in any of the completion blocks, just this crash.
This is error is caused because no group identifier is set when you set the scene identifier in the schedule object. Recalling a scene requires also a group identifier, which means the scene will be activated on the lights that are both part of the scene and group. Consider the following examples:
Example1: Scene "1": lights: "1","2","3" Group "0": contains all lights. This group is by default available
When you recall scene "1" on group "0" then all the lights will go the state defined for that scene.
Example2: Scene "1": lights: "1","2","3" Group "1": lights: "1"
When you recall scene "1" on group "1" then only light "1" will go to the defined state for that scene.
Example3: Scene "1": lights: "1","2","3" Group "1": lights: "4"
When you recall scene "1" on group "1", the scene won't be activated on any of the lights because they are not part of the group.
I agree with you that this shouldn't crash the SDK, but rather produce an error. We'll create a ticket for this on our backlog.
Thanks for that information. The comment in the header file seems to contradict that though, implying that if you have a scene identifier set for a schedule meant to change an entire scene at once, a group identifier is not needed.
It sounds like I should just be able to set a group identifier of 0 (which includes all lights) and it should work?
/* The identifier of the group this schedule should have effect on, this is only set if this schedule is meant to change a group and not a scene or light. / @property (nonatomic, strong) NSString *groupIdentifier;
Thanks for reporting, in 1.3beta we have improved the header documentation with regard to using the scene and group identifiers.
I'm getting * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* setObjectForKey: object cannot be nil (key: address)'
I saw a previous post on this but he was using lightIdentifier. I'm trying to use sceneIdentifier, and according to the header file, I should be able to have a nil lightIdentifier and nil groupIdentifier if I provide a valid sceneIdentifier.
Still, even if the request isn't formed correctly, the SDK should produce an error, not crash. Any suggestions?
2 0x00016d68 in -[PHBridgeSendAPI2 createSchedule:completionHandler:] at /Library/Server/Xcode/Data/BotRuns/Cache/c5ea3bc5-5e62-5e62-453d-f1fa5ca3092c/source/HueSDK/HueSDK/BridgeSendAPI/PHBridgeSendAPI2.m:196