DeviceProperty Class

Description


The DeviceProperty class is the main data class to hold the definition data of a property. All other Property-Classes will be converted to this class when they are added to the LaRoomy Api Interface. This class could also be used to directly construct a Device-Property.

  	
class DeviceProperty {
public:
    DeviceProperty();
    DeviceProperty(const DeviceProperty &p);
    DeviceProperty(Button &b);
    DeviceProperty(Switch &s);
    DeviceProperty(LevelSelector &ls);
    DeviceProperty(LevelIndicator &li);
    DeviceProperty(TextDisplay &td);
    DeviceProperty(OptionSelector &os);
    DeviceProperty(RGBSelector &rs);
    DeviceProperty(ExtendedLevelSelector &els);
    DeviceProperty(TimeSelector &ts);
    DeviceProperty(TimeFrameSelector &tfs);
    DeviceProperty(DateSelector &dss);
    DeviceProperty(UnlockControl &uc);
    DeviceProperty(NavigatorControl &nc);
    DeviceProperty(BarGraph &bg);
    DeviceProperty(LineGraph &lg);
    DeviceProperty(StringInterrogator &si);
    DeviceProperty(TextListPresenter &tlp);

    unsigned int propertyType = 0;
    uint8_t imageID = 0;
    uint8_t propertyState = 0;
    unsigned int propertyID = 0;
    bool isEnabled = true;

    String descriptor = "not set";
);
  

Constructor


The DeviceProperty class has a constructor for every specific property class, so all methods that take a DeviceProperty as an argument, can also take all other Property-Classes.

Property Type


The Property-Type determins the appearance and the functionality of the property element. The PropertyType enum can be used to set the value.

  	  
unsigned int propertyType = PropertyType::SWITCH;
  

Available property types:

Value Property Type
1 Button
2 Switch
3 Level Selector
4 Level Indicator
5 Text Display
6 Option Selector
7 RGB Selector
8 Extended Level Selector
9 Time Selector
10 Time Frame Selector
11 Date Selector
12 Unlock Control
13 Navigator Control
14 Bar Graph
15 Line Graph
16 String Interrogator
17 Text List Presenter

Image ID


The image defines the image which will be displayed in the property element. The LaRoomyImages enum can be used to set the image. A full list of the available images is here.

  	  
uint8_t imageID = LaRoomyImages::HOUSE_001;
  

Property State


This is the state of a Simple-Property. If the property is a complex type this parameter is not used.

Property ID


This parameter is used to uniquely identify a property element. Therefore it must be unique for every property element, that means that no other element should have the same id. The property element must not have a zero ID.

Enabled State


The isEnabled parameter affects the visual state of a property and the possibility of user interaction. If an element is disabled (param set to false) the element is grayed out and accepts no user input.

Descriptor


This is the text resource for the property element. Note that the raw descriptor has special syntax for some property elements.