Skip to content

Commit

Permalink
Apply some suggestions from code rabbit
Browse files Browse the repository at this point in the history
  • Loading branch information
itavero committed Jan 4, 2025
1 parent 3e2b9f2 commit 524bd1a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Since version 1.0.0, we try to follow the [Semantic Versioning](https://semver.o

- Light sensor will now use `illuminance` property if `illuminance_lux` is not available. This should fix compatibility with the new major v2 release of Zigbee2MQTT. (see [#966](https://github.com/itavero/homebridge-z2m/issues/966))
- Brightness for a Light is no longer requested by default. This should prevent issues when the light is off.
Old behavior can be restored using the `request_brightness` option in the converter specific configuration.
Old behavior can be restored using the `request_brightness` option in the converter-specific configuration.
(see [#882](https://github.com/itavero/homebridge-z2m/issues/882))

## [1.11.0-beta.6] - 2024-06-30
Expand Down
3 changes: 2 additions & 1 deletion docs/light.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ The table below shows how the different features within this `exposes` entry are
"adaptive_lighting": {
"only_when_on": true,
"transition": 0.5
}
},
"request_brightness": false
}
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/converters/light.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ export class LightCreator implements ServiceCreator {
let requestBrightness = false;
let adaptiveLightingConfig: AdaptiveLightingConfig | undefined = undefined;
if (isLightConfig(converterConfig)) {
if (converterConfig.request_brightness === true) {
requestBrightness = true;
}
requestBrightness = !!converterConfig.request_brightness;
if (isAdaptiveLightingConfig(converterConfig.adaptive_lighting)) {
adaptiveLightingConfig = converterConfig.adaptive_lighting;
} else if (converterConfig.adaptive_lighting === true) {
Expand Down

0 comments on commit 524bd1a

Please sign in to comment.