Module: OpenHAB::Core::EntityLookup
- Included in:
- DSL, DSL::Items::Builder, DSL::Items::ItemBuilder, DSL::Rules::Builder, DSL::Rules::BuilderDSL, DSL::Sitemaps::WidgetBuilder
- Defined in:
- lib/openhab/core/entity_lookup.rb
Overview
Note:
Thing UIDs are separated by a colon :
. Since it is not a valid symbol for an identifier,
it must be replaced with an underscore _
. So to access astro:sun:home
, use astro_sun_home
as an alternative to things["astro:sun:home"]
Manages access to openHAB entities
You can access openHAB items and things directly using their name, anywhere EntityLookup
is available.
Instance Method Summary collapse
-
#method_missing ⇒ Item, ...
Automatically looks up openHAB items and things in appropriate registries.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Item, ...
Automatically looks up openHAB items and things in appropriate registries
74 75 76 77 78 79 80 81 |
# File 'lib/openhab/core/entity_lookup.rb', line 74 ruby2_keywords def method_missing(method, *args) return super unless args.empty? && !block_given? logger.trace { "method missing, performing openHAB Lookup for: #{method}" } EntityLookup.lookup_entity(method, create_dummy_items: self.class.respond_to?(:create_dummy_items?) && self.class.create_dummy_items?) || super end |