diff --git a/custom_components/blueprint/__init__.py b/custom_components/blueprint/__init__.py index d2fbd04..36da949 100644 --- a/custom_components/blueprint/__init__.py +++ b/custom_components/blueprint/__init__.py @@ -11,10 +11,11 @@ from .const import * # pylint: disable=wildcard-import -VERSION = '0.0.1' +VERSION = "0.0.1" _LOGGER = logging.getLogger(__name__) - # pylint: disable=unused-argument +# pylint: disable=unused-argument + async def async_setup(hass, config): """Set up this component.""" @@ -34,7 +35,8 @@ async def async_setup(hass, config): # Load platforms for platform in PLATFORMS: hass.async_create_task( - discovery.async_load_platform(hass, platform, DOMAIN, {}, config)) + discovery.async_load_platform(hass, platform, DOMAIN, {}, config) + ) return True diff --git a/custom_components/blueprint/const.py b/custom_components/blueprint/const.py index fb7d3c3..3ee6f46 100644 --- a/custom_components/blueprint/const.py +++ b/custom_components/blueprint/const.py @@ -1,11 +1,11 @@ """Consts""" -DOMAIN = 'blueprint' -DOMAIN_DATA = '{}_data'.format(DOMAIN) -VERSION = '0.0.1' -URL = 'https://blueprint.com/api' -REQUIRED_FILES = ['sensor.py', 'const.py'] -ISSUE_URL = 'https://github.com/custom-components/blueprint/issues' -PLATFORMS = ['sensor'] +DOMAIN = "blueprint" +DOMAIN_DATA = "{}_data".format(DOMAIN) +VERSION = "0.0.1" +URL = "https://blueprint.com/api" +REQUIRED_FILES = ["sensor.py", "const.py"] +ISSUE_URL = "https://github.com/custom-components/blueprint/issues" +PLATFORMS = ["sensor"] STARTUP = """ ---------------------------------------------- diff --git a/custom_components/blueprint/sensor.py b/custom_components/blueprint/sensor.py index 197eec8..d758ff7 100644 --- a/custom_components/blueprint/sensor.py +++ b/custom_components/blueprint/sensor.py @@ -3,17 +3,19 @@ from . import update_data from .const import * # pylint: disable=wildcard-import, unused-wildcard-import -ICON = 'mdi:format-quote-close' +ICON = "mdi:format-quote-close" async def async_setup_platform( - hass, config, async_add_entities, discovery_info=None): # pylint: disable=unused-argument + hass, config, async_add_entities, discovery_info=None +): # pylint: disable=unused-argument """Setup sensor platform.""" async_add_entities([blueprintSensor(hass)], True) class blueprintSensor(Entity): """blueprint Sensor class.""" + def __init__(self, hass): self.hass = hass self._state = None @@ -21,7 +23,7 @@ def __init__(self, hass): async def async_update(self): """Update the sensor.""" await update_data(self.hass) - updated = self.hass.data[DOMAIN_DATA].get('compliment') + updated = self.hass.data[DOMAIN_DATA].get("compliment") if updated is None: updated = self._state self._state = updated.capitalize()