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_name
attributeDeclaration
Swift
public var friendlyName: String? { get }
-
The icon of the entity, from the
icon
attribute This will be in the formattype:name
, e.g.mdi:map
orhass:line
Declaration
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
domain
is 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]) throws
Parameters
domain
The domain of the entity whose attributes these are for
dictionary
The dictionary representation of the