feat: configure built-in breathing colors per alert category
This commit is contained in:
+5
-2
@@ -31,6 +31,9 @@ for level,value in (("warning",1),("critical",2),("emergency",3)):
|
||||
option("rgb",f"{level}_flash_{edge}_ms",1500,f"{ {'warning':'普通','critical':'严重','emergency':'紧急'}[level]}告警{'亮灯' if edge=='on' else '灭灯'}时间",f"{level.title()} flash {edge}",minimum=50,maximum=60000,unit="ms",visible={"alert_mode":["flash"]})
|
||||
for edge in ("on","off"):
|
||||
option("rgb",f"normal_flash_{edge}_ms",1500,"正常闪烁"+("亮灯" if edge=="on" else "灭灯")+"时间",f"Normal flash {edge}",minimum=50,maximum=60000,unit="ms",visible={"normal_mode":["flash"]})
|
||||
for group,color in GROUPS.items():
|
||||
title={"cpu":"处理器、温度与散热","power":"电源","memory":"内存","storage":"存储","network":"网络","service":"服务与进程"}[group]
|
||||
option("rgb",group+"_breathe_color",color,title+"呼吸颜色",group.title()+" breathing color","enum",choices=list(COLORS),visible={"alert_mode":["breathe"]})
|
||||
for group,values in DEFAULT_RGB.items():
|
||||
for channel,value in zip("rgb",values):
|
||||
title={"cpu":"处理器","power":"电源","memory":"内存","storage":"存储","network":"网络","service":"服务","normal":"正常"}[group]
|
||||
@@ -87,8 +90,8 @@ def descriptor():
|
||||
"fan":{"control":"levels","levels":["OFF","L1","L2","L3","L4","MAX"],"rpm":False,"autonomous":True,"owner":"plugin"},
|
||||
"display":{"width":128,"height":32,"pages":True},
|
||||
"rgb":{"modes":list(dict.fromkeys(["off","breathe","flash","solid",*EFFECTS])),"preset_colors":list(COLORS),"custom_flash_experimental":True}},
|
||||
"notes":[{"zh":"内置呼吸使用预置颜色:CPU红、电源黄、内存紫、存储白、网络蓝、服务青。自定义闪烁仍可能异色。",
|
||||
"en":"Built-in breathing uses presets: CPU red, power yellow, memory purple, storage white, network blue, services cyan. Custom flashing may still show incorrect colors."},
|
||||
"notes":[{"zh":"内置呼吸可按告警对象选择预置颜色(红、绿、蓝、黄、紫、青、白);默认CPU红、电源黄、内存紫、存储白、网络蓝、服务青。自定义闪烁仍可能异色。",
|
||||
"en":"Built-in breathing colors are configurable per alert category (red, green, blue, yellow, purple, cyan, white). Defaults: CPU red, power yellow, memory purple, storage white, network blue, services cyan. Custom flashing may still show incorrect colors."},
|
||||
{"zh":"自定义闪烁的实际亮灭保持时间不低于最小保持时间。停止插件会请求风扇全速;风扇没有RPM反馈。",
|
||||
"en":"Custom flash phases last at least the minimum hold time. Stopping the plugin requests full fan speed; RPM feedback is unavailable."}],
|
||||
"schema":SCHEMA}
|
||||
|
||||
Reference in New Issue
Block a user