mirror of
https://github.com/esphome/esphome.git
synced 2025-11-06 01:51:49 +00:00
Compare commits
33 Commits
2022.11.0b
...
2022.11.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70f1c71a9f | ||
|
|
816df5ad47 | ||
|
|
7e88eea532 | ||
|
|
d1cdfd3b72 | ||
|
|
d6a03d48f5 | ||
|
|
d453b42b1a | ||
|
|
7c19b961e2 | ||
|
|
d924702825 | ||
|
|
e8784ba383 | ||
|
|
e3a454d1a6 | ||
|
|
58fda40389 | ||
|
|
6a73699a38 | ||
|
|
3bd6456fbe | ||
|
|
608be4e050 | ||
|
|
10f590324b | ||
|
|
39f0f748bf | ||
|
|
9efe59a984 | ||
|
|
fcb02af782 | ||
|
|
3aeef1afd4 | ||
|
|
a45ee8f4ac | ||
|
|
31b62d7dca | ||
|
|
22f81475db | ||
|
|
cc7cf73d59 | ||
|
|
9682e60a25 | ||
|
|
fd8b9fb028 | ||
|
|
bdf1813b3a | ||
|
|
45b6c93f5f | ||
|
|
6124531479 | ||
|
|
b8549d323c | ||
|
|
01adece673 | ||
|
|
0220934e4c | ||
|
|
ca09693efa | ||
|
|
e96d7483b3 |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
today="$(date --utc '+%Y%m%d')"
|
today="$(date --utc '+%Y%m%d')"
|
||||||
TAG="${TAG}${today}"
|
TAG="${TAG}${today}"
|
||||||
fi
|
fi
|
||||||
echo "::set-output name=tag::${TAG}"
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
# yamllint enable rule:line-length
|
# yamllint enable rule:line-length
|
||||||
|
|
||||||
deploy-pypi:
|
deploy-pypi:
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ RUN \
|
|||||||
apt-get update \
|
apt-get update \
|
||||||
# Use pinned versions so that we get updates with build caching
|
# Use pinned versions so that we get updates with build caching
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
nginx-light=1.18.0-6.1+deb11u2 \
|
nginx-light=1.18.0-6.1+deb11u3 \
|
||||||
&& rm -rf \
|
&& rm -rf \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/{cache,log}/* \
|
/var/{cache,log}/* \
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ CODEOWNERS = ["@OttoWinter"]
|
|||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.Schema({}),
|
cv.Schema({}),
|
||||||
cv.only_with_arduino,
|
cv.only_with_arduino,
|
||||||
|
cv.only_on(["esp32", "esp8266"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
import esphome.final_validate as fv
|
|
||||||
from esphome.components import web_server_base
|
from esphome.components import web_server_base
|
||||||
from esphome.components.web_server_base import CONF_WEB_SERVER_BASE_ID
|
from esphome.components.web_server_base import CONF_WEB_SERVER_BASE_ID
|
||||||
from esphome.const import CONF_ID, CONF_NETWORKS, CONF_PASSWORD, CONF_SSID, CONF_WIFI
|
from esphome.const import CONF_ID
|
||||||
from esphome.core import coroutine_with_priority, CORE
|
from esphome.core import coroutine_with_priority, CORE
|
||||||
|
|
||||||
AUTO_LOAD = ["web_server_base"]
|
AUTO_LOAD = ["web_server_base"]
|
||||||
@@ -13,7 +12,6 @@ CODEOWNERS = ["@OttoWinter"]
|
|||||||
captive_portal_ns = cg.esphome_ns.namespace("captive_portal")
|
captive_portal_ns = cg.esphome_ns.namespace("captive_portal")
|
||||||
CaptivePortal = captive_portal_ns.class_("CaptivePortal", cg.Component)
|
CaptivePortal = captive_portal_ns.class_("CaptivePortal", cg.Component)
|
||||||
|
|
||||||
CONF_KEEP_USER_CREDENTIALS = "keep_user_credentials"
|
|
||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.Schema(
|
cv.Schema(
|
||||||
{
|
{
|
||||||
@@ -21,29 +19,13 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
|
cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
|
||||||
web_server_base.WebServerBase
|
web_server_base.WebServerBase
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_KEEP_USER_CREDENTIALS, default=False): cv.boolean,
|
|
||||||
}
|
}
|
||||||
).extend(cv.COMPONENT_SCHEMA),
|
).extend(cv.COMPONENT_SCHEMA),
|
||||||
cv.only_with_arduino,
|
cv.only_with_arduino,
|
||||||
|
cv.only_on(["esp32", "esp8266"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def validate_wifi(config):
|
|
||||||
wifi_conf = fv.full_config.get()[CONF_WIFI]
|
|
||||||
if config.get(CONF_KEEP_USER_CREDENTIALS, False) and (
|
|
||||||
CONF_SSID in wifi_conf
|
|
||||||
or CONF_PASSWORD in wifi_conf
|
|
||||||
or CONF_NETWORKS in wifi_conf
|
|
||||||
):
|
|
||||||
raise cv.Invalid(
|
|
||||||
f"WiFi credentials cannot be used together with {CONF_KEEP_USER_CREDENTIALS}"
|
|
||||||
)
|
|
||||||
return config
|
|
||||||
|
|
||||||
|
|
||||||
FINAL_VALIDATE_SCHEMA = validate_wifi
|
|
||||||
|
|
||||||
|
|
||||||
@coroutine_with_priority(64.0)
|
@coroutine_with_priority(64.0)
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
paren = await cg.get_variable(config[CONF_WEB_SERVER_BASE_ID])
|
paren = await cg.get_variable(config[CONF_WEB_SERVER_BASE_ID])
|
||||||
@@ -57,6 +39,3 @@ async def to_code(config):
|
|||||||
cg.add_library("WiFi", None)
|
cg.add_library("WiFi", None)
|
||||||
if CORE.is_esp8266:
|
if CORE.is_esp8266:
|
||||||
cg.add_library("DNSServer", None)
|
cg.add_library("DNSServer", None)
|
||||||
|
|
||||||
if config.get(CONF_KEEP_USER_CREDENTIALS, False):
|
|
||||||
cg.add_define("USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS")
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using namespace esphome::cover;
|
|||||||
CoverTraits CurrentBasedCover::get_traits() {
|
CoverTraits CurrentBasedCover::get_traits() {
|
||||||
auto traits = CoverTraits();
|
auto traits = CoverTraits();
|
||||||
traits.set_supports_position(true);
|
traits.set_supports_position(true);
|
||||||
|
traits.set_supports_toggle(true);
|
||||||
traits.set_is_assumed_state(false);
|
traits.set_is_assumed_state(false);
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
@@ -20,6 +21,20 @@ void CurrentBasedCover::control(const CoverCall &call) {
|
|||||||
if (call.get_stop()) {
|
if (call.get_stop()) {
|
||||||
this->direction_idle_();
|
this->direction_idle_();
|
||||||
}
|
}
|
||||||
|
if (call.get_toggle().has_value()) {
|
||||||
|
if (this->current_operation != COVER_OPERATION_IDLE) {
|
||||||
|
this->start_direction_(COVER_OPERATION_IDLE);
|
||||||
|
this->publish_state();
|
||||||
|
} else {
|
||||||
|
if (this->position == COVER_CLOSED || this->last_operation_ == COVER_OPERATION_CLOSING) {
|
||||||
|
this->target_position_ = COVER_OPEN;
|
||||||
|
this->start_direction_(COVER_OPERATION_OPENING);
|
||||||
|
} else {
|
||||||
|
this->target_position_ = COVER_CLOSED;
|
||||||
|
this->start_direction_(COVER_OPERATION_CLOSING);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if (call.get_position().has_value()) {
|
if (call.get_position().has_value()) {
|
||||||
auto pos = *call.get_position();
|
auto pos = *call.get_position();
|
||||||
if (pos == this->position) {
|
if (pos == this->position) {
|
||||||
@@ -202,9 +217,11 @@ void CurrentBasedCover::start_direction_(CoverOperation dir) {
|
|||||||
trig = this->stop_trigger_;
|
trig = this->stop_trigger_;
|
||||||
break;
|
break;
|
||||||
case COVER_OPERATION_OPENING:
|
case COVER_OPERATION_OPENING:
|
||||||
|
this->last_operation_ = dir;
|
||||||
trig = this->open_trigger_;
|
trig = this->open_trigger_;
|
||||||
break;
|
break;
|
||||||
case COVER_OPERATION_CLOSING:
|
case COVER_OPERATION_CLOSING:
|
||||||
|
this->last_operation_ = dir;
|
||||||
trig = this->close_trigger_;
|
trig = this->close_trigger_;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ class CurrentBasedCover : public cover::Cover, public Component {
|
|||||||
uint32_t start_dir_time_{0};
|
uint32_t start_dir_time_{0};
|
||||||
uint32_t last_publish_time_{0};
|
uint32_t last_publish_time_{0};
|
||||||
float target_position_{0};
|
float target_position_{0};
|
||||||
|
|
||||||
|
cover::CoverOperation last_operation_{cover::COVER_OPERATION_OPENING};
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace current_based
|
} // namespace current_based
|
||||||
|
|||||||
@@ -250,6 +250,7 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
}
|
}
|
||||||
),
|
),
|
||||||
validate_config,
|
validate_config,
|
||||||
|
cv.only_on(["esp32", "esp8266"]),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ CONFIG_SCHEMA = (
|
|||||||
|
|
||||||
|
|
||||||
def auto_data_rate(config):
|
def auto_data_rate(config):
|
||||||
interval_sec = config[CONF_UPDATE_INTERVAL].seconds
|
interval_sec = config[CONF_UPDATE_INTERVAL].total_milliseconds / 1000
|
||||||
interval_hz = 1.0 / interval_sec
|
interval_hz = 1.0 / interval_sec
|
||||||
for datarate in sorted(QMC5883LDatarates.keys()):
|
for datarate in sorted(QMC5883LDatarates.keys()):
|
||||||
if float(datarate) >= interval_hz:
|
if float(datarate) >= interval_hz:
|
||||||
|
|||||||
@@ -10,6 +10,9 @@
|
|||||||
#ifdef USE_ESP8266
|
#ifdef USE_ESP8266
|
||||||
#include "sntp.h"
|
#include "sntp.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_RP2040
|
||||||
|
#include "lwip/apps/sntp.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// Yes, the server names are leaked, but that's fine.
|
// Yes, the server names are leaked, but that's fine.
|
||||||
#ifdef CLANG_TIDY
|
#ifdef CLANG_TIDY
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ optional<std::string> ToUpperFilter::new_value(std::string value) {
|
|||||||
// ToLowerFilter
|
// ToLowerFilter
|
||||||
optional<std::string> ToLowerFilter::new_value(std::string value) {
|
optional<std::string> ToLowerFilter::new_value(std::string value) {
|
||||||
for (char &c : value)
|
for (char &c : value)
|
||||||
c = ::toupper(c);
|
c = ::tolower(c);
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,9 @@
|
|||||||
#ifdef USE_ESP8266
|
#ifdef USE_ESP8266
|
||||||
#include "sys/time.h"
|
#include "sys/time.h"
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_RP2040
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
#include <cerrno>
|
#include <cerrno>
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
}
|
}
|
||||||
).extend(cv.COMPONENT_SCHEMA),
|
).extend(cv.COMPONENT_SCHEMA),
|
||||||
cv.only_with_arduino,
|
cv.only_with_arduino,
|
||||||
|
cv.only_on(["esp32", "esp8266"]),
|
||||||
default_url,
|
default_url,
|
||||||
validate_local,
|
validate_local,
|
||||||
)
|
)
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -39,11 +39,8 @@ void WiFiComponent::setup() {
|
|||||||
this->last_connected_ = millis();
|
this->last_connected_ = millis();
|
||||||
this->wifi_pre_setup_();
|
this->wifi_pre_setup_();
|
||||||
|
|
||||||
#ifndef USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS
|
uint32_t hash = this->has_sta() ? fnv1_hash(App.get_compilation_time()) : 88491487UL;
|
||||||
uint32_t hash = fnv1_hash(App.get_compilation_time());
|
|
||||||
#else
|
|
||||||
uint32_t hash = 88491487UL;
|
|
||||||
#endif
|
|
||||||
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
|
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
|
||||||
|
|
||||||
SavedWifiSettings save{};
|
SavedWifiSettings save{};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
"""Constants used by esphome."""
|
"""Constants used by esphome."""
|
||||||
|
|
||||||
__version__ = "2022.11.0b1"
|
__version__ = "2022.11.0"
|
||||||
|
|
||||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||||
|
|
||||||
|
|||||||
@@ -313,7 +313,11 @@ class EsphomeUploadHandler(EsphomeCommandWebSocket):
|
|||||||
class EsphomeCompileHandler(EsphomeCommandWebSocket):
|
class EsphomeCompileHandler(EsphomeCommandWebSocket):
|
||||||
def build_command(self, json_message):
|
def build_command(self, json_message):
|
||||||
config_file = settings.rel_path(json_message["configuration"])
|
config_file = settings.rel_path(json_message["configuration"])
|
||||||
return ["esphome", "--dashboard", "compile", config_file]
|
command = ["esphome", "--dashboard", "compile"]
|
||||||
|
if json_message.get("only_generate", False):
|
||||||
|
command.append("--only-generate")
|
||||||
|
command.append(config_file)
|
||||||
|
return command
|
||||||
|
|
||||||
|
|
||||||
class EsphomeValidateHandler(EsphomeCommandWebSocket):
|
class EsphomeValidateHandler(EsphomeCommandWebSocket):
|
||||||
|
|||||||
@@ -884,6 +884,7 @@ binary_sensor:
|
|||||||
then:
|
then:
|
||||||
- cover.toggle: time_based_cover
|
- cover.toggle: time_based_cover
|
||||||
- cover.toggle: endstop_cover
|
- cover.toggle: endstop_cover
|
||||||
|
- cover.toggle: current_based_cover
|
||||||
- platform: hydreon_rgxx
|
- platform: hydreon_rgxx
|
||||||
hydreon_rgxx_id: hydreon_rg9
|
hydreon_rgxx_id: hydreon_rg9
|
||||||
too_cold:
|
too_cold:
|
||||||
@@ -1246,6 +1247,7 @@ cover:
|
|||||||
close_duration: 4.5min
|
close_duration: 4.5min
|
||||||
- platform: current_based
|
- platform: current_based
|
||||||
name: Current Based Cover
|
name: Current Based Cover
|
||||||
|
id: current_based_cover
|
||||||
open_sensor: ade7953_current_a
|
open_sensor: ade7953_current_a
|
||||||
open_moving_current_threshold: 0.5
|
open_moving_current_threshold: 0.5
|
||||||
open_obstacle_current_threshold: 0.8
|
open_obstacle_current_threshold: 0.8
|
||||||
|
|||||||
Reference in New Issue
Block a user