- type: custom:button-card
show_entity_picture: true
entity: sensor.number_climates_on
show_state: true
name: 空调
card_mod:
style: |
ha-card {
margin: -2% 0px % 0px;
}
tap_action:
action: call-service
service: input_boolean.toggle
service_data:
entity_id: input_boolean.guan_bi_suo_you_kong_diao
animation_card: |
[[[
const animation_speed_ms = 900;
const animation = `card_bounce ${animation_speed_ms}ms cubic-bezier(0.22, 1, 0.36, 1)`;
this.shadowRoot.getElementById("card").style.animation = animation;
window.setTimeout(() => {
this.shadowRoot.getElementById("card").style.animation = "none";
}, animation_speed_ms)
]]]
extra_styles: |
@keyframes card_bounce {
0% {
transform: scale(1);
}
15% {
transform: scale(0.9);
}
25% {
transform: scale(1);
}
30% {
transform: scale(0.98);
}
100% {
transform: scale(1);
}
}
entity_picture: |
[[[ if (entity.state == 0) return '/local/house/空调无AC关.png';
else return '/local/house/空调无AC.gif';
]]]
styles:
custom_fields:
graph:
- position: absolute
- left: '-1px'
- top: 70.5%
unit:
- position: absolute
- left: 50%
- top: 72%
card:
- border-radius: 15px
- height: 115px
entity_picture:
- width: 55%
让我瞅瞅怎么个事情 |