diff --git a/tariff/awattar.go b/tariff/awattar.go index 57de34643..3f4119148 100644 --- a/tariff/awattar.go +++ b/tariff/awattar.go @@ -18,7 +18,6 @@ type Awattar struct { mux sync.Mutex log *util.Logger uri string - unit string data api.Rates updated time.Time } @@ -49,7 +48,6 @@ func NewAwattarFromConfig(other map[string]interface{}) (api.Tariff, error) { t := &Awattar{ embed: &cc.embed, log: util.NewLogger("awattar"), - unit: cc.Currency, uri: fmt.Sprintf(awattar.RegionURI, strings.ToLower(cc.Region)), } diff --git a/tariff/elering.go b/tariff/elering.go index d5e3336a7..92eb468a3 100644 --- a/tariff/elering.go +++ b/tariff/elering.go @@ -19,7 +19,6 @@ type Elering struct { *embed mux sync.Mutex log *util.Logger - unit string region string data api.Rates updated time.Time @@ -49,7 +48,6 @@ func NewEleringFromConfig(other map[string]interface{}) (api.Tariff, error) { t := &Elering{ embed: &cc.embed, log: util.NewLogger("Elering"), - unit: cc.Currency, region: strings.ToLower(cc.Region), } diff --git a/tariff/fixed.go b/tariff/fixed.go index 1b5bfa323..cd0943396 100644 --- a/tariff/fixed.go +++ b/tariff/fixed.go @@ -12,7 +12,6 @@ import ( ) type Fixed struct { - unit string clock clock.Clock zones fixed.Zones dynamic bool @@ -39,7 +38,6 @@ func NewFixedFromConfig(other map[string]interface{}) (api.Tariff, error) { } t := &Fixed{ - unit: cc.Currency, clock: clock.New(), dynamic: len(cc.Zones) > 1, } diff --git a/tariff/tibber.go b/tariff/tibber.go index e1cb6f427..6f991d5dc 100644 --- a/tariff/tibber.go +++ b/tariff/tibber.go @@ -18,7 +18,6 @@ type Tibber struct { mux sync.Mutex log *util.Logger homeID string - unit string client *tibber.Client data api.Rates updated time.Time @@ -50,22 +49,16 @@ func NewTibberFromConfig(other map[string]interface{}) (api.Tariff, error) { t := &Tibber{ log: log, homeID: cc.HomeID, - unit: cc.Unit, client: tibber.NewClient(log, cc.Token), } - if t.homeID == "" || t.unit == "" { + if t.homeID == "" { home, err := t.client.DefaultHome(t.homeID) if err != nil { return nil, err } - if t.homeID == "" { - t.homeID = home.ID - } - if t.unit == "" { - t.unit = home.CurrentSubscription.PriceInfo.Current.Currency - } + t.homeID = home.ID } done := make(chan error)