Class: OpenHAB::DSL::Sitemaps::SwitchBuilder
- Inherits:
-
WidgetBuilder
- Object
- WidgetBuilder
- OpenHAB::DSL::Sitemaps::SwitchBuilder
- Defined in:
- lib/openhab/dsl/sitemaps/builder.rb
Overview
Builds a ‘Switch` element
Direct Known Subclasses
Instance Attribute Summary collapse
-
#mappings ⇒ Hash, ...
Mappings from command to label.
Attributes inherited from WidgetBuilder
#icon, #icon_colors, #item, #label, #label_colors, #static_icon, #value_colors, #visibilities
Method Summary
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 Attribute Details
#mappings ⇒ Hash, ...
Mappings from command to label
If a hash is given, the keys are the commands and the values are the labels. The keys can be any command, string or symbol. They will be converted to strings.
If an array is given:
-
Scalar elements define the command, and the label is the same as the command.
-
Array elements contain the command, label, and optional third element for the icon.
-
Hash elements contain the ‘command`, `release` (optional), `label`, and `icon` (optional) defined by the corresponding keys.
361 362 363 |
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 361 def mappings @mappings end |