Difference between revisions of "Location Object"

From Hubitat Documentation
Jump to: navigation, search
Line 2: Line 2:
  
 
==Properties==
 
==Properties==
==<code>id</code>==
+
===<code>id</code>===
 
A unique id for the location, as a Long.
 
A unique id for the location, as a Long.
==<code>name</code>==
+
===<code>name</code>===
 
The name of the location as a String.
 
The name of the location as a String.
==<code>temperatureScale</code>==
+
===<code>temperatureScale</code>===
 
The temperature scale of the location as a String (C or F).
 
The temperature scale of the location as a String (C or F).
==<code>timeZone</code>==
+
===<code>timeZone</code>===
 
The time zone of the location as a TimeZone object.
 
The time zone of the location as a TimeZone object.
==<code>zipCode</code>==
+
===<code>zipCode</code>===
 
The zip code of the location as a String.
 
The zip code of the location as a String.
==<code>latitude</code>==
+
===<code>latitude</code>===
 
The latitude of the location as a BigDecimal.
 
The latitude of the location as a BigDecimal.
==<code>longitude</code>==
+
===<code>longitude</code>===
 
The longitude of the location as a BigDecimal.
 
The longitude of the location as a BigDecimal.
==<code>sunrise</code>==
+
===<code>sunrise</code>===
 
The sunrise of the location as a Date.
 
The sunrise of the location as a Date.
==<code>sunset</code>==
+
===<code>sunset</code>===
 
The sunset of the location as a Date.
 
The sunset of the location as a Date.
==<code>hubs</code>==
+
===<code>hubs</code>===
 
A list of hubs for this location as a List<Hub>.  In Hubitat there is only one Hub in the list.
 
A list of hubs for this location as a List<Hub>.  In Hubitat there is only one Hub in the list.
  
 
==Methods==
 
==Methods==
==<code>getFormattedLatitude</code>==
+
===<code>getFormattedLatitude</code>===
==<code>getFormattedLongitude</code>==
+
===<code>getFormattedLongitude</code>===
==<code>getTimeFormat</code>==
+
===<code>getTimeFormat</code>===
==<code>getModes</code>==
+
===<code>getModes</code>===
==<code>getMode</code>==
+
===<code>getMode</code>===
==<code>setMode</code>==
+
===<code>setMode</code>===
==<code>currentMode</code>==
+
===<code>currentMode</code>===

Revision as of 14:59, 22 April 2019

The Location object is composed of methods that allow you to interact with the settings and values of a location. This object is available to Apps and Drivers via the "getLocation()" method or simply using the property "location".

Properties

id

A unique id for the location, as a Long.

name

The name of the location as a String.

temperatureScale

The temperature scale of the location as a String (C or F).

timeZone

The time zone of the location as a TimeZone object.

zipCode

The zip code of the location as a String.

latitude

The latitude of the location as a BigDecimal.

longitude

The longitude of the location as a BigDecimal.

sunrise

The sunrise of the location as a Date.

sunset

The sunset of the location as a Date.

hubs

A list of hubs for this location as a List<Hub>. In Hubitat there is only one Hub in the list.

Methods

getFormattedLatitude

getFormattedLongitude

getTimeFormat

getModes

getMode

setMode

currentMode