Feature/setup cfg (#28)
* Add setup.cfg * Run black and isort. * Add blueprint to first party. * Make const import consistent.
This commit is contained in:
@ -5,8 +5,8 @@ For more details about this integration, please refer to
|
||||
https://github.com/custom-components/blueprint
|
||||
"""
|
||||
import asyncio
|
||||
import logging
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import Config, HomeAssistant
|
||||
@ -14,7 +14,7 @@ from homeassistant.exceptions import ConfigEntryNotReady
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||
from sampleclient.client import Client
|
||||
|
||||
from .const import (
|
||||
from custom_components.blueprint.const import (
|
||||
CONF_PASSWORD,
|
||||
CONF_USERNAME,
|
||||
DOMAIN,
|
||||
@ -70,9 +70,7 @@ class BlueprintDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
self.api = Client(username, password)
|
||||
self.platforms = []
|
||||
|
||||
super().__init__(
|
||||
hass, _LOGGER, name=DOMAIN, update_interval=SCAN_INTERVAL,
|
||||
)
|
||||
super().__init__(hass, _LOGGER, name=DOMAIN, update_interval=SCAN_INTERVAL)
|
||||
|
||||
async def _async_update_data(self):
|
||||
"""Update data via library."""
|
||||
|
@ -1,9 +1,8 @@
|
||||
"""Adds config flow for Blueprint."""
|
||||
import voluptuous as vol
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.core import callback
|
||||
|
||||
from sampleclient.client import Client
|
||||
import voluptuous as vol
|
||||
|
||||
from custom_components.blueprint.const import ( # pylint: disable=unused-import
|
||||
CONF_PASSWORD,
|
||||
@ -58,7 +57,7 @@ class BlueprintFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=vol.Schema(
|
||||
{vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str,}
|
||||
{vol.Required(CONF_USERNAME): str, vol.Required(CONF_PASSWORD): str}
|
||||
),
|
||||
errors=self._errors,
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
"""BlueprintEntity class"""
|
||||
from homeassistant.helpers import entity
|
||||
|
||||
from custom_components.blueprint.const import DOMAIN, VERSION, NAME
|
||||
from custom_components.blueprint.const import DOMAIN, NAME, VERSION
|
||||
|
||||
|
||||
class BlueprintEntity(entity.Entity):
|
||||
|
@ -10,4 +10,4 @@
|
||||
"requirements": [
|
||||
"sampleclient"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
|
||||
from custom_components.blueprint.const import DEFAULT_NAME, DOMAIN, ICON, SWITCH
|
||||
|
||||
from custom_components.blueprint.entity import BlueprintEntity
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user