|
|
|
@ -29,6 +29,9 @@ var Home = React.createClass({
|
|
|
|
|
sensorTemperature: sensorProps,
|
|
|
|
|
sensorPm10: sensorProps,
|
|
|
|
|
sensorPm25: sensorProps,
|
|
|
|
|
sensorWindDir: sensorProps,
|
|
|
|
|
sensorWindSpeed: sensorProps,
|
|
|
|
|
sensorRain: sensorProps,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// Having measurements every minute is too much. Group them.
|
|
|
|
@ -131,6 +134,9 @@ var Home = React.createClass({
|
|
|
|
|
this.props._requestSensorData('pressure', daysAgo3);
|
|
|
|
|
this.props._requestSensorData('pm10', daysAgo3);
|
|
|
|
|
this.props._requestSensorData('pm25', daysAgo3);
|
|
|
|
|
this.props._requestSensorData('windDir', daysAgo3);
|
|
|
|
|
this.props._requestSensorData('windSpeed', daysAgo3);
|
|
|
|
|
this.props._requestSensorData('rain', daysAgo3);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
componentDidMount: function () {
|
|
|
|
@ -150,10 +156,13 @@ var Home = React.createClass({
|
|
|
|
|
let sensorTemperatureData = this.prepareData(this.props.sensorTemperature.data);
|
|
|
|
|
let sensorHumidityData = this.prepareData(this.props.sensorHumidity.data);
|
|
|
|
|
let sensorUvData = this.prepareData(this.props.sensorUv.data);
|
|
|
|
|
// let sensorLuminosityData = this.prepareData(this.props.sensorLuminosity.data);
|
|
|
|
|
// let sensorPressureData = this.prepareData(this.props.sensorPressure.data);
|
|
|
|
|
let sensorLuminosityData = this.prepareData(this.props.sensorLuminosity.data);
|
|
|
|
|
let sensorPressureData = this.prepareData(this.props.sensorPressure.data);
|
|
|
|
|
let sensorPm10Data = this.prepareData(this.props.sensorPm10.data);
|
|
|
|
|
let sensorPm25Data = this.prepareData(this.props.sensorPm25.data);
|
|
|
|
|
let sensorWindDirData = this.prepareData(this.props.sensorWindDir.data);
|
|
|
|
|
let sensorWindSpeedData = this.prepareData(this.props.sensorWindSpeed.data);
|
|
|
|
|
let sensorRainData = this.prepareData(this.props.sensorRain.data);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<section className='page'>
|
|
|
|
@ -177,14 +186,28 @@ var Home = React.createClass({
|
|
|
|
|
lastReading={sensorTemperatureData.last}
|
|
|
|
|
avgs={sensorTemperatureData.avgs}
|
|
|
|
|
plotData={sensorTemperatureData.data}
|
|
|
|
|
axisLineMax={35}
|
|
|
|
|
axisLineMax={40}
|
|
|
|
|
axisLineVal={20}
|
|
|
|
|
axisLineMin={4}
|
|
|
|
|
axisLineMin={0}
|
|
|
|
|
unit=' ºC'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--hum'
|
|
|
|
|
fetching={this.props.sensorPressure.fetching}
|
|
|
|
|
fetched={this.props.sensorPressure.fetched}
|
|
|
|
|
title='Luftdruck'
|
|
|
|
|
lastReading={sensorPressureData.last}
|
|
|
|
|
avgs={sensorPressureData.avgs}
|
|
|
|
|
plotData={sensorPressureData.data}
|
|
|
|
|
axisLineMax={1020}
|
|
|
|
|
axisLineVal={1010}
|
|
|
|
|
axisLineMin={980}
|
|
|
|
|
unit=' hPa'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--press'
|
|
|
|
|
fetching={this.props.sensorHumidity.fetching}
|
|
|
|
|
fetched={this.props.sensorHumidity.fetched}
|
|
|
|
|
title='rel. Luftfeuchte'
|
|
|
|
@ -197,8 +220,50 @@ var Home = React.createClass({
|
|
|
|
|
unit=' %'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--press'
|
|
|
|
|
fetching={this.props.sensorRain.fetching}
|
|
|
|
|
fetched={this.props.sensorRain.fetched}
|
|
|
|
|
title='Niederschlag'
|
|
|
|
|
lastReading={sensorRainData.last}
|
|
|
|
|
avgs={sensorRainData.avgs}
|
|
|
|
|
plotData={sensorRainData.data}
|
|
|
|
|
axisLineMax={10}
|
|
|
|
|
axisLineVal={5}
|
|
|
|
|
axisLineMin={0}
|
|
|
|
|
unit=' L/m² / 5 Min'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--uv'
|
|
|
|
|
fetching={this.props.sensorWindDir.fetching}
|
|
|
|
|
fetched={this.props.sensorWindDir.fetched}
|
|
|
|
|
title='Windrichtung'
|
|
|
|
|
lastReading={sensorWindDirData.last}
|
|
|
|
|
avgs={sensorWindDirData.avgs}
|
|
|
|
|
plotData={sensorWindDirData.data}
|
|
|
|
|
axisLineMax={360}
|
|
|
|
|
axisLineVal={180}
|
|
|
|
|
axisLineMin={0}
|
|
|
|
|
unit=' °'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--uv'
|
|
|
|
|
fetching={this.props.sensorWindSpeed.fetching}
|
|
|
|
|
fetched={this.props.sensorWindSpeed.fetched}
|
|
|
|
|
title='Windgeschwindigkeit'
|
|
|
|
|
lastReading={sensorWindSpeedData.last}
|
|
|
|
|
avgs={sensorWindSpeedData.avgs}
|
|
|
|
|
plotData={sensorWindSpeedData.data}
|
|
|
|
|
axisLineMax={90}
|
|
|
|
|
axisLineVal={30}
|
|
|
|
|
axisLineMin={0}
|
|
|
|
|
unit=' km/h'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--lux'
|
|
|
|
|
fetching={this.props.sensorUv.fetching}
|
|
|
|
|
fetched={this.props.sensorUv.fetched}
|
|
|
|
|
title='Uv Licht'
|
|
|
|
@ -211,7 +276,7 @@ var Home = React.createClass({
|
|
|
|
|
unit=' μW/cm²'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
{/* <SensorWidget
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--lux'
|
|
|
|
|
fetching={this.props.sensorLuminosity.fetching}
|
|
|
|
|
fetched={this.props.sensorLuminosity.fetched}
|
|
|
|
@ -225,20 +290,6 @@ var Home = React.createClass({
|
|
|
|
|
unit=' lx'
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--press'
|
|
|
|
|
fetching={this.props.sensorPressure.fetching}
|
|
|
|
|
fetched={this.props.sensorPressure.fetched}
|
|
|
|
|
title='Luftdruck'
|
|
|
|
|
lastReading={sensorPressureData.last}
|
|
|
|
|
avgs={sensorPressureData.avgs}
|
|
|
|
|
plotData={sensorPressureData.data}
|
|
|
|
|
axisLineMax={1020}
|
|
|
|
|
axisLineVal={1010}
|
|
|
|
|
axisLineMin={1000}
|
|
|
|
|
unit=' hPa'
|
|
|
|
|
/> */}
|
|
|
|
|
|
|
|
|
|
<SensorWidget
|
|
|
|
|
className='card--pm'
|
|
|
|
|
fetching={this.props.sensorPm10.fetching}
|
|
|
|
@ -287,6 +338,9 @@ function selector (state) {
|
|
|
|
|
sensorTemperature: state.sensorTemperature,
|
|
|
|
|
sensorPm10: state.sensorPm10,
|
|
|
|
|
sensorPm25: state.sensorPm25,
|
|
|
|
|
sensorWindDir: state.sensorWindDir,
|
|
|
|
|
sensorWindSpeed: state.sensorWindSpeed,
|
|
|
|
|
sensorRain: state.sensorRain,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|