#!/usr/bin/env python3
"""Cariflex - Create FlexMeasures assets via API client."""

import time
from flexmeasures_client import FlexMeasuresClient

# Connect to FlexMeasures
client = FlexMeasuresClient(
    email="admin@digitribe.fr",
    password="Digitribe972",
    host="flexmeasures.digitribe.fr",
    ssl=True,
    request_timeout=60.0
)

print("✅ Connected to FlexMeasures")

# Get access token
token = client.access_token
print(f"🔑 Token: {token[:20]}...")

# Check existing assets
try:
    assets = client.get_assets()
    print(f"📦 Existing assets: {len(assets)}")
    for a in assets[:5]:
        print(f"  - {a}")
except Exception as e:
    print(f"Error getting assets: {e}")
