Skip to content

Commit

Permalink
fix: disable controls on backlight off
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed May 3, 2024
1 parent 2ca81f3 commit e2ba916
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog][],
and this project adheres to [Semantic Versioning][].

## 2.3.2

### Fixed

- When the backlight is turned off, its settings are disabled.

## [2.3.1]

### Added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,13 @@
brightness: e.detail as LightStateValue,
})
}
$: disabled = !$stateStore[domain].enabled
</script>

<div use:fsd={'features/LightsBrightnessSlider'}>
<Slider
{disabled}
min={0}
max={4}
step={1}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,13 @@
$: colors = supportsRandom ? ['random', ...modeColors] : modeColors
$: colorIndex = $stateStore[domain].color
$: index = colorIndex === 7 ? 0 : supportsRandom ? colorIndex + 1 : colorIndex
$: disabled = !$stateStore[domain].enabled
</script>

<div use:fsd={'features/LightsColorSelector'}>
<ColorSelector
{index}
disabled={!supportsColor}
disabled={disabled || !supportsColor}
options={colors}
primaryProp="index"
on:change={handleChange}
Expand Down
3 changes: 3 additions & 0 deletions ui/src/features/lights/select-mode/ui/LightsModeSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
title: m.name,
disabled: m.code === 18, // Disable custom mode
}))
$: disabled = !$stateStore[domain].enabled
</script>

<div use:fsd={'features/LightsModeSelect'}>
<Select
{options}
{disabled}
value={$stateStore[domain].mode.toString()}
on:change={handleChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
$: modeCode = $stateStore[domain].mode
$: mode = $modesStore[domain].find((m) => m.code === modeCode)
$: supportsSpeed = mode?.supports.speed ?? false
$: disabled = !$stateStore[domain].enabled
</script>

<div use:fsd={'features/LightsSpeedSlider'}>
<Slider
disabled={!supportsSpeed}
disabled={disabled || !supportsSpeed}
min={0}
max={4}
step={1}
Expand Down

0 comments on commit e2ba916

Please sign in to comment.