Does casting Pyrotechnics interrupt the spell Sanctuary on the caster? In particular in the case where the effect Smoke is activated and there is an enemy creature in a place where the smoke spreads.
If the warded creature makes an attack or casts a spell that affects an enemy creature, this spell ends.
So if your pyrotechnics spell affects an enemy creature, your sanctuary ends. If it doesn't affect an enemy creature, sanctuary keeps going.
In the case of the Fireworks effect, that's simple enough - if an enemy is within 10 feet of the fire you cast it on, and is therefore forced to make a saving throw, you've affected them.
In the case of the Smoke effect, it's a little less clear. It would be up to your DM to decide whether someone being in the heavily obscured area you created counts as them being affected by it. Personally, keeping in mind that being in a heavily obscured area gives a creature the blinded condition, I would definitely say that it has affected them.