public final class SceneAction
- Object
- 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.
Constructors
public SceneAction(String accessoryId, String serviceId, Trait trait, TraitValue value) | Creates a scene action. |
Methods
public String getAccessoryId() | The accessory this action acts on. |
public String getServiceId() | The service on that accessory. |
public Trait getTrait() | The trait this action sets. |
public TraitValue getValue() | The value it sets the trait to. |
public String toString() | Returns a string representation of the object. |
Inherited methods
Constructor details
SceneAction
public SceneAction(String accessoryId, String serviceId, Trait trait, TraitValue value)Creates a scene action.
Parameters
accessoryIdString- the accessory to act on
serviceIdString- the service on that accessory
traitTrait- the trait to set
valueTraitValue- the value to set it to
Throws
IllegalArgumentException- when any argument is
nullor empty, or whenvalue’s kind does not match the trait’s
Method details
getAccessoryId
public String getAccessoryId()The accessory this action acts on.
Returns
the accessory identifier, never
nullgetServiceId
public String getServiceId()The service on that accessory.
Returns
the service identifier, never
nullgetTrait
public Trait getTrait()The trait this action sets.
Returns
the trait, never
nullgetValue
public TraitValue getValue()The value it sets the trait to.
Returns
the value, never
nulltoString
public String toString()Returns 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())