Class: OpenHAB::DSL::Sitemaps::Builder
- Inherits:
-
Object
- Object
- OpenHAB::DSL::Sitemaps::Builder
- Defined in:
- lib/openhab/dsl/sitemaps/builder.rb
Overview
A sitemap builder allows you to dynamically create openHAB sitemaps at runtime.
Instance Method Summary collapse
Instance Method Details
#sitemap(name, label: nil, icon: nil) { ... } ⇒ SitemapBuilder
51 52 53 54 55 56 57 58 59 |
# File 'lib/openhab/dsl/sitemaps/builder.rb', line 51 def sitemap(name, label: nil, icon: nil, &block) sitemap = SitemapBuilder.new(name, @builder_proxy, label: label, icon: icon, &block) sitemap = sitemap.build if @update && @provider.get(sitemap.uid) @provider.update(sitemap) else @provider.add(sitemap) end end |