Closed jenscski closed 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.
Property 'brightness.statusPattern' was given in an unsupported type. Using the default one!
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) ?
if (config.brightness.statusPattern)
Yes you are right, thanks for reporting. Was fixes in v1.2.2
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
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)
?