public DailyHomeConsumptionDto(HomeConsumptionDaily result)
 {
     Date        = new DateTimeOffset(result.Date, TimeSpan.Zero).ToUnixTimeMilliseconds();
     ToHome      = new HomeConsumptionDto("Home consumption", result.Consumption.UsageSummary.Select(a => a.WattHours));
     FromGrid    = new HomeConsumptionDto("From grid", result.Grid.UsageSummary.Select(a => a.WattHours));
     FromSolar   = new HomeConsumptionDto("From sun", result.Solar.UsageSummary.Select(a => a.WattHours));
     FromBattery = new HomeConsumptionDto("From battery", result.Battery.UsageSummary.Select(a => a.WattHours));
     ToBattery   = new HomeConsumptionDto("To battery", result.BatteryCharge.UsageSummary.Select(a => a.WattHours));
     ToCommunity = new HomeConsumptionDto("Solar to community", result.SolarExported.UsageSummary.Select(a => a.WattHours));
 }
예제 #2
0
 public DailyPowerMovementDto(PowerMovementDaily result)
 {
     Date                      = new DateTimeOffset(result.Date, TimeSpan.Zero).ToUnixTimeMilliseconds();
     ToHome                    = new HomeConsumptionDto("Home consumption", result.Consumption.UsageSummary.Select(a => a.WattHours));
     FromGridToHome            = new HomeConsumptionDto("From grid to home", result.GridToHome.UsageSummary.Select(a => a.WattHours));
     FromGridToBattery         = new HomeConsumptionDto("From grid to battery", result.GridToBattery.UsageSummary.Select(a => a.WattHours));
     FromBatteryToHome         = new HomeConsumptionDto("From battery to home", result.BatteryToHome.UsageSummary.Select(a => a.WattHours));
     FromBatteryToHomeNeg      = new HomeConsumptionDto("From battery to home", result.BatteryToHome.UsageSummary.Select(a => - a.WattHours));
     FromBatteryToCommunity    = new HomeConsumptionDto("From battery to community", result.BatteryToGrid.UsageSummary.Select(a => a.WattHours));
     FromBatteryToCommunityNeg = new HomeConsumptionDto("From battery to community", result.BatteryToGrid.UsageSummary.Select(a => - a.WattHours));
     FromSunToBattery          = new HomeConsumptionDto("From sun to battery", result.SolarToBattery.UsageSummary.Select(a => a.WattHours));
     FromSunToGrid             = new HomeConsumptionDto("From sun to grid", result.SolarToGrid.UsageSummary.Select(a => a.WattHours));
     FromSunToHome             = new HomeConsumptionDto("From sun to home", result.SolarToHome.UsageSummary.Select(a => a.WattHours));
 }