mirror of
https://github.com/esphome/esphome.git
synced 2025-11-01 23:51:47 +00:00
Compare commits
48 Commits
2022.11.0b
...
2022.11.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72b2943332 | ||
|
|
4ec0ef7548 | ||
|
|
25bc6761f6 | ||
|
|
81b6562c25 | ||
|
|
ae74189fc2 | ||
|
|
9e516efe10 | ||
|
|
366e29439e | ||
|
|
1c9c700d7f | ||
|
|
b2e6b9d31f | ||
|
|
7623f63846 | ||
|
|
2bfaf9dce3 | ||
|
|
5c2c1560bb | ||
|
|
f7096ab78e | ||
|
|
98f8feb625 | ||
|
|
9944ca414e | ||
|
|
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')"
|
||||
TAG="${TAG}${today}"
|
||||
fi
|
||||
echo "::set-output name=tag::${TAG}"
|
||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||
# yamllint enable rule:line-length
|
||||
|
||||
deploy-pypi:
|
||||
|
||||
@@ -94,7 +94,7 @@ RUN \
|
||||
apt-get update \
|
||||
# Use pinned versions so that we get updates with build caching
|
||||
&& 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 \
|
||||
/tmp/* \
|
||||
/var/{cache,log}/* \
|
||||
|
||||
@@ -11,6 +11,10 @@ ADC_MODE(ADC_VCC)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef USE_RP2040
|
||||
#include <hardware/adc.h>
|
||||
#endif
|
||||
|
||||
namespace esphome {
|
||||
namespace adc {
|
||||
|
||||
@@ -32,9 +36,13 @@ static const int ADC_MAX = (1 << SOC_ADC_RTC_MAX_BITWIDTH) - 1; // 4095 (12 b
|
||||
static const int ADC_HALF = (1 << SOC_ADC_RTC_MAX_BITWIDTH) >> 1; // 2048 (12 bit) or 4096 (13 bit)
|
||||
#endif
|
||||
|
||||
void ADCSensor::setup() {
|
||||
#ifdef USE_RP2040
|
||||
extern "C"
|
||||
#endif
|
||||
void
|
||||
ADCSensor::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
|
||||
#ifndef USE_ADC_SENSOR_VCC
|
||||
#if !defined(USE_ADC_SENSOR_VCC) && !defined(USE_RP2040)
|
||||
pin_->setup();
|
||||
#endif
|
||||
|
||||
@@ -63,6 +71,16 @@ void ADCSensor::setup() {
|
||||
}
|
||||
|
||||
#endif // USE_ESP32
|
||||
|
||||
#ifdef USE_RP2040
|
||||
static bool initialized = false;
|
||||
if (!initialized) {
|
||||
adc_init();
|
||||
initialized = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
ESP_LOGCONFIG(TAG, "ADC '%s' setup finished!", this->get_name().c_str());
|
||||
}
|
||||
|
||||
void ADCSensor::dump_config() {
|
||||
@@ -98,6 +116,12 @@ void ADCSensor::dump_config() {
|
||||
}
|
||||
}
|
||||
#endif // USE_ESP32
|
||||
#ifdef USE_RP2040
|
||||
if (this->is_temperature_)
|
||||
ESP_LOGCONFIG(TAG, " Pin: Temperature");
|
||||
else
|
||||
LOG_PIN(" Pin: ", pin_);
|
||||
#endif
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
}
|
||||
|
||||
@@ -175,6 +199,29 @@ float ADCSensor::sample() {
|
||||
}
|
||||
#endif // USE_ESP32
|
||||
|
||||
#ifdef USE_RP2040
|
||||
float ADCSensor::sample() {
|
||||
if (this->is_temperature_) {
|
||||
adc_set_temp_sensor_enabled(true);
|
||||
delay(1);
|
||||
adc_select_input(4);
|
||||
} else {
|
||||
uint8_t pin = this->pin_->get_pin();
|
||||
adc_gpio_init(pin);
|
||||
adc_select_input(pin - 26);
|
||||
}
|
||||
|
||||
int raw = adc_read();
|
||||
if (this->is_temperature_) {
|
||||
adc_set_temp_sensor_enabled(false);
|
||||
}
|
||||
if (output_raw_) {
|
||||
return raw;
|
||||
}
|
||||
return raw * 3.3f / 4096.0f;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_ESP8266
|
||||
std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
|
||||
#endif
|
||||
|
||||
@@ -38,10 +38,18 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
||||
std::string unique_id() override;
|
||||
#endif
|
||||
|
||||
#ifdef USE_RP2040
|
||||
void set_is_temperature() { is_temperature_ = true; }
|
||||
#endif
|
||||
|
||||
protected:
|
||||
InternalGPIOPin *pin_;
|
||||
bool output_raw_{false};
|
||||
|
||||
#ifdef USE_RP2040
|
||||
bool is_temperature_{false};
|
||||
#endif
|
||||
|
||||
#ifdef USE_ESP32
|
||||
adc_atten_t attenuation_{ADC_ATTEN_DB_0};
|
||||
adc1_channel_t channel_{};
|
||||
|
||||
@@ -94,6 +94,9 @@ def validate_adc_pin(value):
|
||||
if str(value).upper() == "VCC":
|
||||
return cv.only_on_esp8266("VCC")
|
||||
|
||||
if str(value).upper() == "TEMPERATURE":
|
||||
return cv.only_on_rp2040("TEMPERATURE")
|
||||
|
||||
if CORE.is_esp32:
|
||||
value = pins.internal_gpio_input_pin_number(value)
|
||||
variant = get_esp32_variant()
|
||||
@@ -117,6 +120,12 @@ def validate_adc_pin(value):
|
||||
{CONF_ANALOG: True, CONF_INPUT: True}, internal=True
|
||||
)(value)
|
||||
|
||||
if CORE.is_rp2040:
|
||||
value = pins.internal_gpio_input_pin_number(value)
|
||||
if value not in (26, 27, 28, 29):
|
||||
raise cv.Invalid("RP2040: Only pins 26, 27, 28 and 29 support ADC.")
|
||||
return pins.internal_gpio_input_pin_schema(value)
|
||||
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@@ -160,6 +169,8 @@ async def to_code(config):
|
||||
|
||||
if config[CONF_PIN] == "VCC":
|
||||
cg.add_define("USE_ADC_SENSOR_VCC")
|
||||
elif config[CONF_PIN] == "TEMPERATURE":
|
||||
cg.add(var.set_is_temperature())
|
||||
else:
|
||||
pin = await cg.gpio_pin_expression(config[CONF_PIN])
|
||||
cg.add(var.set_pin(pin))
|
||||
|
||||
@@ -8,6 +8,7 @@ CODEOWNERS = ["@OttoWinter"]
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
cv.Schema({}),
|
||||
cv.only_with_arduino,
|
||||
cv.only_on(["esp32", "esp8266"]),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
import esphome.final_validate as fv
|
||||
from esphome.components import web_server_base
|
||||
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
|
||||
|
||||
AUTO_LOAD = ["web_server_base"]
|
||||
@@ -13,7 +12,6 @@ CODEOWNERS = ["@OttoWinter"]
|
||||
captive_portal_ns = cg.esphome_ns.namespace("captive_portal")
|
||||
CaptivePortal = captive_portal_ns.class_("CaptivePortal", cg.Component)
|
||||
|
||||
CONF_KEEP_USER_CREDENTIALS = "keep_user_credentials"
|
||||
CONFIG_SCHEMA = cv.All(
|
||||
cv.Schema(
|
||||
{
|
||||
@@ -21,29 +19,13 @@ CONFIG_SCHEMA = cv.All(
|
||||
cv.GenerateID(CONF_WEB_SERVER_BASE_ID): cv.use_id(
|
||||
web_server_base.WebServerBase
|
||||
),
|
||||
cv.Optional(CONF_KEEP_USER_CREDENTIALS, default=False): cv.boolean,
|
||||
}
|
||||
).extend(cv.COMPONENT_SCHEMA),
|
||||
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)
|
||||
async def to_code(config):
|
||||
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)
|
||||
if CORE.is_esp8266:
|
||||
cg.add_library("DNSServer", None)
|
||||
|
||||
if config.get(CONF_KEEP_USER_CREDENTIALS, False):
|
||||
cg.add_define("USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS")
|
||||
|
||||
@@ -113,7 +113,9 @@ CLIMATE_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA).
|
||||
{
|
||||
cv.Optional(CONF_MIN_TEMPERATURE): cv.temperature,
|
||||
cv.Optional(CONF_MAX_TEMPERATURE): cv.temperature,
|
||||
cv.Optional(CONF_TEMPERATURE_STEP): cv.temperature,
|
||||
cv.Optional(CONF_TEMPERATURE_STEP): cv.float_with_unit(
|
||||
"visual_temperature", "(°C|° C|°|C|° K|° K|K|°F|° F|F)?"
|
||||
),
|
||||
}
|
||||
),
|
||||
cv.Optional(CONF_ACTION_STATE_TOPIC): cv.All(
|
||||
|
||||
@@ -13,6 +13,7 @@ using namespace esphome::cover;
|
||||
CoverTraits CurrentBasedCover::get_traits() {
|
||||
auto traits = CoverTraits();
|
||||
traits.set_supports_position(true);
|
||||
traits.set_supports_toggle(true);
|
||||
traits.set_is_assumed_state(false);
|
||||
return traits;
|
||||
}
|
||||
@@ -20,6 +21,20 @@ void CurrentBasedCover::control(const CoverCall &call) {
|
||||
if (call.get_stop()) {
|
||||
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()) {
|
||||
auto pos = *call.get_position();
|
||||
if (pos == this->position) {
|
||||
@@ -202,9 +217,11 @@ void CurrentBasedCover::start_direction_(CoverOperation dir) {
|
||||
trig = this->stop_trigger_;
|
||||
break;
|
||||
case COVER_OPERATION_OPENING:
|
||||
this->last_operation_ = dir;
|
||||
trig = this->open_trigger_;
|
||||
break;
|
||||
case COVER_OPERATION_CLOSING:
|
||||
this->last_operation_ = dir;
|
||||
trig = this->close_trigger_;
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -89,6 +89,8 @@ class CurrentBasedCover : public cover::Cover, public Component {
|
||||
uint32_t start_dir_time_{0};
|
||||
uint32_t last_publish_time_{0};
|
||||
float target_position_{0};
|
||||
|
||||
cover::CoverOperation last_operation_{cover::COVER_OPERATION_OPENING};
|
||||
};
|
||||
|
||||
} // namespace current_based
|
||||
|
||||
@@ -299,7 +299,7 @@ BLEDescriptor *BLEClientBase::get_config_descriptor(uint16_t handle) {
|
||||
auto *chr = this->get_characteristic(handle);
|
||||
if (chr != nullptr) {
|
||||
for (auto &desc : chr->descriptors) {
|
||||
if (desc->uuid == espbt::ESPBTUUID::from_uint16(0x2902))
|
||||
if (desc->uuid.get_uuid().uuid.uuid16 == 0x2902)
|
||||
return desc;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,10 +449,13 @@ ESPBTUUID ESPBTUUID::from_raw(const std::string &data) {
|
||||
ESPBTUUID ESPBTUUID::from_uuid(esp_bt_uuid_t uuid) {
|
||||
ESPBTUUID ret;
|
||||
ret.uuid_.len = uuid.len;
|
||||
ret.uuid_.uuid.uuid16 = uuid.uuid.uuid16;
|
||||
ret.uuid_.uuid.uuid32 = uuid.uuid.uuid32;
|
||||
for (size_t i = 0; i < ESP_UUID_LEN_128; i++)
|
||||
ret.uuid_.uuid.uuid128[i] = uuid.uuid.uuid128[i];
|
||||
if (uuid.len == ESP_UUID_LEN_16) {
|
||||
ret.uuid_.uuid.uuid16 = uuid.uuid.uuid16;
|
||||
} else if (uuid.len == ESP_UUID_LEN_32) {
|
||||
ret.uuid_.uuid.uuid32 = uuid.uuid.uuid32;
|
||||
} else if (uuid.len == ESP_UUID_LEN_128) {
|
||||
memcpy(ret.uuid_.uuid.uuid128, uuid.uuid.uuid128, ESP_UUID_LEN_128);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
ESPBTUUID ESPBTUUID::as_128bit() const {
|
||||
|
||||
@@ -250,6 +250,7 @@ CONFIG_SCHEMA = cv.All(
|
||||
}
|
||||
),
|
||||
validate_config,
|
||||
cv.only_on(["esp32", "esp8266"]),
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -86,6 +86,8 @@ async def to_code(config):
|
||||
if CORE.is_esp32:
|
||||
cg.add_library("WiFiClientSecure", None)
|
||||
cg.add_library("HTTPClient", None)
|
||||
if CORE.is_esp8266:
|
||||
cg.add_library("ESP8266HTTPClient", None)
|
||||
|
||||
if CONF_TOUCH_SLEEP_TIMEOUT in config:
|
||||
cg.add(var.set_touch_sleep_timeout_internal(config[CONF_TOUCH_SLEEP_TIMEOUT]))
|
||||
|
||||
@@ -103,7 +103,7 @@ CONFIG_SCHEMA = (
|
||||
|
||||
|
||||
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
|
||||
for datarate in sorted(QMC5883LDatarates.keys()):
|
||||
if float(datarate) >= interval_hz:
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/macros.h"
|
||||
|
||||
#include <PinNames.h>
|
||||
#include <hardware/clocks.h>
|
||||
#include <hardware/gpio.h>
|
||||
#include <hardware/pwm.h>
|
||||
|
||||
namespace esphome {
|
||||
namespace rp2040_pwm {
|
||||
@@ -15,10 +17,17 @@ static const char *const TAG = "rp2040_pwm";
|
||||
|
||||
void RP2040PWM::setup() {
|
||||
ESP_LOGCONFIG(TAG, "Setting up RP2040 PWM Output...");
|
||||
this->pin_->setup();
|
||||
this->pwm_ = new mbed::PwmOut((PinName) this->pin_->get_pin());
|
||||
this->turn_off();
|
||||
|
||||
this->setup_pwm_();
|
||||
}
|
||||
|
||||
void RP2040PWM::setup_pwm_() {
|
||||
pwm_config config = pwm_get_default_config();
|
||||
pwm_config_set_clkdiv(&config, clock_get_hz(clk_sys) / (255.0f * this->frequency_));
|
||||
pwm_config_set_wrap(&config, 254);
|
||||
pwm_init(pwm_gpio_to_slice_num(this->pin_->get_pin()), &config, true);
|
||||
}
|
||||
|
||||
void RP2040PWM::dump_config() {
|
||||
ESP_LOGCONFIG(TAG, "RP2040 PWM:");
|
||||
LOG_PIN(" Pin: ", this->pin_);
|
||||
@@ -33,10 +42,13 @@ void HOT RP2040PWM::write_state(float state) {
|
||||
state = 1.0f - state;
|
||||
}
|
||||
|
||||
auto total_time_us = static_cast<uint32_t>(roundf(1e6f / this->frequency_));
|
||||
if (this->frequency_changed_) {
|
||||
this->setup_pwm_();
|
||||
this->frequency_changed_ = false;
|
||||
}
|
||||
|
||||
this->pwm_->period_us(total_time_us);
|
||||
this->pwm_->write(state);
|
||||
gpio_set_function(this->pin_->get_pin(), GPIO_FUNC_PWM);
|
||||
pwm_set_gpio_level(this->pin_->get_pin(), state * 255.0f);
|
||||
}
|
||||
|
||||
} // namespace rp2040_pwm
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
#include "esphome/core/component.h"
|
||||
#include "esphome/core/hal.h"
|
||||
|
||||
#include "drivers/PwmOut.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace rp2040_pwm {
|
||||
|
||||
@@ -19,6 +17,7 @@ class RP2040PWM : public output::FloatOutput, public Component {
|
||||
/// Dynamically update frequency
|
||||
void update_frequency(float frequency) override {
|
||||
this->set_frequency(frequency);
|
||||
this->frequency_changed_ = true;
|
||||
this->write_state(this->last_output_);
|
||||
}
|
||||
|
||||
@@ -31,11 +30,13 @@ class RP2040PWM : public output::FloatOutput, public Component {
|
||||
protected:
|
||||
void write_state(float state) override;
|
||||
|
||||
void setup_pwm_();
|
||||
|
||||
InternalGPIOPin *pin_;
|
||||
mbed::PwmOut *pwm_;
|
||||
float frequency_{1000.0};
|
||||
/// Cache last output level for dynamic frequency updating
|
||||
float last_output_{0.0};
|
||||
bool frequency_changed_{false};
|
||||
};
|
||||
|
||||
template<typename... Ts> class SetFrequencyAction : public Action<Ts...> {
|
||||
|
||||
@@ -10,6 +10,9 @@
|
||||
#ifdef USE_ESP8266
|
||||
#include "sntp.h"
|
||||
#endif
|
||||
#ifdef USE_RP2040
|
||||
#include "lwip/apps/sntp.h"
|
||||
#endif
|
||||
|
||||
// Yes, the server names are leaked, but that's fine.
|
||||
#ifdef CLANG_TIDY
|
||||
|
||||
@@ -51,7 +51,7 @@ optional<std::string> ToUpperFilter::new_value(std::string value) {
|
||||
// ToLowerFilter
|
||||
optional<std::string> ToLowerFilter::new_value(std::string value) {
|
||||
for (char &c : value)
|
||||
c = ::toupper(c);
|
||||
c = ::tolower(c);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#ifdef USE_ESP8266
|
||||
#include "sys/time.h"
|
||||
#endif
|
||||
#ifdef USE_RP2040
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
#include <cerrno>
|
||||
|
||||
namespace esphome {
|
||||
|
||||
@@ -75,6 +75,7 @@ CONFIG_SCHEMA = cv.All(
|
||||
}
|
||||
).extend(cv.COMPONENT_SCHEMA),
|
||||
cv.only_with_arduino,
|
||||
cv.only_on(["esp32", "esp8266"]),
|
||||
default_url,
|
||||
validate_local,
|
||||
)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -39,11 +39,8 @@ void WiFiComponent::setup() {
|
||||
this->last_connected_ = millis();
|
||||
this->wifi_pre_setup_();
|
||||
|
||||
#ifndef USE_CAPTIVE_PORTAL_KEEP_USER_CREDENTIALS
|
||||
uint32_t hash = fnv1_hash(App.get_compilation_time());
|
||||
#else
|
||||
uint32_t hash = 88491487UL;
|
||||
#endif
|
||||
uint32_t hash = this->has_sta() ? fnv1_hash(App.get_compilation_time()) : 88491487UL;
|
||||
|
||||
this->pref_ = global_preferences->make_preference<wifi::SavedWifiSettings>(hash, true);
|
||||
|
||||
SavedWifiSettings save{};
|
||||
|
||||
@@ -548,6 +548,7 @@ def only_with_framework(frameworks):
|
||||
|
||||
only_on_esp32 = only_on("esp32")
|
||||
only_on_esp8266 = only_on("esp8266")
|
||||
only_on_rp2040 = only_on("rp2040")
|
||||
only_with_arduino = only_with_framework("arduino")
|
||||
only_with_esp_idf = only_with_framework("esp-idf")
|
||||
|
||||
@@ -1679,7 +1680,7 @@ def source_refresh(value: str):
|
||||
if value.lower() == "always":
|
||||
return source_refresh("0s")
|
||||
if value.lower() == "never":
|
||||
return source_refresh("1000y")
|
||||
return source_refresh("365250d")
|
||||
return positive_time_period_seconds(value)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
"""Constants used by esphome."""
|
||||
|
||||
__version__ = "2022.11.0b1"
|
||||
__version__ = "2022.11.3"
|
||||
|
||||
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
|
||||
|
||||
|
||||
@@ -313,7 +313,11 @@ class EsphomeUploadHandler(EsphomeCommandWebSocket):
|
||||
class EsphomeCompileHandler(EsphomeCommandWebSocket):
|
||||
def build_command(self, json_message):
|
||||
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):
|
||||
|
||||
@@ -884,6 +884,7 @@ binary_sensor:
|
||||
then:
|
||||
- cover.toggle: time_based_cover
|
||||
- cover.toggle: endstop_cover
|
||||
- cover.toggle: current_based_cover
|
||||
- platform: hydreon_rgxx
|
||||
hydreon_rgxx_id: hydreon_rg9
|
||||
too_cold:
|
||||
@@ -1246,6 +1247,7 @@ cover:
|
||||
close_duration: 4.5min
|
||||
- platform: current_based
|
||||
name: Current Based Cover
|
||||
id: current_based_cover
|
||||
open_sensor: ade7953_current_a
|
||||
open_moving_current_threshold: 0.5
|
||||
open_obstacle_current_threshold: 0.8
|
||||
|
||||
Reference in New Issue
Block a user