Enum StructureChangeKind
- All Implemented Interfaces:
Comparable<StructureChangeKind>
What moved in the home, for HomeStructureEvent.
These say the graph snapshot you are holding is out of date. Call
SmartHome.refresh() and wait for it to complete before reading the graph
again: SmartHome.getStructures() answers from the last refresh, so on its
own it hands back the same stale snapshot the event just told you about.
They never carry trait values -- those arrive through a
TraitSubscription, which is a separate mechanism with separate delivery
guarantees.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn accessory joined a home.An accessory moved to a different room.An accessory left a home.An accessory was renamed by the user in their ecosystem app.SmartHome.getAvailability()now answers something different -- the user granted or revoked access, signed in or out, or installed the provider the backend was waiting for.An accessory became reachable or unreachable.A scene was created, changed or deleted.A home was added or removed, or the set of homes the user has granted access to changed. -
Method Summary
Modifier and TypeMethodDescriptionstatic StructureChangeKindReturns the enum constant of this type with the specified name.static StructureChangeKind[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
STRUCTURES_CHANGED
A home was added or removed, or the set of homes the user has granted access to changed. Everything you were holding is suspect. -
ACCESSORY_ADDED
An accessory joined a home. -
ACCESSORY_REMOVED
An accessory left a home.
Anything you had persisted about it -- a favourite, a widget -- now points at nothing, and a write to it will fail with
HomeError.ACCESSORY_NOT_FOUND. -
ACCESSORY_RENAMED
An accessory was renamed by the user in their ecosystem app. -
ACCESSORY_MOVED
An accessory moved to a different room. -
REACHABILITY_CHANGED
An accessory became reachable or unreachable.
The most frequent kind by a wide margin, and the one worth handling separately: a whole graph re-fetch on every reachability flap is wasteful, and updating one row's availability indicator is usually all that is wanted.
HomeStructureEvent.getAccessoryId()names the accessory. When a bridge drops, expect one of these per accessory behind it. -
SCENES_CHANGED
A scene was created, changed or deleted. -
AVAILABILITY_CHANGED
SmartHome.getAvailability()now answers something different -- the user granted or revoked access, signed in or out, or installed the provider the backend was waiting for. Ask again.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-