michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
411 stars 114 forks source link

Bridge serial number != bridge id #226

Closed spudwebb closed 3 years ago

spudwebb commented 3 years ago

When discovering a bridge with MdnsBridgeLocator or SsdpBridgeLocator, the bridge id reported is actually the bridge serial number

https://github.com/Q42/Q42.HueApi/blob/4b4ef660cb31394efe3a5e3bfbf65ee55cc1fd12/src/Q42.HueApi/MUdpBasedBridgeLocator.cs#L152

but the bridge id reported in the BridgeConfig class or using HttpBridgeLocator is actually different from the serial number example: bridge id = ecb5fafffe0ed863 serial number = ecb5fa0ed863

so there is an extra fffe inserted to build the BridgeId, but can we assume it always follow that pattern?

not sure what the best way to fix that?

michielpost commented 3 years ago

The BridgeLocator gets the serialnumber from http:///description.xml I'm not sure if this always follows the same pattern. Maybe the official Hue forum can help with this question?

spudwebb commented 3 years ago

I workaround this issue in my own app, but I still think something should be done about it. At least a BridgeSerialNumber property should be added to the LocatedBridge class, and it's this property that should be set when discovering with MdnsBridgeLocator or SsdpBridgeLocator