本帖最后由 zhanfu86 于 2023-8-24 11:16 编辑
试试我的,好像没效果啊。。漏了资源里添加 /local/community/lovelace-card-mod/card-mod.js 了。现在可以了。感谢大佬。
type: custom:mushroom-template-card
layout: horizontal
primary: >-
{% if states("binary_sensor.3429efa75290_laundrycyclestatus") ==
'on' %}
洗衣机 - {{states('select.3429efa75290_laundrycycle')}}
{% else %}
洗衣机
{% endif %}
secondary: >-
{% if states("binary_sensor.3429efa75290_laundrycyclestatus") ==
'on' %}
剩余时间 {{ states('sensor.3429efa75290_remainingtimehh') }}:{{ '%02d' | format(states('sensor.3429efa75290_remainingtimemm') | int) }}
{% else %}
已关机
{% endif %}
icon: mdi:washing-machine
entity: switch.3429efa75290_onoffstatus
badge_icon: |-
{% if states('switch.3429efa75290_onoffstatus') == 'on' %}
mdi:pinwheel
{% endif %}
badge_color: |-
{% if states('switch.3429efa75290_onoffstatus') == 'on' %}
#ff9f09
{% endif %}
icon_color: |
{% if states('switch.3429efa75290_onoffstatus') == 'on' %}
red
{% endif %}
fill_container: true
card_mod:
style: |
ha-card {
--card-primary-font-size: 32px;
--card-secondary-font-size: 16px;
}
|