Skip to content

Commit

Permalink
Revert "remove lazy imports, global vars"
Browse files Browse the repository at this point in the history
This reverts commit eb5a966.
  • Loading branch information
dynasticorpheus committed Jan 19, 2022
1 parent 44832a1 commit 008d571
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions custom_components/mindergas/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
}
)

LOGIN_URL = "https://www.mindergas.nl/users/sign_in/"
URL_DATA = "https://www.mindergas.nl/member/year_overview/new"
URL_DASHBOARD = "https://www.mindergas.nl/member/dashboard"


def setup_platform(hass, config, add_entities, discovery_info=None):
username = config.get(CONF_USERNAME)
Expand Down Expand Up @@ -84,6 +80,9 @@ def icon(self):

def update(self):

LOGIN_URL = "https://www.mindergas.nl/users/sign_in/"
URL_DATA = "https://www.mindergas.nl/member/year_overview/new"
URL_DASHBOARD = "https://www.mindergas.nl/member/dashboard"
URL_RESULT = "none"
n = 0
while not URL_RESULT == URL_DASHBOARD:
Expand Down Expand Up @@ -174,7 +173,13 @@ def icon(self):
return "mdi:chart-line"

def update(self):
import requests
from bs4 import BeautifulSoup
from lxml import html

LOGIN_URL = "https://www.mindergas.nl/users/sign_in/"
URL_DATA = "https://www.mindergas.nl/member/year_overview/new"
URL_DASHBOARD = "https://www.mindergas.nl/member/dashboard"
URL_RESULT = "none"
n = 0
while not URL_RESULT == URL_DASHBOARD:
Expand Down Expand Up @@ -260,7 +265,13 @@ def icon(self):
return "mdi:chart-line"

def update(self):
import requests
from bs4 import BeautifulSoup
from lxml import html

LOGIN_URL = "https://www.mindergas.nl/users/sign_in/"
URL_DATA = "https://www.mindergas.nl/member/year_overview/new"
URL_DASHBOARD = "https://www.mindergas.nl/member/dashboard"
URL_RESULT = "none"
n = 0
while not URL_RESULT == URL_DASHBOARD:
Expand Down

0 comments on commit 008d571

Please sign in to comment.