{"action":"created","issue":{"url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/639","repository_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero","labels_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/639/labels{/name}","comments_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/639/comments","events_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/639/events","html_url":"https://github.com/RPi-Distro/python-gpiozero/issues/639","id":311778998,"number":639,"title":"Add fade method to PWMLED, RGBLED and LEDBoard","user":{"login":"bennuttall","id":1609725,"avatar_url":"https://avatars2.githubusercontent.com/u/1609725?v=4","gravatar_id":"","url":"https://api.github.com/users/bennuttall","html_url":"https://github.com/bennuttall","followers_url":"https://api.github.com/users/bennuttall/followers","following_url":"https://api.github.com/users/bennuttall/following{/other_user}","gists_url":"https://api.github.com/users/bennuttall/gists{/gist_id}","starred_url":"https://api.github.com/users/bennuttall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bennuttall/subscriptions","organizations_url":"https://api.github.com/users/bennuttall/orgs","repos_url":"https://api.github.com/users/bennuttall/repos","events_url":"https://api.github.com/users/bennuttall/events{/privacy}","received_events_url":"https://api.github.com/users/bennuttall/received_events","type":"User","site_admin":false},"labels":[{"id":277686841,"url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/labels/suggestion","name":"suggestion","color":"eb6420","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-05T21:40:39Z","updated_at":"2018-04-06T13:58:33Z","closed_at":null,"author_association":"OWNER","body":"As suggested in #449, we should consider adding a `fade` method to PWMLED and RGBLED so that users can fade from one value to another in a specified amount of time:\r\n\r\n```python\r\nled.fade(start=0, end=1, fade_time=10) # example of named args but these would probably be the defaults\r\n```\r\n\r\nThe effect would be roughly equivalent to setting the source to a list values stepping from one value to the other:\r\n\r\n```python\r\nled.source_delay = 0.1\r\nled.source = [i/100 for i in range(100)]\r\n```\r\n\r\nHowever it would be implemented like `blink` and `pulse` rather than by setting source.\r\n\r\nRequest for comments on the API!"},"comment":{"url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/comments/379261643","html_url":"https://github.com/RPi-Distro/python-gpiozero/issues/639#issuecomment-379261643","issue_url":"https://api.github.com/repos/RPi-Distro/python-gpiozero/issues/639","id":379261643,"user":{"login":"lurch","id":476186,"avatar_url":"https://avatars2.githubusercontent.com/u/476186?v=4","gravatar_id":"","url":"https://api.github.com/users/lurch","html_url":"https://github.com/lurch","followers_url":"https://api.github.com/users/lurch/followers","following_url":"https://api.github.com/users/lurch/following{/other_user}","gists_url":"https://api.github.com/users/lurch/gists{/gist_id}","starred_url":"https://api.github.com/users/lurch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lurch/subscriptions","organizations_url":"https://api.github.com/users/lurch/orgs","repos_url":"https://api.github.com/users/lurch/repos","events_url":"https://api.github.com/users/lurch/events{/privacy}","received_events_url":"https://api.github.com/users/lurch/received_events","type":"User","site_admin":false},"created_at":"2018-04-06T13:58:33Z","updated_at":"2018-04-06T13:58:33Z","author_association":"CONTRIBUTOR","body":"I'm obviously a bit biased, but why not the API that I suggested?\r\n`led.fade_to(value, fade_time=1, background=True)` :man_shrugging: \r\n\r\n* The `fade_time=1` and `background=True` defaults match up better with the existing `blink` and `pulse` API\r\n* I think it makes sense for the 'start' of the fade to always be the LED's _current_ value? (especially useful if doing a sequence of fades with RGBLED)\r\n\r\n\r\nFrom a technical point of view, it probably makes sense to add `.fade_to` (or `.fade`) to every class that currently implements `.pulse`, i.e. `PWMOutputDevice`, `RGBLED` and `LEDBoard`."}}
{"actor":{"display_login":"lurch"}}