Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should support icons.js specified entity icons #1704

Open
felipecrs opened this issue Dec 2, 2024 · 5 comments
Open

Should support icons.js specified entity icons #1704

felipecrs opened this issue Dec 2, 2024 · 5 comments
Labels
feature New feature or request

Comments

@felipecrs
Copy link
Contributor

[REQUIRED] Card diagnostic information:

Click here to show
card_version: 6.0.0-beta.8
browser: >-
  Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like
  Gecko) Chrome/131.0.0.0 Safari/537.36
date: 2024-12-02T16:23:34.652Z
frigate_versions:
  624fd5a51dc304193d7e34ab79e1dae3: 5.5.1/0.14.1-f4f3cfa
lang: en
timezone: America/Sao_Paulo
git:
  hash: a869109
  build_date: Mon, 14 Oct 2024 00:01:23 GMT
  commit_date: Sun, 13 Oct 2024 16:50:47 -0700
ha_version: 2024.12.0b4
config:
  type: custom:frigate-card
  automations:
    - conditions:
        - condition: fullscreen
          fullscreen: false
      actions:
        - action: custom:frigate-card-action
          frigate_card_action: live_substream_off
    - conditions:
        - condition: fullscreen
          fullscreen: true
        - condition: screen
          media_query: '(min-width: 1500px)'
      actions:
        - action: custom:frigate-card-action
          frigate_card_action: live_substream_on
  overrides:
    - conditions:
        - condition: view
          views:
            - live
        - condition: camera
          cameras:
            - camera.rua
      merge:
        live:
          controls:
            ptz:
              hide_zoom: true
    - conditions:
        - condition: fullscreen
          fullscreen: true
      merge:
        menu:
          style: overlay
          buttons:
            substreams:
              enabled: true
        cameras_global:
          dimensions:
            layout:
              fit: contain
  cameras_global:
    live_provider: go2rtc
    image:
      refresh_seconds: 1
    dimensions:
      aspect_ratio: '16:9'
      layout:
        fit: cover
  menu:
    buttons:
      frigate:
        enabled: true
      snapshots:
        enabled: false
      cameras:
        alignment: opposing
      timeline:
        enabled: false
      media_player:
        enabled: true
      live:
        enabled: true
      recordings:
        enabled: false
      substreams:
        enabled: false
        alignment: opposing
        priority: 51
        icon: mdi:high-definition
      mute:
        enabled: true
      display_mode:
        enabled: false
    style: outside
    position: top
  cameras:
    - camera_entity: camera.portao
      dependencies:
        cameras:
          - portao_hd
    - camera_entity: camera.rua
      dependencies:
        cameras:
          - rua_hd
    - camera_entity: camera.morro
      dependencies:
        cameras:
          - morro_hd
    - camera_entity: camera.video_porteiro
      dependencies:
        cameras:
          - video_porteiro_hd
    - camera_entity: camera.portao
      title: Portão (HD)
      id: portao_hd
      go2rtc:
        stream: portao_hd
      capabilities:
        disable_except:
          - substream
    - camera_entity: camera.rua
      title: Rua (HD)
      id: rua_hd
      go2rtc:
        stream: rua_hd
      capabilities:
        disable_except:
          - substream
    - camera_entity: camera.morro
      title: Morro (HD)
      id: morro_hd
      go2rtc:
        stream: morro_hd
      capabilities:
        disable_except:
          - substream
    - camera_entity: camera.video_porteiro
      title: Vídeo Porteiro (HD)
      id: video_porteiro_hd
      go2rtc:
        stream: video_porteiro_hd
      capabilities:
        disable_except:
          - substream
  live:
    controls:
      next_previous:
        style: none
      thumbnails:
        mode: none
      builtin: false
    show_image_during_load: true
    draggable: false
    lazy_unload:
      - unselected
      - hidden
  image:
    mode: camera
  media_viewer:
    auto_unmute:
      - selected
      - visible
  elements:
    - type: custom:frigate-card-conditional
      conditions:
        - condition: view
          views:
            - live
        - condition: camera
          cameras:
            - camera.portao
        - condition: media_loaded
          media_loaded: true
      elements:
        - type: custom:frigate-card-menu-submenu-select
          entity: select.camera_do_portao_visao_noturna
          alignment: opposing
          priority: 52
          options:
            '0':
              icon: mdi:theme-light-dark
            '1':
              icon: mdi:weather-sunny
            '2':
              icon: mdi:weather-night
    - type: custom:frigate-card-conditional
      conditions:
        - condition: view
          views:
            - live
        - condition: camera
          cameras:
            - camera.morro
        - condition: media_loaded
          media_loaded: true
      elements:
        - type: custom:frigate-card-menu-submenu-select
          entity: select.camera_do_morro_visao_noturna
          alignment: opposing
          priority: 52
          options:
            '0':
              icon: mdi:theme-light-dark
            '1':
              icon: mdi:weather-sunny
            '2':
              icon: mdi:weather-night
    - type: custom:frigate-card-conditional
      conditions:
        - condition: view
          views:
            - live
        - condition: camera
          cameras:
            - camera.rua
        - condition: media_loaded
          media_loaded: true
      elements:
        - type: custom:frigate-card-menu-submenu-select
          entity: select.camera_da_rua_visao_noturna
          alignment: opposing
          priority: 52
          options:
            '0':
              icon: mdi:theme-light-dark
            '1':
              icon: mdi:weather-sunny
            '2':
              icon: mdi:weather-night
  profiles:
    - low-performance
  status_bar:
    style: none

[REQUIRED] Description of problem:

Icons of the select entity are no longer honored/rendered in the menu bar:

image

image

[OPTIONAL] Last working release (if known): 5.2.0

[OPTIONAL] Javascript errors shown in the web inspector: None.

[OPTIONAL] Additional information: None.

@felipecrs felipecrs added the bug Something isn't working label Dec 2, 2024
@dermotduffy
Copy link
Owner

I think this is related to a larger change in the HA ecosystem around icons.js. The dynamic icon in your case is simply no longer in the entity state, so the card does not know about it.

Related: home-assistant/core#103294

This will unfortunately make it a bigger deal to fix.

@felipecrs
Copy link
Contributor Author

Hm... but dynamic icon? This icon is not dynamic anyhow.

@dermotduffy
Copy link
Owner

Hm... but dynamic icon? This icon is not dynamic anyhow.

"dynamic" was the wrong choice of word! The icon you want HA to display for that entity used to be contained in the entity state. It is not anymore. Instead, we have to make a websocket call to fetch the icons for that entity, and then pick the right one out of that.

@felipecrs
Copy link
Contributor Author

Got it. That's sad. Good thing I can still set my own icon then through the card's YAML.

Feel free to close this issue if you prefer.

@dermotduffy
Copy link
Owner

Feel free to close this issue if you prefer.

No, think it needs fixing. Thanks for flagging.

@dermotduffy dermotduffy changed the title custom:frigate-card-menu-submenu-select no longer honor select entity icons Card support support icons.js specified entity icons Dec 9, 2024
@dermotduffy dermotduffy added feature New feature or request and removed bug Something isn't working labels Dec 9, 2024
@dermotduffy dermotduffy changed the title Card support support icons.js specified entity icons Should support icons.js specified entity icons Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants