Commit aa33c09fe8a6bbd448f48c9941272d1642a3b2f8

Authored by Alain Klotz
1 parent 47dbdda5
Exists in dev

Add output_data in components

config/schemas/schema_device-2.0.yml
... ... @@ -31,7 +31,30 @@ schema;schema_component_attributes:
31 31 type: any
32 32 placeholder:
33 33 type: str
34   -
  34 +
  35 +schema;schema_component_output_data:
  36 + type: map
  37 + required: False
  38 + mapping:
  39 + attribute:
  40 + type: map
  41 + required: False
  42 + mapping:
  43 + key:
  44 + type: str
  45 + required: True
  46 + category:
  47 + type: str
  48 + required: True
  49 + label:
  50 + type: str
  51 + value_type:
  52 + type: str
  53 + unit:
  54 + type: str
  55 + description:
  56 + type: str
  57 +
35 58 schema;schema_capability:
36 59 type: map
37 60 required: True
... ... @@ -44,6 +67,12 @@ schema;schema_capability:
44 67 required: False # True if we're not using default values
45 68 seq:
46 69 - include : schema_component_attributes
  70 + output_data:
  71 + type: seq
  72 + required: False # True if we're not using default values
  73 + seq:
  74 + - include : schema_component_output_data
  75 +
47 76  
48 77 # old version
49 78 # schema;schema_capability:
... ...
privatedev/config/tnc/device_Raspberry_TAROT_sn002.yml
1   -# Schema file to check the syntax of this config file
2   -schema: schema_device-2.0.yml
3   -
4   -# Here is the description of the configuration of an isolated device
5   -DEVICE:
6   -
7   - inventory_label: SEC-RSP-011
8   - manufacturer: "Eymar"
9   - model: "TAROT meteo station"
10   - description: "Universal meteo station for TAROT based on Raspberry 4"
11   - sn: SN002
12   - power:
13   - voltage: 220
14   - intensity: 1
15   - socket: "CEE 7/7 2P+T"
16   -
17   - connector:
18   - input: 220V
19   - output: "data frame"
20   -
21   - hostname: ""
22   - virtual_machine: False
23   - os: Linux
24   - os_version: Raspbian
25   - network_interfaces:
26   - - B8:27:EB:8B:99:AA # RJ45
27   - - b8:27:eb:de:cc:AB # Wifi
28   - protocol:
29   - transport: TCP
30   - langage: Json
31   - read: True
32   - write: False
33   -
34   - CAPABILITIES:
35   -
36   - - CAPABILITY:
37   - component: WeatherStation
38   -
39   - attributes:
40   -
41   - - attribute:
42   - key: manufacturer
43   - value: "L. Eymar"
44   -
45   - - attribute:
46   - key: model
47   - value: Raspberry
  1 +# Schema file to check the syntax of this config file
  2 +schema: schema_device-2.0.yml
  3 +
  4 +# Here is the description of the configuration of an isolated device
  5 +DEVICE:
  6 +
  7 + inventory_label: SEC-RSP-011
  8 + manufacturer: "Eymar"
  9 + model: "TAROT meteo station"
  10 + description: "Universal meteo station for TAROT based on Raspberry 4"
  11 + sn: SN002
  12 + power:
  13 + voltage: 220
  14 + intensity: 1
  15 + socket: "CEE 7/7 2P+T"
  16 +
  17 + connector:
  18 + input: 220V
  19 + output: "data frame"
  20 +
  21 + hostname: ""
  22 + virtual_machine: False
  23 + os: Linux
  24 + os_version: Raspbian
  25 + network_interfaces:
  26 + - B8:27:EB:8B:99:AA # RJ45
  27 + - b8:27:eb:de:cc:AB # Wifi
  28 + protocol:
  29 + transport: TCP
  30 + langage: Json
  31 + read: True
  32 + write: False
  33 +
  34 + CAPABILITIES:
  35 +
  36 + - CAPABILITY:
  37 + component: WeatherStation
  38 +
  39 + attributes:
  40 +
  41 + - attribute:
  42 + key: manufacturer
  43 + value: "L. Eymar"
  44 +
  45 + - attribute:
  46 + key: model
  47 + value: Raspberry
  48 +
  49 + output_data:
  50 +
  51 + - data:
  52 + key: rain
  53 + category: meteo
  54 + label: Rain
  55 + value_type: float
  56 + unit: bool
  57 + description:
  58 +
  59 + - data:
  60 + key: temp_ext
  61 + category: meteo
  62 + label: Ext. Temp.
  63 + value_type: float
  64 + unit: degC
  65 + description:
  66 +
  67 + - data:
  68 + key: Power_supply
  69 + category: electricity
  70 + label: Power supply
  71 + value_type: float
  72 + unit: Volts
  73 + description:
... ...