Skip to content

Commit bf2cfe8

Browse files
kvfasilmaggie98choyVinodsathyaseelanbrendanobra
authored
3.2.1 to main (#935)
* Making test config field optional. (#928) * backport: model_number from DeviceInfo (#932) (#933) * backport: model_number from DeviceInfo Co-authored-by: Brendan O'Bra <brendan@obrafamily.org> --------- Co-authored-by: Maggie Choy <maggie98choy@yahoo.com> Co-authored-by: Vinod Sathyaseelan <Vinod_sathyaseelan@comcast.com> Co-authored-by: Brendan O'Bra <brendan@obrafamily.org>
1 parent 6ea17dc commit bf2cfe8

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

.github/workflows/Build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
push:
55
branches: [ "main" ]
66
pull_request:
7-
branches: [ "main", "3.1.rc" ]
7+
branches: [ "main", "3.2.rc" ]
88

99
env:
1010
CARGO_TERM_COLOR: always

core/sdk/src/api/manifest/ripple_manifest_loader.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ pub struct RippleManifestConfig {
3838
}
3939

4040
#[derive(Clone, Debug, Deserialize, Default)]
41+
#[serde(default)]
4142
struct DefaultManifestConfig {
4243
device: String,
4344
extn: String,
4445
tag: Option<String>,
45-
test_device: String,
46-
test_extn: String,
46+
test_device: Option<String>,
47+
test_extn: Option<String>,
4748
}
4849

4950
#[derive(Clone, Debug, Deserialize, Default)]
@@ -354,13 +355,17 @@ impl RippleConfigLoader {
354355
};
355356

356357
let test_path = if is_extn {
357-
self.manifest_config.default.test_extn.as_str()
358+
self.manifest_config.default.test_extn.as_deref()
358359
} else {
359-
self.manifest_config.default.test_device.as_str()
360+
self.manifest_config.default.test_device.as_deref()
360361
};
361362

362-
let test_path_resolved = if !test_path.is_empty() {
363-
Some(self.resolve_path(test_path))
363+
let test_path_resolved = if let Some(path) = test_path {
364+
if !path.is_empty() {
365+
Some(self.resolve_path(path))
366+
} else {
367+
None
368+
}
364369
} else {
365370
None
366371
};

device/thunder_ripple_sdk/src/processors/thunder_device_info.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,18 +273,19 @@ impl ThunderDeviceInfoRequestProcessor {
273273
let resp = state
274274
.get_thunder_client()
275275
.call(DeviceCallRequest {
276-
method: ThunderPlugin::System.method("getSystemVersions"),
276+
method: ThunderPlugin::System.method("getDeviceInfo"),
277277
params: None,
278278
})
279279
.await;
280280
info!("{}", resp.message);
281-
let resp = resp.message.get("stbVersion");
282-
if resp.is_none() {
283-
return "NA".to_owned();
284-
}
285-
let resp = resp.unwrap().as_str().unwrap().trim_matches('"');
286-
let split_string: Vec<&str> = resp.split('_').collect();
287-
String::from(split_string[0])
281+
282+
let model_number = resp
283+
.message
284+
.get("model_number")
285+
.and_then(|v| v.as_str())
286+
.unwrap_or("NA");
287+
288+
model_number.to_owned()
288289
}
289290

290291
async fn get_model(state: &CachedState) -> String {

0 commit comments

Comments
 (0)