1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-02 16:11:53 +00:00

Compare commits

...

25 Commits

Author SHA1 Message Date
Jesse Hills
0fe18a6144 Merge pull request #6940 from esphome/bump-2024.6.0
2024.6.0
2024-06-20 08:26:41 +12:00
Jesse Hills
a6d1aa91de Bump version to 2024.6.0 2024-06-19 21:52:47 +12:00
Jesse Hills
9747811b82 Merge pull request #6938 from esphome/bump-2024.6.0b5
2024.6.0b5
2024-06-19 18:19:14 +12:00
Jesse Hills
ff803aa108 Rename test files 2024-06-19 16:37:33 +12:00
Jesse Hills
8bac82f804 Bump version to 2024.6.0b5 2024-06-19 15:37:43 +12:00
Jesse Hills
6682451ee0 [network] Default ipv6 to false to always set the flags (#6937)
* [network] Default ipv6 to false to always set the flags

* Separate tests for ipv6 disabled and enabled

* Forgot other platforms wouldnt have the variable in config
2024-06-19 15:37:43 +12:00
dependabot[bot]
c17090c1e5 Bump docker/build-push-action from 6.0.0 to 6.0.1 in /.github/actions/build-image (#6934)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
dependabot[bot]
acf69bb56f Bump docker/build-push-action from 5.4.0 to 6.0.0 in /.github/actions/build-image (#6927)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
dependabot[bot]
fd7a212562 Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#6926)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
Jesse Hills
c053a33fe8 Merge pull request #6930 from esphome/bump-2024.6.0b4
2024.6.0b4
2024-06-18 16:12:04 +12:00
Jesse Hills
ff07637dfd Bump version to 2024.6.0b4 2024-06-18 14:26:24 +12:00
Jesse Hills
43b5c2deb7 Rename legacy/modern to ota/factory (#6922)
* Rename legacy/modern to ota/factory

* Add modern/legacy in brackets
2024-06-18 14:26:24 +12:00
Jesse Hills
d27e7b3b70 [wifi] Fix some access point bugs related to esp-idf 4.4.7 (#6928)
* Set dhcp server range to only 10 IPs

* Change log level to errors to make it clearer

* We want to stop the dhcp server, not client
2024-06-18 14:26:24 +12:00
Giel van Schijndel
5dec62bf1e fix(dallas): make recovery time for 1-bit equal to that of 0-bit (#6763) 2024-06-18 14:26:24 +12:00
Jesse Hills
cfe28ce7a3 Merge pull request #6915 from esphome/bump-2024.6.0b3
2024.6.0b3
2024-06-17 16:27:24 +12:00
Jesse Hills
25a3db1637 Bump version to 2024.6.0b3 2024-06-17 15:35:53 +12:00
Jesse Hills
65638bf614 [mqtt] Fix datetime copy pasta (#6914) 2024-06-17 15:35:52 +12:00
Jesse Hills
1e66241b26 [ili9xxx] Fix init for GC9A01A (#6913) 2024-06-17 15:35:52 +12:00
esphomebot
eb50f0eafd Synchronise Device Classes from Home Assistant (#6904) 2024-06-17 15:35:52 +12:00
Jesse Hills
4e8a7986cd Merge pull request #6902 from esphome/bump-2024.6.0b2
2024.6.0b2
2024-06-13 11:40:44 +12:00
Jesse Hills
3db71b98ae Bump version to 2024.6.0b2 2024-06-13 10:31:08 +12:00
Jesse Hills
73cb3ec852 Bump esphome-dashboard to 20240613.0 (#6901) 2024-06-13 10:31:08 +12:00
Jesse Hills
91e72fe121 [host] Execute host program when using run command (#6897) 2024-06-13 10:31:08 +12:00
Oliver Hihn
be486e0ca6 Add step_delay option to X9C component (#6890) 2024-06-13 10:31:07 +12:00
Jesse Hills
fdefc825bb [CI] Fix for sdl (#6892) 2024-06-13 10:31:07 +12:00
39 changed files with 192 additions and 65 deletions

View File

@@ -46,7 +46,7 @@ runs:
- name: Build and push to ghcr by digest
id: build-ghcr
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.0.1
with:
context: .
file: ./docker/Dockerfile
@@ -69,7 +69,7 @@ runs:
- name: Build and push to dockerhub by digest
id: build-dockerhub
uses: docker/build-push-action@v5.4.0
uses: docker/build-push-action@v6.0.1
with:
context: .
file: ./docker/Dockerfile

View File

@@ -454,7 +454,7 @@ jobs:
matrix:
file: ${{ fromJson(needs.list-components.outputs.components) }}
steps:
- name: Install libsodium
- name: Install dependencies
run: sudo apt-get install libsodium-dev libsdl2-dev
- name: Check out code from GitHub
@@ -508,8 +508,8 @@ jobs:
- name: List components
run: echo ${{ matrix.components }}
- name: Install libsodium
run: sudo apt-get install libsodium-dev
- name: Install dependencies
run: sudo apt-get install libsodium-dev libsdl2-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.6

View File

@@ -65,7 +65,7 @@ jobs:
pip3 install build
python3 -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@v1.9.0
deploy-docker:
name: Build ESPHome ${{ matrix.platform }}

View File

@@ -488,6 +488,15 @@ def command_run(args, config):
if exit_code != 0:
return exit_code
_LOGGER.info("Successfully compiled program.")
if CORE.is_host:
from esphome.platformio_api import get_idedata
idedata = get_idedata(config)
if idedata is None:
return 1
program_path = idedata.raw["prog_path"]
return run_external_process(program_path)
port = choose_upload_log_host(
default=args.device,
check_default=None,

View File

@@ -96,16 +96,16 @@ def get_board(core_obj=None):
def get_download_types(storage_json):
return [
{
"title": "Modern format",
"title": "Factory format (Previously Modern)",
"description": "For use with ESPHome Web and other tools.",
"file": "firmware-factory.bin",
"download": f"{storage_json.name}-factory.bin",
"file": "firmware.factory.bin",
"download": f"{storage_json.name}.factory.bin",
},
{
"title": "Legacy format",
"description": "For use with ESPHome Flasher.",
"file": "firmware.bin",
"download": f"{storage_json.name}.bin",
"title": "OTA format (Previously Legacy)",
"description": "For OTA updating a device.",
"file": "firmware.ota.bin",
"download": f"{storage_json.name}.ota.bin",
},
]

View File

@@ -17,17 +17,19 @@ from SCons.Script import ARGUMENTS
# Copy over the default sdkconfig.
from os import path
if path.exists("./sdkconfig.defaults"):
os.makedirs(".temp", exist_ok=True)
shutil.copy("./sdkconfig.defaults", "./.temp/sdkconfig-esp32-idf")
def esp32_create_combined_bin(source, target, env):
verbose = bool(int(ARGUMENTS.get("PIOVERBOSE", "0")))
if verbose:
print("Generating combined binary for serial flashing")
app_offset = 0x10000
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}-factory.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
sections = env.subst(env.get("FLASH_EXTRA_IMAGES"))
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
chip = env.get("BOARD_MCU")
@@ -62,5 +64,14 @@ def esp32_create_combined_bin(source, target, env):
else:
subprocess.run(["esptool.py", *cmd])
def esp32_copy_ota_bin(source, target, env):
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.ota.bin")
shutil.copyfile(firmware_name, new_file_name)
# pylint: disable=E0602
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin) # noqa
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_copy_ota_bin) # noqa

View File

@@ -6,10 +6,18 @@ Import("env") # noqa
def esp8266_copy_factory_bin(source, target, env):
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}-factory.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.bin")
shutil.copyfile(firmware_name, new_file_name)
def esp8266_copy_ota_bin(source, target, env):
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.ota.bin")
shutil.copyfile(firmware_name, new_file_name)
# pylint: disable=E0602
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp8266_copy_factory_bin) # noqa
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp8266_copy_ota_bin) # noqa

View File

@@ -60,7 +60,7 @@ void HOT IRAM_ATTR GPIOOneWireBus::write_bit_(bool bit) {
// recovery time: t_rec: min=1µs
// ds18b20 appears to read the bus after roughly 14µs
uint32_t delay0 = bit ? 6 : 60;
uint32_t delay1 = bit ? 54 : 5;
uint32_t delay1 = bit ? 59 : 5;
// delay A/C
delayMicroseconds(delay0);

View File

@@ -34,8 +34,8 @@ void ILI9XXXDisplay::setup() {
ESP_LOGD(TAG, "Setting up ILI9xxx");
this->setup_pins_();
this->init_lcd_(this->init_sequence_);
this->init_lcd_(this->extra_init_sequence_.data());
this->init_lcd(this->init_sequence_);
this->init_lcd(this->extra_init_sequence_.data());
switch (this->pixel_mode_) {
case PIXEL_MODE_16:
if (this->is_18bitdisplay_) {
@@ -405,7 +405,7 @@ void ILI9XXXDisplay::reset_() {
}
}
void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
void ILI9XXXDisplay::init_lcd(const uint8_t *addr) {
if (addr == nullptr)
return;
uint8_t cmd, x, num_args;
@@ -427,6 +427,20 @@ void ILI9XXXDisplay::init_lcd_(const uint8_t *addr) {
}
}
void ILI9XXXGC9A01A::init_lcd(const uint8_t *addr) {
if (addr == nullptr)
return;
uint8_t cmd, x, num_args;
while ((cmd = *addr++) != 0) {
x = *addr++;
num_args = x & 0x7F;
this->send_command(cmd, addr, num_args);
addr += num_args;
if (x & 0x80)
delay(150); // NOLINT
}
}
// Tell the display controller where we want to draw pixels.
void ILI9XXXDisplay::set_addr_window_(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2) {
x1 += this->offset_x_;

View File

@@ -109,7 +109,7 @@ class ILI9XXXDisplay : public display::DisplayBuffer,
virtual void set_madctl();
void display_();
void init_lcd_(const uint8_t *addr);
virtual void init_lcd(const uint8_t *addr);
void set_addr_window_(uint16_t x, uint16_t y, uint16_t x2, uint16_t y2);
void reset_();
@@ -269,6 +269,7 @@ class ILI9XXXS3BoxLite : public ILI9XXXDisplay {
class ILI9XXXGC9A01A : public ILI9XXXDisplay {
public:
ILI9XXXGC9A01A() : ILI9XXXDisplay(INITCMD_GC9A01A, 240, 240, true) {}
void init_lcd(const uint8_t *addr) override;
};
//----------- ILI9XXX_24_TFT display --------------

View File

@@ -6,12 +6,12 @@
#include "mqtt_const.h"
#ifdef USE_MQTT
#ifdef USE_DATETIME_TIME
#ifdef USE_DATETIME_DATETIME
namespace esphome {
namespace mqtt {
static const char *const TAG = "mqtt.datetime.time";
static const char *const TAG = "mqtt.datetime.datetime";
using namespace esphome::datetime;
@@ -80,5 +80,5 @@ bool MQTTDateTimeComponent::publish_state(uint16_t year, uint8_t month, uint8_t
} // namespace mqtt
} // namespace esphome
#endif // USE_DATETIME_TIME
#endif // USE_DATETIME_DATETIME
#endif // USE_MQTT

View File

@@ -3,7 +3,7 @@
#include "esphome/core/defines.h"
#ifdef USE_MQTT
#ifdef USE_DATETIME_TIME
#ifdef USE_DATETIME_DATETIME
#include "esphome/components/datetime/datetime_entity.h"
#include "mqtt_component.h"
@@ -17,7 +17,7 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
*
* @param time The time entity.
*/
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *time);
explicit MQTTDateTimeComponent(datetime::DateTimeEntity *datetime);
// ========== INTERNAL METHODS ==========
// (In most use cases you won't need these)
@@ -41,5 +41,5 @@ class MQTTDateTimeComponent : public mqtt::MQTTComponent {
} // namespace mqtt
} // namespace esphome
#endif // USE_DATETIME_DATE
#endif // USE_DATETIME_DATETIME
#endif // USE_MQTT

View File

@@ -19,7 +19,12 @@ IPAddress = network_ns.class_("IPAddress")
CONFIG_SCHEMA = cv.Schema(
{
cv.SplitDefault(CONF_ENABLE_IPV6): cv.All(
cv.SplitDefault(
CONF_ENABLE_IPV6,
esp8266=False,
esp32=False,
rp2040=False,
): cv.All(
cv.boolean, cv.only_on([PLATFORM_ESP32, PLATFORM_ESP8266, PLATFORM_RP2040])
),
cv.Optional(CONF_MIN_IPV6_ADDR_COUNT, default=0): cv.positive_int,
@@ -28,18 +33,17 @@ CONFIG_SCHEMA = cv.Schema(
async def to_code(config):
if CONF_ENABLE_IPV6 in config:
cg.add_define("USE_NETWORK_IPV6", config[CONF_ENABLE_IPV6])
cg.add_define(
"USE_NETWORK_MIN_IPV6_ADDR_COUNT", config[CONF_MIN_IPV6_ADDR_COUNT]
)
if CORE.using_esp_idf:
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", config[CONF_ENABLE_IPV6])
add_idf_sdkconfig_option(
"CONFIG_LWIP_IPV6_AUTOCONFIG", config[CONF_ENABLE_IPV6]
if (enable_ipv6 := config.get(CONF_ENABLE_IPV6, None)) is not None:
cg.add_define("USE_NETWORK_IPV6", enable_ipv6)
if enable_ipv6:
cg.add_define(
"USE_NETWORK_MIN_IPV6_ADDR_COUNT", config[CONF_MIN_IPV6_ADDR_COUNT]
)
if CORE.using_esp_idf:
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6)
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6)
else:
if config[CONF_ENABLE_IPV6]:
if enable_ipv6:
cg.add_build_flag("-DCONFIG_LWIP_IPV6")
cg.add_build_flag("-DCONFIG_LWIP_IPV6_AUTOCONFIG")
if CORE.is_rp2040:

View File

@@ -47,10 +47,16 @@ def set_core_data(config):
def get_download_types(storage_json):
return [
{
"title": "UF2 format",
"title": "UF2 factory format",
"description": "For copying to RP2040 over USB.",
"file": "firmware.uf2",
"download": f"{storage_json.name}.uf2",
"download": f"{storage_json.name}.factory.uf2",
},
{
"title": "OTA format",
"description": "For OTA updating a device.",
"file": "firmware.ota.bin",
"download": f"{storage_json.name}.ota.bin",
},
]
@@ -160,6 +166,8 @@ async def to_code(config):
cg.add_define("ESPHOME_BOARD", config[CONF_BOARD])
cg.add_define("ESPHOME_VARIANT", "RP2040")
cg.add_platformio_option("extra_scripts", ["post:post_build.py"])
conf = config[CONF_FRAMEWORK]
cg.add_platformio_option("framework", "arduino")
cg.add_build_flag("-DUSE_ARDUINO")
@@ -225,4 +233,10 @@ def generate_pio_files() -> bool:
# Called by writer.py
def copy_files() -> bool:
dir = os.path.dirname(__file__)
post_build_file = os.path.join(dir, "post_build.py.script")
copy_file_if_changed(
post_build_file,
CORE.relative_build_path("post_build.py"),
)
return generate_pio_files()

View File

@@ -0,0 +1,23 @@
import shutil
# pylint: disable=E0602
Import("env") # noqa
def rp2040_copy_factory_uf2(source, target, env):
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.uf2")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.factory.uf2")
shutil.copyfile(firmware_name, new_file_name)
def rp2040_copy_ota_bin(source, target, env):
firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin")
new_file_name = env.subst("$BUILD_DIR/${PROGNAME}.ota.bin")
shutil.copyfile(firmware_name, new_file_name)
# pylint: disable=E0602
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", rp2040_copy_factory_uf2) # noqa
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", rp2040_copy_ota_bin) # noqa

View File

@@ -7,6 +7,7 @@ from esphome.const import (
CONF_ID,
CONF_MQTT_ID,
CONF_WEB_SERVER_ID,
DEVICE_CLASS_EMPTY,
DEVICE_CLASS_FIRMWARE,
)
from esphome.core import CORE, coroutine_with_priority
@@ -24,6 +25,7 @@ PerformAction = update_ns.class_("PerformAction", automation.Action)
IsAvailableCondition = update_ns.class_("IsAvailableCondition", automation.Condition)
DEVICE_CLASSES = [
DEVICE_CLASS_EMPTY,
DEVICE_CLASS_FIRMWARE,
]

View File

@@ -694,15 +694,15 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
info.netmask = network::IPAddress(255, 255, 255, 0);
}
err = esp_netif_dhcpc_stop(s_ap_netif);
err = esp_netif_dhcps_stop(s_ap_netif);
if (err != ESP_OK && err != ESP_ERR_ESP_NETIF_DHCP_ALREADY_STOPPED) {
ESP_LOGV(TAG, "esp_netif_dhcpc_stop failed: %s", esp_err_to_name(err));
ESP_LOGE(TAG, "esp_netif_dhcps_stop failed: %s", esp_err_to_name(err));
return false;
}
err = esp_netif_set_ip_info(s_ap_netif, &info);
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_set_ip_info failed! %d", err);
ESP_LOGE(TAG, "esp_netif_set_ip_info failed! %d", err);
return false;
}
@@ -712,20 +712,20 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
start_address += 99;
lease.start_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease start: %s", start_address.str().c_str());
start_address += 100;
start_address += 10;
lease.end_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease end: %s", start_address.str().c_str());
err = esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_REQUESTED_IP_ADDRESS, &lease, sizeof(lease));
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_dhcps_option failed! %d", err);
ESP_LOGE(TAG, "esp_netif_dhcps_option failed! %d", err);
return false;
}
err = esp_netif_dhcps_start(s_ap_netif);
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_dhcps_start failed! %d", err);
ESP_LOGE(TAG, "esp_netif_dhcps_start failed! %d", err);
return false;
}

View File

@@ -716,12 +716,12 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
if (wifi_softap_dhcps_status() == DHCP_STARTED) {
if (!wifi_softap_dhcps_stop()) {
ESP_LOGV(TAG, "Stopping DHCP server failed!");
ESP_LOGW(TAG, "Stopping DHCP server failed!");
}
}
if (!wifi_set_ip_info(SOFTAP_IF, &info)) {
ESP_LOGV(TAG, "Setting SoftAP info failed!");
ESP_LOGE(TAG, "Setting SoftAP info failed!");
return false;
}
@@ -735,17 +735,17 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
start_address += 99;
lease.start_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease start: %s", start_address.str().c_str());
start_address += 100;
start_address += 10;
lease.end_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease end: %s", start_address.str().c_str());
if (!wifi_softap_set_dhcps_lease(&lease)) {
ESP_LOGV(TAG, "Setting SoftAP DHCP lease failed!");
ESP_LOGE(TAG, "Setting SoftAP DHCP lease failed!");
return false;
}
// lease time 1440 minutes (=24 hours)
if (!wifi_softap_set_dhcps_lease_time(1440)) {
ESP_LOGV(TAG, "Setting SoftAP DHCP lease time failed!");
ESP_LOGE(TAG, "Setting SoftAP DHCP lease time failed!");
return false;
}
@@ -755,13 +755,13 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
uint8_t mode = 1;
// bit0, 1 enables router information from ESP8266 SoftAP DHCP server.
if (!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) {
ESP_LOGV(TAG, "wifi_softap_set_dhcps_offer_option failed!");
ESP_LOGE(TAG, "wifi_softap_set_dhcps_offer_option failed!");
return false;
}
#endif
if (!wifi_softap_dhcps_start()) {
ESP_LOGV(TAG, "Starting SoftAP DHCPS failed!");
ESP_LOGE(TAG, "Starting SoftAP DHCPS failed!");
return false;
}

View File

@@ -823,15 +823,15 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
info.netmask = network::IPAddress(255, 255, 255, 0);
}
err = esp_netif_dhcpc_stop(s_ap_netif);
err = esp_netif_dhcps_stop(s_ap_netif);
if (err != ESP_OK && err != ESP_ERR_ESP_NETIF_DHCP_ALREADY_STOPPED) {
ESP_LOGV(TAG, "esp_netif_dhcpc_stop failed: %s", esp_err_to_name(err));
ESP_LOGE(TAG, "esp_netif_dhcps_stop failed: %s", esp_err_to_name(err));
return false;
}
err = esp_netif_set_ip_info(s_ap_netif, &info);
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_set_ip_info failed! %d", err);
ESP_LOGE(TAG, "esp_netif_set_ip_info failed! %d", err);
return false;
}
@@ -841,20 +841,20 @@ bool WiFiComponent::wifi_ap_ip_config_(optional<ManualIP> manual_ip) {
start_address += 99;
lease.start_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease start: %s", start_address.str().c_str());
start_address += 100;
start_address += 10;
lease.end_ip = start_address;
ESP_LOGV(TAG, "DHCP server IP lease end: %s", start_address.str().c_str());
err = esp_netif_dhcps_option(s_ap_netif, ESP_NETIF_OP_SET, ESP_NETIF_REQUESTED_IP_ADDRESS, &lease, sizeof(lease));
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_dhcps_option failed! %d", err);
ESP_LOGE(TAG, "esp_netif_dhcps_option failed! %d", err);
return false;
}
err = esp_netif_dhcps_start(s_ap_netif);
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_netif_dhcps_start failed! %d", err);
ESP_LOGE(TAG, "esp_netif_dhcps_start failed! %d", err);
return false;
}
@@ -887,12 +887,12 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) {
esp_err_t err = esp_wifi_set_config(WIFI_IF_AP, &conf);
if (err != ESP_OK) {
ESP_LOGV(TAG, "esp_wifi_set_config failed! %d", err);
ESP_LOGE(TAG, "esp_wifi_set_config failed! %d", err);
return false;
}
if (!this->wifi_ap_ip_config_(ap.get_manual_ip())) {
ESP_LOGV(TAG, "wifi_ap_ip_config_ failed!");
ESP_LOGE(TAG, "wifi_ap_ip_config_ failed!");
return false;
}

View File

@@ -8,6 +8,7 @@ from esphome.const import (
CONF_INC_PIN,
CONF_UD_PIN,
CONF_INITIAL_VALUE,
CONF_STEP_DELAY,
)
CODEOWNERS = ["@EtienneMD"]
@@ -26,6 +27,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_INITIAL_VALUE, default=1.0): cv.float_range(
min=0.01, max=1.0
),
cv.Optional(CONF_STEP_DELAY, default=1): cv.int_range(min=1, max=100),
}
)
)
@@ -44,3 +46,4 @@ async def to_code(config):
cg.add(var.set_ud_pin(ud_pin))
cg.add(var.set_initial_value(config[CONF_INITIAL_VALUE]))
cg.add(var.set_step_delay(config[CONF_STEP_DELAY]))

View File

@@ -22,9 +22,9 @@ void X9cOutput::trim_value(int change_amount) {
for (int i = 0; i < abs(change_amount); i++) { // Move wiper
this->inc_pin_->digital_write(true);
delayMicroseconds(1);
delayMicroseconds(this->step_delay_);
this->inc_pin_->digital_write(false);
delayMicroseconds(1);
delayMicroseconds(this->step_delay_);
}
delayMicroseconds(100); // Let value settle
@@ -69,6 +69,7 @@ void X9cOutput::dump_config() {
LOG_PIN(" Increment Pin: ", this->inc_pin_);
LOG_PIN(" Up/Down Pin: ", this->ud_pin_);
ESP_LOGCONFIG(TAG, " Initial Value: %f", this->initial_value_);
ESP_LOGCONFIG(TAG, " Step Delay: %d", this->step_delay_);
LOG_FLOAT_OUTPUT(this);
}

View File

@@ -13,6 +13,7 @@ class X9cOutput : public output::FloatOutput, public Component {
void set_inc_pin(InternalGPIOPin *pin) { inc_pin_ = pin; }
void set_ud_pin(InternalGPIOPin *pin) { ud_pin_ = pin; }
void set_initial_value(float initial_value) { initial_value_ = initial_value; }
void set_step_delay(int step_delay) { step_delay_ = step_delay; }
void setup() override;
void dump_config() override;
@@ -26,6 +27,7 @@ class X9cOutput : public output::FloatOutput, public Component {
InternalGPIOPin *ud_pin_;
float initial_value_;
float pot_value_;
int step_delay_;
};
} // namespace x9c

View File

@@ -1,6 +1,6 @@
"""Constants used by esphome."""
__version__ = "2024.6.0b1"
__version__ = "2024.6.0"
ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_"
VALID_SUBSTITUTIONS_CHARACTERS = (
@@ -784,6 +784,7 @@ CONF_STATIC_IP = "static_ip"
CONF_STATUS = "status"
CONF_STB_PIN = "stb_pin"
CONF_STEP = "step"
CONF_STEP_DELAY = "step_delay"
CONF_STEP_MODE = "step_mode"
CONF_STEP_PIN = "step_pin"
CONF_STOP = "stop"

View File

@@ -12,7 +12,7 @@ pyserial==3.5
platformio==6.1.15 # When updating platformio, also update Dockerfile
esptool==4.7.0
click==8.1.7
esphome-dashboard==20240429.1
esphome-dashboard==20240613.0
aioesphomeapi==24.3.0
zeroconf==0.132.2
python-magic==0.4.27

View File

@@ -1,6 +1,9 @@
substitutions:
network_enable_ipv6: "false"
wifi:
ssid: MySSID
password: password1
network:
enable_ipv6: true
enable_ipv6: ${network_enable_ipv6}

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1,4 @@
substitutions:
network_enable_ipv6: "true"
<<: !include common.yaml

View File

@@ -0,0 +1 @@
network:

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 4
ud_pin: 5
initial_value: 0.5
step_delay: 50

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 4
ud_pin: 5
initial_value: 0.5
step_delay: 50

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 14
ud_pin: 15
initial_value: 0.5
step_delay: 50

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 14
ud_pin: 15
initial_value: 0.5
step_delay: 50

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 14
ud_pin: 15
initial_value: 0.5
step_delay: 50

View File

@@ -5,3 +5,4 @@ output:
inc_pin: 4
ud_pin: 5
initial_value: 0.5
step_delay: 50