Skip to content

Commit

Permalink
Document String for icon in ItemBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: Jimmy Tanagra <[email protected]>
  • Loading branch information
jimtng authored and ccutrer committed Sep 22, 2023
1 parent 39530ad commit 879ecda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/openhab/dsl/items/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ class ItemBuilder
# @return [String, nil]
attr_accessor :format
# The icon to be associated with the item
# @return [Symbol, nil]
# @return [Symbol, String, nil]
attr_accessor :icon
# Groups to which this item should be added
# @return [Array<String, GroupItem>]
Expand Down Expand Up @@ -240,7 +240,7 @@ def normalize_tags(*tags)
# @param dimension [Symbol, nil] The unit dimension for a {NumberItem} (see {ItemBuilder#dimension})
# @param unit [Symbol, String, nil] The unit for a {NumberItem} (see {ItemBuilder#unit})
# @param format [String, nil] The formatting pattern for the item's state (see {ItemBuilder#format})
# @param icon [Symbol, nil] The icon to be associated with the item (see {ItemBuilder#icon})
# @param icon [Symbol, String, nil] The icon to be associated with the item (see {ItemBuilder#icon})
# @param group [String,
# GroupItem,
# GroupItemBuilder,
Expand All @@ -260,7 +260,7 @@ def normalize_tags(*tags)
# @param autoupdate [true, false, nil] Autoupdate setting (see {ItemBuilder#autoupdate})
# @param thing [String, Core::Things::Thing, Core::Things::ThingUID, nil]
# A Thing to be used as the base for the channel.
# @param channel [String, Core::Things::ChannelUID, nil]
# @param channel [String, Symbol, Core::Things::ChannelUID, Core::Things::Channel, nil]
# Channel to link the item to (see {ItemBuilder#channel}).
# @param expire [String] An expiration specification (see {ItemBuilder#expire}).
# @param alexa [String, Symbol, Array<(String, Hash<String, Object>)>, nil]
Expand Down Expand Up @@ -414,9 +414,9 @@ def group(*groups)
#
# Add a channel link to this item.
#
# @param [String, Core::Things::ChannelUID, Symbol] channel Channel to link the item to.
# When thing is set, this can be a relative channel name.
# @param [Hash] config Additional configuration, such as profile
# @param channel [String, Symbol, Core::Things::ChannelUID, Core::Things::Channel]
# Channel to link the item to. When thing is set, this can be a relative channel name.
# @param config [Hash] Additional configuration, such as profile
# @return [void]
#
# @example
Expand Down
3 changes: 2 additions & 1 deletion lib/openhab/dsl/things/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ def initialize(uid, label = nil, binding: nil, type: nil, bridge: nil, location:

# Add an explicitly configured channel to this item
# @see ChannelBuilder#initialize
# @return [Core::Things::Channel]
def channel(*args, **kwargs, &block)
channel = ChannelBuilder.new(*args, thing: self, **kwargs)
channel.instance_eval(&block) if block
@channels << channel.build
channel.build.tap { |c| @channels << c }
end

# @!visibility private
Expand Down

0 comments on commit 879ecda

Please sign in to comment.