Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
drc38 authored Feb 9, 2023
1 parent 8253c97 commit 0b75370
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 3 additions & 1 deletion custom_components/solarweb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):

return True


async def async_process_data(data):
"""Process raw data to simply HA sensor processing."""
# Alter Data Channels structure to simplify sensor usage
Expand All @@ -83,6 +84,7 @@ async def async_process_data(data):
_LOGGER.debug(f"New flow data structure: {sens}")
return sens


class SolarWebDataUpdateCoordinator(DataUpdateCoordinator):
"""Class to manage fetching data from the API."""

Expand All @@ -102,7 +104,7 @@ async def _async_update_data(self):
try:
data: PvSystemFlowData = await self.api.get_system_flow_data()
_LOGGER.debug(f"Flow data polled: {data}")

return await async_process_data(data)
except Exception as exception:
raise UpdateFailed() from exception
Expand Down
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import pytest
import pytest_asyncio
from fronius_solarweb.errors import NotAuthorizedException
from fronius_solarweb.schema.pvsystem import PvSystemFlowData
from fronius_solarweb.schema.pvsystem import PvSystemMetaData
from custom_components.solarweb import (
async_process_data,
)
from fronius_solarweb.errors import NotAuthorizedException
from fronius_solarweb.schema.pvsystem import PvSystemFlowData
from fronius_solarweb.schema.pvsystem import PvSystemMetaData

from .const import PV_FLOW_DATA
from .const import PV_SYS_DATA
Expand Down
3 changes: 2 additions & 1 deletion tests/test_init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test solarweb setup process."""
import pytest
import logging

import pytest
from custom_components.solarweb import (
async_reload_entry,
)
Expand Down

0 comments on commit 0b75370

Please sign in to comment.