Fix output_power log strings, lint

This commit is contained in:
Otto Winter 2019-11-12 22:26:35 +01:00
parent 39a520f552
commit a386bb476f
No known key found for this signature in database
GPG Key ID: DB66C0BE6013F97E
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ void WiFiComponent::setup() {
if (this->has_sta()) { if (this->has_sta()) {
this->wifi_sta_pre_setup_(); this->wifi_sta_pre_setup_();
if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) { if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) {
ESP_LOGV(TAG, "Setting Power Save Option failed!"); ESP_LOGV(TAG, "Setting Output Power Option failed!");
} }
if (!this->wifi_apply_power_save_()) { if (!this->wifi_apply_power_save_()) {
@ -53,7 +53,7 @@ void WiFiComponent::setup() {
} else if (this->has_ap()) { } else if (this->has_ap()) {
this->setup_ap_config_(); this->setup_ap_config_();
if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) { if (this->output_power_.has_value() && !this->wifi_apply_output_power_(*this->output_power_)) {
ESP_LOGV(TAG, "Setting Power Save Option failed!"); ESP_LOGV(TAG, "Setting Output Power Option failed!");
} }
#ifdef USE_CAPTIVE_PORTAL #ifdef USE_CAPTIVE_PORTAL
if (captive_portal::global_captive_portal != nullptr) if (captive_portal::global_captive_portal != nullptr)

View File

@ -54,7 +54,7 @@ bool WiFiComponent::wifi_mode_(optional<bool> sta, optional<bool> ap) {
return ret; return ret;
} }
bool WiFiComponent::wifi_apply_output_power_(float output_power) { bool WiFiComponent::wifi_apply_output_power_(float output_power) {
int8_t val = static_cast<uint8_t>(output_power * 4); int8_t val = static_cast<int8_t>(output_power * 4);
return esp_wifi_set_max_tx_power(val) == ESP_OK; return esp_wifi_set_max_tx_power(val) == ESP_OK;
} }
bool WiFiComponent::wifi_sta_pre_setup_() { bool WiFiComponent::wifi_sta_pre_setup_() {