HAEntityAttributes
public struct HAEntityAttributes
The attributes of the entity’s state
-
Convenience access to values inside of the dictionary
Declaration
Swift
public subscript(key: String) -> Any? { get } -
A dictionary representation of the attributes This contains all keys and values received, including those not parsed or handled otherwise
Declaration
Swift
public var dictionary: [String : Any] -
The display name for the entity, from the
friendly_nameattributeDeclaration
Swift
public var friendlyName: String? { get } -
The icon of the entity, from the
iconattribute This will be in the formattype:name, e.g.mdi:maporhass:lineDeclaration
Swift
public var icon: String? { get } -
For a zone-type entity, this contains parsed attributes specific to the zone
Declaration
Swift
public var zone: HAEntityAttributesZone? -
Create attributes from individual values
domainis required here as it may inform the per-domain parsing.Throws
When the attributes are missing any required fields, domain-specificDeclaration
Swift
public init(domain: String, dictionary: [String : Any]) throwsParameters
domainThe domain of the entity whose attributes these are for
dictionaryThe dictionary representation of the
View on GitHub