plasticrake / tplink-smarthome-api

TP-Link Smarthome WiFi API
MIT License
1.02k stars 141 forks source link

feat(Client): add devicesUseDiscoveryPort to DiscoveryOptions #139

Closed plasticrake closed 2 years ago

plasticrake commented 2 years ago

TP-Link devices until now have responded to the discovery ping using port 9999. Newer devices and firmware are now responding back on a random port. The previous default would create device connections defauling to the port the devices responded from, which worked when they always used 9999. The new default behavior will always create devices using the default port of

  1. This option can be set to true to use the previous behavior.

Related plasticrake/homebridge-tplink-smarthome#244 Related plasticrake/homebridge-tplink-smarthome#250

codecov[bot] commented 2 years ago

Codecov Report

Merging #139 (95254bd) into master (6bd7a9e) will decrease coverage by 0.11%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #139      +/-   ##
==========================================
- Coverage   84.13%   84.02%   -0.12%     
==========================================
  Files          24       24              
  Lines        1229     1233       +4     
  Branches      291      295       +4     
==========================================
+ Hits         1034     1036       +2     
- Misses        115      116       +1     
- Partials       80       81       +1     
Impacted Files Coverage Δ
src/client.ts 83.58% <100.00%> (+0.34%) :arrow_up:
src/network/tcp-socket.ts 76.19% <0.00%> (-2.39%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6bd7a9e...95254bd. Read the comment docs.

simlu commented 1 year ago

This was a breaking change for me FYI.

Had to add devicesUseDiscoveryPort: true to get things working as expected again. I did not dig into this further.

Here is the pr in question https://github.com/blackflux/kasa-smart-hub/pull/37/files