Skip to content

Commit

Permalink
Merge pull request #496 from jwillemsen/jwi-precommitfixes
Browse files Browse the repository at this point in the history
Run pre-commit to fix action failures
  • Loading branch information
CJNE authored Mar 11, 2024
2 parents af608dd + e77eb9f commit 5eb9f17
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
29 changes: 13 additions & 16 deletions custom_components/myenergi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,18 @@
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.core import callback
from homeassistant.helpers.selector import NumberSelector
from homeassistant.helpers.selector import NumberSelectorConfig
from pymyenergi.client import MyenergiClient
from pymyenergi.connection import Connection
from pymyenergi.exceptions import (
TimeoutException,
WrongCredentials
)
from pymyenergi.exceptions import TimeoutException
from pymyenergi.exceptions import WrongCredentials

from . import SCAN_INTERVAL
from .const import (
CONF_PASSWORD,
CONF_SCAN_INTERVAL,
CONF_USERNAME,
DOMAIN
)

from homeassistant.helpers.selector import (
NumberSelector,
NumberSelectorConfig,
)
from .const import CONF_PASSWORD
from .const import CONF_SCAN_INTERVAL
from .const import CONF_USERNAME
from .const import DOMAIN

_LOGGER: logging.Logger = logging.getLogger(__package__)

Expand Down Expand Up @@ -119,7 +112,11 @@ async def async_step_user(self, user_input=None):
step_id="user",
data_schema=vol.Schema(
{
vol.Required(CONF_SCAN_INTERVAL, default=scan_interval): NumberSelector(NumberSelectorConfig(min=1, max=300, step=1),),
vol.Required(
CONF_SCAN_INTERVAL, default=scan_interval
): NumberSelector(
NumberSelectorConfig(min=1, max=300, step=1),
),
}
),
)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/myenergi/diagnostics.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
"""Diagnostics support for Daikin Diagnostics."""
from __future__ import annotations

from typing import Any

from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device_registry import DeviceEntry

from pymyenergi.client import MyenergiClient
from pymyenergi.connection import Connection

from .const import DOMAIN


async def async_get_config_entry_diagnostics(
hass: HomeAssistant, entry: ConfigEntry
) -> dict[str, Any]:
Expand All @@ -23,4 +24,3 @@ async def async_get_config_entry_diagnostics(
for device in all_devices:
data[device.serial_number] = device.data
return data

0 comments on commit 5eb9f17

Please sign in to comment.