mirror of
https://github.com/esphome/esphome.git
synced 2025-11-15 14:25:45 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2b1d5438d | ||
|
|
fe66f93a01 | ||
|
|
581dffe2d4 | ||
|
|
6f22006bf7 | ||
|
|
fe54700687 |
@@ -3,7 +3,7 @@ import voluptuous as vol
|
||||
from esphome.components import binary_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_BINARY_SENSORS, CONF_ID, CONF_LAMBDA, CONF_NAME
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda, variable
|
||||
from esphome.cpp_generator import add, process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomBinarySensorConstructor = binary_sensor.binary_sensor_ns.class_(
|
||||
@@ -27,9 +27,9 @@ def to_code(config):
|
||||
rhs = CustomBinarySensorConstructor(template_)
|
||||
custom = variable(config[CONF_ID], rhs)
|
||||
for i, conf in enumerate(config[CONF_BINARY_SENSORS]):
|
||||
var = Pvariable(conf[CONF_ID], custom.get_binary_sensor(i))
|
||||
add(var.set_name(conf[CONF_NAME]))
|
||||
binary_sensor.setup_binary_sensor(var, conf)
|
||||
rhs = custom.Pget_binary_sensor(i)
|
||||
add(rhs.set_name(conf[CONF_NAME]))
|
||||
binary_sensor.register_binary_sensor(rhs, conf)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_CUSTOM_BINARY_SENSOR'
|
||||
|
||||
@@ -163,8 +163,8 @@ def to_code(config):
|
||||
else:
|
||||
add(mqtt.set_log_message_template(exp_mqtt_message(log_topic)))
|
||||
|
||||
if CONF_LEVEL in config:
|
||||
add(mqtt.set_log_level(logger.LOG_LEVELS[config[CONF_LEVEL]]))
|
||||
if CONF_LEVEL in log_topic:
|
||||
add(mqtt.set_log_level(logger.LOG_LEVELS[log_topic[CONF_LEVEL]]))
|
||||
|
||||
if CONF_SSL_FINGERPRINTS in config:
|
||||
for fingerprint in config[CONF_SSL_FINGERPRINTS]:
|
||||
|
||||
@@ -3,7 +3,7 @@ import voluptuous as vol
|
||||
from esphome.components import sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_NAME, CONF_SENSORS
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda, variable
|
||||
from esphome.cpp_generator import add, process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomSensorConstructor = sensor.sensor_ns.class_('CustomSensorConstructor')
|
||||
@@ -25,9 +25,9 @@ def to_code(config):
|
||||
rhs = CustomSensorConstructor(template_)
|
||||
custom = variable(config[CONF_ID], rhs)
|
||||
for i, conf in enumerate(config[CONF_SENSORS]):
|
||||
var = Pvariable(conf[CONF_ID], custom.get_sensor(i))
|
||||
add(var.set_name(conf[CONF_NAME]))
|
||||
sensor.setup_sensor(var, conf)
|
||||
rhs = custom.Pget_sensor(i)
|
||||
add(rhs.set_name(conf[CONF_NAME]))
|
||||
sensor.register_sensor(rhs, conf)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_CUSTOM_SENSOR'
|
||||
|
||||
@@ -3,7 +3,7 @@ import voluptuous as vol
|
||||
from esphome.components import switch
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_NAME, CONF_SWITCHES
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda, variable
|
||||
from esphome.cpp_generator import add, process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomSwitchConstructor = switch.switch_ns.class_('CustomSwitchConstructor')
|
||||
@@ -26,9 +26,9 @@ def to_code(config):
|
||||
rhs = CustomSwitchConstructor(template_)
|
||||
custom = variable(config[CONF_ID], rhs)
|
||||
for i, conf in enumerate(config[CONF_SWITCHES]):
|
||||
var = Pvariable(conf[CONF_ID], custom.get_switch(i))
|
||||
add(var.set_name(conf[CONF_NAME]))
|
||||
switch.setup_switch(var, conf)
|
||||
rhs = custom.Pget_switch(i)
|
||||
add(rhs.set_name(conf[CONF_NAME]))
|
||||
switch.register_switch(rhs, conf)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_CUSTOM_SWITCH'
|
||||
|
||||
@@ -3,7 +3,7 @@ import voluptuous as vol
|
||||
from esphome.components import text_sensor
|
||||
import esphome.config_validation as cv
|
||||
from esphome.const import CONF_ID, CONF_LAMBDA, CONF_NAME, CONF_TEXT_SENSORS
|
||||
from esphome.cpp_generator import Pvariable, add, process_lambda, variable
|
||||
from esphome.cpp_generator import add, process_lambda, variable
|
||||
from esphome.cpp_types import std_vector
|
||||
|
||||
CustomTextSensorConstructor = text_sensor.text_sensor_ns.class_('CustomTextSensorConstructor')
|
||||
@@ -26,9 +26,9 @@ def to_code(config):
|
||||
rhs = CustomTextSensorConstructor(template_)
|
||||
custom = variable(config[CONF_ID], rhs)
|
||||
for i, conf in enumerate(config[CONF_TEXT_SENSORS]):
|
||||
var = Pvariable(conf[CONF_ID], custom.get_text_sensor(i))
|
||||
add(var.set_name(conf[CONF_NAME]))
|
||||
text_sensor.setup_text_sensor(var, conf)
|
||||
rhs = custom.Pget_text_sensor(i)
|
||||
add(rhs.set_name(conf[CONF_NAME]))
|
||||
text_sensor.register_text_sensor(rhs, conf)
|
||||
|
||||
|
||||
BUILD_FLAGS = '-DUSE_CUSTOM_TEXT_SENSOR'
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
MAJOR_VERSION = 1
|
||||
MINOR_VERSION = 11
|
||||
PATCH_VERSION = '0b1'
|
||||
PATCH_VERSION = '0b2'
|
||||
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
|
||||
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
|
||||
ESPHOME_CORE_VERSION = '1.11.0b1'
|
||||
ESPHOME_CORE_VERSION = '1.11.0b2'
|
||||
|
||||
ESP_PLATFORM_ESP32 = 'ESP32'
|
||||
ESP_PLATFORM_ESP8266 = 'ESP8266'
|
||||
|
||||
@@ -46,17 +46,8 @@ i.very-large {
|
||||
font-family: "SFMono-Regular",Consolas,"Liberation Mono",Menlo,Courier,monospace;
|
||||
}
|
||||
|
||||
.autoscroll {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
flex-basis: auto;
|
||||
}
|
||||
|
||||
.autoscroll div {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
.log {
|
||||
max-height: calc(100% - 56px);
|
||||
background-color: #1c1c1c;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
@@ -161,6 +152,10 @@ ul.stepper:not(.horizontal) .step.active::before, ul.stepper:not(.horizontal) .s
|
||||
height: auto !important;
|
||||
}
|
||||
|
||||
.tap-target-wrapper {
|
||||
position: fixed !important;
|
||||
}
|
||||
|
||||
/* https://github.com/tnhu/status-indicator/blob/master/styles.css */
|
||||
.status-indicator .status-indicator-icon {
|
||||
display: inline-block;
|
||||
@@ -223,9 +218,8 @@ ul.stepper:not(.horizontal) .step.active::before, ul.stepper:not(.horizontal) .s
|
||||
#editor {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
padding: 16px;
|
||||
border-radius: 3px;
|
||||
height: 100%
|
||||
height: calc(100% - 56px);
|
||||
}
|
||||
|
||||
.update-available i {
|
||||
|
||||
@@ -168,6 +168,7 @@ const colorReplace = (pre, state, text) => {
|
||||
}
|
||||
}
|
||||
addSpan(text.substring(i));
|
||||
scrollToBottomOfElement(pre);
|
||||
};
|
||||
|
||||
const removeUpdateAvailable = (filename) => {
|
||||
@@ -700,4 +701,15 @@ const startWizard = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const scrollToBottomOfElement = (element) => {
|
||||
var atBottom = false;
|
||||
if (element.scrollTop + 30 >= (element.scrollHeight - element.offsetHeight)) {
|
||||
atBottom = true;
|
||||
}
|
||||
|
||||
if (atBottom) {
|
||||
element.scrollTop = element.scrollHeight;
|
||||
}
|
||||
}
|
||||
|
||||
setupWizardStart.addEventListener('click', startWizard);
|
||||
@@ -93,15 +93,9 @@
|
||||
</div>
|
||||
|
||||
<div id="modal-logs" class="modal modal-fixed-footer">
|
||||
<div class="modal-content autoscroll">
|
||||
<div>
|
||||
<h4>Show Logs <code class="inlinecode filename"></code></h4>
|
||||
<div>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<h4>Show Logs <code class="inlinecode filename"></code></h4>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="modal-close waves-effect waves-green btn-flat stop-logs">Close</a>
|
||||
@@ -109,13 +103,9 @@
|
||||
</div>
|
||||
|
||||
<div id="modal-upload" class="modal modal-fixed-footer">
|
||||
<div class="modal-content autoscroll">
|
||||
<div>
|
||||
<h4>Compile And Upload <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<h4>Compile And Upload <code class="inlinecode filename"></code></h4>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="https://esphome.io/guides/faq.html#i-can-t-get-flashing-over-usb-to-work" target="_blank"
|
||||
@@ -127,13 +117,9 @@
|
||||
</div>
|
||||
|
||||
<div id="modal-compile" class="modal modal-fixed-footer">
|
||||
<div class="modal-content autoscroll">
|
||||
<div>
|
||||
<h4>Compile <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-content">
|
||||
<h4>Compile <code class="inlinecode filename"></code></h4>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="https://esphome.io/guides/faq.html#i-can-t-get-flashing-over-usb-to-work"
|
||||
@@ -149,9 +135,7 @@
|
||||
<div id="modal-validate" class="modal modal-fixed-footer">
|
||||
<div class="modal-content">
|
||||
<h4>Validate <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="modal-close waves-effect waves-green btn-flat stop-logs">Stop</a>
|
||||
@@ -400,12 +384,10 @@
|
||||
</div>
|
||||
|
||||
<div id="modal-clean-mqtt" class="modal modal-fixed-footer">
|
||||
<div class="modal-content autoscroll">
|
||||
<div class="modal-content">
|
||||
<div>
|
||||
<h4>Clean MQTT discovery <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -414,12 +396,10 @@
|
||||
</div>
|
||||
|
||||
<div id="modal-clean" class="modal modal-fixed-footer">
|
||||
<div class="modal-content autoscroll">
|
||||
<div class="modal-content">
|
||||
<div>
|
||||
<h4>Clean Build Files <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
@@ -430,9 +410,7 @@
|
||||
<div id="modal-hass-config" class="modal modal-fixed-footer">
|
||||
<div class="modal-content">
|
||||
<h4>Generate Home Assistant Configuration <code class="inlinecode filename"></code></h4>
|
||||
<div class="log-container">
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<pre class="log"></pre>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="modal-close waves-effect waves-green btn-flat stop-logs">Stop</a>
|
||||
|
||||
Reference in New Issue
Block a user