The purpose is Read up sensor1, read, store in a variable, and disconnect the pin. And do the same for the sensor2.
All the sensors are DS18B20. I put a delay of 1 second between the sensor1 reading and sensor2.
When you said the battery level should be out of the loop, you suggest to me to put before loop?
Digitalwrite is to power up and down the sensors, should I put out of the loop too?
So you have DS18B20 connected to D4 and D5, don’t you? Or D4 and D5 are just to power the sensor on?
In the first scenario, I don’t think you have to do anything with the pin, the library will do that.
Second scenario, I am not sure about warming time thesensor will need, but maybe it takes more time or something like. Maybe current is not enough. I can’t tell.