https://github.com/sfekilou/M5STACK_4RELAY
Library with these functions:
begin(TwoWire &wireport,int sdaPin, int sclPin,uint32_t frequency); //Initialize I2C port
uint16_t ReadState(); //read 0x10 & 0x11 registers
SyncMode(bool Sync); //sync or async LEDs
void AllOff(); //set all relays to OFF
void Write4Relay(int number,bool state); //set or unset the relay number