question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Native support for select entities

See original GitHub issue

Is your feature request related to a problem? Please describe. I like to have control over the night vision mode of my Tuya camera. Fortunately, the Tuya integration provides a Select entity with the options Automatic, On and Off.

I wanted to include a menu button in the Frigate card that would allow me to switch between these options.

Describe the solution you’d like Something like below:

- type: custom:frigate-card-menu-select
  conditions:
    view:
      - live
    camera:
      - camera.rua
    entity: select.camera_da_rua_night_vision

That could auto-color the icon based on entity’s icon and auto-mark the selected option as selected. And, of course, auto-render a submenu based on the available options.

Describe alternatives you’ve considered The following, but I haven’t figured out yet how could I mark the selected option as selected based on the entity state.

- type: custom:frigate-card-menu-submenu
  icon: mdi:theme-light-dark
  conditions:
    view:
      - live
    camera:
      - camera.rua
  items:
    - title: Automatic
      icon: mdi:theme-light-dark
      tap_action: 
        action: call-service
        service: select.select_option
        service_data:
          entity_id: select.camera_da_rua_night_vision
          option: '0'
    - title: Off
      icon: mdi:weather-sunny
      tap_action: 
        action: call-service
        service: select.select_option
        service_data:
          entity_id: select.camera_da_rua_night_vision
          option: '1'
    - title: On
      icon: mdi:weather-night
      tap_action: 
        action: call-service
        service: select.select_option
        service_data:
          entity_id: select.camera_da_rua_night_vision
          option: '2'

Additional context None.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
dermotduffycommented, May 9, 2022

Woohoo! Thank you for testing!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to call native SQL queries with JPA & Hibernate
In this article, I will show you how to use native SQL queries, different options to map the query result to DTOs and...
Read more >
Querying JPA Entities with JPQL and Native SQL - Oracle
JPQL lets you define queries using one of the following three statements: SELECT, UPDATE, or DELETE. It's interesting to note that the EntityManager...
Read more >
Native SQL Queries
Native SQL queries which query for entities that are mapped as part of an inheritance must include all properties for the base class...
Read more >
Native SQL - Doctrine Object Relational Mapper (ORM)
With NativeQuery you can execute native SELECT SQL statements and map the results to Doctrine entities or any other result format supported by...
Read more >
Querying in Entity Framework
Entity framework supports three types of queries: 1) LINQ-to-Entities, ... //Querying with Object Services and Entity SQL string sqlString = "SELECT VALUE ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found