Class LocationItem
- All Implemented Interfaces:
Identifiable<String>
,ActiveItem
,Item
- Author:
- Gaƫl L'hopital - Initial contribution
-
Field Summary
Fields inherited from class org.openhab.core.items.GenericItem
category, eventPublisher, groupNames, itemStateConverter, label, listeners, name, state, tags, timeSeriesListeners, type
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondistanceFrom
(@Nullable LocationItem awayItem) Compute the distance with another Point type, http://stackoverflow.com/questions/837872/calculate-distance-in-meters-when-you-know-longitude-and-latitude-in- javaThis method provides a list of all command types that can be used for this itemThis method provides a list of all data types that can be used to update the item statevoid
void
Set a new state.void
setTimeSeries
(TimeSeries timeSeries) Set a new time series.Methods inherited from class org.openhab.core.items.GenericItem
addGroupName, addGroupNames, addGroupNames, addStateChangeListener, addTag, addTags, addTags, addTimeSeriesListener, applyState, applyTimeSeries, dispose, equals, getCategory, getCommandDescription, getCommandOptions, getGroupNames, getLabel, getName, getState, getStateAs, getStateDescription, getStateDescription, getTags, getType, getUID, hashCode, hasTag, internalSend, isAcceptedState, logSetTypeError, logSetTypeError, notifyListeners, removeAllTags, removeGroupName, removeStateChangeListener, removeTag, removeTimeSeriesListener, send, setCategory, setCommandDescriptionService, setEventPublisher, setItemStateConverter, setLabel, setStateDescriptionService, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.openhab.core.items.Item
getCommandDescription
-
Constructor Details
-
LocationItem
-
-
Method Details
-
send
-
getAcceptedDataTypes
Description copied from interface:Item
This method provides a list of all data types that can be used to update the item state
Imagine e.g. a dimmer device: It's status could be 0%, 10%, 50%, 100%, but also OFF or ON and maybe UNDEFINED. So the accepted data types would be in this case
PercentType
, andUnDefType
The order of data types denotes the order of preference. So in case a state needs to be converted in order to be accepted, it will be attempted to convert it to a type from top to bottom. Therefore the type with the least information loss should be on top of the list - in the example above the
PercentType
carries more information than the , hence it is listed first.- Returns:
- a list of data types that can be used to update the item state
-
getAcceptedCommandTypes
Description copied from interface:Item
This method provides a list of all command types that can be used for this item
Imagine e.g. a dimmer device: You could ask it to dim to 0%, 10%, 50%, 100%, but also to turn OFF or ON. So the accepted command types would be in this case
PercentType
,- Returns:
- a list of all command types that can be used for this item
-
distanceFrom
Compute the distance with another Point type, http://stackoverflow.com/questions/837872/calculate-distance-in-meters-when-you-know-longitude-and-latitude-in- java- Parameters:
awayItem
- the point to calculate the distance with- Returns:
- distance between the two points in meters
-
setState
Description copied from class:GenericItem
Set a new state. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyState(State)
should be called by classes overriding this method.- Overrides:
setState
in classGenericItem
- Parameters:
state
- new state of this item
-
setTimeSeries
Description copied from class:GenericItem
Set a new time series. Subclasses may override this method in order to do necessary conversions upfront. Afterwards,GenericItem.applyTimeSeries(TimeSeries)
should be called by classes overriding this method. A time series may only contain events that are compatible with the item's internal state.- Overrides:
setTimeSeries
in classGenericItem
- Parameters:
timeSeries
- new time series of this item
-