mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 01:07:10 +00:00
apply small feedback suggestions from a previous PR that is already merged (#37551)
This commit is contained in:
parent
27ef8a1ced
commit
e5872cc0e4
@ -2,7 +2,6 @@
|
||||
import asyncio
|
||||
|
||||
from bond import Bond
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_HOST
|
||||
@ -10,8 +9,6 @@ from homeassistant.core import HomeAssistant
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)
|
||||
|
||||
PLATFORMS = ["cover"]
|
||||
|
||||
|
||||
|
@ -51,8 +51,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
if user_input is not None:
|
||||
try:
|
||||
info = await validate_input(self.hass, user_input)
|
||||
|
||||
return self.async_create_entry(title=info["title"], data=user_input)
|
||||
except CannotConnect:
|
||||
errors["base"] = "cannot_connect"
|
||||
except InvalidAuth:
|
||||
@ -60,6 +58,8 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
except Exception: # pylint: disable=broad-except
|
||||
_LOGGER.exception("Unexpected exception")
|
||||
errors["base"] = "unknown"
|
||||
else:
|
||||
return self.async_create_entry(title=info["title"], data=user_input)
|
||||
|
||||
return self.async_show_form(
|
||||
step_id="user", data_schema=DATA_SCHEMA, errors=errors
|
||||
|
@ -64,7 +64,7 @@ class BondCover(CoverEntity):
|
||||
@property
|
||||
def device_info(self) -> Optional[Dict[str, Any]]:
|
||||
"""Get a an HA device representing this cover."""
|
||||
return {ATTR_NAME: self.name, "identifiers": {(DOMAIN, self.unique_id)}}
|
||||
return {ATTR_NAME: self.name, "identifiers": {(DOMAIN, self._device.device_id)}}
|
||||
|
||||
@property
|
||||
def is_closed(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user