How to lock (prevent status change) input_select?

I use an input_select and an input_boolean. For example

  • input_boolean.desktop_isactive and
  • input_select.desktop_content

Now it should be allowed or permitted to change the state of input_select.desktop_content depending on the state of input_boolean.desktop_isactive.

Is there a simple way to do this? Or would I have to show or hide input_select depending on input_boolean.desktop_isactive?

It would be nice to just be able to set input_select as “not changeable” via code, so that it is displayed but “inactive” and the content can’t be changed in the GUI.

As a workaround I can use conditional entities, but maybe there are other solutions?

sensor.desktop_alarm contains the value of input_select.desktop_alarm

type: entities
entities:
  - entity: input_boolean.desktop_isaktive
  - type: conditional
    conditions:
      - entity: input_boolean.desktop_isaktive
        state: 'off'
    row:
      entity: input_select.desktop_alarm
  - type: conditional
    conditions:
      - entity: input_boolean.desktop_isaktive
        state: 'on'
    row:
      entity: sensor.desktop_alarm