Skip to content

Commit

Permalink
apply small feedback suggestions from a previous PR that is already m…
Browse files Browse the repository at this point in the history
  • Loading branch information
prystupa authored Jul 7, 2020
1 parent 27ef8a1 commit e5872cc
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions homeassistant/components/bond/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@
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
from homeassistant.core import HomeAssistant

from .const import DOMAIN

CONFIG_SCHEMA = vol.Schema({DOMAIN: vol.Schema({})}, extra=vol.ALLOW_EXTRA)

PLATFORMS = ["cover"]


Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/bond/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ async def async_step_user(self, user_input=None):
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:
errors["base"] = "invalid_auth"
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
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/bond/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def name(self) -> Optional[str]:
@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):
Expand Down

0 comments on commit e5872cc

Please sign in to comment.