first commit

This commit is contained in:
Souti
2025-03-06 11:09:58 +01:00
commit 11f7d440ff
330 changed files with 38306 additions and 0 deletions

31
tuya/Victron.py Normal file
View File

@@ -0,0 +1,31 @@
import requests
import json
import prettytable as pt
# URL de l'API
url = "http://192.168.1.49/getVictron"
# Faire la requete GET
response = requests.get(url)
# Verifier que la requete a reussi
if response.status_code == 200:
# Charger le JSON recu
data = response.json()
# Creer un tableau PrettyTable
table = pt.PrettyTable()
table.field_names = ["ID", "Key Label", "Label", "Value"]
# Ajouter les lignes au tableau
for item in data:
table.add_row([
item.get("id", "N/A"),
item.get("key_label", "N/A"),
item.get("label", "N/A"),
item.get("value", "N/A")
])
# Afficher le tableau
print(table)