Difference between revisions of "Location Object"
(Added missing hsmStatus property) |
(→getTimeFormat) |
||
Line 31: | Line 31: | ||
===<code>getFormattedLongitude</code>=== | ===<code>getFormattedLongitude</code>=== | ||
===<code>getTimeFormat</code>=== | ===<code>getTimeFormat</code>=== | ||
+ | :Retrieves whether or not the hub is set to 12 or 24 hour time. | ||
+ | |||
+ | :;Signature | ||
+ | :: <code>int getTimeFormat()</code> | ||
+ | |||
+ | :;Returns | ||
+ | :: 12 if the time is set to 12 hour (am/pm), 24 if it is set to 24 hour. | ||
+ | |||
===<code>getModes</code>=== | ===<code>getModes</code>=== | ||
:Get a list of modes for the location. | :Get a list of modes for the location. |
Revision as of 19:03, 15 May 2020
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".
Contents
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.
hsmStatus
The current status of the Hubitat Safety Monitor. This is a String of one of the following values: armedAway, armingAway, armedHome, armingHome, armedNight, armingNight, disarmed, allDisarmed
hubs
A list of hubs for this location as a List<Hub>. In Hubitat there is only one Hub in the list.
hub
The Hub for this location.
Methods
getFormattedLatitude
getFormattedLongitude
getTimeFormat
- Retrieves whether or not the hub is set to 12 or 24 hour time.
- Signature
int getTimeFormat()
- Returns
- 12 if the time is set to 12 hour (am/pm), 24 if it is set to 24 hour.
getModes
- Get a list of modes for the location.
- Signature
List<Mode> getModes()
getMode
- Get the current mode of the location.
- Signature
String getMode()