Skip to content

Commit

Permalink
Add country_code, hint and areas to Location
Browse files Browse the repository at this point in the history
  • Loading branch information
rnestler committed May 20, 2024
1 parent b5626a6 commit 18f9dab
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ use crate::sensors::Sensors;

type Extensions = BTreeMap<String, Value>;

#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq)]
pub struct Area {
#[serde(skip_serializing_if = "Option::is_none")]
name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
description: Option<String>,
square_meters: f64,
}

#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq)]
pub struct Location {
#[serde(skip_serializing_if = "Option::is_none")]
Expand All @@ -15,6 +24,12 @@ pub struct Location {
pub lon: f64,
#[serde(skip_serializing_if = "Option::is_none")]
pub timezone: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub country_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hint: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub areas: Option<Vec<Area>>,
}

#[derive(Serialize, Deserialize, Default, Debug, Clone, PartialEq, Eq)]
Expand Down

0 comments on commit 18f9dab

Please sign in to comment.