devbobo / homebridge-lifx-lan

LiFx LAN platform plugin for Homebridge
MIT License
84 stars 27 forks source link

Lightbulb Service not userInteractive #10

Closed florian-muc closed 8 years ago

florian-muc commented 8 years ago

Recently discovered that some apps don't show the LIFx lightbulb in the app and did some testing.

When inquiring on iOS, the LIFx Lightbulb service reports being not userInteractive. When looking at HMService.h, this is correct behavior.

This means it's a bug and the plugin should return YES for userInteractive.

/*!

devbobo commented 8 years ago

@florian-mac which apps and what iOS version ?

devbobo commented 8 years ago

@florian-muc I spoke with @khaost about this problem, he said accessories need to provide a service name, as the presence of this determines if it's user interactive or not.

My current release (0.1.4) should address this, but the devices will need to be freshly instanciated.

To do this easily..

1 Make the following code changes here...

    this.api.on('didFinishLaunching', function() {
        this.api.unregisterPlatformAccessories("homebridge-lifx-lan", "LifxLan", this.accessories);
        this.accessories = {};

        /*
        Client.init({
            debug:                  this.config.debug || false,
            broadcast:              this.config.broadcast || '255.255.255.255',
            lightOfflineTolerance:  this.config.lightOfflineTolerance || 5,
            messageHandlerTimeout:  this.config.messageHandlerTimeout || 45000,
            resendMaxTimes:         this.config.resendMaxTimes || 4,
            resendPacketDelay:      this.config.resendPacketDelay || 150
        });
        */
    }.bind(this));

2 Restart homebridge twice (ensures that devices aren't reloaded from the device cache). 3 Remove code changes above. 4 Restart homebridge

devbobo commented 8 years ago

@florian-muc I've just release version 0.1.5 which should automatically add the Service name if one doesn't exist, when Homebridge is restarted.

florian-muc commented 8 years ago

@devbobo Thanks so much for the quick reaction and fix :) Already updated to 0.1.5, all is perfect now. Thanks again!