Skip to content

Commit

Permalink
fix slider auto value attribute setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerwyn committed May 21, 2024
1 parent 2e20905 commit 4535dc2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dist/android-tv-card.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "android-tv-card",
"version": "3.7.1",
"version": "3.7.2",
"description": "Android TV Remote Card",
"main": "./dist/android-tv-card.js",
"scripts": {
Expand Down
15 changes: 8 additions & 7 deletions src/android-tv-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,14 @@ class AndroidTVCard extends LitElement {
config as Record<string, number>
).slider_step;
}
if (
'slider_attribute' in config &&
!('value_attribute' in customAction)
) {
customAction.value_attribute =
(config as Record<string, string>).slider_attribute ??
'volume_level';
if (!('value_attribute' in customAction)) {
if ('slider_attribute' in config) {
customAction.value_attribute =
(config as Record<string, string>)
.slider_attribute ?? 'volume_level';
} else {
customAction.value_attribute = 'volume_level';
}
}
if (
'enable_slider_feedback' in config &&
Expand Down

0 comments on commit 4535dc2

Please sign in to comment.