esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
411 stars 26 forks source link

Add http_request support to LibreTiny platform #2416

Open ghost58400 opened 11 months ago

ghost58400 commented 11 months ago

Describe the problem you have/What new integration you would like

Add http_request support to LibreTiny platform, in the same way as esp8266

Please describe your use case for this integration and alternatives you've tried:

Make any http request with a LibreTiny device

Additional context

Since LibreTiny support was added to ESPHome on 2023.9, I would like to use the http_request component on a LibreTiny device. The HTTPClient library is implemented on LibreTiny : https://docs.libretiny.eu/ltapi/class_h_t_t_p_client/ Since the arduino esp32 implementation of http_request uses the Arduino HTTPClient library too, is it as simple as adding the LibreTiny platform to init.py ?

Lalessus commented 10 months ago

Seria interessante usar http_request no libretiny.

tiltec commented 9 months ago

I managed to get http_request working on bk72xx with the help of some very nice people in the libretiny discord and a pile of hacks. Let's see if this can somehow be made into pull request(s)...

https://github.com/esphome/esphome/compare/dev...tiltec:esphome:dev https://github.com/tiltec/libretiny/commit/22d68683aebf95a5a614ce7149aafc19ee4730ff

Libretiny seems to need some fiddling to get mbedtlsclient working nicely, my changes above cripple it a bit (but it should be fine if you use http only, or maybe just no cookies).