Skip to content

Commit

Permalink
Action commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ludeeus committed Mar 8, 2019
1 parent ad2e54a commit bf3dab8
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
8 changes: 5 additions & 3 deletions custom_components/blueprint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand All @@ -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


Expand Down
14 changes: 7 additions & 7 deletions custom_components/blueprint/const.py
Original file line number Diff line number Diff line change
@@ -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 = """
----------------------------------------------
Expand Down
8 changes: 5 additions & 3 deletions custom_components/blueprint/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,27 @@
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

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()
Expand Down

0 comments on commit bf3dab8

Please sign in to comment.