{"action":"created","issue":{"url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/76","labels_url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/76/comments","events_url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/76/events","html_url":"https://github.com/rhempel/ev3dev-lang-python/pull/76","id":115640701,"number":76,"title":"Switch to group-based interface in Leds","user":{"login":"ddemidov","id":270503,"avatar_url":"https://avatars.githubusercontent.com/u/270503?v=3","gravatar_id":"","url":"https://api.github.com/users/ddemidov","html_url":"https://github.com/ddemidov","followers_url":"https://api.github.com/users/ddemidov/followers","following_url":"https://api.github.com/users/ddemidov/following{/other_user}","gists_url":"https://api.github.com/users/ddemidov/gists{/gist_id}","starred_url":"https://api.github.com/users/ddemidov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ddemidov/subscriptions","organizations_url":"https://api.github.com/users/ddemidov/orgs","repos_url":"https://api.github.com/users/ddemidov/repos","events_url":"https://api.github.com/users/ddemidov/events{/privacy}","received_events_url":"https://api.github.com/users/ddemidov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-07T06:40:28Z","updated_at":"2015-11-07T09:27:54Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/pulls/76","html_url":"https://github.com/rhempel/ev3dev-lang-python/pull/76","diff_url":"https://github.com/rhempel/ev3dev-lang-python/pull/76.diff","patch_url":"https://github.com/rhempel/ev3dev-lang-python/pull/76.patch"},"body":"This is based on discussion at https://github.com/rhempel/ev3dev-lang-python/issues/37#issuecomment-153442761.\r\n\r\nThis introduces concepts of led groups (see also ev3dev/ev3dev#412) and colors into `Leds` class. The led groups may be operated as in:\r\n```py\r\n# Set group color:\r\nLeds.set_color(Leds.LEFT, Leds.AMBER)\r\nLeds.set_color(Leds.RIGHT, (1.0, 0.75))\r\n\r\n# Batch set arbitrary led properties in group:\r\nLeds.set(Leds.LEFT, trigger='timer', brightness_pct=0.5)\r\n```\r\n\r\nI hope this is close to what @EricPobot had in mind.\r\n\r\nThis is accompanied by rhempel/ev3dev-lang@28361dad5e4f33749ee76634eeedfc1b972b6507"},"comment":{"url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/comments/154672273","html_url":"https://github.com/rhempel/ev3dev-lang-python/pull/76#issuecomment-154672273","issue_url":"https://api.github.com/repos/rhempel/ev3dev-lang-python/issues/76","id":154672273,"user":{"login":"EricPobot","id":2886835,"avatar_url":"https://avatars.githubusercontent.com/u/2886835?v=3","gravatar_id":"","url":"https://api.github.com/users/EricPobot","html_url":"https://github.com/EricPobot","followers_url":"https://api.github.com/users/EricPobot/followers","following_url":"https://api.github.com/users/EricPobot/following{/other_user}","gists_url":"https://api.github.com/users/EricPobot/gists{/gist_id}","starred_url":"https://api.github.com/users/EricPobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EricPobot/subscriptions","organizations_url":"https://api.github.com/users/EricPobot/orgs","repos_url":"https://api.github.com/users/EricPobot/repos","events_url":"https://api.github.com/users/EricPobot/events{/privacy}","received_events_url":"https://api.github.com/users/EricPobot/received_events","type":"User","site_admin":false},"created_at":"2015-11-07T09:27:54Z","updated_at":"2015-11-07T09:27:54Z","body":"It seems to do the job as expected. OK for me.\r\n\r\nBTW dealing with the colours rather that with the individual leds avoids a logical but disturbing behaviour which made me scratch my head recently. While the leds are on in amber (or any mix), `red_on()` and alike seems to be inoperative. In fact they are, but have no visual effect, since it is also required to invoke `green_off()` to obtain the desired result. Once again, what happens is perfectly correct, but not intuitive.\r\nMaybe we should completely remove individual coloured leds control, and propose only colour setting as you've implemented. "}}