How to reverse lock position on localtuya lock

Im trying to setup a local tuya garage door switch as a lock
it has a sensor that detects the door contact state but this is reversed so its false when closed and true when opened
is there a way to reverse this? i would like it to require a pin to open via google assistant and atm it only needs a pin to close it which is not very helpful

The Spook integration has a inverse helper.

I had a look at Spook but its not able to inverse locks only switches

I was able to do this by creating a new lock template to reverse the states and actions

lock:
  - platform: template
    name: Garage door
    value_template: >-
      {% if is_state('lock.smart_garage_door_opener_garage_door', 'unlocked') %} 
        locked 
      {% else %}
        unlocked 
      {% endif %}
    lock:
      action: lock.unlock
      target:
        entity_id: lock.smart_garage_door_opener_garage_door
    unlock:
      action: lock.lock
      target:
        entity_id: lock.smart_garage_door_opener_garage_door`Preformatted text`