Well, this is very specific to the Apple HomeKit ecosystem. If you are not familiar with homekit then the library and the example won't make much sense to you.
If you are, this is actually quite a great library to build your own HomeKit integrable devices. Works really well.
there is a solid documentation to get started (HomeSpan/docs/GettingStarted.md at master · HomeSpan/HomeSpan · GitHub)
I'd recommend following the Tutorials
one thing that is not obvious at first (and author tried to highlight that through indentation) is that when you do
new SpanAccessory(); // Begin by creating a new Accessory using SpanAccessory(), no arguments needed
new Service::AccessoryInformation(); // HAP requires every Accessory to implement an AccessoryInformation Service, with the required Identify Characteristic
new Characteristic::Identify(); // Create the required Identify
the service and Characteristic are automatically attached to the most recently created element (so here Identify s attached to AccessoryInformation which is attached to our new SpanAccessory)
@VirtualCZ I'm unclear on what you want to achieve