Skip to content

Commit ec04f7f

Browse files
committed
Apply _when_ to sensor state, remove sensor from top level model
1 parent a34a76d commit ec04f7f

File tree

3 files changed

+21
-44
lines changed

3 files changed

+21
-44
lines changed

release/models/platform/openconfig-platform-common.yang

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ submodule openconfig-platform-common {
2020
"This modules contains common groupings that are used in multiple
2121
components within the platform module.";
2222

23-
oc-ext:openconfig-version "0.33.0";
24-
25-
revision "2025-09-16" {
26-
description
27-
"Add sensor container.";
28-
reference "0.33.0";
29-
}
23+
oc-ext:openconfig-version "0.32.0";
3024

3125
revision "2025-07-15" {
3226
description

release/models/platform/openconfig-platform-sensor.yang

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module openconfig-platform-sensor {
88
prefix "oc-sensor";
99

1010
import openconfig-platform { prefix oc-platform; }
11+
import openconfig-platform-types { prefix oc-platform-types; }
1112
import openconfig-extensions { prefix oc-ext; }
1213
import openconfig-alarm-types { prefix oc-alarm-types; }
1314

@@ -167,25 +168,30 @@ module openconfig-platform-sensor {
167168
}
168169
}
169170

171+
grouping sensor-top {
172+
container sensor {
173+
description
174+
"Data for sensor components";
175+
176+
container state {
177+
when "../../oc-platform:state/oc-platform:type = 'oc-platform-types:SENSOR'";
178+
config false;
179+
description
180+
"Operational state data for sensor components";
181+
uses sensor-state;
182+
uses sensor-threshold-top;
183+
}
184+
}
185+
}
170186

171187
// data definition statements
172188

173189
// augment statements
174190

175-
augment "/oc-platform:components/oc-platform:component/oc-platform:state/" +
176-
"oc-platform:sensor" {
177-
description
178-
"Adding sensor data to component model";
179-
180-
uses sensor-threshold-top;
181-
}
182-
183-
augment "/oc-platform:components/oc-platform:component/oc-platform:state/" +
184-
"oc-platform:sensor/oc-platform:state" {
191+
augment "/oc-platform:components/oc-platform:component" {
185192
description
186-
"Adding sensor state data to component model";
193+
"Adding sensor container to component";
187194

188-
uses sensor-state;
195+
uses sensor-top;
189196
}
190-
191197
}

release/models/platform/openconfig-platform.yang

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,7 @@ module openconfig-platform {
6565
(presence or absence of a component) and state (physical
6666
attributes or status).";
6767

68-
oc-ext:openconfig-version "0.33.0";
69-
70-
revision "2025-09-16" {
71-
description
72-
"Add sensor container.";
73-
reference "0.33.0";
74-
}
68+
oc-ext:openconfig-version "0.32.0";
7569

7670
revision "2025-07-15" {
7771
description
@@ -1063,20 +1057,6 @@ revision "2024-05-29" {
10631057
}
10641058
}
10651059

1066-
grouping platform-component-sensor-state {
1067-
container sensor {
1068-
//when "../state/type = 'oc-platform-types:SENSOR'";
1069-
description
1070-
"Data for sensor components";
1071-
1072-
container state {
1073-
config false;
1074-
description
1075-
"Operational state data for sensor components";
1076-
}
1077-
}
1078-
}
1079-
10801060
grouping platform-anchors-top {
10811061
description
10821062
"This grouping is used to add containers for components that
@@ -1372,9 +1352,6 @@ revision "2024-05-29" {
13721352
"'oc-platform-types:INTEGRATED_CIRCUIT' or " +
13731353
"'oc-platform-types:FRU'";
13741354
}
1375-
uses platform-component-sensor-state {
1376-
when "./type = 'oc-platform-types:SENSOR'";
1377-
}
13781355
}
13791356

13801357
uses platform-component-properties-top;

0 commit comments

Comments
 (0)