『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 606|回复: 6

[求助] Mushroom界面中空调间距很宽,请问如何解决

[复制链接]

7

主题

15

帖子

82

积分

注册会员

Rank: 2

积分
82
金钱
67
HASS币
0
发表于 2024-1-28 03:14:02 | 显示全部楼层 |阅读模式
Mushroom界面中空调间距很宽,不知道是不是style不起作用,请问如何解决
捕获.JPG
type: custom:stack-in-card
keep:
  margin: false
  box_shadow: false
  background: false
cards:
  - type: grid
    square: false
    columns: 2
    cards:
      - type: custom:mushroom-template-card
        style: |
          ha-card {
            padding-bottom: 1px !important;
          }
        primary: 客厅空调
        secondary: |
          当前: {{ state_attr('climate.keting_aux', 'hvac_action') }}
        icon: |-
          {% set mode = states('climate.keting_aux') %}
          {% if mode == 'off' %}
          mdi:power
          {% elif mode == 'cool' %}
          mdi:snowflake
          {% elif mode == 'heat' %}
          mdi:fire
          {% elif mode == 'heat_cool' %}
          mdi:autorenew
          {% else %}
          mdi:home-thermometer
          {% endif %}
        icon_color: |-
          {% set status = state_attr('climate.keting_aux','hvac_action') %}
          {% if status == 'off' %}
          grey
          {% elif status == 'cooling' %}
          blue
          {% elif status == 'heating' %}
          red
          {% else %}
          grey
          {% endif %}
        tap_action: none
      - type: custom:simple-thermostat
        entity: climate.keting_aux
        layout:
          step: row
        header: false
        control: false
        decimals: '0'
        hide:
          temperature: true
          state: true
  - type: custom:mushroom-chips-card
    style: |
      ha-card {
        --chip-box-shadow: none;
        --chip-background: none;
      }
    alignment: justify
    chips:
      - type: template
        entity: climate.keting_aux
        content: |
          {{ state_attr(entity, 'fan_mode') }}
        icon: mdi:fan
        icon_color: green
        tap_action: none
      - type: template
        content: '{{ states(entity) }} °C'
        entity: sensor.a4c138aefe53_temperature
        icon: mdi:home-thermometer
        icon_color: blue
        tap_action:
          action: none
        hold_action:
          action: none
      - type: weather
        entity: weather.wo_de_jia
        show_conditions: true
        show_temperature: true
      - type: template
        double_tap_action:
          action: none
        content: '{{ states(entity) }}%'
        entity: sensor.a4c138aefe53_humidity
        icon: mdi:water
        icon_color: blue
        tap_action:
          action: none
        hold_action:
          action: none
  - type: custom:simple-thermostat
    style: |
      ha-card {
        --st-font-size-toggle-label: 6px
        --st-spacing: 0px;
        --st-default-spacing: 0px;
        --st-mode-background: #ebebeb;
        margin-left: 12px;
        margin-right: 12px;
      }
      ha-card .mode-item.active.off { 
        background: #363636;
        color: #9e9e9e;
      }
      ha-card .mode-item.active.cool { 
        background: #1d3447;
        color: #2196f3;
      }
      ha-card .mode-item.active.heat { 
        background: #472421;
        color: #f44336;
      }
      ha-card .mode-item.active.heat_cool { 
        background: #493516;
        color: #ff9800;
      }
      ha-card .mode-item.active { 
        background: #263926;
        color: #4caf50;
      }
      ha-card .mode-item.active:hover { 
        background: #363636;
        color: #9e9e9e;
      }
      ha-card .mode-item:hover { 
        background: #363636;
        color: #9e9e9e;
      }
      ha-card .mode-item {
        --st-spacing: 10px;
        border-radius: 10px;
      }
      ha-card .modes {
        grid-gap: 12px
      }
    entity: climate.keting_aux
    header: false
    setpoints: false
    hide:
      temperature: true
      state: true
    layout:
      mode:
        headings: false
        icons: true
        names: true
      step: row
    control:
      hvac:
        'off':
          name: 关闭
        heat:
          name: 制热
        cool:
          name: 制冷
        dry:
          name: 除湿
        fan_only:
          name: 送风
  - type: grid
    square: false
    columns: 3
    cards:
      - type: custom:mushroom-entity-card
        entity: sensor.a4c138aefe53_temperature
        secondary_info: name
        name: 室内
        icon_color: green
      - type: custom:mushroom-entity-card
        entity: sensor.a4c138aefe53_temperature
        primary_info: state
        secondary_info: name
        name: 室外
        icon_color: blue
      - type: custom:simple-thermostat
        style: |
          ha-card {
            --st-font-size-toggle-label: 6px
            --st-spacing: 0px;
            --st-default-spacing: 1.6px;
            --st-mode-background: #ebebeb;
            margin-right: 12px;
          }
          ha-card .mode-item.active { 
            background: #263926;
            color: #4caf50;
          }
          ha-card .mode-item.active:hover { 
            background: #363636;
            color: #9e9e9e;
          }
          ha-card .mode-item:hover { 
            background: #363636;
            color: #9e9e9e;
          }
          ha-card .mode-item {
            --st-spacing: 6px;
            border-radius: 10px;
          }
          ha-card .modes {
            grid-gap: 12px
          }
        entity: climate.keting_aux
        header: false
        setpoints: false
        hide:
          temperature: true
          state: true
        layout:
          mode:
            headings: false
            icons: true
            names: false
          step: row
        control:
          fan:
            Auto:
              icon: mdi:fan-auto
            Low: false
            Medium: false
            High: false
            Turbo:
              name: 超强
              icon: mdi:fan
            Mute: false
  - type: custom:mini-graph-card
    entities:
      - entity: sensor.a4c138aefe53_temperature
        name: 室内温度
        color: '#4caf50'
      - entity: sensor.a4c138aefe53_temperature
        name: 室外温度
        color: '#2196f3'
        y_axis: secondary
    hours_to_show: 24
    line_width: 1
    font_size: 50
    animate: true
    show:
      name: false
      icon: false
      state: false
      legend: false
      fill: fade




回复

使用道具 举报

18

主题

122

帖子

1348

积分

金牌会员

Rank: 6Rank: 6

积分
1348
金钱
1226
HASS币
0
发表于 2024-1-28 16:41:45 | 显示全部楼层
微信截图_20240128164000.png
宽吗?不宽呀。
你换Mushroom主题试试呢?
回复

使用道具 举报

7

主题

15

帖子

82

积分

注册会员

Rank: 2

积分
82
金钱
67
HASS币
0
 楼主| 发表于 2024-1-28 20:12:24 | 显示全部楼层
我看有论坛有些大神贴出来的图片,行距很小,想要那样的效果
回复

使用道具 举报

7

主题

1085

帖子

3413

积分

论坛元老

Rank: 8Rank: 8

积分
3413
金钱
2328
HASS币
0
发表于 2024-1-28 21:33:19 | 显示全部楼层
我也是这样的,如果只有一列,那就好看一点,窄了就丑。
回复

使用道具 举报

18

主题

122

帖子

1348

积分

金牌会员

Rank: 6Rank: 6

积分
1348
金钱
1226
HASS币
0
发表于 2024-1-29 08:25:43 | 显示全部楼层
想调哪个卡片的高度就在card_mod里加入
height: 100px ;
如果不生效试试
height: 100px !important;
回复

使用道具 举报

7

主题

15

帖子

82

积分

注册会员

Rank: 2

积分
82
金钱
67
HASS币
0
 楼主| 发表于 2024-1-29 18:20:32 | 显示全部楼层
qiaofei828 发表于 2024-1-29 08:25
想调哪个卡片的高度就在card_mod里加入
height: 100px ;
如果不生效试试
      - type: custom:simple-thermostat
        entity: climate.keting_aux
        layout:
          step: row
        header: false
        control: false
        decimals: '0'
        hide:
          temperature: true
          state: true
        card_mod:
          height: 80px !important

代码没法生效,空调模式这行和上下的行距还是很大,

                               
登录/注册后可看大图

怎么做到你那么距离那么小的
回复

使用道具 举报

7

主题

15

帖子

82

积分

注册会员

Rank: 2

积分
82
金钱
67
HASS币
0
 楼主| 发表于 2024-2-1 02:16:55 | 显示全部楼层
qiaofei828 发表于 2024-1-29 08:25
想调哪个卡片的高度就在card_mod里加入
height: 100px ;
如果不生效试试

原来要
card_mod:
  style: |
    ha-card {
        height: 80px !important
    }

终于解决了,多谢
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-5-16 14:14 , Processed in 0.115856 second(s), 31 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表