Skip to content

v0.7.10

Choose a tag to compare

@tiejiang29 tiejiang29 released this 21 Jun 10:17

v0.7.10 更新

优化

refresh_interval 字段从数字滑动条改为普通文本输入框,跟其它字段风格统一。

原因

之前用 vol.Coerce(int) + vol.Clamp(min=12, max=48),HA 会把它渲染成数字 slider/box(看起来像拉动条),跟旁边的 LLM 配置、邮箱等纯文本字段风格不一致,显得突兀。

改动

  • schema 改用 selector({"text": {"type": "text"}}),UI 渲染成普通文本输入框
  • 提交处理:int(str(x).strip()) 转换 + max(12, min(48, hours)) clamp 兜底
  • 默认值改成字符串 "12",跟其它字段类型统一
  • 顺手清掉未使用的 _int helper

使用

直接填小时数(如 12、24、36),范围 12-48。填小于 12 会被提到 12,填大于 48 会被压到 48,填非数字会被静默忽略保留原值。