MQTT Custom component, with several/multiple attributes

Hi.

Im a newbie within custom components, so this may be a stupid question…

Im currently studying this example:

What im trying to do is to create an entity consisting of several attributes.
The physical device sends data via MQTT (one specific topic for each value)
i.e:
state: deviceXX/onoff
voltage: deviceXX/voltage
mode: deviceXX/mode_id

So my question is how to include several mqtt topics into one component. (one for each attribute)
examples? Could this be done by adding some lines to the example linked above?

like:
devicexx (state)
- voltage
- mode

Thanks

Br,
Bjoern