Class: OpenHAB::DSL::Sitemaps::LinkableWidgetBuilder

Inherits:
WidgetBuilder
  • Object
show all
Defined in:
lib/openhab/dsl/sitemaps/builder.rb

Overview

Parent class for builders of widgets that can contain other widgets.

See Also:

  • orgorg.openhaborg.openhab.coreorg.openhab.core.modelorg.openhab.core.model.sitemaporg.openhab.core.model.sitemap.sitemaporg.openhab.core.model.sitemap.sitemap.LinkableWidget

Instance Attribute Summary

Attributes inherited from WidgetBuilder

#icon, #icon_colors, #item, #label, #label_colors, #static_icon, #value_colors, #visibilities

Instance Method Summary collapse

Methods inherited from WidgetBuilder

#icon_color, #label_color, #value_color, #visibility

Methods included from Core::EntityLookup

#method_missing

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class OpenHAB::Core::EntityLookup

Instance Method Details

#buttongrid(item: nil, label: nil, icon: nil, static_icon: nil, buttons: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ ButtongridBuilder

Create a new ‘Buttongrid` element.

Examples:

# This creates a buttongrid to emulate a TV remote control
sitemaps.build do
  sitemap "remote", label: "TV Remote Control" do
    buttongrid item: LivingRoom_TV_RCButton, buttons: [
      [1, 1, "BACK", "Back", "f7:return"],
      [1, 2, "HOME", "Menu", "material:apps"],
      [1, 3, "YELLOW", "Search", "f7:search"],
      [2, 2, "UP", "Up", "f7:arrowtriangle_up"],
      [4, 2, "DOWN", "Down", "f7:arrowtriangle_down"],
      [3, 1, "LEFT", "Left", "f7:arrowtriangle_left"],
      [3, 3, "RIGHT", "Right", "f7:arrowtriangle_right"],
      [3, 2, "ENTER", "Enter", "material:adjust"]
    ]
  end
end

Parameters:

  • item (String, Core::Items::Item, nil) (defaults to: nil)

    The item whose state to show (see WidgetBuilder#item)

  • label (String, nil) (defaults to: nil)
  • icon (String, Hash<String, String>, Hash<Array<String>, String>, nil) (defaults to: nil)
  • static_icon (String, nil) (defaults to: nil)
  • label_color (String, Hash<String, String>, Hash<Array<String>, String>, nil) (defaults to: nil)

    One or more label color rules (see WidgetBuilder#label_color)

  • value_color (String, Hash<String, String>, Hash<Array<String>, String>, nil) (defaults to: nil)

    One or more value color rules (see WidgetBuilder#value_color)

  • icon_color (String, Hash<String, String>, Hash<Array<String>, String>, nil) (defaults to: nil)

    One or more icon color rules (see WidgetBuilder#icon_color)

  • visibility (String, Array<String>, Array<Array<String>>, nil) (defaults to: nil)

    One or more visibility rules (see WidgetBuilder#visibility)

  • buttons (Array<Array<int, int, Command, String, String>>) (defaults to: nil)

    An array of buttons to display. Each element is an array with the following elements:

    • row: 1-12

    • column: 1-12

    • command: The command to send when the button is pressed

    • label: The label to display on the button

    • icon: The icon to display on the button (optional)

Yields:

Returns:

See Also:

Since:

  • openHAB 4.1



208
209
210
211
212
213
214
215
216
217
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 208

def buttongrid(item: nil,
               label: nil,
               icon: nil,
               static_icon: nil,
               buttons: nil,
               label_color: nil,
               value_color: nil,
               icon_color: nil,
               visibility: nil)
end

#chart(item: nil, label: nil, icon: nil, static_icon: nil, service: nil, refresh: nil, period: nil, legend: nil, group: nil, y_axis_pattern: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ ChartBuilder

Create a new ‘Chart` element.

Parameters:

Yields:

Returns:



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 85

