Metadata-Version: 2.4
Name: tangods-mcmax
Version: 1.1.0
Summary: A tango device server to control the microcontrollers in the project MC-MAX
Author-email: Antonio Bartalesi <antonio.bartalesi@gmail.com>, Laura Torres Garcia <lautg88@gmail.com>
Project-URL: repository, https://gitlab.com/ABartalesi/mc-max-tango-device-server
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytango>=9.5
Requires-Dist: paho-mqtt>=2.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Dynamic: license-file

# Tango Device Server for the MC-MAX project

[![pipeline status](https://gitlab.com/ABartalesi/mc-max-tango-device-server/badges/main/pipeline.svg)](https://gitlab.com/ABartalesi/mc-max-tango-device-server/-/pipelines)
[![coverage report](https://gitlab.com/ABartalesi/mc-max-tango-device-server/badges/main/coverage.svg)](https://gitlab.com/ABartalesi/mc-max-tango-device-server/-/pipelines)
[![PyPI](https://img.shields.io/pypi/v/tangods-mcmax)](https://pypi.org/project/tangods-mcmax/)
[![Python](https://img.shields.io/pypi/pyversions/tangods-mcmax)](https://pypi.org/project/tangods-mcmax/)
[![License](https://img.shields.io/badge/license-GPLv3%2B-blue)](LICENSE)

This tango device server connects to an mqtt broker using the paho-mqtt library
and upon success reads the esp-32 self description topic, and starts a tango
device with dynamic attributes and commands.

One device serves one microcontroller. The attributes and commands are not
declared here: they are built at runtime from the JSON self-description the
microcontroller publishes, so a firmware change is enough to change the Tango
interface. See [`specs/README.md`](specs/README.md) for the MQTT contract.

## Properties

Name | Description
---- | ----
`broker` | A string, URI of the mqtt broker
`username` | The username for the mqtt broker connection
`password` | The password for the mqtt broker connection
`mqtt_name` | The name of the microcontroller in the mqtt topic tree. Usually it's the hostname of the microcontroller (without domain).

## Development

```bash
python -m venv .venv
.venv/bin/pip install -e ".[test]"
.venv/bin/pytest --cov=mcmax --cov-report=term-missing
```

Style and typing are enforced by [pre-commit](https://pre-commit.com)
(ruff and mypy); CI runs the same hooks:

```bash
pre-commit install
pre-commit run --all
```
