Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ProfileCallback#handle_command when an item is linked to a different channel type #182

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Oct 25, 2023

This failed because handle_command tried to call ColorItem#format_command when the channel is a String and should be able to handle any string, not related to a color

profile("test") do |event, command:, callback:|
  logger.warn "Profile called #{event} #{command}"
  case event
  when :command_from_item
    logger.warn("command_from_item: #{command} #{command.class}")
    callback.handle_command("test")
  end
end

things.build do
  thing "astro:moon:test"
end

items.build do
  color_item "Color1" do
    channel "astro:moon:test:phase#name", profile: "ruby:test"
  end
end

Color1.command "0,100,100"

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng added the bug Something isn't working label Oct 25, 2023
@ccutrer ccutrer merged commit 5173a52 into openhab:main Oct 25, 2023
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants