forked from esphome/esphome
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ESP32 Upgrade AsyncTCP to 1.1.1 (esphome#773)
- Loading branch information
1 parent
8021464
commit 9f4b666
Showing
1 changed file
with
12 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,23 @@ | ||
# Dummy integration to allow relying on AsyncTCP | ||
from esphome.core import CORE, coroutine_with_priority | ||
import esphome.codegen as cg | ||
from esphome.const import ARDUINO_VERSION_ESP32_1_0_0, ARDUINO_VERSION_ESP32_1_0_1, \ | ||
ARDUINO_VERSION_ESP32_1_0_2 | ||
from esphome.core import CORE, coroutine_with_priority | ||
|
||
|
||
@coroutine_with_priority(200.0) | ||
def to_code(config): | ||
if CORE.is_esp32: | ||
# https://github.com/me-no-dev/AsyncTCP/blob/master/library.json | ||
cg.add_library('AsyncTCP', '1.0.3') | ||
versions_requiring_older_asynctcp = [ | ||
ARDUINO_VERSION_ESP32_1_0_0, | ||
ARDUINO_VERSION_ESP32_1_0_1, | ||
ARDUINO_VERSION_ESP32_1_0_2, | ||
] | ||
if CORE.arduino_version in versions_requiring_older_asynctcp: | ||
cg.add_library('AsyncTCP', '1.0.3') | ||
else: | ||
cg.add_library('AsyncTCP', '1.1.1') | ||
elif CORE.is_esp8266: | ||
# https://github.com/OttoWinter/ESPAsyncTCP | ||
cg.add_library('ESPAsyncTCP-esphome', '1.2.2') |