public final class SceneAction

  1. Object
  2. 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

accessoryId String
the accessory to act on
serviceId String
the service on that accessory
trait Trait
the trait to set
value TraitValue
the value to set it to

Throws

IllegalArgumentException
when any argument is null or empty, or when value’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 null

getServiceId

public String getServiceId()
The service on that accessory.

Returns

the service identifier, never null

getTrait

public Trait getTrait()
The trait this action sets.

Returns

the trait, never null

getValue

public TraitValue getValue()
The value it sets the trait to.

Returns

the value, never null

toString

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())