klanchman / homebridge-logi-circle-controls

Homebridge plugin for extended Logitech Circle camera controls
MIT License
21 stars 1 forks source link

Determine user agent based on Logitech API info endpoint #25

Open klanchman opened 3 years ago

klanchman commented 3 years ago

I was very lazy with #24 and hardcoded the latest iOS client version. The client hasn't been updated in quite a while, so I figure this will work for a decent amount of time.

However, a better solution would be looking at Logitech's GET /api/info endpoint, which returns a payload like this:

{
  "Version": "1.68.0-31-g5b738a7c8",
  "minVersions": [
    {
      "Name": "iOSClient",
      "Version": "3.3.1"
    },
    {
      "Name": "AndroidClient",
      "Version": "3.3.1"
    },
    {
      "Name": "KryptoCamera",
      "Version": "4.0.352"
    }
  ]
}

The plugin would then be able to use one of the versions found here to construct its User-Agent header.