mirror of
				https://github.com/esphome/esphome.git
				synced 2025-11-04 00:51:49 +00:00 
			
		
		
		
	Compare commits
	
		
			21 Commits
		
	
	
		
			2021.12.0b
			...
			2021.12.3
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					50848c2f4d | ||
| 
						 | 
					d32633b3c7 | ||
| 
						 | 
					b37739eec2 | ||
| 
						 | 
					28f87dc804 | ||
| 
						 | 
					41879e41e6 | ||
| 
						 | 
					fc0a6546a2 | ||
| 
						 | 
					ffd4280d6c | ||
| 
						 | 
					db3b955b0f | ||
| 
						 | 
					5516f65971 | ||
| 
						 | 
					9471df0a1b | ||
| 
						 | 
					6d39f64be7 | ||
| 
						 | 
					b89d0a9a73 | ||
| 
						 | 
					4bb779d9a5 | ||
| 
						 | 
					386a5b6362 | ||
| 
						 | 
					e32a999cd0 | ||
| 
						 | 
					bfbc6a4bad | ||
| 
						 | 
					8c9e0e552d | ||
| 
						 | 
					8aaf9fd83f | ||
| 
						 | 
					08057720b8 | ||
| 
						 | 
					bfaa648837 | ||
| 
						 | 
					d504daef91 | 
