{"action":"created","issue":{"url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/6","repository_url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci","labels_url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/6/comments","events_url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/6/events","html_url":"https://github.com/50ButtonsEach/fliclib-linux-hci/issues/6","id":155247629,"number":6,"title":"How to handle events","user":{"login":"RobZe89","id":17066038,"avatar_url":"https://avatars.githubusercontent.com/u/17066038?v=3","gravatar_id":"","url":"https://api.github.com/users/RobZe89","html_url":"https://github.com/RobZe89","followers_url":"https://api.github.com/users/RobZe89/followers","following_url":"https://api.github.com/users/RobZe89/following{/other_user}","gists_url":"https://api.github.com/users/RobZe89/gists{/gist_id}","starred_url":"https://api.github.com/users/RobZe89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RobZe89/subscriptions","organizations_url":"https://api.github.com/users/RobZe89/orgs","repos_url":"https://api.github.com/users/RobZe89/repos","events_url":"https://api.github.com/users/RobZe89/events{/privacy}","received_events_url":"https://api.github.com/users/RobZe89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-05-17T12:31:27Z","updated_at":"2016-07-14T15:44:08Z","closed_at":null,"body":"Dear team\r\n\r\nGlad to see, that there is a new linux release for the flic button. I'm using the old fliclib quite a long time with the known problems. My problem now is that I'm not as good as many of you. I want to migrate to the new version, but I didn't get to find out the way to handle the events coming from the flic button. Maybe some of you can show / write a sample for the 3 types of \"actions\", short, double, long click on a flic button. Like in this [comment](https://github.com/50ButtonsEach/fliclib-linux-dist/issues/10#issuecomment-185926306) for the old fliclib. \r\n\r\nIt could be in python or nodejs, doesn't matter.\r\n\r\nBest Regards\r\nRob"},"comment":{"url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/comments/232704516","html_url":"https://github.com/50ButtonsEach/fliclib-linux-hci/issues/6#issuecomment-232704516","issue_url":"https://api.github.com/repos/50ButtonsEach/fliclib-linux-hci/issues/6","id":232704516,"user":{"login":"PiRune","id":20454469,"avatar_url":"https://avatars.githubusercontent.com/u/20454469?v=3","gravatar_id":"","url":"https://api.github.com/users/PiRune","html_url":"https://github.com/PiRune","followers_url":"https://api.github.com/users/PiRune/followers","following_url":"https://api.github.com/users/PiRune/following{/other_user}","gists_url":"https://api.github.com/users/PiRune/gists{/gist_id}","starred_url":"https://api.github.com/users/PiRune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PiRune/subscriptions","organizations_url":"https://api.github.com/users/PiRune/orgs","repos_url":"https://api.github.com/users/PiRune/repos","events_url":"https://api.github.com/users/PiRune/events{/privacy}","received_events_url":"https://api.github.com/users/PiRune/received_events","type":"User","site_admin":false},"created_at":"2016-07-14T15:44:08Z","updated_at":"2016-07-14T15:44:08Z","body":"Thank you for the swift reply, Emill :) My main problem is, however, getting the \"if\" statements to work, so I can have different actions for different click types and different buttons, like in RobZe89's example.\r\n\r\nI guess the logic should be something like:\r\n```\r\nIf bdAddr is xx:xx:xx:xx:xx:xx and clickType is ButtonSingleClick\r\n    then run sonos_volume_up_script.py and print(\"Volume turned up\")\r\n\r\nIf bdAddr is xx:xx:xx:xx:xx:xx and clickType is ButtonDoubleClick\r\n    then run sonos_volume_down_script.py and print(\"Volume turned down\")\r\n\r\nIf bdAddr is yy:yy:yy:yy:yy:yy and clicktype is ButtonHold\r\n    then run hue_lights_script.py and print(\"Hue lights dimmed to 50%\")\r\n```\r\nBut I can't get this part to work and I'm not sure where to put it. Should it be part of the some_handler function? like:\r\n```\r\ndef some_handler(channel, click_type, was_queued, time_diff):\r\n       If bdAddr is xx:xx:xx:xx:xx:xx and clickType is ButtonSingleClick\r\n           then run sonos_volume_up_script.py and print(\"Volume turned up\")\r\n```"}}
{"actor":{"display_login":"PiRune"}}