Creating multiple things in a loop

I’m implementing 8x ds18b20 temperature sensors as webthing. The protocol that they use is 1wire. Now i have a running loop collecting id’s and temperature of those eight sensors and i wold like to create a webthing for each. I looked in to the multiple thing example but don’t see how to create multiple things in a loop.
Is that actually possible?

The webthing libraries do not handle adding/removing things at runtime well. They expect the complete list of things to be present when the server is started.

Does that mean that I can loop through my sensors and create as many as are found on the 1wire line and then start the server with a list of things like:

list_of_things = [sensor1, sensor 2, sensor 3]
server = WebThingServer(MultipleThings(list_of_things, 'some devices'), port=8888)

or do you mean exactly that, is not handled properly?

Yes, that would be the right thing to do. My point was just that you’ll have to stop looping after you start the server, because it’s not straightforward to add new devices after that point.