We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a430535 commit 89041f5Copy full SHA for 89041f5
example.py
@@ -16,11 +16,14 @@ async def main():
16
data = Luftdaten(155, loop, session)
17
await data.get_data()
18
19
- # Print the sensor values
20
- print("Sensor values:", data.values)
21
-
22
- # Print the coordinates fo the sensor
23
- print("Location:", data.meta['latitude'], data.meta['longitude'])
+ if data.values and data.meta:
+ # Print the sensor values
+ print("Sensor values:", data.values)
+
+ # Print the coordinates fo the sensor
24
+ print("Location:", data.meta['latitude'], data.meta['longitude'])
25
+ else:
26
+ print("Station is not available:", data.sensor_id)
27
28
29
loop = asyncio.get_event_loop()
0 commit comments