mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Update frontend
This commit is contained in:
parent
068e62623d
commit
e4fe8336cc
@ -67,7 +67,9 @@ def setup(hass, config):
|
|||||||
lights[1], switches[0], 'input_select.living_room_preset',
|
lights[1], switches[0], 'input_select.living_room_preset',
|
||||||
'rollershutter.living_room_window', media_players[1],
|
'rollershutter.living_room_window', media_players[1],
|
||||||
'scene.romantic_lights'])
|
'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', [
|
group.Group(hass, 'kitchen', [
|
||||||
lights[2], 'rollershutter.kitchen_window', 'lock.kitchen_door'])
|
lights[2], 'rollershutter.kitchen_window', 'lock.kitchen_door'])
|
||||||
group.Group(hass, 'doors', [
|
group.Group(hass, 'doors', [
|
||||||
@ -145,6 +147,17 @@ def setup(hass, config):
|
|||||||
{'input_boolean': {'notify': {'icon': 'mdi:car',
|
{'input_boolean': {'notify': {'icon': 'mdi:car',
|
||||||
'initial': False,
|
'initial': False,
|
||||||
'name': 'Notify Anne Therese is home'}}})
|
'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
|
# Set up weblink
|
||||||
bootstrap.setup_component(
|
bootstrap.setup_component(
|
||||||
hass, 'weblink',
|
hass, 'weblink',
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
"""DO NOT MODIFY. Auto-generated by build_frontend script."""
|
"""DO NOT MODIFY. Auto-generated by build_frontend script."""
|
||||||
CORE = "d0b415dac66c8056d81380b258af5767"
|
CORE = "c104bd9f39a2b228058e601050036107"
|
||||||
UI = "91e62a30269ae27ecaa354ae2eae4be9"
|
UI = "5373a6e2b921b9639fe739cd4c79f741"
|
||||||
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
@ -1 +1 @@
|
|||||||
Subproject commit 16031117ae91efb43102c1b2cd5d505061d45538
|
Subproject commit 0d4c1be2f89843dc42fca0000f8952d523399c8f
|
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* eslint-disable quotes, comma-spacing */
|
/* 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 */
|
/* eslint-enable quotes, comma-spacing */
|
||||||
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';
|
var CacheNamePrefix = 'sw-precache-v1--' + (self.registration ? self.registration.scope : '') + '-';
|
||||||
|
|
||||||
|
Binary file not shown.
@ -8,7 +8,7 @@ import logging
|
|||||||
|
|
||||||
import voluptuous as vol
|
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
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
@ -68,18 +68,18 @@ def setup(hass, config):
|
|||||||
name = cfg.get(CONF_NAME)
|
name = cfg.get(CONF_NAME)
|
||||||
minimum = cfg.get(CONF_MIN)
|
minimum = cfg.get(CONF_MIN)
|
||||||
maximum = cfg.get(CONF_MAX)
|
maximum = cfg.get(CONF_MAX)
|
||||||
state = cfg.get(CONF_INITIAL)
|
state = cfg.get(CONF_INITIAL, minimum)
|
||||||
step = cfg.get(CONF_STEP)
|
step = cfg.get(CONF_STEP, 1)
|
||||||
icon = cfg.get(CONF_ICON)
|
icon = cfg.get(CONF_ICON)
|
||||||
|
unit = cfg.get(ATTR_UNIT_OF_MEASUREMENT)
|
||||||
|
|
||||||
if state < minimum:
|
if state < minimum:
|
||||||
state = minimum
|
state = minimum
|
||||||
if state > maximum:
|
if state > maximum:
|
||||||
state = maximum
|
state = maximum
|
||||||
|
|
||||||
entities.append(
|
entities.append(InputSlider(object_id, name, state, minimum, maximum,
|
||||||
InputSlider(object_id, name, state, minimum, maximum, step, icon)
|
step, icon, unit))
|
||||||
)
|
|
||||||
|
|
||||||
if not entities:
|
if not entities:
|
||||||
return False
|
return False
|
||||||
@ -104,7 +104,8 @@ class InputSlider(Entity):
|
|||||||
"""Represent an slider."""
|
"""Represent an slider."""
|
||||||
|
|
||||||
# pylint: disable=too-many-arguments
|
# 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."""
|
"""Initialize a select input."""
|
||||||
self.entity_id = ENTITY_ID_FORMAT.format(object_id)
|
self.entity_id = ENTITY_ID_FORMAT.format(object_id)
|
||||||
self._name = name
|
self._name = name
|
||||||
@ -113,6 +114,7 @@ class InputSlider(Entity):
|
|||||||
self._maximum = maximum
|
self._maximum = maximum
|
||||||
self._step = step
|
self._step = step
|
||||||
self._icon = icon
|
self._icon = icon
|
||||||
|
self._unit = unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
@ -134,6 +136,10 @@ class InputSlider(Entity):
|
|||||||
"""State of the component."""
|
"""State of the component."""
|
||||||
return self._current_value
|
return self._current_value
|
||||||
|
|
||||||
|
@property
|
||||||
|
def unit_of_measurement(self):
|
||||||
|
return self._unit
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def state_attributes(self):
|
def state_attributes(self):
|
||||||
"""State attributes."""
|
"""State attributes."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user