Metadata-Version: 2.4
Name: girouettes
Version: 0.2.0
Summary: Pilotage de girouettes LED Hanover et Mobitec via une API Python unifiee.
Project-URL: Homepage, https://github.com/Ymo90/girouettes
Project-URL: Repository, https://github.com/Ymo90/girouettes
Keywords: rs485,hanover,mobitec,led,girouette
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: System :: Hardware
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: pyserial
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"

# test_girouette

Projet Python pour piloter des girouettes LED Hanover et Mobitec avec une API unifiee en francais.

## Structure

- girouette/
  - __init__.py
  - erreurs.py
  - hanover.py
  - mobitec.py
  - generique.py
- tests/
  - conftest.py
  - test_hanover.py
  - test_mobitec.py
  - test_generique.py
- examples/
  - demo_generique.py
  - demo_horloge.py
  - demo_lecture_texte.py
  - demo_lecture_continue.py
- docs/
  - guide_debutant.md
  - guide_superx_1_3.pdf
  - hanover_communication_protocol.txt
  - hanover_communications_protocol_0_14.pdf
  - mobitec_protocol.md
  - superx.txt

## Installation

1. Creer et activer un environnement virtuel Python.
2. Installer les dependances d'execution:

```bash
pip install -r requirements.txt
```

3. (Optionnel) Installer aussi les dependances de developpement/tests:

```bash
pip install -r requirements-dev.txt
```

## Lancer les tests

```bash
pytest -q tests/test_hanover.py tests/test_mobitec.py tests/test_generique.py
```

## Lancer les exemples

Exemple principal (API unifiee):

```bash
python examples/demo_generique.py
```

Exemple horloge:

```bash
python examples/demo_horloge.py
```

Exemple lecture/affichage d'un texte:

```bash
python examples/demo_lecture_texte.py "Prochain depart 12:05"
```

Exemple lecture continue (mise a jour a chaque saisie):

```bash
python examples/demo_lecture_continue.py
```

## Utilisation rapide

```python
from girouette.generique import GirouetteGenerique

with GirouetteGenerique(
    port="COM5",
    type_backend="hanover",  # ou "mobitec"
    adresse=2,
    vitesse=4800,
) as g:
    g.afficher_texte("BONJOUR", alignement_h="centre")
```

Acces direct backend Hanover (avance):

```python
from girouette.hanover import GirouetteHanover

with GirouetteHanover("COM5", adresse=2) as g:
  g.afficher("LIGNE 42")
```

Acces direct backend Mobitec (avance):

```python
from girouette.mobitec import GirouetteMobitec, Police, AlignementHorizontal

with GirouetteMobitec("COM5") as g:
  g.display_text("LIGNE 42", alignment=AlignementHorizontal.CENTRE, font=Police.MOYENNE_13PX)
```

## Notes

- L'API debutant commune expose: afficher_texte, afficher_deux_lignes, afficher_defilant, effacer, regler_luminosite, lire_statut.
- Certaines fonctions dependent du backend materiel. Si une fonction n'est pas supportee, une exception explicite est levee.
- Pour afficher_defilant, la semantique de vitesse differe selon le backend: Mobitec accepte un delai float (ex. 0.08), alors que Hanover n'applique qu'un parametre entier >= 1.
- Cote Mobitec, les enums francais sont disponibles: `Police`, `AlignementHorizontal`.
- Les anciens noms anglais restent valides pour compatibilite: `Font`, `Alignment`.

## Mobitec avance (noms francais)

En acces direct backend Mobitec, privilegier les methodes francaises:

- afficher_multiligne(...)
- afficher_pixels(...)
- afficher_clignotant(...)
- afficher_machine_a_ecrire(...)
- arreter_animation()

Les noms anglais historiques sont conserves pour retrocompatibilite
(display_multiline, display_pixel_art, display_blinking, display_typewriter,
stop_current_animation).

