From 5e15e86b4e80f9b2a1d3e228886953987340f82e Mon Sep 17 00:00:00 2001 From: Josh Deprez Date: Tue, 23 Aug 2022 05:19:43 +0000 Subject: [PATCH] Tariff changes --- tariff.go | 61 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/tariff.go b/tariff.go index b6be678..fc9c4c7 100644 --- a/tariff.go +++ b/tariff.go @@ -4,35 +4,42 @@ import ( "time" ) -//const dailySupplyCharge = 105.750 / 100 // 1 July 2020 - 30 June 2021 -const dailySupplyCharge = 98.234 / 100 // 1 July 2021 - 30 June 2022 - -var ( - //solarFeedInTariff = fixedTariff(8.471 / 100) // 1 July 2020 - 30 June 2021 - solarFeedInTariff = fixedTariff(6.501 / 100) // 1 July 2021 - 30 June 2022 - tariff93 = &onOffPeakTariff{ - // 1 July 2020 - 30 June 2021: - //onPeak: 32.137 / 100, - //offPeak: 14.963 / 100, - // 1 July 2021 - 30 June 2022: - onPeak: 29.852 / 100, - offPeak: 13.9 / 100, - isPeak: (&weekdayHours{ - zone: time.FixedZone("UTC+10", +10*60*60), - on: [24]bool{ - 7: true, - 8: true, - 9: true, - 16: true, - 17: true, - 18: true, - 19: true, - 20: true, - }, - }).isPeak, - } +const ( + //dailySupplyCharge = 105.750 / 100 // 1 July 2020 - 30 June 2021 + //dailySupplyCharge = 98.234 / 100 // 1 July 2021 - 30 June 2022 + //dailySupplyCharge = 98.234 / 100 // 1 July 2021 - 30 June 2022 + dailySupplyCharge = 1.099030 // 1 July 2021 - 30 June 2022 + + //solarFeedInTariff = fixedTariff(8.471 / 100) // 1 July 2020 - 30 June 2021 + //solarFeedInTariff = fixedTariff(6.501 / 100) // 1 July 2021 - 30 June 2022 + solarFeedInTariff = fixedTariff(0.088830) // 1 July 2022 - 30 June 2023 ) +var tariff93 = &onOffPeakTariff{ + // 1 July 2020 - 30 June 2021: + //onPeak: 32.137 / 100, + //offPeak: 14.963 / 100, + // 1 July 2021 - 30 June 2022: + //onPeak: 29.852 / 100, + //offPeak: 13.9 / 100, + // 1 July 2022 - 30 June 2023: + onPeak: 0.333990, + offPeak: 0.155510, + isPeak: (&weekdayHours{ + zone: time.FixedZone("UTC+10", +10*60*60), + on: [24]bool{ + 7: true, + 8: true, + 9: true, + 16: true, + 17: true, + 18: true, + 19: true, + 20: true, + }, + }).isPeak, +} + type tariff interface { pricePerKWh(time.Time) float64 }