code: async def set_gpio_mode(self, gpio_id, mode, timeout=OTGW_DEFAULT_TIMEOUT):
          
          if gpio_id in "AB" and mode in range(8):
              if mode == 7 and gpio_id != "B":
                  return None
              cmd = globals().get("OTGW_CMD_GPIO_{}".format(gpio_id))
              status = {}
              ret = await self._wait_for_cmd(cmd, mode, timeout)
              if ret is None:
                  return
              ret = int(ret)
              var = globals().get("OTGW_GPIO_{}".format(gpio_id))
              status[var] = ret
              self._update_status(status)
              asyncio.ensure_future(
                  self._poll_gpio(self._protocol.status.get(OTGW_GPIO_A)
                                  or self._protocol.status.get(OTGW_GPIO_B)))
              return ret
docs: Configure the functions of the two GPIO pins of the gateway.
          The following functions are available:
  
          0 No function, default for both ports on a freshly flashed chip
          1 Ground - A permanently low output (0V). Could be used for a
              power LED
          2 Vcc - A permanently high output (5V). Can be used as a
              short-proof power supply for some external circuitry used
              by the other GPIO port
          3 LED E - An additional LED if you want to present more than 4
              LED functions
          4 LED F - An additional LED if you want to present more than 5
              LED functions
          5 Home - Set thermostat to setback temperature when pulled low
          6 Away - Set thermostat to setback temperature when pulled high
          7 DS1820 (GPIO port B only) - Data line for a DS18S20 or
              DS18B20 temperature sensor used to measure the outside
              temperature. A 4k7 resistor should be connected between
              GPIO port B and Vcc
  
          Return the new mode for the specified gpio, or None on
          failure.
  
          This method is a coroutine