mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-06 10:44:04 +00:00
Switch from TPLinkSmartHomeProtocol to IotProtocol/XorTransport (#710)
* Switch from TPLinkSmartHomeProtocol to IotProtocol/XorTransport * Add test * Update docs * Fix ruff deleting deprecated import
This commit is contained in:
@@ -9,7 +9,7 @@ import dpkt
|
||||
from dpkt.ethernet import ETH_TYPE_IP, Ethernet
|
||||
|
||||
from kasa.cli import echo
|
||||
from kasa.protocol import TPLinkSmartHomeProtocol
|
||||
from kasa.xortransport import XorEncryption
|
||||
|
||||
|
||||
def read_payloads_from_file(file):
|
||||
@@ -34,7 +34,7 @@ def read_payloads_from_file(file):
|
||||
data = transport.data
|
||||
|
||||
try:
|
||||
decrypted = TPLinkSmartHomeProtocol.decrypt(data[4:])
|
||||
decrypted = XorEncryption.decrypt(data[4:])
|
||||
except Exception as ex:
|
||||
echo(f"[red]Unable to decrypt the data, ignoring: {ex}[/red]")
|
||||
continue
|
||||
|
Reference in New Issue
Block a user