Skip to content

Commit

Permalink
color-control-server.ts aktualisieren
Browse files Browse the repository at this point in the history
  • Loading branch information
t0bst4r authored Dec 22, 2024
1 parent d272e32 commit 62c1a33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/matter/behaviors/color-control-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { applyPatchState } from "../../utils/apply-patch-state.js";
const FeaturedBase = Base.with("ColorTemperature", "HueSaturation");

export interface ColorControlConfig {
expandMinMaxForValue?: boolean;
expandMinMaxTemperature?: boolean;
}

export class ColorControlServerBase extends FeaturedBase {
Expand All @@ -31,7 +31,7 @@ export class ColorControlServerBase extends FeaturedBase {
const attributes = entity.state.attributes as LightDeviceAttributes;
let minKelvin = attributes.min_color_temp_kelvin ?? 1500;
let maxKelvin = attributes.max_color_temp_kelvin ?? 8000;
if (this.state.config?.expandMinMaxForValue == true) {
if (this.state.config?.expandMinMaxTemperature == true) {
minKelvin = Math.min(minKelvin, currentLevel ?? Infinity);
maxKelvin = Math.max(maxKelvin, currentLevel ?? -Infinity);
}
Expand Down

0 comments on commit 62c1a33

Please sign in to comment.