Enum StructureChangeKind

java.lang.Object
java.lang.Enum<StructureChangeKind>
com.codename1.home.StructureChangeKind
All Implemented Interfaces:
Comparable<StructureChangeKind>

public enum StructureChangeKind extends Enum<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 Details

    • STRUCTURES_CHANGED

      public static final StructureChangeKind 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

      public static final StructureChangeKind ACCESSORY_ADDED
      An accessory joined a home.
    • ACCESSORY_REMOVED

      public static final StructureChangeKind 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

      public static final StructureChangeKind ACCESSORY_RENAMED
      An accessory was renamed by the user in their ecosystem app.
    • ACCESSORY_MOVED

      public static final StructureChangeKind ACCESSORY_MOVED
      An accessory moved to a different room.
    • REACHABILITY_CHANGED

      public static final StructureChangeKind 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

      public static final StructureChangeKind SCENES_CHANGED
      A scene was created, changed or deleted.
    • AVAILABILITY_CHANGED

      public static final StructureChangeKind 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

      public static StructureChangeKind[] 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

      public static StructureChangeKind valueOf(String name)
      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 name
      NullPointerException - if the argument is null