Skip to content

Commit

Permalink
fix: detect new sliders introduced with Home Assistant core v2023.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Zanna_37 committed Feb 27, 2023
1 parent cb3fa41 commit 28391b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/swipe-navigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ const exceptions = [

// Header bar (contains tabs)
"app-header",
// Slider bar (used by the Tile card)
"ha-bar-slider",
// Sidebar (contains dashboards)
"ha-sidebar",
// Slider
"ha-slider",
"#slider",
// Map
"hui-map-card",

Expand All @@ -39,8 +38,6 @@ const exceptions = [
"#graph-wrapper svg.apexcharts-svg",
// History explorer card (https://github.com/alexarch21/history-explorer-card)
"history-explorer-card",
// 🍄 Mushroom (https://github.com/piitaya/lovelace-mushroom)
"mushroom-slider",
// my-cards (https://github.com/AnthonMS/my-cards)
"my-slider",
"my-slider-v2",
Expand All @@ -57,6 +54,15 @@ const exceptions = [
"swipe-card",
// Lovelace Vacuum Map card (https://github.com/PiotrMachowski/lovelace-xiaomi-vacuum-map-card)
"xiaomi-vacuum-map-card",


// DEPRECATED
// will be removed in December 2023

// 🍄 Mushroom (https://github.com/piitaya/lovelace-mushroom)
"mushroom-slider", // it uses the same id as built-in slider
// Slider bar (used by the Tile card)
"ha-bar-slider", // it uses the same id as built-in slider
].join(",");


Expand Down
2 changes: 1 addition & 1 deletion tests/dashboards/individual-dashboards/one-tile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ test("shouldn't change, tile slider swiped", async ({ page }) => {


let matches = 0;
const regexp = /.*Ignoring touch on "ha-bar-slider".*/;
const regexp = /.*Ignoring touch on "div".*/;
for (const log of consoleLogs) {
if (regexp.test(log)) { matches++; }
}
Expand Down

0 comments on commit 28391b6

Please sign in to comment.