mirror of
https://github.com/esphome/esphome.git
synced 2025-11-03 00:21:56 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
59c192becc | ||
|
|
a800816750 | ||
|
|
99d9ab4e40 | ||
|
|
f310ca1b74 | ||
|
|
f763daa577 | ||
|
|
970563e07b | ||
|
|
e006045f59 | ||
|
|
fff3645901 | ||
|
|
a5383fd208 | ||
|
|
9ce3a2059f | ||
|
|
69e6cf2c0c | ||
|
|
28635124f9 | ||
|
|
035be87a83 | ||
|
|
e8bdbc45a9 | ||
|
|
429caccefa | ||
|
|
744ca1af7c | ||
|
|
106f0d611f | ||
|
|
d826416684 |
@@ -394,7 +394,7 @@ def command_update_all(args):
|
||||
import click
|
||||
|
||||
success = {}
|
||||
files = list_yaml_files(args.configuration)
|
||||
files = list_yaml_files(args.configuration[0])
|
||||
twidth = 60
|
||||
|
||||
def print_bar(middle_text):
|
||||
@@ -408,7 +408,7 @@ def command_update_all(args):
|
||||
print("-" * twidth)
|
||||
print()
|
||||
rc = run_external_process(
|
||||
"esphome", "--dashboard", "run", f, "--no-logs", "--device", "OTA"
|
||||
"esphome", "--dashboard", "run", "--no-logs", "--device", "OTA", f
|
||||
)
|
||||
if rc == 0:
|
||||
print_bar("[{}] {}".format(color(Fore.BOLD_GREEN, "SUCCESS"), f))
|
||||
@@ -504,6 +504,7 @@ def parse_args(argv):
|
||||
"version",
|
||||
"clean",
|
||||
"dashboard",
|
||||
"vscode",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -686,7 +687,7 @@ def run_esphome(argv):
|
||||
CORE.dashboard = args.dashboard
|
||||
|
||||
setup_log(args.verbose, args.quiet)
|
||||
if args.deprecated_argv_suggestion is not None:
|
||||
if args.deprecated_argv_suggestion is not None and args.command != "vscode":
|
||||
_LOGGER.warning(
|
||||
"Calling ESPHome with the configuration before the command is deprecated "
|
||||
"and will be removed in the future. "
|
||||
|
||||
@@ -91,7 +91,16 @@ bool ESP32BLE::ble_setup_() {
|
||||
}
|
||||
}
|
||||
|
||||
err = esp_ble_gap_set_device_name(App.get_name().c_str());
|
||||
std::string name = App.get_name();
|
||||
if (name.length() > 20) {
|
||||
if (App.is_name_add_mac_suffix_enabled()) {
|
||||
name.erase(name.begin() + 13, name.end() - 7); // Remove characters between 13 and the mac address
|
||||
} else {
|
||||
name = name.substr(0, 20);
|
||||
}
|
||||
}
|
||||
|
||||
err = esp_ble_gap_set_device_name(name.c_str());
|
||||
if (err != ESP_OK) {
|
||||
ESP_LOGE(TAG, "esp_ble_gap_set_device_name failed: %d", err);
|
||||
return false;
|
||||
|
||||
@@ -137,6 +137,18 @@ WIFI_NETWORK_STA = WIFI_NETWORK_BASE.extend(
|
||||
)
|
||||
|
||||
|
||||
def validate(config, item_config):
|
||||
if (
|
||||
(CONF_NETWORKS in item_config)
|
||||
and (item_config[CONF_NETWORKS] == [])
|
||||
and (CONF_AP not in item_config)
|
||||
):
|
||||
if "esp32_improv" not in config:
|
||||
raise ValueError(
|
||||
"Please specify at least an SSID or an Access Point to create."
|
||||
)
|
||||
|
||||
|
||||
def _validate(config):
|
||||
if CONF_PASSWORD in config and CONF_SSID not in config:
|
||||
raise cv.Invalid("Cannot have WiFi password without SSID!")
|
||||
@@ -157,9 +169,7 @@ def _validate(config):
|
||||
config[CONF_NETWORKS] = cv.ensure_list(WIFI_NETWORK_STA)(network)
|
||||
|
||||
if (CONF_NETWORKS not in config) and (CONF_AP not in config):
|
||||
raise cv.Invalid(
|
||||
"Please specify at least an SSID or an Access Point " "to create."
|
||||
)
|
||||
config[CONF_NETWORKS] = []
|
||||
|
||||
if config.get(CONF_FAST_CONNECT, False):
|
||||
networks = config.get(CONF_NETWORKS, [])
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
MAJOR_VERSION = 1
|
||||
MINOR_VERSION = 19
|
||||
PATCH_VERSION = "0b3"
|
||||
PATCH_VERSION = "0"
|
||||
__short_version__ = f"{MAJOR_VERSION}.{MINOR_VERSION}"
|
||||
__version__ = f"{__short_version__}.{PATCH_VERSION}"
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ namespace esphome {
|
||||
class Application {
|
||||
public:
|
||||
void pre_setup(const std::string &name, const char *compilation_time, bool name_add_mac_suffix) {
|
||||
this->name_add_mac_suffix_ = name_add_mac_suffix;
|
||||
if (name_add_mac_suffix) {
|
||||
this->name_ = name + "-" + get_mac_address().substr(6);
|
||||
} else {
|
||||
@@ -97,6 +98,8 @@ class Application {
|
||||
/// Get the name of this Application set by set_name().
|
||||
const std::string &get_name() const { return this->name_; }
|
||||
|
||||
bool is_name_add_mac_suffix_enabled() const { return this->name_add_mac_suffix_; }
|
||||
|
||||
const std::string &get_compilation_time() const { return this->compilation_time_; }
|
||||
|
||||
/** Set the target interval with which to run the loop() calls.
|
||||
@@ -245,6 +248,7 @@ class Application {
|
||||
|
||||
std::string name_;
|
||||
std::string compilation_time_;
|
||||
bool name_add_mac_suffix_;
|
||||
uint32_t last_loop_{0};
|
||||
uint32_t loop_interval_{16};
|
||||
int dump_config_at_{-1};
|
||||
|
||||
@@ -11,4 +11,4 @@ ifaddr==0.1.7
|
||||
platformio==5.1.1
|
||||
esptool==2.8
|
||||
click==7.1.2
|
||||
esphome-dashboard==20210611.0
|
||||
esphome-dashboard==20210615.0
|
||||
|
||||
Reference in New Issue
Block a user