Clean up code for onewire config flow (#67970)

* Change debug level of integration reload after config update to debug

* Remove extra .keys() call for dict itreation

* Remove unecessary type check

* Remove unused LOGGER reference
This commit is contained in:
Per Öberg 2022-03-15 08:26:54 +01:00 committed by GitHub
parent ef71ab04ad
commit 7615f138d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 18 deletions

View File

@ -47,5 +47,5 @@ async def async_unload_entry(hass: HomeAssistant, config_entry: ConfigEntry) ->
async def options_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Handle options update."""
_LOGGER.info("Configuration options updated, reloading OneWire integration")
_LOGGER.debug("Configuration options updated, reloading OneWire integration")
await hass.config_entries.async_reload(entry.entry_id)

View File

@ -1,7 +1,6 @@
"""Config flow for 1-Wire component."""
from __future__ import annotations
import logging
from typing import Any
import voluptuous as vol
@ -47,9 +46,6 @@ DATA_SCHEMA_MOUNTDIR = vol.Schema(
)
_LOGGER = logging.getLogger(__name__)
async def validate_input_owserver(
hass: HomeAssistant, data: dict[str, Any]
) -> dict[str, str]:
@ -255,7 +251,7 @@ class OnewireOptionsFlowHandler(OptionsFlow):
default=self._get_current_configured_sensors(),
description="Multiselect with list of devices to choose from",
): cv.multi_select(
{device: False for device in self.configurable_devices.keys()}
{device: False for device in self.configurable_devices}
),
}
),
@ -273,8 +269,6 @@ class OnewireOptionsFlowHandler(OptionsFlow):
return await self._update_options()
self.current_device, description = self.devices_to_configure.popitem()
data_schema: vol.Schema
if description.family == "28":
data_schema = vol.Schema(
{
vol.Required(