Skip to content

Commit

Permalink
change in Buttongrid: call create_button_definition in OH4.2 (#270)
Browse files Browse the repository at this point in the history
This is to adapt to the change in core:
openhab/openhab-core#4223

A separate PR will be created to add support for the new `Button` widget

Signed-off-by: Jimmy Tanagra <[email protected]>
  • Loading branch information
jimtng authored May 21, 2024
1 parent e586fbe commit efe760a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/openhab/dsl/sitemaps/builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,12 @@ def button(button)
def build
widget = super
buttons.each do |button|
button_object = SitemapBuilder.factory.create_button
button_object = if SitemapBuilder.factory.respond_to?(:create_button_definition)
SitemapBuilder.factory.create_button_definition
else
# @deprecated OH 4.1 in OH 4.2 this clause is not needed
SitemapBuilder.factory.create_button
end
button_object.row = button[0]
button_object.column = button[1]
button_object.cmd = button[2]
Expand Down

0 comments on commit efe760a

Please sign in to comment.