Skip to content

Commit d4b5824

Browse files
committed
fix linting errors
1 parent f180e59 commit d4b5824

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ your changes to the integration.
8383
## Pre-commit
8484

8585
You can use the [pre-commit](https://pre-commit.com/) settings included in the
86-
repostory to have code style and linting checks.
86+
repository to have code style and linting checks.
8787

8888
With `pre-commit` tool already installed,
8989
activate the settings of the repository:

custom_components/ocpp/api.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@ def __init__(
370370

371371
async def post_connect(self):
372372
"""Logic to be executed right after a charger connects."""
373+
373374
# Define custom service handles for charge point
374375
async def handle_clear_profile(call):
375376
"""Handle the clear profile service call."""
@@ -493,7 +494,7 @@ async def handle_data_transfer(call):
493494
if self.received_boot_notification is False:
494495
await self.trigger_boot_notification()
495496
await self.trigger_status_notification()
496-
except (NotImplementedError) as e:
497+
except NotImplementedError as e:
497498
_LOGGER.error("Configuration of the charger failed: %s", e)
498499

499500
async def get_supported_features(self):

scripts/setup

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cd "$(dirname "$0")/.."
66

77
python3 -m pip install --requirement requirements.txt
88
pre-commit install
9-
precommit run --all
9+
pre-commit run --all

tests/test_config_flow.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
@pytest.fixture(autouse=True)
2020
def bypass_setup_fixture():
2121
"""Prevent setup."""
22-
with patch("custom_components.ocpp.async_setup", return_value=True,), patch(
22+
with patch(
23+
"custom_components.ocpp.async_setup",
24+
return_value=True,
25+
), patch(
2326
"custom_components.ocpp.async_setup_entry",
2427
return_value=True,
2528
):

tests/test_init.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
"""Test ocpp setup process."""
22
# from homeassistant.exceptions import ConfigEntryNotReady
33
# import pytest
4+
from typing import AsyncGenerator
5+
6+
from homeassistant.core import HomeAssistant
47
from pytest_homeassistant_custom_component.common import MockConfigEntry
58

69
from custom_components.ocpp import (
@@ -19,7 +22,9 @@
1922
# Home Assistant using the pytest_homeassistant_custom_component plugin.
2023
# Assertions allow you to verify that the return value of whatever is on the left
2124
# side of the assertion matches with the right side.
22-
async def test_setup_unload_and_reload_entry(hass, bypass_get_data):
25+
async def test_setup_unload_and_reload_entry(
26+
hass: AsyncGenerator[HomeAssistant, None], bypass_get_data: None
27+
):
2328
"""Test entry setup and unload."""
2429
# Create a mock entry so we don't have to go through config flow
2530
config_entry = MockConfigEntry(
@@ -35,12 +40,12 @@ async def test_setup_unload_and_reload_entry(hass, bypass_get_data):
3540
await hass.async_block_till_done()
3641

3742
assert DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]
38-
assert type(hass.data[DOMAIN][config_entry.entry_id]) == CentralSystem
43+
assert type(hass.data[DOMAIN][config_entry.entry_id]) is CentralSystem
3944

4045
# Reload the entry and assert that the data from above is still there
4146
assert await async_reload_entry(hass, config_entry) is None
4247
assert DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]
43-
assert type(hass.data[DOMAIN][config_entry.entry_id]) == CentralSystem
48+
assert type(hass.data[DOMAIN][config_entry.entry_id]) is CentralSystem
4449

4550
# Unload the entry and verify that the data has been removed
4651
unloaded = await async_unload_entry(hass, config_entry)

0 commit comments

Comments
 (0)