Door Lock Multi State

Hi I’m trying to make a custom button card that has 3 states based off of 2 input boolean and one tap action

States:

Locked, This state is lock bolt engaged
      input_boolean.test_open_closed = closed
      input_boolean.test_locked_unlocked = locked
 
 Unlocked, This state is lock bolt disengaged
      input_boolean.test_open_closed = closed
      input_boolean.test_locked_unlocked = unlocked
 
 Open, Lock disengaged and open
      input_boolean.test_open_closed = open
      input_boolean.test_locked_unlocked = unlocked

How is the best way to achieve this? can I use custom button card?
The situation is when you have a hardwired door lock or door lock controller that integrates to Home Assistant via I/O like esphome.

eg Relay 1 = Lock / Unlock control
Input 1 = Bolt position
Input 2 = Reed switch (door position)

I had this code for lock and unlock But I don’t know how to bring in the 2nd state of door open closed.

show_name: true
show_icon: true
type: custom:button-card
entity: input_boolean.test_open_closed
state:
  - value: 'on'
    color: green
    icon: mdi:door-open
    styles:
      icon:
        - filter: opacity(100%)
        - animation: blink 2s ease infinite
  - value: 'off'
    color: red
    icon: mdi:door-closed
tap_action:
  action: toggle
  service: null
  confirmation:
    text: Confirm Unlock?
  entity: button.garage_door
name: Front Door