本帖最后由 cookiesliy 于 2025-4-3 22:52 编辑
代码平时没问题,就是刚打开的时候偶尔会跳出那个错误,一会儿就恢复正常了.
------------------------------------------------------------------
type: custom:stack-in-card
title: 机柜
cards:
- type: horizontal-stack
cards:
- type: custom:flex-horseshoe-card
styles:
card:
- "--keep-background": "false"
entities:
- entity: sensor.tuya_temperature_temperature
attribute: temperature
decimals: 1
name: 机柜温湿度
unit: °C
- entity: sensor.tuya_temperature_humidity
attribute: humidity
decimals: 0
unit: "%"
icon: mdi:water-percent
- entity: sensor.tuya_temperature_battery
attribute: battery
decimals: 0
unit: "%"
icon: mdi:battery
show:
horseshoe_style: lineargradient
layout:
hlines:
- id: 0
xpos: 50
ypos: 42
length: 50
styles:
- stroke: var(--primary-text-color);
- stroke-width: 5;
- stroke-linecap: round;
- opacity: 0.7;
states:
- id: 0
entity_index: 0
xpos: 50
ypos: 34
styles:
- font-size: 3em;
- id: 1
entity_index: 1
xpos: 40
ypos: 57
styles:
- text-anchor: start;
- font-size: 1.5em;
- id: 2
entity_index: 2
xpos: 40
ypos: 72
styles:
- text-anchor: start;
- font-size: 1.5em;
icons:
- id: 0
entity_index: 1
xpos: 37
ypos: 57
align: end
size: 1.3
- id: 1
entity_index: 2
xpos: 37
ypos: 72
align: end
size: 1.3
names:
- id: 0
entity_index: 0
xpos: 50
ypos: 95
styles:
- font-size: 1.5 em;
horseshoe_scale:
min: -10
max: 40
color_stops:
"16": "#F2FBEF"
"17": "#DFF4D6"
"18": "#CAEDBB"
"19": "#B4E69F"
"20": "#A4E08B"
"21": "#94DB76"
"22": "#8CD76E"
"23": "#81D263"
"24": "#77CD59"
"25": "#65C446"
|