public final class HomeZone

  1. Object
  2. HomeZone

A named grouping of rooms – “upstairs”, “the annexe”: HomeKit’s HMZone.

HomeKit only. No other backend has the concept, and HomeStructure.getZones() returns an empty list on them rather than synthesizing groupings out of room names. A guess about which rooms a user thinks of as upstairs is not information, and an app that laid out its navigation around invented zones would look broken on the platform that has real ones.

An immutable snapshot.

Constructors

public HomeZone(String id, String name, List<String> roomIds)Creates a zone snapshot.

Methods

public String getId()The identifier this zone is addressed by.
public String getName()The user-visible name, empty when the zone has none.
public List<String> getRoomIds()The rooms in this zone.
public String toString()Returns a string representation of the object.

Inherited methods

Constructor details

HomeZone

public HomeZone(String id, String name, List<String> roomIds)
Creates a zone snapshot. Called by the iOS port.

Parameters

id String
the zone identifier
name String
the user-visible name, or null for none
roomIds List<String>
the rooms in this zone; null becomes empty

Throws

IllegalArgumentException
when id is null or empty

Method details

getId

public String getId()
The identifier this zone is addressed by.

Returns

the identifier, never null

getName

public String getName()
The user-visible name, empty when the zone has none.

Returns

the name, never null

getRoomIds

public List<String> getRoomIds()
The rooms in this zone.

Returns

an immutable list of room identifiers, possibly empty

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