Metadata-Version: 2.1
Name: inventory-handler
Version: 1.0.1
Summary: Install service to create the inventory of the equipment
License: Closed
Author: EVTEC AG
Author-email: evtec@evtec.ch
Requires-Python: ==3.10.9
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Requires-Dist: aiofiles (==23.2.1)
Requires-Dist: dbus-next (==0.2.3)
Requires-Dist: jsonschema (==4.4.0)
Description-Content-Type: text/markdown

# Inventory Handler

The `inventory-handler` is a service designed to collect and maintain device-specific data. It ensures data validity, detects changes, and updates a persistent JSON inventory file accordingly.

## Features

- 🛠️ **Device Data Collection**: Gathers structured data related to device-specific properties.
- ✅ **Schema Validation**: Ensures all collected data conforms to a predefined [JSON Schema](https://json-schema.org/) before being stored.
- 📁 **Persistent Storage**: Data is written to or updated in: `/mnt/persistent-data/evtec-ecp-data/data/inventory.json`

- ⚙️ **Property-Specific Generators**: Each property is handled by a Generator class that:
- Computes or retrieves the current value.
- Optionally triggers **callbacks** when values change.

## Architecture

- Each data field in the inventory is managed by a dedicated **Generator**.
- Generators can define **on-change callbacks**, allowing custom reactions to specific value changes (e.g., logging, triggering external systems, or resetting cached data).
- The complete inventory is assembled from these generators and validated as a single document against the schema before being persisted.

## Use Cases

- Centralizing and persisting device identity and capabilities.
- Tracking configuration drift or hardware changes.
- Feeding consistent system metadata into monitoring, provisioning, or UI layers.

## File Structure

```text
├── inventory_handler
│   │   ├── InventoryController.py
│   │   ├── InventoryGenerators.py
│   │   ├── InventoryHandler.py
│   │   ├── InventoryRepository.py
│   │   ├── inventory_schema.json
│   │   ├── InventoryService.py
│   │   ├── InventoryTypes.py
│   │   ├── InventoryUtils.py
│   │   └── RaucSync.py
│   ├── inventory-handler.service
│   ├── poetry.lock
│   ├── pyproject.toml
│   ├── README.md
│   └── tests
│       ├── InventoryGenerators_test.py
│       ├── InventoryRepository_test.py
│       ├── InventoryService_test.py
│       └── RaucSync_test.py

```

## Rauc Sync
![alt text](RaucSync.svg)
