mirror of
https://github.com/esphome/esphome.git
synced 2025-09-03 03:42:20 +01:00
Add wifi output_power setting (#853)
* Add wifi output_power setting
See also:
- https://github.com/esphome/feature-requests/issues/471#issuecomment-552350467
- https://github.com/esp8266/Arduino/issues/6366
- https://github.com/esp8266/Arduino/issues/6471
- 849f8cf920/code/espurna/config/general.h (L593-L599)
- https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/network/esp_wifi.html#_CPPv425esp_wifi_set_max_tx_power6int8_t
* Lint
This commit is contained in:
@@ -36,6 +36,9 @@ void WiFiComponent::setup() {
|
||||
|
||||
if (this->has_sta()) {
|
||||
this->wifi_sta_pre_setup_();
|
||||
if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) {
|
||||
ESP_LOGV(TAG, "Setting Power Save Option failed!");
|
||||
}
|
||||
|
||||
if (!this->wifi_apply_power_save_()) {
|
||||
ESP_LOGV(TAG, "Setting Power Save Option failed!");
|
||||
@@ -49,6 +52,9 @@ void WiFiComponent::setup() {
|
||||
}
|
||||
} else if (this->has_ap()) {
|
||||
this->setup_ap_config_();
|
||||
if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) {
|
||||
ESP_LOGV(TAG, "Setting Power Save Option failed!");
|
||||
}
|
||||
#ifdef USE_CAPTIVE_PORTAL
|
||||
if (captive_portal::global_captive_portal != nullptr)
|
||||
captive_portal::global_captive_portal->start();
|
||||
|
Reference in New Issue
Block a user