@golemio/microclimate 1.2.8-dev.1384166512 → 1.2.8-dev.1561229684

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,56 +1,56 @@
1
- drop VIEW v_sensor_points;
2
-
3
- ALTER TABLE sensor_devices_import
4
- ALTER COLUMN lat TYPE float4,
5
- ALTER COLUMN lng TYPE float4;
6
-
7
- CREATE OR REPLACE VIEW v_sensor_points
8
- AS SELECT DISTINCT s.point_id,
9
- s.point_name,
10
- s.location_id,
11
- s.location,
12
- s.loc_description,
13
- s.loc_orientation,
14
- s.loc_surface,
15
- s.lat,
16
- s.lng,
17
- NULL::text AS x_jtsk,
18
- NULL::text AS y_jtsk,
19
- NULL::text AS elevation_m,
20
- s.sensor_position,
21
- s.sensor_position_detail,
22
- concat(unpivot.measure, unpivot.height_cm) AS measure,
23
- CASE
24
- WHEN unpivot.measure = 'air_temp'::text THEN 'Teplota vzduchu'::text
25
- WHEN unpivot.measure = 'air_hum'::text THEN 'Vlhkost vzduchu'::text
26
- WHEN unpivot.measure = 'pressure'::text THEN 'Atmosférický tlak'::text
27
- WHEN unpivot.measure = 'wind_dir'::text THEN 'Směr větru'::text
28
- WHEN unpivot.measure = 'wind_impact'::text THEN 'Náraz větru'::text
29
- WHEN unpivot.measure = 'wind_speed'::text THEN 'Rychlost větru'::text
30
- WHEN unpivot.measure = 'precip'::text THEN 'Úhrn srážek'::text
31
- WHEN unpivot.measure = 'sun_irr'::text THEN 'Sluneční záření'::text
32
- WHEN unpivot.measure = 'soil_temp'::text THEN 'Teplota půdy'::text
33
- WHEN unpivot.measure = 'water_pot'::text THEN 'Vodní potenciál půdy'::text
34
- WHEN unpivot.measure = 'dendro_circ'::text THEN 'Obvod stromu'::text
35
- WHEN unpivot.measure = 'dendro_gain'::text THEN 'Přírůstek obvodu stromu'::text
36
- ELSE NULL::text
37
- END AS measure_cz,
38
- CASE
39
- WHEN unpivot.measure = 'air_temp'::text THEN '°C'::text
40
- WHEN unpivot.measure = 'air_hum'::text THEN '%'::text
41
- WHEN unpivot.measure = 'pressure'::text THEN 'Pa'::text
42
- WHEN unpivot.measure = 'wind_dir'::text THEN '°'::text
43
- WHEN unpivot.measure = 'wind_impact'::text THEN 'km/h'::text
44
- WHEN unpivot.measure = 'wind_speed'::text THEN 'km/h'::text
45
- WHEN unpivot.measure = 'precip'::text THEN 'mm'::text
46
- WHEN unpivot.measure = 'sun_irr'::text THEN 'lux'::text
47
- WHEN unpivot.measure = 'soil_temp'::text THEN '°C'::text
48
- WHEN unpivot.measure = 'water_pot'::text THEN 'kPa'::text
49
- WHEN unpivot.measure = 'dendro_circ'::text THEN 'mm'::text
50
- WHEN unpivot.measure = 'dendro_gain'::text THEN 'µm'::text
51
- ELSE NULL::text
52
- END AS unit
53
- FROM microclimate.sensor_devices_import s,
54
- LATERAL ( VALUES ('air_temp'::text,s.air_temp), ('air_hum'::text,s.air_hum), ('pressure'::text,s.pressure), ('wind_dir'::text,s.wind_dir), ('wind_impact'::text,s.wind_impact), ('wind_speed'::text,s.wind_speed), ('precip'::text,s.precip), ('sun_irr'::text,s.sun_irr), ('soil_temp'::text,s.soil_temp), ('water_pot'::text,s.water_pot), ('dendro_circ'::text,s.dendro_circ), ('dendro_gain'::text,s.dendro_gain)) unpivot(measure, height_cm)
55
- WHERE unpivot.height_cm IS NOT NULL
56
- ORDER BY s.point_id;
1
+ drop VIEW v_sensor_points;
2
+
3
+ ALTER TABLE sensor_devices_import
4
+ ALTER COLUMN lat TYPE float4,
5
+ ALTER COLUMN lng TYPE float4;
6
+
7
+ CREATE OR REPLACE VIEW v_sensor_points
8
+ AS SELECT DISTINCT s.point_id,
9
+ s.point_name,
10
+ s.location_id,
11
+ s.location,
12
+ s.loc_description,
13
+ s.loc_orientation,
14
+ s.loc_surface,
15
+ s.lat,
16
+ s.lng,
17
+ NULL::text AS x_jtsk,
18
+ NULL::text AS y_jtsk,
19
+ NULL::text AS elevation_m,
20
+ s.sensor_position,
21
+ s.sensor_position_detail,
22
+ concat(unpivot.measure, unpivot.height_cm) AS measure,
23
+ CASE
24
+ WHEN unpivot.measure = 'air_temp'::text THEN 'Teplota vzduchu'::text
25
+ WHEN unpivot.measure = 'air_hum'::text THEN 'Vlhkost vzduchu'::text
26
+ WHEN unpivot.measure = 'pressure'::text THEN 'Atmosférický tlak'::text
27
+ WHEN unpivot.measure = 'wind_dir'::text THEN 'Směr větru'::text
28
+ WHEN unpivot.measure = 'wind_impact'::text THEN 'Náraz větru'::text
29
+ WHEN unpivot.measure = 'wind_speed'::text THEN 'Rychlost větru'::text
30
+ WHEN unpivot.measure = 'precip'::text THEN 'Úhrn srážek'::text
31
+ WHEN unpivot.measure = 'sun_irr'::text THEN 'Sluneční záření'::text
32
+ WHEN unpivot.measure = 'soil_temp'::text THEN 'Teplota půdy'::text
33
+ WHEN unpivot.measure = 'water_pot'::text THEN 'Vodní potenciál půdy'::text
34
+ WHEN unpivot.measure = 'dendro_circ'::text THEN 'Obvod stromu'::text
35
+ WHEN unpivot.measure = 'dendro_gain'::text THEN 'Přírůstek obvodu stromu'::text
36
+ ELSE NULL::text
37
+ END AS measure_cz,
38
+ CASE
39
+ WHEN unpivot.measure = 'air_temp'::text THEN '°C'::text
40
+ WHEN unpivot.measure = 'air_hum'::text THEN '%'::text
41
+ WHEN unpivot.measure = 'pressure'::text THEN 'Pa'::text
42
+ WHEN unpivot.measure = 'wind_dir'::text THEN '°'::text
43
+ WHEN unpivot.measure = 'wind_impact'::text THEN 'km/h'::text
44
+ WHEN unpivot.measure = 'wind_speed'::text THEN 'km/h'::text
45
+ WHEN unpivot.measure = 'precip'::text THEN 'mm'::text
46
+ WHEN unpivot.measure = 'sun_irr'::text THEN 'lux'::text
47
+ WHEN unpivot.measure = 'soil_temp'::text THEN '°C'::text
48
+ WHEN unpivot.measure = 'water_pot'::text THEN 'kPa'::text
49
+ WHEN unpivot.measure = 'dendro_circ'::text THEN 'mm'::text
50
+ WHEN unpivot.measure = 'dendro_gain'::text THEN 'µm'::text
51
+ ELSE NULL::text
52
+ END AS unit
53
+ FROM microclimate.sensor_devices_import s,
54
+ LATERAL ( VALUES ('air_temp'::text,s.air_temp), ('air_hum'::text,s.air_hum), ('pressure'::text,s.pressure), ('wind_dir'::text,s.wind_dir), ('wind_impact'::text,s.wind_impact), ('wind_speed'::text,s.wind_speed), ('precip'::text,s.precip), ('sun_irr'::text,s.sun_irr), ('soil_temp'::text,s.soil_temp), ('water_pot'::text,s.water_pot), ('dendro_circ'::text,s.dendro_circ), ('dendro_gain'::text,s.dendro_gain)) unpivot(measure, height_cm)
55
+ WHERE unpivot.height_cm IS NOT NULL
56
+ ORDER BY s.point_id;
@@ -1,56 +1,56 @@
1
- drop VIEW v_sensor_points;
2
-
3
- ALTER TABLE sensor_devices_import
4
- ALTER COLUMN lat TYPE float8,
5
- ALTER COLUMN lng TYPE float8;
6
-
7
- CREATE OR REPLACE VIEW v_sensor_points
8
- AS SELECT DISTINCT s.point_id,
9
- s.point_name,
10
- s.location_id,
11
- s.location,
12
- s.loc_description,
13
- s.loc_orientation,
14
- s.loc_surface,
15
- s.lat,
16
- s.lng,
17
- NULL::text AS x_jtsk,
18
- NULL::text AS y_jtsk,
19
- NULL::text AS elevation_m,
20
- s.sensor_position,
21
- s.sensor_position_detail,
22
- concat(unpivot.measure, unpivot.height_cm) AS measure,
23
- CASE
24
- WHEN unpivot.measure = 'air_temp'::text THEN 'Teplota vzduchu'::text
25
- WHEN unpivot.measure = 'air_hum'::text THEN 'Vlhkost vzduchu'::text
26
- WHEN unpivot.measure = 'pressure'::text THEN 'Atmosférický tlak'::text
27
- WHEN unpivot.measure = 'wind_dir'::text THEN 'Směr větru'::text
28
- WHEN unpivot.measure = 'wind_impact'::text THEN 'Náraz větru'::text
29
- WHEN unpivot.measure = 'wind_speed'::text THEN 'Rychlost větru'::text
30
- WHEN unpivot.measure = 'precip'::text THEN 'Úhrn srážek'::text
31
- WHEN unpivot.measure = 'sun_irr'::text THEN 'Sluneční záření'::text
32
- WHEN unpivot.measure = 'soil_temp'::text THEN 'Teplota půdy'::text
33
- WHEN unpivot.measure = 'water_pot'::text THEN 'Vodní potenciál půdy'::text
34
- WHEN unpivot.measure = 'dendro_circ'::text THEN 'Obvod stromu'::text
35
- WHEN unpivot.measure = 'dendro_gain'::text THEN 'Přírůstek obvodu stromu'::text
36
- ELSE NULL::text
37
- END AS measure_cz,
38
- CASE
39
- WHEN unpivot.measure = 'air_temp'::text THEN '°C'::text
40
- WHEN unpivot.measure = 'air_hum'::text THEN '%'::text
41
- WHEN unpivot.measure = 'pressure'::text THEN 'Pa'::text
42
- WHEN unpivot.measure = 'wind_dir'::text THEN '°'::text
43
- WHEN unpivot.measure = 'wind_impact'::text THEN 'km/h'::text
44
- WHEN unpivot.measure = 'wind_speed'::text THEN 'km/h'::text
45
- WHEN unpivot.measure = 'precip'::text THEN 'mm'::text
46
- WHEN unpivot.measure = 'sun_irr'::text THEN 'lux'::text
47
- WHEN unpivot.measure = 'soil_temp'::text THEN '°C'::text
48
- WHEN unpivot.measure = 'water_pot'::text THEN 'kPa'::text
49
- WHEN unpivot.measure = 'dendro_circ'::text THEN 'mm'::text
50
- WHEN unpivot.measure = 'dendro_gain'::text THEN 'µm'::text
51
- ELSE NULL::text
52
- END AS unit
53
- FROM microclimate.sensor_devices_import s,
54
- LATERAL ( VALUES ('air_temp'::text,s.air_temp), ('air_hum'::text,s.air_hum), ('pressure'::text,s.pressure), ('wind_dir'::text,s.wind_dir), ('wind_impact'::text,s.wind_impact), ('wind_speed'::text,s.wind_speed), ('precip'::text,s.precip), ('sun_irr'::text,s.sun_irr), ('soil_temp'::text,s.soil_temp), ('water_pot'::text,s.water_pot), ('dendro_circ'::text,s.dendro_circ), ('dendro_gain'::text,s.dendro_gain)) unpivot(measure, height_cm)
55
- WHERE unpivot.height_cm IS NOT NULL
56
- ORDER BY s.point_id;
1
+ drop VIEW v_sensor_points;
2
+
3
+ ALTER TABLE sensor_devices_import
4
+ ALTER COLUMN lat TYPE float8,
5
+ ALTER COLUMN lng TYPE float8;
6
+
7
+ CREATE OR REPLACE VIEW v_sensor_points
8
+ AS SELECT DISTINCT s.point_id,
9
+ s.point_name,
10
+ s.location_id,
11
+ s.location,
12
+ s.loc_description,
13
+ s.loc_orientation,
14
+ s.loc_surface,
15
+ s.lat,
16
+ s.lng,
17
+ NULL::text AS x_jtsk,
18
+ NULL::text AS y_jtsk,
19
+ NULL::text AS elevation_m,
20
+ s.sensor_position,
21
+ s.sensor_position_detail,
22
+ concat(unpivot.measure, unpivot.height_cm) AS measure,
23
+ CASE
24
+ WHEN unpivot.measure = 'air_temp'::text THEN 'Teplota vzduchu'::text
25
+ WHEN unpivot.measure = 'air_hum'::text THEN 'Vlhkost vzduchu'::text
26
+ WHEN unpivot.measure = 'pressure'::text THEN 'Atmosférický tlak'::text
27
+ WHEN unpivot.measure = 'wind_dir'::text THEN 'Směr větru'::text
28
+ WHEN unpivot.measure = 'wind_impact'::text THEN 'Náraz větru'::text
29
+ WHEN unpivot.measure = 'wind_speed'::text THEN 'Rychlost větru'::text
30
+ WHEN unpivot.measure = 'precip'::text THEN 'Úhrn srážek'::text
31
+ WHEN unpivot.measure = 'sun_irr'::text THEN 'Sluneční záření'::text
32
+ WHEN unpivot.measure = 'soil_temp'::text THEN 'Teplota půdy'::text
33
+ WHEN unpivot.measure = 'water_pot'::text THEN 'Vodní potenciál půdy'::text
34
+ WHEN unpivot.measure = 'dendro_circ'::text THEN 'Obvod stromu'::text
35
+ WHEN unpivot.measure = 'dendro_gain'::text THEN 'Přírůstek obvodu stromu'::text
36
+ ELSE NULL::text
37
+ END AS measure_cz,
38
+ CASE
39
+ WHEN unpivot.measure = 'air_temp'::text THEN '°C'::text
40
+ WHEN unpivot.measure = 'air_hum'::text THEN '%'::text
41
+ WHEN unpivot.measure = 'pressure'::text THEN 'Pa'::text
42
+ WHEN unpivot.measure = 'wind_dir'::text THEN '°'::text
43
+ WHEN unpivot.measure = 'wind_impact'::text THEN 'km/h'::text
44
+ WHEN unpivot.measure = 'wind_speed'::text THEN 'km/h'::text
45
+ WHEN unpivot.measure = 'precip'::text THEN 'mm'::text
46
+ WHEN unpivot.measure = 'sun_irr'::text THEN 'lux'::text
47
+ WHEN unpivot.measure = 'soil_temp'::text THEN '°C'::text
48
+ WHEN unpivot.measure = 'water_pot'::text THEN 'kPa'::text
49
+ WHEN unpivot.measure = 'dendro_circ'::text THEN 'mm'::text
50
+ WHEN unpivot.measure = 'dendro_gain'::text THEN 'µm'::text
51
+ ELSE NULL::text
52
+ END AS unit
53
+ FROM microclimate.sensor_devices_import s,
54
+ LATERAL ( VALUES ('air_temp'::text,s.air_temp), ('air_hum'::text,s.air_hum), ('pressure'::text,s.pressure), ('wind_dir'::text,s.wind_dir), ('wind_impact'::text,s.wind_impact), ('wind_speed'::text,s.wind_speed), ('precip'::text,s.precip), ('sun_irr'::text,s.sun_irr), ('soil_temp'::text,s.soil_temp), ('water_pot'::text,s.water_pot), ('dendro_circ'::text,s.dendro_circ), ('dendro_gain'::text,s.dendro_gain)) unpivot(measure, height_cm)
55
+ WHERE unpivot.height_cm IS NOT NULL
56
+ ORDER BY s.point_id;
@@ -0,0 +1,89 @@
1
+ asyncapi: 3.0.0
2
+ info:
3
+ title: 🌡️ Microclimate
4
+ version: 1.0.0
5
+ description: Microclimate info
6
+ channels:
7
+ microclimate.refreshMeasurements:
8
+ address: dataplatform.microclimate.refreshMeasurements
9
+ description: Generate messages for microclimate.refreshMeasurementsById
10
+ bindings:
11
+ amqp:
12
+ is: queue
13
+ queue:
14
+ durable: true
15
+ messages:
16
+ empty:
17
+ $ref: "#/components/messages/emptyMessage"
18
+ microclimate.refreshMeasurementsById:
19
+ address: dataplatform.microclimate.refreshMeasurementsById
20
+ description: Update measurements by id and date range
21
+ bindings:
22
+ amqp:
23
+ is: queue
24
+ queue:
25
+ durable: true
26
+ messages:
27
+ microclimate.RefreshMeasurementsById:
28
+ $ref: "#/components/messages/microclimate.RefreshMeasurementsById"
29
+ microclimate.refreshSensorDevices:
30
+ address: dataplatform.microclimate.refreshSensorDevices
31
+ description: Update data from sensor devices
32
+ bindings:
33
+ amqp:
34
+ is: queue
35
+ queue:
36
+ durable: true
37
+ messages:
38
+ empty:
39
+ $ref: "#/components/messages/emptyMessage"
40
+ microclimate.refreshSensorViews:
41
+ address: dataplatform.microclimate.refreshSensorViews
42
+ description: Refresh views in db
43
+ bindings:
44
+ amqp:
45
+ is: queue
46
+ queue:
47
+ durable: true
48
+ messages:
49
+ empty:
50
+ $ref: "#/components/messages/emptyMessage"
51
+ operations:
52
+ microclimate.refreshMeasurements:
53
+ action: "send"
54
+ channel:
55
+ $ref: "#/channels/microclimate.refreshMeasurements"
56
+ microclimate.refreshMeasurementsById:
57
+ action: "send"
58
+ channel:
59
+ $ref: "#/channels/microclimate.refreshMeasurementsById"
60
+ microclimate.refreshSensorDevices:
61
+ action: "send"
62
+ channel:
63
+ $ref: "#/channels/microclimate.refreshSensorDevices"
64
+ microclimate.refreshSensorViews:
65
+ action: "send"
66
+ channel:
67
+ $ref: "#/channels/microclimate.refreshSensorViews"
68
+ components:
69
+ messages:
70
+ emptyMessage:
71
+ title: Empty message
72
+ microclimate.RefreshMeasurementsById:
73
+ payload:
74
+ type: object
75
+ properties:
76
+ "sensorAddr":
77
+ type: string
78
+ "dateRange":
79
+ type: string
80
+ enum:
81
+ - "today"
82
+ - "yesterday"
83
+ - "currentWeek"
84
+ - "previousWeek"
85
+ - "currentMonth"
86
+ - "previousMonth"
87
+ - "currentYear"
88
+ - "previousYear"
89
+ additionalProperties: false
@@ -303,6 +303,8 @@ Proměnné zaslané vysílači se liší, tj. různé vysílače odesílají rů
303
303
  - OpenAPI v3 dokumentace
304
304
  - [swagger] (https://gitlab.com/operator-ict/golemio/code/modules/microclimate/-/blob/development/docs/openapi.yaml).
305
305
  - api je veřejné
306
+ - AsyncApi dokumentace
307
+ - [AsyncApi](./asyncapi.yaml)
306
308
 
307
309
  #### _/microclimate/locations_
308
310
 
package/docs/index.md ADDED
@@ -0,0 +1,3 @@
1
+ # @golemio/microclimate
2
+
3
+ This module is intended for use with Golemio services. Refer [here](https://gitlab.com/operator-ict/golemio/code/modules/core/-/blob/development/README.md) for further information on usage, local development and more.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemio/microclimate",
3
- "version": "1.2.8-dev.1384166512",
3
+ "version": "1.2.8-dev.1561229684",
4
4
  "description": "Golemio Microclimate Module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",