def chart(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          service: nil,
          refresh: nil,
          period: nil,
          legend: nil,
          group: nil,
          y_axis_pattern: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#colorpicker(item: nil, label: nil, icon: nil, static_icon: nil, frequency: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ ColorpickerBuilder

Create a new ‘Colorpicker` element.

Parameters:

Yields:

Returns:



241
242
243
244
245
246
247
248
249
250
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 241

def colorpicker(item: nil,
                label: nil,
                icon: nil,
                static_icon: nil,
                frequency: nil,
                label_color: nil,
                value_color: nil,
                icon_color: nil,
                visibility: nil)
end

#default(item: nil, label: nil, icon: nil, static_icon: nil, height: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ DefaultBuilder

Create a new ‘Default` element.

Parameters:

Yields:

Returns:



257
258
259
260
261
262
263
264
265
266
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 257

def default(item: nil,
           label: nil,
           icon: nil,
           static_icon: nil,
           height: nil,
           label_color: nil,
           value_color: nil,
           icon_color: nil,
           visibility: nil)
end

#frame(item: nil, label: nil, icon: nil, static_icon: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ FrameBuilder

Create a new ‘Frame` element.

Parameters:

Yields:

Returns:



6
7
8
9
10
11
12
13
14
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 6

def frame(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#group(item: nil, label: nil, icon: nil, static_icon: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ GroupBuilder

Create a new ‘Group` element.

Parameters:

Yields:

Returns:



36
37
38
39
40
41
42
43
44
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 36

def group(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#image(item: nil, label: nil, icon: nil, static_icon: nil, url: nil, refresh: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ ImageBuilder

Create a new ‘Image` element.

Parameters:

Yields:

Returns:



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 51

def image(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          url: nil,
          refresh: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#input(item: nil, label: nil, icon: nil, static_icon: nil, hint: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ InputBuilder

Create a new ‘Input` element.

Parameters:

Yields:

Returns:

Since:

  • openHAB 4.0



191
192
193
194
195
196
197
198
199
200
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 191

def input(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          hint: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#mapview(item: nil, label: nil, icon: nil, static_icon: nil, height: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ MapviewBuilder

Create a new ‘Mapview` element.

Yields:

Returns:



139
140
141
142
143
144
145
146
147
148
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 139

def mapview(item: nil,
            label: nil,
            icon: nil,
            static_icon: nil,
            height: nil,
            label_color: nil,
            value_color: nil,
            icon_color: nil,
            visibility: nil)
end

#selection(item: nil, label: nil, icon: nil, static_icon: nil, mappings: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ SelectionBuilder

Create a new ‘Selection` element.

Yields:

Returns:



174
175
176
177
178
179
180
181
182
183
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 174

def selection(item: nil,
              label: nil,
              icon: nil,
              static_icon: nil,
              mappings: nil,
              label_color: nil,
              value_color: nil,
              icon_color: nil,
              visibility: nil)
end

#setpoint(item: nil, label: nil, icon: nil, static_icon: nil, range: nil, step: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ SetpointBuilder

Create a new ‘Setpoint` element.

Parameters:

Yields:

Returns:



224
225
226
227
228
229
230
231
232
233
234
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 224

def setpoint(item: nil,
            label: nil,
            icon: nil,
            static_icon: nil,
            range: nil,
            step: nil,
            label_color: nil,
            value_color: nil,
            icon_color: nil,
            visibility: nil)
end

#slider(item: nil, label: nil, icon: nil, static_icon: nil, range: nil, step: nil, switch: nil, frequency: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ SliderBuilder

Create a new ‘Slider` element.

Parameters:

Yields:

Returns:



155
156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 155

def slider(item: nil,
           label: nil,
           icon: nil,
           static_icon: nil,
           range: nil,
           step: nil,
           switch: nil,
           frequency: nil,
           label_color: nil,
           value_color: nil,
           icon_color: nil,
           visibility: nil)
end

#switch(item: nil, label: nil, icon: nil, static_icon: nil, mappings: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ SwitchBuilder

Create a new ‘Switch` element.

Parameters:

Yields:

Returns:



123
124
125
126
127
128
129
130
131
132
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 123

def switch(item: nil,
           label: nil,
           icon: nil,
           static_icon: nil,
           mappings: nil,
           label_color: nil,
           value_color: nil,
           icon_color: nil,
           visibility: nil)
end

#text(item: nil, label: nil, icon: nil, static_icon: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ TextBuilder

Create a new ‘Text` element.

Parameters:

Yields:

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 21

def text(item: nil,
         label: nil,
         icon: nil,
         static_icon: nil,
         label_color: nil,
         value_color: nil,
         icon_color: nil,
         visibility: nil)
end

#video(item: nil, label: nil, icon: nil, static_icon: nil, url: nil, encoding: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ VideoBuilder

Create a new ‘Video` element.

Parameters:

Yields:

Returns:



68
69
70
71
72
73
74
75
76
77
78
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 68

def video(item: nil,
          label: nil,
          icon: nil,
          static_icon: nil,
          url: nil,
          encoding: nil,
          label_color: nil,
          value_color: nil,
          icon_color: nil,
          visibility: nil)
end

#webview(item: nil, label: nil, icon: nil, static_icon: nil, url: nil, height: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ WebviewBuilder

Create a new ‘Webview` element.

Parameters:

Yields:

Returns:



106
107
108
109
110
111
112
113
114
115
116
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 106

def webview(item: nil,
            label: nil,
            icon: nil,
            static_icon: nil,
            url: nil,
            height: nil,
            label_color: nil,
            value_color: nil,
            icon_color: nil,
            visibility: nil)
end