Switch ebike brake status with an Arduino

Board: Wemos D1 mini Pro
Brake: Tektro HD E350 (the brake signal cable has two wires).

When the brake lever is pulled back, probably the line gets
shorted.

How can I change the brake status (brake set, not set) with a mc?

Do I need a relay or transistor for that?

Connect one wire to GND. Connect the other wire to and input and enable pull up on that input pin.

Then you should be able to see the input change when the break is pulled.

That's probably how I can get the status.
But how can I set the status?

The product page says "Hydraulic Disc Brake" and I don't see any wires. It looks to me that it works purely mechanically. I'm no expert on e-bikes but i don't think you can control this digitally.

You can see it here.

As far as I can tell this signal is for something like a brake light. So you can only get the brake status from it.

But you say you want to set the status? Like you want to engage/disengage the brakes through an Arduino?

You can use it for a brake light but if connected to a motor controller, you can also switch off the motor.

I already found the solution in another forum:

An ATTiny85 microcontroller could do the job. Take a transistor, hook the emitter to ground, hook the collector to the e-brake cutoff line, and hook the base through a resistor (around 1kohm) to another pin on the AtTiny.

With this setup the brake status could be changed from a MC as required.

What would be more suitable and efficient for a ESP8266: a BJT, a MOSFET or a relay?
Because most of the time the brake status is "not set", power should only be needed if
the brake status is set to "brake is set".
Probably by choosing between pull-down or pull-up this could be possible.