Need help with code update

I have a bunch of sonoff s31 power switches that I flashed with esphome long time ago and they have always worked fine. I’m repurposing one of them and updated the code. now I can’t get the power button status to show correctly or toggle.
this is what I had that worked.

binary_sensor:
  - platform: gpio
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: bedroomff Power Button
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: bedroomff Power1
    pin: GPIO12
    id: relay
  - platform: restart
    name: bedroomff Restart  

I changed it to this after looking at the docs, but still no luck. anything jump out at anyone?

binary_sensor:
  - platform: gpio
    pin:
      number: 0
      mode:
        input: true
        pullup: true
      inverted: True
    name: "Printer s31 Power Button"
    on_press:
      - switch.toggle: relay

switch:
  - platform: gpio
    name: "Printer s31"
    pin: 12
    id: relay
  - platform: restart
    name:  "Printer s31"  

In my files, the inverted: true is indented 2 spaces extra. Seems different from the documentation indeed.

something must have changed not to recently, I had a previous release (or 2) of esphome, I completed my code with that, and now it works fine. I was going to get rid of it (bare metal install with HA) and am moving to docker containers on my server, but I guess I’ll hold on to the old version a bit longer.