Inversion of Switch as X (for lock)

I’ve implemented the “switch as x” integration for a couple of locks (actually switches) that I have, however they report locked when they’re unlocked and unlocked when they’re actually locked.

Can an “Invert” switch be added to transform locked to unlocked and vice versa?

Invert it in a template switch and use that.

I invert lock in file …/etc/homeassistant/custom_component/ble_monitor/ble_parser/xiaomi.py

BLE_LOCK_ACTION = {
0b0000: [1, “lock”, “unlock outside the door”], #invert "Lift Up:
0b0001: [0, “lock”, “lock”], #invert "Invert Lift Up:
0b0010: [0, “antilock”, “turn on anti-lock”],
0b0011: [1, “antilock”, “turn off anti-lock”],
0b0100: [1, “lock”, “unlock inside the door”], # invert "Door lock/unlock from inside
0b0101: [0, “lock”, “lock inside the door”], # invert "Door lock/unlock from inside:
0b0110: [0, “childlock”, “turn on child lock”],
0b0111: [1, “childlock”, “turn off child lock”],
0b1000: [0, “lock”, “lock outside the door”],
0b1111: [1, “lock”, “abnormal”],