Skip to content

Commit

Permalink
Pylint style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
klaasnicolaas committed Dec 13, 2021
1 parent 75d1c34 commit d00ad65
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
.idea/*
__pycache__
19 changes: 12 additions & 7 deletions custom_components/omnik_inverter/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
from .const import (
CONF_SCAN_INTERVAL,
CONF_SOURCE_TYPE,
CONFIGFLOW_VERSION,
DEFAULT_SCAN_INTERVAL,
DOMAIN,
LOGGER,
SERVICE_DEVICE,
SERVICE_INVERTER,
CONFIGFLOW_VERSION,
)

PLATFORMS = (SENSOR_DOMAIN,)
Expand Down Expand Up @@ -59,10 +59,15 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

return unload_ok


async def async_migrate_entry(hass: HomeAssistant, config_entry: ConfigEntry):
"""Migrate old entry."""
if config_entry.version <= 2:
LOGGER.warning("Impossible to migrate config version from version %s to version %s.\r\nPlease consider to delete and re-add the integration.", config_entry.version, CONFIGFLOW_VERSION)
LOGGER.warning(
"Impossible to migrate config version from version %s to version %s.\r\nPlease consider to delete and re-add the integration.",
config_entry.version,
CONFIGFLOW_VERSION,
)
return False


Expand Down Expand Up @@ -105,11 +110,11 @@ def __init__(
session=async_get_clientsession(hass),
)
else:
self.omnikinverter = OmnikInverter(
host=self.config_entry.data[CONF_HOST],
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
session=async_get_clientsession(hass),
)
self.omnikinverter = OmnikInverter(
host=self.config_entry.data[CONF_HOST],
source_type=self.config_entry.data[CONF_SOURCE_TYPE],
session=async_get_clientsession(hass),
)

async def _async_update_data(self) -> OmnikInverterData:
"""Fetch data from Omnik Inverter."""
Expand Down
4 changes: 2 additions & 2 deletions custom_components/omnik_inverter/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
from homeassistant.helpers.aiohttp_client import async_get_clientsession

from .const import (
DOMAIN,
CONFIGFLOW_VERSION,
CONF_SCAN_INTERVAL,
CONF_SOURCE_TYPE,
CONFIGFLOW_VERSION,
DEFAULT_SCAN_INTERVAL,
DOMAIN,
)


Expand Down

0 comments on commit d00ad65

Please sign in to comment.