fix: remove truncate - nesting breaks the layout

pull/5471/head
Jason Stirnaman 2024-05-15 11:21:48 -05:00
parent f98a7dbb2c
commit aa51867486
1 changed files with 4 additions and 8 deletions

View File

@ -347,8 +347,6 @@ Add the `/api/devices` API endpoint that retrieves, processes, and lists registe
In `./api/devices.py`, add the following:
{{% truncate %}}
```python
def get_device(device_id=None) -> {}:
influxdb_client = InfluxDBClient(url=config.get('APP', 'INFLUX_URL'),
@ -381,14 +379,12 @@ Add the `/api/devices` API endpoint that retrieves, processes, and lists registe
return result
```
{{% /truncate %}}
{{% caption %}}[iot-api-python/api/devices.py get_device()](https://github.com/influxdata/iot-api-python/blob/9bf44a659424a27eb937d545dc0455754354aef5/api/devices.py#L30){{% /caption %}}
{{% caption %}}[iot-api-python/api/devices.py get_device()](https://github.com/influxdata/iot-api-python/blob/9bf44a659424a27eb937d545dc0455754354aef5/api/devices.py#L30){{% /caption %}}
The `get_device(device_id)` function does the following:
The `get_device(device_id)` function does the following:
1. Instantiates a `QueryApi` client and sends the Flux query to InfluxDB.
2. Iterates over the `FluxTable` in the response and returns a list of tuples.
1. Instantiates a `QueryApi` client and sends the Flux query to InfluxDB.
2. Iterates over the `FluxTable` in the response and returns a list of tuples.
## Create IoT virtual device