semvec/pypi-packages huggingface dataset:
soil-power-sensor-protobuf 2.3.1
Python package for encoding/decoding measurement data from the Soil Power Sensor
Requires Python: >=3.11

# Soil Power Sensor Python Protobuf Bindings {#protobuf-python}

The soil power sensor protobuf protocol is implemented as a Python package that allows for `Measurement` messages to be decoded into a dictionary and `Response` messages to be encoded. The generated files from protobuf are also accessible for more complex use cases.


## Installation

Use the following to install the `soil-power-sensor-protobuf` package with `pip`:

```bash
pip install soil-power-sensor-protobuf
```

## Usage

The following example code demonstrates decoding the measurement message and encoding a response.

```python
from soil_power_sensor_protobuf import encode, decode

# get data encoded by the soil power sensor
data = ...

meas_dict = decode(data)

# process data
...

# send response
resp_str = encode(success=True)
```

The formatting of the dictionary depends on the type of measurement sent. The key `type` is included on all measurement types and can be used to determine the type of message. See the source `*.proto` files to get the full list of types to get the full list of types and keys. A list is provided in [Message Types](#message-types). The Python protobuf API uses camel case when naming keys. The key `ts` is in ISO 8601 format as a string.

## Message Types

Type `power`
```python
meas_dict = {
  "type": "power",
  "loggerId": ...,
  "cellId": ...,
  "ts": ...,
  "data": {
    "voltage": ...,
    "current": ...
  },
  "data_type": {
    "voltage": float,
    "voltage": float
  }
}
```

Type `teros12`
```python
meas_dict = {
  "type": "teros12",
  "loggerId": ...,
  "cellId": ...,
  "ts": ...,
  "data": {
    "vwcRaw": ...,
    "vwcAdj": ...,
    "temp": ...,
    "ec": ...
  },
  "data_type": {
    "vwcRaw": float,
    "vwcAdj": float,
    "temp": float,
    "ec": int
  }
}
```

Type `bme280` with `raw=True` (default)
```python
meas_dict = {
  "type": "bme280",
  "loggerId": ...,
  "cellId": ...,
  "ts": ...,
  "data": {
    "pressure": ...,
    "temperature": ...,
    "humidity": ...,
  },
  "data_type": {
    "pressure": int,
    "temperature": int,
    "humidity": int, 
  }
}
```

Type `bme280` with `raw=False`
```python
meas_dict = {
  "type": "bme280",
  "loggerId": ...,
  "cellId": ...,
  "ts": ...,
  "data": {
    "pressure": ...,
    "temperature": ...,
    "humidity": ...,
  },
  "data_type": {
    "pressure": float,
    "temperature": float,
    "humidity": float, 
  }
}
```



## Testing

To run the package tests, create a virtual environment, install as an editable package, and run `unittest`.

```bash
python -m venv .venv
source .venv/bin/activate
pip install -e .
python -m unittest
```
pandora-avatar 0.0.11
Avatar is a scalable multi-platform Bluetooth testing tool capable of running
Requires Python: >=3.8

# Avatar

Avatar is a python Bluetooth testing tool orchestrating multiple devices which
implement the [Pandora interfaces](
https://github.com/google/bt-test-interfaces).

## Install

```bash
python -m venv venv
source venv/bin/activate.fish # or any other shell
pip install [-e] .
```

## Usage

```bash
python cases/host_test.py -c cases/config.yml --verbose
```

## Specify a test bed
```bash
python cases/host_test.py -c cases/config.yml --test_bed bumble.bumbles --verbose
```

## Development

1. Make sure to have a `root-canal` instance running somewhere.
   ```bash
   root-canal
   ```

1. Run the example using Bumble vs Bumble config file. The default `6402` HCI
   port of `root-canal` may be changed in this config file.
   ```
   python cases/host_test.py -c cases/config.yml --verbose
   ```

1. Lint with `pyright` and `mypy`
   ```
   pyright
   mypy
   ```

1. Format & imports style
   ```
   black avatar/ cases/
   isort avatar/ cases/
   ```