resoai / TileBoard

A simple yet highly configurable Dashboard for HomeAssistant
MIT License
1.63k stars 278 forks source link

Volume Slider Issues in Older Browser #768

Closed mcgeebc closed 2 years ago

mcgeebc commented 2 years ago

The volume slider defaults to min or max when navigating to a page on and older browser. In my case, I'm running FullyKiosk with Webview 59. Unfortunately, I don't have the option to upgrade.

After some investigation, I found that this is likely caused by the use of Nullish coalescing operators (??) in the initSliderConf function (line 883 of main.js) may cause sliders to fail in older browsers or old versions of Webview like mine.

source: https://caniuse.com/mdn-javascript_operators_nullish_coalescing

This is likely causing issues with other types of sliders in older browsers. I haven't tested that.

Submitting this for anyone that wants to work on implementing an alternative to Nullish coalescing operators. I'm going to work on it myself, but I'm new to JavaScript and Github in general, so it might take awhile.

rchl commented 2 years ago

The "release" package is transpiled so it doesn't contain any code using nullish coalescing operator or other modern JS syntax.

So the issue might be with the logic itself but is surely not with the syntax compatibility with older browsers.

Post you configuration for that tile and also dump of the entity attributes from the HA devtools and maybe we can figure out what the problem is.

mcgeebc commented 2 years ago

Thanks for the response. That makes sense; however, I should have mentioned that I only experience this in older browsers. I've used both FullyKiosk and Wall Panel. Both have the same behavior. When I test with Chrome on my laptop, it doesn't have this issue.

Here is an example tile: { position: [3, 2], id: 'media_player.bedroom_clock_echo', title: 'Master Bedroom', height: 1, width: 3, type: TYPES.MEDIA_PLAYER, hideSource: true, hideMuteButton: false, state: false, //state: '@attributes.media_title', subtitle: '@attributes.media_title', bgSuffix: '@attributes.entity_picture' }

Here are the entity attributes: source_list: Local Speaker volume_level: 0.2 is_volume_muted: false media_content_type: music media_duration: 277 media_position: 94 media_position_updated_at: 2021-09-22T22:02:03.908491+00:00 media_title: Desperately Wanting media_artist: Better Than Ezra media_album_name: Greatest Hits source: Local Speaker shuffle: false entity_picture_local: /api/media_player_proxy/media_player.bedroom_clock_echo?token=23bf4d7e605ea20b755a244f9df9b183214339332a3445a3e9a09f052ad21b01&cache=ed67c23d9ef125fc available: true last_called: false last_called_timestamp: 1632340991019 last_called_summary: off connected_bluetooth: null bluetooth_list: friendly_name: Bedroom Clock Echo entity_picture: https://m.media-amazon.com/images/I/81SMrxTRZBL._UL600_.jpg supported_features: 56253

mcgeebc commented 2 years ago

I wasn’t able to figure this out with Webview 59. I ended up upgrading my OS. Everything works with a newer webview version. Since I can no longer recreate the issue, I’m closing it.