Skip to content

Commit

Permalink
Try to improve performance v3.4.3
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasloven committed Mar 13, 2024
1 parent 4de5148 commit f59abc7
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 80 deletions.
2 changes: 1 addition & 1 deletion card-mod.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,7 +1,7 @@
{
"name": "card-mod",
"private": true,
"version": "3.4.2",
"version": "3.4.3",
"description": "",
"scripts": {
"build": "rollup -c",
Expand Down
2 changes: 1 addition & 1 deletion src/patch/ha-icon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function joinSet(dst: Set<any>, src: Set<any>) {

async function findParentCardMod(node: any, step = 0): Promise<Set<CardMod>> {
let cardMods: Set<CardMod> = new Set();
// if (step == 10) return cardMods;
if (step == 10) return cardMods;
if (!node) return cardMods;

if (node.updateComplete) await node.updateComplete;
Expand Down
113 changes: 38 additions & 75 deletions test/views/10_performance_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ title: Performance test
# https://github.com/thomasloven/lovelace-card-mod/issues/154
# Switching between this tab and any other tab used to be very very slow.
cards:
- type: entities
entities:
- light.bed_light
- type: picture-elements
image: https://placekitten.com/g/800/800
card_mod:
Expand All @@ -26,153 +29,113 @@ cards:
--label-badge-red: cyan;
}
elements:
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: &common
entity: sun.sun
type: state-icon
card_mod:
style: |
:host {
--card-mod-icon: {% if is_state('light.bed_light','on') %}mdi:star {% else %} mdi:star-outline{%endif%};
}
# element_type: state-badge
# type: custom:hui-element
# entity: sensor.outside_temperature
style:
top: 10%
left: 10%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 10%
left: 30%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 10%
left: 50%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 10%
left: 70%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 10%
left: 90%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 30%
left: 10%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 30%
left: 30%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 30%
left: 50%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 30%
left: 70%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 30%
left: 90%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 50%
left: 10%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 50%
left: 30%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 50%
left: 50%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 50%
left: 70%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 50%
left: 90%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 70%
left: 10%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 70%
left: 30%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 70%
left: 50%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 70%
left: 70%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 70%
left: 90%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 90%
left: 10%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 90%
left: 30%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 90%
left: 50%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 90%
left: 70%
- element_type: state-badge
type: custom:hui-element
entity: sensor.outside_temperature
- <<: *common
style:
top: 90%
left: 90%

0 comments on commit f59abc7

Please sign in to comment.