@@ -27,7 +27,7 @@ RUN \
 | 
			
		||||
        python3-cryptography=3.3.2-1 \
 | 
			
		||||
        iputils-ping=3:20210202-1 \
 | 
			
		||||
        git=1:2.30.2-1 \
 | 
			
		||||
        curl=7.74.0-1.3+b1 \
 | 
			
		||||
        curl=7.74.0-1.3+deb11u1 \
 | 
			
		||||
    && rm -rf \
 | 
			
		||||
        /tmp/* \
 | 
			
		||||
        /var/{cache,log}/* \
 | 
			
		||||
@@ -64,7 +64,7 @@ RUN \
 | 
			
		||||
 | 
			
		||||
# Copy esphome and install
 | 
			
		||||
COPY . /esphome
 | 
			
		||||
RUN pip3 install --no-cache-dir -e /esphome
 | 
			
		||||
RUN pip3 install --no-cache-dir /esphome
 | 
			
		||||
 | 
			
		||||
# Settings for dashboard
 | 
			
		||||
ENV USERNAME="" PASSWORD=""
 | 
			
		||||
@@ -112,7 +112,7 @@ RUN \
 | 
			
		||||
 | 
			
		||||
# Copy esphome and install
 | 
			
		||||
COPY . /esphome
 | 
			
		||||
RUN pip3 install --no-cache-dir -e /esphome
 | 
			
		||||
RUN pip3 install --no-cache-dir /esphome
 | 
			
		||||
 | 
			
		||||
# Labels
 | 
			
		||||
LABEL \
 | 
			
		||||
 
 | 
			
		||||
@@ -33,7 +33,7 @@ DHT = dht_ns.class_("DHT", cg.PollingComponent)
 | 
			
		||||
CONFIG_SCHEMA = cv.Schema(
 | 
			
		||||
    {
 | 
			
		||||
        cv.GenerateID(): cv.declare_id(DHT),
 | 
			
		||||
        cv.Required(CONF_PIN): pins.gpio_input_pin_schema,
 | 
			
		||||
        cv.Required(CONF_PIN): pins.internal_gpio_input_pin_schema,
 | 
			
		||||
        cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
 | 
			
		||||
            unit_of_measurement=UNIT_CELSIUS,
 | 
			
		||||
            accuracy_decimals=1,
 | 
			
		||||
 
 | 
			
		||||
@@ -42,11 +42,11 @@ void arch_init() {
 | 
			
		||||
  // Idle task watchdog is disabled on ESP-IDF
 | 
			
		||||
#elif defined(USE_ARDUINO)
 | 
			
		||||
  enableLoopWDT();
 | 
			
		||||
  // Disable idle task watchdog on the core we're using (Arduino pins the process to a core)
 | 
			
		||||
#if CONFIG_ARDUINO_RUNNING_CORE == 0
 | 
			
		||||
  // Disable idle task watchdog on the core we're using (Arduino pins the task to a core)
 | 
			
		||||
#if defined(CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0) && CONFIG_ARDUINO_RUNNING_CORE == 0
 | 
			
		||||
  disableCore0WDT();
 | 
			
		||||
#endif
 | 
			
		||||
#if CONFIG_ARDUINO_RUNNING_CORE == 1
 | 
			
		||||
#if defined(CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1) && CONFIG_ARDUINO_RUNNING_CORE == 1
 | 
			
		||||
  disableCore1WDT();
 | 
			
		||||
#endif
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -17,7 +17,7 @@ MQTTButtonComponent::MQTTButtonComponent(button::Button *button) : MQTTComponent
 | 
			
		||||
 | 
			
		||||
void MQTTButtonComponent::setup() {
 | 
			
		||||
  this->subscribe(this->get_command_topic_(), [this](const std::string &topic, const std::string &payload) {
 | 
			
		||||
    if (payload == "press") {
 | 
			
		||||
    if (payload == "PRESS") {
 | 
			
		||||
      this->button_->press();
 | 
			
		||||
    } else {
 | 
			
		||||
      ESP_LOGW(TAG, "'%s': Received unknown status payload: %s", this->friendly_name().c_str(), payload.c_str());
 | 
			
		||||
@@ -31,6 +31,7 @@ void MQTTButtonComponent::dump_config() {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void MQTTButtonComponent::send_discovery(JsonObject &root, mqtt::SendDiscoveryConfig &config) {
 | 
			
		||||
  config.state_topic = false;
 | 
			
		||||
  if (!this->button_->get_device_class().empty())
 | 
			
		||||
    root[MQTT_DEVICE_CLASS] = this->button_->get_device_class();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -62,7 +62,7 @@ void TextSensor::add_on_raw_state_callback(std::function<void(std::string)> call
 | 
			
		||||
std::string TextSensor::get_state() const { return this->state; }
 | 
			
		||||
std::string TextSensor::get_raw_state() const { return this->raw_state; }
 | 
			
		||||
void TextSensor::internal_send_state_to_frontend(const std::string &state) {
 | 
			
		||||
  this->state = this->raw_state;
 | 
			
		||||
  this->state = state;
 | 
			
		||||
  this->has_state_ = true;
 | 
			
		||||
  ESP_LOGD(TAG, "'%s': Sending state '%s'", this->name_.c_str(), state.c_str());
 | 
			
		||||
  this->callback_.call(state);
 | 
			
		||||
 
 | 
			
		||||
@@ -431,7 +431,8 @@ async def to_code(config):
 | 
			
		||||
 | 
			
		||||
    heat_cool_mode_available = CONF_HEAT_ACTION in config and CONF_COOL_ACTION in config
 | 
			
		||||
    two_points_available = CONF_HEAT_ACTION in config and (
 | 
			
		||||
        CONF_COOL_ACTION in config or CONF_FAN_ONLY_ACTION in config
 | 
			
		||||
        CONF_COOL_ACTION in config
 | 
			
		||||
        or (config[CONF_FAN_ONLY_COOLING] and CONF_FAN_ONLY_ACTION in config)
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
    sens = await cg.get_variable(config[CONF_SENSOR])
 | 
			
		||||
 
 | 
			
		||||
@@ -22,31 +22,38 @@ AUTO_LOAD = ["json", "web_server_base"]
 | 
			
		||||
web_server_ns = cg.esphome_ns.namespace("web_server")
 | 
			
		||||
WebServer = web_server_ns.class_("WebServer", cg.Component, cg.Controller)
 | 
			
		||||
 | 
			
		||||
CONFIG_SCHEMA = cv.Schema(
 | 
			
		||||
    {
 | 
			
		||||
        cv.GenerateID(): cv.declare_id(WebServer),
 | 
			
		||||
        cv.Optional(CONF_PORT, default=80): cv.port,
 | 
			
		||||
        cv.Optional(
 | 
			
		||||
            CONF_CSS_URL, default="https://esphome.io/_static/webserver-v1.min.css"
 | 
			
		||||
        ): cv.string,
 | 
			
		||||
        cv.Optional(CONF_CSS_INCLUDE): cv.file_,
 | 
			
		||||
        cv.Optional(
 | 
			
		||||
            CONF_JS_URL, default="https://esphome.io/_static/webserver-v1.min.js"
 | 
			
		||||
        ): cv.string,
 | 
			
		||||
        cv.Optional(CONF_JS_INCLUDE): cv.file_,
 | 
			
		||||
        cv.Optional(CONF_AUTH): cv.Schema(
 | 
			
		||||
            {
 | 
			
		||||
                cv.Required(CONF_USERNAME): cv.All(cv.string_strict, cv.Length(min=1)),
 | 
			
		||||
                cv.Required(CONF_PASSWORD): cv.All(cv.string_strict, cv.Length(min=1)),
 | 
			
		||||
            }
 | 
			
		||||
        ),
 | 
			
		||||
        cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
 | 
			
		||||
            web_server_base.WebServerBase
 | 
			
		||||
        ),
 | 
			
		||||
        cv.Optional(CONF_INCLUDE_INTERNAL, default=False): cv.boolean,
 | 
			
		||||
        cv.Optional(CONF_OTA, default=True): cv.boolean,
 | 
			
		||||
    }
 | 
			
		||||
).extend(cv.COMPONENT_SCHEMA)
 | 
			
		||||
CONFIG_SCHEMA = cv.All(
 | 
			
		||||
    cv.Schema(
 | 
			
		||||
        {
 | 
			
		||||
            cv.GenerateID(): cv.declare_id(WebServer),
 | 
			
		||||
            cv.Optional(CONF_PORT, default=80): cv.port,
 | 
			
		||||
            cv.Optional(
 | 
			
		||||
                CONF_CSS_URL, default="https://esphome.io/_static/webserver-v1.min.css"
 | 
			
		||||
            ): cv.string,
 | 
			
		||||
            cv.Optional(CONF_CSS_INCLUDE): cv.file_,
 | 
			
		||||
            cv.Optional(
 | 
			
		||||
                CONF_JS_URL, default="https://esphome.io/_static/webserver-v1.min.js"
 | 
			
		||||
            ): cv.string,
 | 
			
		||||
            cv.Optional(CONF_JS_INCLUDE): cv.file_,
 | 
			
		||||
            cv.Optional(CONF_AUTH): cv.Schema(
 | 
			
		||||
                {
 | 
			
		||||
                    cv.Required(CONF_USERNAME): cv.All(
 | 
			
		||||
                        cv.string_strict, cv.Length(min=1)
 | 
			
		||||
                    ),
 | 
			
		||||
                    cv.Required(CONF_PASSWORD): cv.All(
 | 
			
		||||
                        cv.string_strict, cv.Length(min=1)
 | 
			
		||||
                    ),
 | 
			
		||||
                }
 | 
			
		||||
            ),
 | 
			
		||||
            cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
 | 
			
		||||
                web_server_base.WebServerBase
 | 
			
		||||
            ),
 | 
			
		||||
            cv.Optional(CONF_INCLUDE_INTERNAL, default=False): cv.boolean,
 | 
			
		||||
            cv.Optional(CONF_OTA, default=True): cv.boolean,
 | 
			
		||||
        },
 | 
			
		||||
    ).extend(cv.COMPONENT_SCHEMA),
 | 
			
		||||
    cv.only_with_arduino,
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@coroutine_with_priority(40.0)
 | 
			
		||||
 
 | 
			
		||||
@@ -390,8 +390,6 @@ void WebServer::handle_switch_request(AsyncWebServerRequest *request, const UrlM
 | 
			
		||||
#ifdef USE_BUTTON
 | 
			
		||||
void WebServer::handle_button_request(AsyncWebServerRequest *request, const UrlMatch &match) {
 | 
			
		||||
  for (button::Button *obj : App.get_buttons()) {
 | 
			
		||||
    if (obj->is_internal())
 | 
			
		||||
      continue;
 | 
			
		||||
    if (obj->get_object_id() != match.id)
 | 
			
		||||
      continue;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
"""Constants used by esphome."""
 | 
			
		||||
 | 
			
		||||
__version__ = "2021.12.0b5"
 | 
			
		||||
__version__ = "2021.12.3"
 | 
			
		||||
 | 
			
		||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -9,7 +9,7 @@ pyserial==3.5
 | 
			
		||||
platformio==5.2.2  # When updating platformio, also update Dockerfile
 | 
			
		||||
esptool==3.2
 | 
			
		||||
click==8.0.3
 | 
			
		||||
esphome-dashboard==20211208.0
 | 
			
		||||
esphome-dashboard==20211211.0
 | 
			
		||||
aioesphomeapi==10.6.0
 | 
			
		||||
zeroconf==0.36.13
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user