mirror of
https://github.com/Ladebeze66/tuya_project.git
synced 2025-12-13 09:06:54 +01:00
23 lines
631 B
Python
23 lines
631 B
Python
import tinytuya
|
|
|
|
# Créer un objet Cloud avec vos identifiants
|
|
cloud = tinytuya.Cloud(
|
|
apiRegion="eu", # 'eu', 'us', 'cn', selon ton projet
|
|
apiKey="fdjdjurkm34yyjp77c7d",
|
|
apiSecret="3e71807fb0c6406792bdf4f07f98e577"
|
|
)
|
|
|
|
# Scanner les appareils
|
|
print("🔍 Recherche de vos appareils connectés...")
|
|
|
|
devices = cloud.getdevices()
|
|
|
|
# Afficher tous les appareils trouvés
|
|
for device in devices:
|
|
print("="*40)
|
|
print(f"Nom : {device['name']}")
|
|
print(f"ID : {device['id']}")
|
|
print(f"IP : {device.get('ip', 'N/A')}")
|
|
print(f"LocalKey : {device.get('local_key', 'N/A')}")
|
|
print("="*40)
|