Search in sources :

Example 1 with StringListType

use of org.eclipse.smarthome.core.library.types.StringListType in project smarthome by eclipse.

the class StateUtil method getAllStates.

public static List<State> getAllStates() {
    LinkedList<State> states = new LinkedList<>();
    DateTimeType dateTime = new DateTimeType();
    states.add(dateTime);
    DecimalType decimal = new DecimalType(23);
    states.add(decimal);
    PercentType percent = new PercentType(50);
    states.add(percent);
    HSBType hsb = new HSBType("50,75,42");
    states.add(hsb);
    states.add(OnOffType.ON);
    states.add(OnOffType.OFF);
    states.add(OpenClosedType.OPEN);
    states.add(OpenClosedType.CLOSED);
    states.add(PlayPauseType.PLAY);
    states.add(PlayPauseType.PAUSE);
    PointType point = new PointType("42.23,23.5");
    states.add(point);
    RawType raw = new RawType(new byte[0], "application/octet-stream");
    states.add(raw);
    states.add(RewindFastforwardType.REWIND);
    states.add(RewindFastforwardType.FASTFORWARD);
    StringListType stringList = new StringListType(new String[] { "foo", "bar" });
    states.add(stringList);
    StringType string = new StringType("foo");
    states.add(string);
    states.add(UnDefType.NULL);
    states.add(UnDefType.UNDEF);
    states.add(UpDownType.UP);
    states.add(UpDownType.DOWN);
    QuantityType<Temperature> quantityType = new QuantityType<Temperature>("12 °C");
    states.add(quantityType);
    return states;
}
Also used : Temperature(javax.measure.quantity.Temperature) StringType(org.eclipse.smarthome.core.library.types.StringType) PercentType(org.eclipse.smarthome.core.library.types.PercentType) LinkedList(java.util.LinkedList) DateTimeType(org.eclipse.smarthome.core.library.types.DateTimeType) QuantityType(org.eclipse.smarthome.core.library.types.QuantityType) State(org.eclipse.smarthome.core.types.State) DecimalType(org.eclipse.smarthome.core.library.types.DecimalType) PointType(org.eclipse.smarthome.core.library.types.PointType) RawType(org.eclipse.smarthome.core.library.types.RawType) HSBType(org.eclipse.smarthome.core.library.types.HSBType) StringListType(org.eclipse.smarthome.core.library.types.StringListType)

Example 2 with StringListType

use of org.eclipse.smarthome.core.library.types.StringListType in project smarthome by eclipse.

the class CallItemTest method testSetStringListType.

@Test
public void testSetStringListType() {
    StringListType callType1 = new StringListType("0699222222", "0179999998");
    CallItem callItem1 = new CallItem("testItem");
    callItem1.setState(callType1);
    assertEquals(callItem1.toString(), "testItem (Type=CallItem, State=0699222222,0179999998, Label=null, Category=null)");
    callType1 = new StringListType("0699222222,0179999998");
    callItem1.setState(callType1);
    assertEquals(callItem1.toString(), "testItem (Type=CallItem, State=0699222222,0179999998, Label=null, Category=null)");
}
Also used : StringListType(org.eclipse.smarthome.core.library.types.StringListType) Test(org.junit.Test)

Aggregations

StringListType (org.eclipse.smarthome.core.library.types.StringListType)2 LinkedList (java.util.LinkedList)1 Temperature (javax.measure.quantity.Temperature)1 DateTimeType (org.eclipse.smarthome.core.library.types.DateTimeType)1 DecimalType (org.eclipse.smarthome.core.library.types.DecimalType)1 HSBType (org.eclipse.smarthome.core.library.types.HSBType)1 PercentType (org.eclipse.smarthome.core.library.types.PercentType)1 PointType (org.eclipse.smarthome.core.library.types.PointType)1 QuantityType (org.eclipse.smarthome.core.library.types.QuantityType)1 RawType (org.eclipse.smarthome.core.library.types.RawType)1 StringType (org.eclipse.smarthome.core.library.types.StringType)1 State (org.eclipse.smarthome.core.types.State)1 Test (org.junit.Test)1