console.log("Hello World !!! ");

async function FetchData(){
	try{
		const tempResponse = await fetch('./HTU21D.json');
		const tempData = await tempResponse.json();
		document.getElementById('Temp-Value').textContent = tempData.Temperature.toFixed(1) + '°C';

		const tempHumidity = await fetch('./HTU21D.json');
		const tempHum = await tempHumidity.json();
		document.getElementById('Hum-Value').textContent = tempHum.Humidity.toFixed(1) + '%';
		
		const brightResponse = await fetch('./BH1750.json');
		const brightData = await brightResponse.json();
		document.getElementById('Bright-Value').textContent = brightData.Brightness.toFixed(1) + 'lux';
	} catch (error){
		console.log(error);
	}
}

FetchData();