mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-13 17:22:54 -05:00
Light level changes
This commit is contained in:
@@ -126,15 +126,7 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Data
|
||||
|
||||
var query = ResourceReader.GetString("ChrisKaczor.HomeMonitor.Weather.Service.Data.Resources.GetReadingValueHistoryGrouped.sql");
|
||||
|
||||
switch (weatherValueType)
|
||||
{
|
||||
case WeatherValueType.LightLevel:
|
||||
query = query.Replace("@Value", "LightLevel / 3.3 * 100");
|
||||
break;
|
||||
default:
|
||||
query = query.Replace("@Value", weatherValueType.ToString());
|
||||
break;
|
||||
}
|
||||
|
||||
return await connection.QueryAsync<WeatherValueGrouped>(query, new { Start = start, End = end, BucketMinutes = bucketMinutes });
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ FROM (
|
||||
Humidity,
|
||||
PressureTemperature AS Temperature,
|
||||
Pressure,
|
||||
LightLevel / 3.3 * 100 AS LightLevel,
|
||||
LightLevel,
|
||||
Rain
|
||||
FROM Reading
|
||||
WHERE Timestamp BETWEEN @Start AND @End
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Models
|
||||
|
||||
Pressure = new ReadingAggregate(readings, r => r.Pressure, 2);
|
||||
|
||||
Light = new ReadingAggregate(readings, r => (r.LightLevel / 3.3m * 100).Truncate(1), 1);
|
||||
Light = new ReadingAggregate(readings, r => r.LightLevel, 2);
|
||||
|
||||
WindSpeed = new ReadingAggregate(readings, r => r.WindSpeed, 1);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace ChrisKaczor.HomeMonitor.Weather.Service.Models
|
||||
Rain = weatherMessage.Rain;
|
||||
Pressure = weatherMessage.Pressure;
|
||||
Temperature = weatherMessage.PressureTemperature;
|
||||
LightLevel = weatherMessage.LightLevel / 3.3m * 100;
|
||||
LightLevel = weatherMessage.LightLevel;
|
||||
Latitude = weatherMessage.Latitude;
|
||||
Longitude = weatherMessage.Longitude;
|
||||
Altitude = weatherMessage.Altitude;
|
||||
|
||||
Reference in New Issue
Block a user