PhilipsHue / PhilipsHueSDK-iOS-OSX

The Software Development Kit for Philips Hue on iOS and OS X (beta)
579 stars 169 forks source link

Kill existing bridge cache? #57

Closed richardsongraph closed 9 years ago

richardsongraph commented 10 years ago

I'm trying to get the current cache of the bridge and then kill it so that my system will search for a new one. How is this done? This doesn't work...

PHBridgeResourcesCache *cache = [PHBridgeResourcesReader readBridgeResourcesCache]; cache = nil;

This happens if the ipAddress changes with a modem or router re-boot.

lightbow commented 10 years ago

Richard, the cache is readonly. It sounds like you might want something like this instead:

    [self disableLocalHeartbeat];
    [self.phHueSDK stopSDK];
    self.phHueSDK = [[PHHueSDK alloc] init];
    [self.phHueSDK startUpSDK];
    [self enableLocalHeartbeat];

(assuming you have a property on your controller object called phHueSDK)