Skip to content

Commit

Permalink
Linting...
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE committed Aug 18, 2024
1 parent 5170684 commit 8ac104d
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ pip==24.0
pre-commit==3.6.2
black==23.11.0
flake8==7.0.0
reorder-python-imports==3.12.0
reorder-python-imports==3.12.0
5 changes: 3 additions & 2 deletions custom_components/sunspec/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
"""Adds config flow for SunSpec."""

import logging

import homeassistant.helpers.config_validation as cv
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
import voluptuous as vol

from . import SCAN_INTERVAL
from .api import SunSpecApiClient
Expand Down
1 change: 1 addition & 0 deletions custom_components/sunspec/entity.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""SunSpecEntity class"""

from homeassistant.helpers.update_coordinator import CoordinatorEntity

from .const import DOMAIN
Expand Down
10 changes: 5 additions & 5 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
"""Tests for SunSpec integration."""

from __future__ import annotations

from typing import Any
from unittest.mock import Mock
from unittest.mock import patch

from custom_components.sunspec import DOMAIN
from custom_components.sunspec import get_sunspec_unique_id
from custom_components.sunspec.api import (
SunSpecApiClient,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.sunspec import DOMAIN
from custom_components.sunspec import get_sunspec_unique_id
from custom_components.sunspec.api import SunSpecApiClient

from .const import MOCK_CONFIG

TEST_CONFIG_ENTRY_ID = "77889900aa"
Expand Down
1 change: 1 addition & 0 deletions tests/const.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Constants for SunSpec tests."""

from custom_components.sunspec.const import CONF_ENABLED_MODELS
from custom_components.sunspec.const import CONF_HOST
from custom_components.sunspec.const import CONF_PORT
Expand Down
8 changes: 5 additions & 3 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
"""Test SunSpec config flow."""

from unittest.mock import patch

from homeassistant import config_entries
from homeassistant import data_entry_flow
import pytest
from pytest_homeassistant_custom_component.common import MockConfigEntry

from custom_components.sunspec.const import CONF_ENABLED_MODELS
from custom_components.sunspec.const import CONF_SCAN_INTERVAL
from custom_components.sunspec.const import DOMAIN
from homeassistant import config_entries
from homeassistant import data_entry_flow
from pytest_homeassistant_custom_component.common import MockConfigEntry

from . import MockSunSpecDataUpdateCoordinator
from .const import MOCK_CONFIG
Expand Down
6 changes: 4 additions & 2 deletions tests/test_sensor.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""Test SunSpec sensor."""
from custom_components.sunspec.sensor import ICON_DC_AMPS

from homeassistant.core import HomeAssistant

from . import setup_mock_sunspec_config_entry
from custom_components.sunspec.sensor import ICON_DC_AMPS

from . import TEST_INVERTER_MM_SENSOR_POWER_ENTITY_ID
from . import TEST_INVERTER_MM_SENSOR_STATE_ENTITY_ID
from . import TEST_INVERTER_PREFIX_SENSOR_DC_ENTITY_ID
Expand All @@ -11,6 +12,7 @@
from . import TEST_INVERTER_SENSOR_POWER_ENTITY_ID
from . import TEST_INVERTER_SENSOR_STATE_ENTITY_ID
from . import TEST_INVERTER_SENSOR_VAR_ID
from . import setup_mock_sunspec_config_entry
from .const import MOCK_CONFIG_MM
from .const import MOCK_CONFIG_PREFIX

Expand Down

0 comments on commit 8ac104d

Please sign in to comment.