Class SceneAction
One thing a Scene does: set one Trait on one AccessoryService to one
value.
The same shape as a TraitWrite, and deliberately a separate type: a write
happens now and can carry a door-lock PIN, while a scene action is stored
and replayed by the platform later, when this app may not be running. There
is nowhere to put a credential in that story, which is why locks are
generally not scriptable into scenes.
-
Constructor Summary
ConstructorsConstructorDescriptionSceneAction(String accessoryId, String serviceId, Trait trait, TraitValue value) Creates a scene action. -
Method Summary
-
Constructor Details
-
SceneAction
Creates a scene action.
Parameters
-
accessoryId: the accessory to act on -
serviceId: the service on that accessory -
trait: the trait to set -
value: the value to set it to
Throws
IllegalArgumentException: when any argument isnullor empty, or whenvalue's kind does not match the trait's
-
-
-
Method Details
-
getAccessoryId
The accessory this action acts on.
Returns
the accessory identifier, never
null -
getServiceId
The service on that accessory.
Returns
the service identifier, never
null -
getTrait
The trait this action sets.
Returns
the trait, never
null -
getValue
The value it sets the trait to.
Returns
the value, never
null -
toString
Description copied from class:ObjectReturns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
-