XL9535 I/O Expander
The XL9535 component allows you to use XL9535 I/O expander in ESPHome. It uses I²C Bus for communication.
Once configured, you can use any of the 16 available pins for your projects. Within ESPHome they emulate a real internal GPIO pin and can therefore be used with many of ESPHome’s components such as the GPIO Binary Sensor or GPIO Switch.
ℹ️ Note
This I/O Expander chip is used in the Lilygo T-RGB 2.1" Round Display
# Example configuration entry
xl9535:
  - id: xl9535_hub
    address: 0x20
# Individual outputs
switch:
  - platform: gpio
    name: XL9535 Pin 0
    pin:
      xl9535: xl9535_hub
      number: 0
      mode:
        output: true
      inverted: falseConfiguration variables
- id (Required, ID): The id to use for this xl9535component.
- address (Optional, int): The I²C address of the driver.
Defaults to 0x20.
Pin configuration variables
- xl9535 (Required, ID): The id of the - xl9535component of the pin.
- number (Required, int): The pin number. Valid numbers are 0-7 and 10-17. 
- inverted (Optional, boolean): If all read and written values should be treated as inverted. Defaults to - false.
- mode (Optional, string): A pin mode to set for the pin at. One of - INPUTor- OUTPUT.