我没有用他自带的button_badge,还是以前版本的手动的模板加,因为以前有个角标的开关,我也一直保留下来了,参考这样:
- !include
- "../../../hki-base/templates/button/button-badge.yaml"
- name: 网络数据
# label: 状态监测
icon: mdi:web
navigation_path: /homekit-infused/network_status
notification: "[[[ if (states['input_number.empty'].state == 0) return ' '; else return `${states['sensor.mikrotik_wan_rx'].state} Mb`; ]]]"
background_color: "[[[ if (states['input_number.empty'].state == 0) return 'rgba(0,0,0,0.0)'; else return 'var(--paper-item-icon-color)'; ]]]"
|