Skip to content

Commit

Permalink
lint and bump
Browse files Browse the repository at this point in the history
  • Loading branch information
Hellowlol committed Feb 8, 2021
1 parent a7eea4d commit 15798f5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
11 changes: 7 additions & 4 deletions custom_components/zaptec/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

_LOGGER = logging.getLogger(__name__)


class ZaptecFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
"""Config flow for Blueprint."""

Expand All @@ -35,7 +36,6 @@ async def async_step_user(
vol.Required("username", default=""): str,
vol.Required("password", default=""): str,
vol.Optional("scan_interval", default=30): vol.Coerce(int),

}

placeholders = {
Expand All @@ -47,15 +47,18 @@ async def async_step_user(
if user_input is not None:
valid_login = False
try:
valid_login = await Account.check_login(user_input["username"], user_input["password"])
valid_login = await Account.check_login(
user_input["username"], user_input["password"]
)
except aiohttp.ClientConnectorError:
errors["base"] = "connection_failure"
except AuthorizationFailedException:
errors["base"] = "auth_failure"

if valid_login:
return self.async_create_entry(title=DOMAIN.capitalize(), data=user_input)

return self.async_create_entry(
title=DOMAIN.capitalize(), data=user_input
)

return self.async_show_form(
step_id="user",
Expand Down
2 changes: 1 addition & 1 deletion custom_components/zaptec/const.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME = 'zaptec'
VERSION = '0.0.1'
VERSION = '0.0.2'
ISSUEURL = 'https://github.com/custom-components/zaptec/issues'

STARTUP = """
Expand Down
12 changes: 1 addition & 11 deletions custom_components/zaptec/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@
from .misc import to_under

_LOGGER = logging.getLogger(__name__)

#PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(SENSOR_SCHEMA_ATTRS)


SCAN_INTERVAL = timedelta(seconds=60)


Expand All @@ -32,12 +28,7 @@ async def _update_remaps() -> None:
OBSERVATIONS_REMAPS.update({value: key for key, value in v.items()})



async def _dry_setup(hass, config, async_add_entities, discovery_info=None):
#async def async_setup_platform(
# hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
#) -> None:

sensors = []
acc = hass.data[DOMAIN]["api"]

Expand Down Expand Up @@ -67,11 +58,11 @@ async def cb(data):

return True


async def async_setup_platform(
hass: HomeAssistantType, config: ConfigType, async_add_entities, discovery_info=None
) -> None:
return True
#return await _dry_setup(hass, config, async_add_entities, discovery_info)


async def async_setup_entry(hass, config_entry, async_add_devices):
Expand Down Expand Up @@ -201,7 +192,6 @@ def device_info(self):
"manufacturer": DOMAIN,
}


@property
def device_state_attributes(self) -> dict:
return self._attrs
Expand Down

0 comments on commit 15798f5

Please sign in to comment.