Skip to content

Commit

Permalink
Move Base component constants to __init__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Limych committed Sep 13, 2020
1 parent 94ab109 commit a9a7b79
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
10 changes: 7 additions & 3 deletions custom_components/gismeteo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@
BASE_URL,
MMHG2HPA,
MS2KMH,
VERSION,
ISSUE_URL,
DOMAIN,
)

try:
Expand All @@ -74,6 +71,13 @@
_LOGGER = logging.getLogger(__name__)


# Base component constants
DOMAIN = "gismeteo"
VERSION = "2.0.14"
ISSUE_URL = "https://github.com/Limych/ha-gismeteo/issues"
ATTRIBUTION = "Data provided by Gismeteo"


# pylint: disable=unused-argument
def setup(hass, config):
"""Set up component."""
Expand Down
6 changes: 0 additions & 6 deletions custom_components/gismeteo/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@

from homeassistant.components.weather import ATTR_FORECAST_CONDITION

# Base component constants
DOMAIN = "gismeteo"
VERSION = "2.0.14"
ISSUE_URL = "https://github.com/Limych/ha-gismeteo/issues"
ATTRIBUTION = "Data provided by Gismeteo"

BASE_URL = "https://services.gismeteo.ru/inform-service/inf_chrome"

MMHG2HPA = 1.333223684
Expand Down
3 changes: 1 addition & 2 deletions custom_components/gismeteo/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.storage import STORAGE_DIR

from . import Gismeteo
from . import Gismeteo, ATTRIBUTION
from .const import (
ATTRIBUTION,
DEFAULT_NAME,
MIN_TIME_BETWEEN_UPDATES,
CONF_CACHE_DIR,
Expand Down
3 changes: 1 addition & 2 deletions custom_components/gismeteo/weather.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.storage import STORAGE_DIR

from . import Gismeteo
from . import Gismeteo, ATTRIBUTION
from .const import (
ATTRIBUTION,
DEFAULT_NAME,
MIN_TIME_BETWEEN_UPDATES,
CONF_CACHE_DIR,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ exclude =
ignore_missing_imports = True

[semantic_release]
version_variable=custom_components/gismeteo/const.py:VERSION
version_variable=custom_components/gismeteo/__init__.py:VERSION
upload_to_pypi=false
upload_to_release=false

0 comments on commit a9a7b79

Please sign in to comment.