Update frontend

This commit is contained in:
Paulus Schoutsen 2016-06-09 23:27:35 -07:00
parent 068e62623d
commit e4fe8336cc
10 changed files with 82 additions and 22 deletions

View File

@ -67,7 +67,9 @@ def setup(hass, config):
lights[1], switches[0], 'input_select.living_room_preset',
'rollershutter.living_room_window', media_players[1],
'scene.romantic_lights'])
group.Group(hass, 'bedroom', [lights[0], switches[1], media_players[0]])
group.Group(hass, 'bedroom', [
lights[0], switches[1], media_players[0],
'input_slider.noise_allowance'])
group.Group(hass, 'kitchen', [
lights[2], 'rollershutter.kitchen_window', 'lock.kitchen_door'])
group.Group(hass, 'doors', [
@ -145,6 +147,17 @@ def setup(hass, config):
{'input_boolean': {'notify': {'icon': 'mdi:car',
'initial': False,
'name': 'Notify Anne Therese is home'}}})
# Set up input boolean
bootstrap.setup_component(
hass, 'input_slider',
{'input_slider': {
'noise_allowance': {'icon': 'mdi:bell-ring',
'min': 0,
'max': 10,
'name': 'Allowed Noise',
'unit_of_measurement': 'dB'}}})
# Set up weblink
bootstrap.setup_component(
hass, 'weblink',

View File

@ -1,3 +1,3 @@
"""DO NOT MODIFY. Auto-generated by build_frontend script."""
CORE = "d0b415dac66c8056d81380b258af5767"
UI = "91e62a30269ae27ecaa354ae2eae4be9"
CORE = "c104bd9f39a2b228058e601050036107"
UI = "5373a6e2b921b9639fe739cd4c79f741"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +1 @@
Subproject commit 16031117ae91efb43102c1b2cd5d505061d45538
Subproject commit 0d4c1be2f89843dc42fca0000f8952d523399c8f

View File

@ -29,7 +29,7 @@
/* eslint-disable quotes, comma-spacing */
var PrecacheConfig = [["/","e3fabc25ca2f0e7962da5ddef4668b54"],["/devEvent","e3fabc25ca2f0e7962da5ddef4668b54"],["/devInfo","e3fabc25ca2f0e7962da5ddef4668b54"],["/devService","e3fabc25ca2f0e7962da5ddef4668b54"],["/devState","e3fabc25ca2f0e7962da5ddef4668b54"],["/devTemplate","e3fabc25ca2f0e7962da5ddef4668b54"],["/history","e3fabc25ca2f0e7962da5ddef4668b54"],["/logbook","e3fabc25ca2f0e7962da5ddef4668b54"],["/map","e3fabc25ca2f0e7962da5ddef4668b54"],["/states","e3fabc25ca2f0e7962da5ddef4668b54"],["/static/core-d0b415dac66c8056d81380b258af5767.js","dfafa8e9e34f53e8c36dd8b3f7299b2a"],["/static/frontend-91e62a30269ae27ecaa354ae2eae4be9.html","e3fabc25ca2f0e7962da5ddef4668b54"],["/static/mdi-9ee3d4466a65bef35c2c8974e91b37c0.html","9a6846935116cd29279c91e0ee0a26d0"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]];
var PrecacheConfig = [["/","5adc44677d331e4e19192fa0dc5a2756"],["/devEvent","5adc44677d331e4e19192fa0dc5a2756"],["/devInfo","5adc44677d331e4e19192fa0dc5a2756"],["/devService","5adc44677d331e4e19192fa0dc5a2756"],["/devState","5adc44677d331e4e19192fa0dc5a2756"],["/devTemplate","5adc44677d331e4e19192fa0dc5a2756"],["/history","5adc44677d331e4e19192fa0dc5a2756"],["/logbook","5adc44677d331e4e19192fa0dc5a2756"],["/map","5adc44677d331e4e19192fa0dc5a2756"],["/states","5adc44677d331e4e19192fa0dc5a2756"],["/static/core-c104bd9f39a2b228058e601050036107.js","0b7730b8d09db9fea5f396e727f9a2b6"],["/static/frontend-5373a6e2b921b9639fe739cd4c79f741.html","5adc44677d331e4e19192fa0dc5a2756"],["/static/mdi-9ee3d4466a65bef35c2c8974e91b37c0.html","9a6846935116cd29279c91e0ee0a26d0"],["static/favicon-192x192.png","419903b8422586a7e28021bbe9011175"],["static/fonts/roboto/Roboto-Bold.ttf","d329cc8b34667f114a95422aaad1b063"],["static/fonts/roboto/Roboto-Light.ttf","7b5fb88f12bec8143f00e21bc3222124"],["static/fonts/roboto/Roboto-Medium.ttf","fe13e4170719c2fc586501e777bde143"],["static/fonts/roboto/Roboto-Regular.ttf","ac3f799d5bbaf5196fab15ab8de8431c"],["static/images/card_media_player_bg.png","a34281d1c1835d338a642e90930e61aa"],["static/webcomponents-lite.min.js","b0f32ad3c7749c40d486603f31c9d8b1"]];
/* eslint-enable quotes, comma-spacing */
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';

View File

@ -8,7 +8,7 @@ import logging
import voluptuous as vol
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import ATTR_ENTITY_ID, ATTR_UNIT_OF_MEASUREMENT
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.entity_component import EntityComponent
@ -68,18 +68,18 @@ def setup(hass, config):
name = cfg.get(CONF_NAME)
minimum = cfg.get(CONF_MIN)
maximum = cfg.get(CONF_MAX)
state = cfg.get(CONF_INITIAL)
step = cfg.get(CONF_STEP)
state = cfg.get(CONF_INITIAL, minimum)
step = cfg.get(CONF_STEP, 1)
icon = cfg.get(CONF_ICON)
unit = cfg.get(ATTR_UNIT_OF_MEASUREMENT)
if state < minimum:
state = minimum
if state > maximum:
state = maximum
entities.append(
InputSlider(object_id, name, state, minimum, maximum, step, icon)
)
entities.append(InputSlider(object_id, name, state, minimum, maximum,
step, icon, unit))
if not entities:
return False
@ -104,7 +104,8 @@ class InputSlider(Entity):
"""Represent an slider."""
# pylint: disable=too-many-arguments
def __init__(self, object_id, name, state, minimum, maximum, step, icon):
def __init__(self, object_id, name, state, minimum, maximum, step, icon,
unit):
"""Initialize a select input."""
self.entity_id = ENTITY_ID_FORMAT.format(object_id)
self._name = name
@ -113,6 +114,7 @@ class InputSlider(Entity):
self._maximum = maximum
self._step = step
self._icon = icon
self._unit = unit
@property
def should_poll(self):
@ -134,6 +136,10 @@ class InputSlider(Entity):
"""State of the component."""
return self._current_value
@property
def unit_of_measurement(self):
return self._unit
@property
def state_attributes(self):
"""State attributes."""