mirror of
https://github.com/esphome/esphome.git
synced 2025-09-12 00:02:21 +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:
@@ -390,6 +390,11 @@ void WiFiComponent::wifi_event_callback(System_Event_t *event) {
|
||||
WiFiMockClass::_event_callback(event);
|
||||
}
|
||||
|
||||
bool WiFiComponent::wifi_apply_output_power_(float output_power) {
|
||||
uint8_t val = static_cast<uint8_t>(output_power * 4);
|
||||
system_phy_set_max_tpw(val);
|
||||
return true;
|
||||
}
|
||||
bool WiFiComponent::wifi_sta_pre_setup_() {
|
||||
if (!this->wifi_mode_(true, {}))
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user