type: custom:floorplan-card
config:
  defaults:
    hover_action: hover-info
    tap_action: more-info
  image: /local/floorplan/home/home_3d.svg
  rules:
    - name: Ke Ting Lights
      entities:
        - element: area.ke_ting
          entity: light.ke_ting_deng_zu
      tap_action:
        action: call-service
        service: script.toggle_ke_ting_lights
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
    - name: Can Ting Lights
      entities:
        - element: area.can_ting
          entity: light.can_ting_deng_zu
      tap_action:
        action: call-service
        service: script.toggle_can_ting_lights
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
    - name: Zhu Wo Lights
      entities:
        - element: area.zhu_wo
          entity: light.zhu_wo_deng_zu
      tap_action:
        action: call-service
        service: script.toggle_zhu_wo_lights
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
    - name: Zhu Wei Lights
      entities:
        - element: area.zhu_wei
          entity: light.zhu_wei_deng_zu
      tap_action:
        action: call-service
        service: script.toggle_zhu_wei_lights
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
    - name: Ci Wei Lights
      entities:
        - element: area.ci_wei
          entity: light.ci_wei_deng_zu
      tap_action:
        action: call-service
        service: script.toggle_ci_wei_lights
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
    - name: Rooms
      entities:
        - element: area.shu_fang
          entity: light.shu_fang_deng
        - element: area.chu_fang
          entity: light.chu_fang_tong_deng
        - element: area.zou_lang
          entity: light.zou_lang_deng
        - element: area.zhu_wei
          entity: light.zhu_wei_tong_deng
        - element: area.ci_wei
          entity: light.ci_wei_tong_deng
        - element: area.ci_wo
          entity: light.ci_wo_deng
      tap_action: light.toggle
      state_action:
        service: floorplan.class_set
        service_data: "${(entity.state === 'on') ? 'light-on' : 'light-off'}"
  stylesheet: /local/floorplan/home/home_3d.css
