Add brightness control to Key Colors targets with HAOS integration
Adds brightness (0.0-1.0) to KeyColorsSettings, applies scaling in the KC processing pipeline after smoothing, exposes a slider on the WebUI target card, and creates a HA number entity for KC target brightness. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -106,6 +106,7 @@ def _kc_settings_to_schema(settings: KeyColorsSettings) -> KeyColorsSettingsSche
|
||||
interpolation_mode=settings.interpolation_mode,
|
||||
smoothing=settings.smoothing,
|
||||
pattern_template_id=settings.pattern_template_id,
|
||||
brightness=settings.brightness,
|
||||
)
|
||||
|
||||
|
||||
@@ -116,6 +117,7 @@ def _kc_schema_to_settings(schema: KeyColorsSettingsSchema) -> KeyColorsSettings
|
||||
interpolation_mode=schema.interpolation_mode,
|
||||
smoothing=schema.smoothing,
|
||||
pattern_template_id=schema.pattern_template_id,
|
||||
brightness=schema.brightness,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -52,6 +52,7 @@ class KeyColorsSettingsSchema(BaseModel):
|
||||
interpolation_mode: str = Field(default="average", description="Color mode (average, median, dominant)")
|
||||
smoothing: float = Field(default=0.3, description="Temporal smoothing (0.0-1.0)", ge=0.0, le=1.0)
|
||||
pattern_template_id: str = Field(default="", description="Pattern template ID for rectangle layout")
|
||||
brightness: float = Field(default=1.0, description="Output brightness (0.0-1.0)", ge=0.0, le=1.0)
|
||||
|
||||
|
||||
class ExtractedColorResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user