99SENSOR_ID = 1
1010
1111RESPONSE_VALID = [
12- {
13- "sensor" : {
14- "sensor_type" : {
15- "manufacturer" : "various" ,
16- "name" : "DHT22" ,
17- "id" : 9
18- },
19- "pin" : "7" ,
20- "id" : 152
12+ {
13+ "sensor" : {
14+ "sensor_type" : {"manufacturer" : "various" , "name" : "DHT22" , "id" : 9 },
15+ "pin" : "7" ,
16+ "id" : 152 ,
17+ },
18+ "timestamp" : "2021-11-07 11:16:45" ,
19+ "sampling_rate" : None ,
20+ "sensordatavalues" : [
21+ {"value" : "10.50" , "id" : 16932663249 , "value_type" : "temperature" },
22+ {"value" : "79.30" , "id" : 16932663267 , "value_type" : "humidity" },
23+ ],
24+ "id" : 7706863277 ,
25+ "location" : {
26+ "country" : "DE" ,
27+ "latitude" : "48.792" ,
28+ "exact_location" : 0 ,
29+ "altitude" : "326.9" ,
30+ "longitude" : "9.164" ,
31+ "indoor" : 0 ,
32+ "id" : 68 ,
33+ },
2134 },
22- "timestamp" : "2021-11-07 11:16:45" ,
23- "sampling_rate" : None ,
24- "sensordatavalues" : [
25- {
26- "value" : "10.50" ,
27- "id" : 16932663249 ,
28- "value_type" : "temperature"
29- },
30- {
31- "value" : "79.30" ,
32- "id" : 16932663267 ,
33- "value_type" : "humidity"
34- }
35- ],
36- "id" : 7706863277 ,
37- "location" : {
38- "country" : "DE" ,
39- "latitude" : "48.792" ,
40- "exact_location" : 0 ,
41- "altitude" : "326.9" ,
42- "longitude" : "9.164" ,
43- "indoor" : 0 ,
44- "id" : 68
45- }
46- },
47- {
48- "sensor" : {
49- "sensor_type" : {
50- "manufacturer" : "various" ,
51- "name" : "DHT22" ,
52- "id" : 9
53- },
54- "pin" : "7" ,
55- "id" : 152
35+ {
36+ "sensor" : {
37+ "sensor_type" : {"manufacturer" : "various" , "name" : "DHT22" , "id" : 9 },
38+ "pin" : "7" ,
39+ "id" : 152 ,
40+ },
41+ "timestamp" : "2021-11-07 11:14:13" ,
42+ "sampling_rate" : None ,
43+ "sensordatavalues" : [
44+ {"value" : "10.50" , "id" : 16932614294 , "value_type" : "temperature" },
45+ {"value" : "80.60" , "id" : 16932614337 , "value_type" : "humidity" },
46+ ],
47+ "id" : 7706841422 ,
48+ "location" : {
49+ "country" : "DE" ,
50+ "latitude" : "48.792" ,
51+ "exact_location" : 0 ,
52+ "altitude" : "326.9" ,
53+ "longitude" : "9.164" ,
54+ "indoor" : 0 ,
55+ "id" : 68 ,
56+ },
5657 },
57- "timestamp" : "2021-11-07 11:14:13" ,
58- "sampling_rate" : None ,
59- "sensordatavalues" : [
60- {
61- "value" : "10.50" ,
62- "id" : 16932614294 ,
63- "value_type" : "temperature"
64- },
65- {
66- "value" : "80.60" ,
67- "id" : 16932614337 ,
68- "value_type" : "humidity"
69- }
70- ],
71- "id" : 7706841422 ,
72- "location" : {
73- "country" : "DE" ,
74- "latitude" : "48.792" ,
75- "exact_location" : 0 ,
76- "altitude" : "326.9" ,
77- "longitude" : "9.164" ,
78- "indoor" : 0 ,
79- "id" : 68
80- }
81- }
8258]
8359
8460
@@ -90,7 +66,8 @@ async def test_sensor_values(httpx_mock: HTTPXMock):
9066 client = Luftdaten (SENSOR_ID )
9167 await client .get_data ()
9268
93- assert client .values == {'temperature' : 10.5 , 'humidity' : 79.3 }
69+ assert client .values == {"temperature" : 10.5 , "humidity" : 79.3 }
70+
9471
9572@pytest .mark .asyncio
9673async def test_meta (httpx_mock : HTTPXMock ):
0 commit comments