feat: add support for delta powershelves#80
Conversation
86f8a82 to
d8d0080
Compare
d8d0080 to
1b42e7c
Compare
| let (_, sensors): (_, Sensors) = client.get(&url).await?; | ||
| for sensor in sensors.members { | ||
| // only voltage sensors | ||
| if !sensor.odata_id.contains("voltage") { |
There was a problem hiding this comment.
I took this from the Liteon implementation, but I think youre right. Might as well add that defesnive check.
b0498fa to
9d1e69a
Compare
| Ok(Power { | ||
| odata: None, | ||
| id: "Power".to_string(), | ||
| name: "Power".to_string(), |
There was a problem hiding this comment.
could we do anything useful with id or name or not really?
There was a problem hiding this comment.
Not really--I took this from the Liteon implementation.
| power_control: vec![], | ||
| power_supplies: Some(power_supplies), | ||
| voltages: Some(voltages), | ||
| redundancy: None, |
There was a problem hiding this comment.
should redundancy be the same as power_supplies, or do we just leave it unset? i really dont know the answer fwiw -- like if power_supplies > 1 then do we need to set anything in there?
There was a problem hiding this comment.
hm, to be honest, I dont know the answer either. But I am borrowing from the Liteon power implementation.
Also, I took a closer look at the Redundancy attribute and I dont think its too applicable:
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "PascalCase")]
pub struct Redundancy {
pub max_num_supported: i64,
pub member_id: String,
pub min_num_needed: i64,
pub mode: String,
pub name: String,
pub redundancy_set: Vec<ODataId>,
}
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "PascalCase")]
pub struct Power {
#[serde(flatten)]
pub odata: Option<ODataLinks>,
pub id: String,
pub name: String,
pub power_control: Vec<PowerControl>,
pub power_supplies: Option<Vec<PowerSupply>>,
pub voltages: Option<Vec<Voltages>>,
pub redundancy: Option<Vec<Redundancy>>,
}
There was a problem hiding this comment.
I think we can get it in as is and improve this in a follow up
There was a problem hiding this comment.
Actually idk, I think we set redundancy as None everywhere.
| pub odata: Option<ODataLinks>, | ||
| pub id: Option<String>, | ||
| pub name: Option<String>, | ||
| pub power_supplies: Option<ODataId>, |
There was a problem hiding this comment.
...ahh yes, this is the RedundancyGroup -- riiight, Power (what i was commenting on) is the old one, and this is the new spec?
|
@spydaNVIDIA any tests at all? |
No description provided.