Skip to content

Commit

Permalink
More linting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
CJNE committed Feb 18, 2024
1 parent 37a0daa commit 0254bad
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 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==24.2.0
flake8==7.0.0
reorder-python-imports==3.12.0
reorder-python-imports==3.12.0
6 changes: 1 addition & 5 deletions custom_components/myenergi/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
from .const import DOMAIN
from .entity import MyenergiEntity

LIBBI_MODE_NAMES = {
0: 'Stopped',
1: 'Normal',
5: 'Export'
}
LIBBI_MODE_NAMES = {0: "Stopped", 1: "Normal", 5: "Export"}

ATTR_BOOST_AMOUNT = "amount"
ATTR_BOOST_TIME = "time"
Expand Down
4 changes: 2 additions & 2 deletions custom_components/myenergi/sensor.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
"""Sensor platform for myenergi."""
import operator

from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.components.sensor import SensorEntity
from homeassistant.components.sensor import SensorStateClass
from homeassistant.components.sensor import SensorDeviceClass
from homeassistant.const import PERCENTAGE
from homeassistant.const import UnitOfElectricPotential
from homeassistant.const import UnitOfEnergy
from homeassistant.const import UnitOfFrequency
from homeassistant.const import PERCENTAGE
from homeassistant.const import UnitOfPower
from homeassistant.const import UnitOfTemperature
from homeassistant.helpers.entity import EntityCategory
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ flake8==7.0.0
reorder-python-imports==3.12.0
homeassistant
pymyenergi
pytest
pytest
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ branch = False

[coverage:report]
show_missing = true
fail_under = 95
fail_under = 95
8 changes: 6 additions & 2 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ async def test_setup_unload_and_reload_entry(hass, bypass_get_data):
# call, no code from custom_components/myenergi/api.py actually runs.
assert await async_setup_entry(hass, config_entry)
assert DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]
assert isinstance(hass.data[DOMAIN][config_entry.entry_id], MyenergiDataUpdateCoordinator)
assert isinstance(
hass.data[DOMAIN][config_entry.entry_id], MyenergiDataUpdateCoordinator
)

# Reload the entry and assert that the data from above is still there
assert await async_reload_entry(hass, config_entry) is None
assert DOMAIN in hass.data and config_entry.entry_id in hass.data[DOMAIN]
assert isinstance(hass.data[DOMAIN][config_entry.entry_id], MyenergiDataUpdateCoordinator)
assert isinstance(
hass.data[DOMAIN][config_entry.entry_id], MyenergiDataUpdateCoordinator
)

# Unload the entry and verify that the data has been removed
assert await async_unload_entry(hass, config_entry)
Expand Down

0 comments on commit 0254bad

Please sign in to comment.