-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathonem2m.m.temperature.json
146 lines (146 loc) · 4.93 KB
/
onem2m.m.temperature.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
"id": "http://openinterconnect.org/onem2mmapping/schemas/onem2m.m.temperature.json#",
"$schema": "http://json-schema.org/draft-04/schema#",
"description" : "Copyright (c) 2018 Open Connectivity Foundation, Inc. All rights reserved.",
"title": "Temperature",
"definitions": {
"onem2m.m.temperature": {
"type": "object",
"properties": {
"currentTemperature": {
"type": "number",
"description": "The current temperature",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.temperature",
"x-to-ocf": [
"oic.r.temperature.temperature = currentTemperature",
"units = C",
"During translation, need to set the description of the multi-instance temperature resource to indicate whether this is the current or target temperature being translated"
],
"x-from-ocf": {
"oneOf": [
{
"properties": {
"units": "string",
"enum": ["C"]
},
"x-from-ocf": [
"currentTemperature = oic.r.temperature.temperature"
]
},
{
"properties": {
"units": "string",
"enum": ["F"]
},
"x-from-ocf": [
"currentTemperature = (oic.r.temperature.temperature-32)*5/9"
]
},
{
"properties": {
"units": "string",
"enum": ["K"]
},
"x-from-ocf": [
"currentTemperature = oic.r.temperature.temperature-273.15"
]
}
]
}
}
},
"targetTemperature": {
"type": "number",
"description": "The desired temperature to reach",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.temperature",
"x-to-ocf": [
"oic.r.temperature.temperature = targetTemperature",
"units = C",
"During translation, need to set the description of the multi-instance temperature resource to indicate whether this is the current or target temperature being translated"
],
"x-from-ocf": {
"oneOf": [
{
"properties": {
"units": "string",
"enum": ["C"]
},
"x-from-ocf": [
"targetTemperature = oic.r.temperature.temperature"
]
},
{
"properties": {
"units": "string",
"enum": ["F"]
},
"x-from-ocf": [
"targetTemperature = (oic.r.temperature.temperature-32)*5/9"
]
},
{
"properties": {
"units": "string",
"enum": ["K"]
},
"x-from-ocf": [
"targetTemperature = oic.r.temperature.temperature-273.15"
]
}
]
}
}
},
"minValue": {
"type": "number",
"description": "Minimum value of 'targetTemperature'",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.temperature",
"x-to-ocf": [
"oic.r.temperature.range[0] = minValue"
],
"x-from-ocf": [
"minValue = oic.r.temperature.range[0]",
"otherwise: minValue = -MAXINT"
]
}
},
"maxValue": {
"type": "number",
"description": "Maximum value of 'targetTemperature'",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.temperature",
"x-to-ocf": [
"oic.r.temperature.range[1] = maxValue"
],
"x-from-ocf": [
"maxValue =oic.r.temperature.range[1]",
"otherwise: maxValue = MAXINT"
]
}
},
"stepValue": {
"type": "number",
"description": "Step value allowed for 'targetTemperature'",
"x-ocf-conversion": {
"x-ocf-alias": "oic.r.temperature",
"x-to-ocf": [
"oic.r.temperature.step = stepValue"
],
"x-from-ocf": [
"stepValue = oic.r.temperature.step",
"otherwise: stepValue = 1"
]
}
}
}
}
},
"type": "object",
"allOf": [
{"$ref": "#/definitions/onem2m.m.temperature"}
],
"required": [ "currentTemperature" ]
}