Add invert_logic to Raspberry Pi Cover state

I am using Raspberry Pi Cover to control my garage door, however due to wiring considerations, my sensor is at the motor end so activates when the door is fully open.

This works fine with a gpio binary sensor as I can set invert_logic to true.

I have switched to using the Raspberry Pi Cover component which works much better because of the relay_time, however the state is inverted because of my setup, and consequently the component shows the opposite of the actual state. This also seems to cause the garage door to open on boot, though I can’t be sure that this is the cause.

For clarity here is my binary_sensor as it works.

  • platform: rpi_gpio
    27: Garage Door Open
    pull_mode: ‘UP’
    bouncetime: 50
    invert_logic: true

and my switch which I need to toggle manually as it has no relay time function:

platform: rpi_gpio
18: Garage Door
invert_logic: false

Anch’io vorrei lavorare con GPIO ma non trovo letteratura in
Scusa se non ho la risposta per te