pub struct Entity {
pub device_id: String,
pub entity_type: EntityType,
pub external_id: Option<String>,
pub id: String,
pub metadata: Option<HashMap>,
pub name: Option<String>,
pub zone_id: Option<String>,
}Expand description
The actual controllable “button” or “sensor”.
Examples: Relay 1, Temp Sensor, Light Switch.JSON schema
{
"description": "The actual controllable \"button\" or \"sensor\".\n\nExamples: Relay 1, Temp Sensor, Light Switch.",
"type": "object",
"required": [
"device_id",
"entity_type",
"id"
],
"properties": {
"device_id": {
"description": "Parent device ID.",
"type": "string"
},
"entity_type": {
"$ref": "#/components/schemas/EntityType"
},
"external_id": {
"description": "External ID from the integration.",
"type": [
"string",
"null"
]
},
"id": {
"description": "Unique identifier (ULID).",
"type": "string"
},
"metadata": {
"oneOf": [
{
"type": "null"
},
{
"oneOf": [
{
"$ref": "#/components/schemas/HashMap"
}
]
}
]
},
"name": {
"description": "Optional friendly name for the entity.",
"type": [
"string",
"null"
]
},
"zone_id": {
"description": "Optional zone this entity belongs to.",
"type": [
"string",
"null"
]
}
}
}Fields§
§device_id: StringParent device ID.
entity_type: EntityType§external_id: Option<String>External ID from the integration.
id: StringUnique identifier (ULID).
metadata: Option<HashMap>§name: Option<String>Optional friendly name for the entity.
zone_id: Option<String>Optional zone this entity belongs to.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Entity
impl<'de> Deserialize<'de> for Entity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Entity
impl RefUnwindSafe for Entity
impl Send for Entity
impl Sync for Entity
impl Unpin for Entity
impl UnsafeUnpin for Entity
impl UnwindSafe for Entity
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more