From ca611b661b99d0b339f584b6097e64f4ff8c202e Mon Sep 17 00:00:00 2001 From: Guy Badman Date: Tue, 17 Mar 2020 15:36:55 +0000 Subject: [PATCH] changes for HACS --- octocost.py => apps/octocost/octocost.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename octocost.py => apps/octocost/octocost.py (97%) diff --git a/octocost.py b/apps/octocost/octocost.py similarity index 97% rename from octocost.py rename to apps/octocost/octocost.py index 118f22b..86e18f0 100644 --- a/octocost.py +++ b/apps/octocost/octocost.py @@ -9,10 +9,10 @@ def initialize(self): self.auth = self.args['auth'] MPAN = self.args['mpan'] SERIAL = self.args['serial'] - region = self.args['region'] + region = self.args['region'] self.startdate = datetime.date.fromisoformat(str(self.args['startdate'])) self.consumptionurl = 'https://api.octopus.energy/v1/electricity-meter-points/' + str(MPAN) + '/meters/' + str(SERIAL) + '/consumption/' - self.costurl= 'https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-' + str(region) + '/standard-unit-rates/' + self.costurl= 'https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-02-21-' + str(region).upper() + '/standard-unit-rates/' time = datetime.datetime.now() time = time + datetime.timedelta(seconds=5) self.run_every(self.cost_and_usage_callback, time, 120 * 60)