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.

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

#items, #method_missing, #things

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

One or more visibility rules (see WidgetBuilder#visibility) Create a new Buttongrid element.

Examples:

Create a buttongrid with buttons as an argument

# 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"],

      # Using keyword arguments:
      {row: 3, column: 2, click: "ENTER", label: "Enter", icon: "material:adjust" }
    ]
  end
end

Create a buttongrid with button widgets

sitemaps.build do
  sitemap "remote", label: "TV Remote Control" do
    buttongrid item: LivingRoom_TV_RCButton do
      button 1, 1, click: "BACK", icon: "f7:return"
      button 1, 2, click: "HOME", icon: "material:apps"
      button 1, 3, click: "YELLOW", icon: "f7:search"
      button 2, 2, click: "UP", icon: "f7:arrowtriangle_up"
      button 4, 2, click: "DOWN", icon: "f7:arrowtriangle_down"
      button 3, 1, click: "LEFT", icon: "f7:arrowtriangle_left"
      button 3, 3, click: "RIGHT", icon: "f7:arrowtriangle_right"
      button 3, 2, click: "ENTER", icon: "material:adjust"
    end

    # The following buttons use widget features introduced in openHAB 4.2+
    buttongrid item: LivingRoom_Curtain do
      button 1, 1, click: "up", release: "stop", icon: "f7:arrowtriangle_up"
      button 2, 1, click: "down", release: "stop", icon: "f7:arrowtriangle_up"
    end
  end
end

Parameters:

Yields:

Returns:

See Also:

Since:

  • openHAB 4.1



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

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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) Create a new Colorpicker element.

Parameters:

Yields:

Returns:



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

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

One or more visibility rules (see WidgetBuilder#visibility) Create a new Default element.

Parameters:

Yields:

Returns:



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

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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) Create a new Input element.

Parameters:

Yields:

Returns:

Since:

  • openHAB 4.0



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

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:



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

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

One or more visibility rules (see WidgetBuilder#visibility) Create a new Setpoint element.

Parameters:

Yields:

Returns:



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

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, release_only: nil, label_color: nil, value_color: nil, icon_color: nil, visibility: nil) { ... } ⇒ SliderBuilder

One or more visibility rules (see WidgetBuilder#visibility) Create a new Slider element.

Parameters:

Yields:

Returns:



155
156
157
158
159
160
161
162
163
164
165
166
167
168
# 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,
           release_only: 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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) 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

One or more visibility rules (see WidgetBuilder#visibility) 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