Device_class for gpio binary sensor?

I installed a reed sensor on my main door and connected it to the raspi gpio.
Everything works fine except that it is not displayed with the door sensor icon.
Am I doing something wrong here or is device_class not supported for the gpio-platform?

binary_sensor:
  - platform: rpi_gpio
    ports:
      13: maindoor
    device_class: door

think you need to indent your device_class so it applies to port 13:

binary_sensor:
  - platform: rpi_gpio
    ports:
      13: maindoor
      device_class: door

Other thing, device_class isn’t listed as an option for Raspberry Pi GPIO Binary Sensor so you may need to add this to your customize config:

    binary_sensor.maindoor:
      friendly_name: Main Door
      icon: mdi:door

if you want the icon to change based on status, then you can create a template sensor based on your binary_sensor.maindoor as the template sensor does support device_class

Thanks for your answer.

With the proposed intend I get the following config error:
Invalid config for [binary_sensor.rpi_gpio]: [device_class] is an invalid option for [binary_sensor.rpi_gpio]

Using a template sensor would be a workaround but as @OttoWinter made clear only a few hours ago the design strategy seems to be the following:

Device classes are supposed to be replacements for the old mdi:… icon attribute so that we can shrink the frontend icon package.

So therefore all entities for all entities that now implement device class, the icon attribute should be dropped (or return nothing if device class already handles it).

I hope that the gpio binary sensor will support device_class soon as I want to keep my config as simple as possible.