# WindShape Software Suite SDK

## Installation

```bash
uv add windsuite_sdk

# Legacy pip method
pip install windsuite_sdk
```


## Basic Example

```python
import os
import threading

from dotenv import load_dotenv
from windsuite_sdk import WindsuiteSDK

load_dotenv()

SERVER_IP_ADDRESS = os.getenv("SERVER_IP_ADDRESS", default="localhost")

stop_event = threading.Event()


def main() -> None:
    base_url = f"http://{SERVER_IP_ADDRESS}"

    print(f"Connecting to WindSuite server at {base_url}")

    sdk = WindsuiteSDK(base_url=base_url)
    sdk.start_communication()

    main_loop_hz = 25

    try:
        sdk.set_psu(state=True)
        stop_event.wait(timeout=2)

        sdk.fan_controller.set_intensity(percent=10).apply()

        while not stop_event.wait(timeout=(1.0 / main_loop_hz)):
            # ! DO WHATEVER
            pass

    except KeyboardInterrupt:
        print("\nShutting down...")
        stop_event.set()
    finally:
        sdk.fan_controller.set_intensity(0).apply()
        sdk.cleanup()
        print("SDK stopped")


if __name__ == "__main__":
    main()
```
