{"action":"opened","issue":{"url":"https://api.github.com/repos/openhab/openhab-distro/issues/227","repository_url":"https://api.github.com/repos/openhab/openhab-distro","labels_url":"https://api.github.com/repos/openhab/openhab-distro/issues/227/labels{/name}","comments_url":"https://api.github.com/repos/openhab/openhab-distro/issues/227/comments","events_url":"https://api.github.com/repos/openhab/openhab-distro/issues/227/events","html_url":"https://github.com/openhab/openhab-distro/issues/227","id":159489714,"number":227,"title":"<XCastedExpressionImpl>.toColor() ","user":{"login":"moskovskiy82","id":15857592,"avatar_url":"https://avatars.githubusercontent.com/u/15857592?v=3","gravatar_id":"","url":"https://api.github.com/users/moskovskiy82","html_url":"https://github.com/moskovskiy82","followers_url":"https://api.github.com/users/moskovskiy82/followers","following_url":"https://api.github.com/users/moskovskiy82/following{/other_user}","gists_url":"https://api.github.com/users/moskovskiy82/gists{/gist_id}","starred_url":"https://api.github.com/users/moskovskiy82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moskovskiy82/subscriptions","organizations_url":"https://api.github.com/users/moskovskiy82/orgs","repos_url":"https://api.github.com/users/moskovskiy82/repos","events_url":"https://api.github.com/users/moskovskiy82/events{/privacy}","received_events_url":"https://api.github.com/users/moskovskiy82/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-09T19:33:30Z","updated_at":"2016-06-09T19:33:30Z","closed_at":null,"body":"Simple rule was working fine under OH1 and under OH2 throws an exception\r\n\r\n`rule \"Set s_RGB_light value\"\r\nwhen\r\nItem s_RGB_light changed\r\nthen\r\nval Color color = (s_RGB_light.state as HSBType).toColor()\r\nval String rgb = String::format(\"%1$02x%2$02x%3$02x\", color.red, color.green, color.blue)\r\npublish(\"mqt\", \"mygateway1-in/36/0/1/0/40\", rgb)\r\nend`\r\n\r\n2016-06-08 22:48:06.739 [INFO ] [marthome.event.ItemStateChangedEvent] - s_RGB_light changed from 140.0,100.0,100 to 0.0,0.0,0.0\r\n2016-06-08 22:48:06.743 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Set s_RGB_light value': An error occured during the script execution: The name '<XCastedExpressionImpl>.toColor()' cannot be resolved to an item or type.\r\n"}}
{"actor":{"display_login":"moskovskiy82"}}