Skip to content

Ví dụ Cấu hình YAML đầy đủ ​

Dưới đây là một ví dụ cấu hình YAML toàn diện cho thẻ. Cấu hình này trình bày một thiết lập hoàn chỉnh định nghĩa các thuộc tính bố cục cơ bản, chế độ hiển thị bản đồ và các cài đặt tương tác tùy chỉnh đã được đề cập trong các phần trước.

yaml
type: custom:dreame-vacuum-card
entity: vacuum.l10s_gen2
title: First Floor Vacuum
aspect_ratio: 1.5
full_height: true
color_scheme: dreame_dark
icon_set: dreame
map_display: floor_plan
locked: only_touch
touch_lock: 200
disable_haptic: true
left_handed: true
legacy_switches: true
scripts:
  - script.sweep_living_room
  - script.mop_kitchen
map_config:
  map_1:
    object_scale: 7
    width: 250
    height: 183
    opacity: 0.45
    hidden_objects:
      - customized_cleaning
      - floor
      - name
      - name_background
      - no_go
      - no_mop
      - order
      - walls
    background_image:
      url: /local/home.png
      left: 77
      top: 10.3
      width: 250
      height: 183
      opacity: 0.75
    overlay_image:
      url: /local/home_overlay.png
      opacity: 0.9
  map_2:
    rotation: 180
    opacity: 0.8
hidden_card_objects:
  - title
  - state
  - status
  - animations
  - shortcuts
  - cruising_history
  - saved_notification
  - map_change_confirmation
hidden_objects:
  - floor
  - obstacle
  - obstacle_background
  - ignored_obstacles
  - furniture_image
  - path
  - pet
override_colors:
  floor: 'rgba(110,110,110,1)'
  wall: 'rgba(64,64,64,1)'
  path: 'rgba(200,200,200,1)'
  active_area: 'rgba(113,189,237,0.4)'
  no_go: 'rgba(133,0,0,0.5)'
  no_mop: 'rgba(134,0,226,0.5)'
  virtual_wall: 'rgba(133,0,0,0.78)'
  carpet: 'rgba(36,163,55,1)'
  icon_background: 'rgba(50,50,50,1)'
  text: 'rgba(220,220,220,1)'
  segment:
    - - 'rgba(46,81,142,1)'
      - 'rgba(12,92,232,1)'
    - - 'rgba(130,111,38,1)'
      - 'rgba(180,146,9,1)'
    - - 'rgba(39,111,158,1)'
      - 'rgba(15,152,242,1)'
    - - 'rgba(83,104,56,1)'
      - 'rgba(76,168,63,1)'
  dark:
    floor: 'rgba(20,20,20,1)'
    wall: 'rgba(40,40,40,1)'
    path: 'rgba(255,255,255,0.8)'
    active_area: 'rgba(50,100,200,0.4)'
    no_go: 'rgba(200,0,0,0.5)'
    no_mop: 'rgba(100,0,100,0.5)'
    icon_background: 'rgba(50,50,50,1)'
    text: 'rgba(255,255,255,1)'