Supereg / homebridge-http-lightbulb

Powerful http lightbulb for Homebridge: https://github.com/homebridge/homebridge
ISC License
23 stars 7 forks source link

Property 'brightness.statusPattern' was given in an unsupported type. Using the default one! #11

Closed jenscski closed 3 years ago

jenscski commented 3 years ago

Describe the bug When using a configuration without any statusPattern, the warning Property 'brightness.statusPattern' was given in an unsupported type. Using the default one! is given.

Expected behavior No warning message

To Reproduce Steps to reproduce the behavior: Use the configuration from https://www.npmjs.com/package/homebridge-http-lightbulb#basic-light-bulb-with-power-and-brightness

Version

Configuration

{
  "accessory": "HTTP-LIGHTBULB",
  "name": "Light",

  "onUrl": "http://localhost/api/lightOn",
  "offUrl": "http://localhost/api/lightOff",
  "statusUrl": "http://localhost/api/lightStatus",

  "brightness": {
    "setUrl": "http://localhost/api/setBrightness?brightness=%s",
    "statusUrl": "http://localhost/api/getBrightness"
  }
}

Possible fix It looks like this line is wrong, https://github.com/Supereg/homebridge-http-lightbulb/blob/master/index.js#L351, Shouldn't be if (config.brightness.statusPattern) ?

Supereg commented 3 years ago

Yes you are right, thanks for reporting. Was fixes in v1.2.2