Custom (multi switch)

Hello,

Is it possible to create a custom multi-switch component?
I tried following the custom sensor example, but gives me error when trying to create multiple switches
( Switch *switch1 = new Switch(); ... )
I’m trying to use M5Stack 4Relay