{"action":"closed","issue":{"url":"https://api.github.com/repos/ultrabug/py3status/issues/174","repository_url":"https://api.github.com/repos/ultrabug/py3status","labels_url":"https://api.github.com/repos/ultrabug/py3status/issues/174/labels{/name}","comments_url":"https://api.github.com/repos/ultrabug/py3status/issues/174/comments","events_url":"https://api.github.com/repos/ultrabug/py3status/issues/174/events","html_url":"https://github.com/ultrabug/py3status/issues/174","id":129834021,"number":174,"title":"Wrong module guess for click event with multiple volume blocks","user":{"login":"cornerman","id":1043127,"avatar_url":"https://avatars.githubusercontent.com/u/1043127?v=3","gravatar_id":"","url":"https://api.github.com/users/cornerman","html_url":"https://github.com/cornerman","followers_url":"https://api.github.com/users/cornerman/followers","following_url":"https://api.github.com/users/cornerman/following{/other_user}","gists_url":"https://api.github.com/users/cornerman/gists{/gist_id}","starred_url":"https://api.github.com/users/cornerman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cornerman/subscriptions","organizations_url":"https://api.github.com/users/cornerman/orgs","repos_url":"https://api.github.com/users/cornerman/repos","events_url":"https://api.github.com/users/cornerman/events{/privacy}","received_events_url":"https://api.github.com/users/cornerman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ultrabug/py3status/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":{"login":"ultrabug","id":474389,"avatar_url":"https://avatars.githubusercontent.com/u/474389?v=3","gravatar_id":"","url":"https://api.github.com/users/ultrabug","html_url":"https://github.com/ultrabug","followers_url":"https://api.github.com/users/ultrabug/followers","following_url":"https://api.github.com/users/ultrabug/following{/other_user}","gists_url":"https://api.github.com/users/ultrabug/gists{/gist_id}","starred_url":"https://api.github.com/users/ultrabug/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ultrabug/subscriptions","organizations_url":"https://api.github.com/users/ultrabug/orgs","repos_url":"https://api.github.com/users/ultrabug/repos","events_url":"https://api.github.com/users/ultrabug/events{/privacy}","received_events_url":"https://api.github.com/users/ultrabug/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-01-29T17:37:57Z","updated_at":"2016-04-15T11:11:08Z","closed_at":"2016-04-15T11:11:08Z","body":"I have defined two volume blocks for two different pulse devices. When defining click events, clicking on either block runs the onClick action of the first module.\r\n\r\nThe configuration looks like this:\r\n```\r\nvolume master {\r\n    device = \"pulse:0\"\r\n    on_click 1 = \"exec pavucontrol\"\r\nnus\"\r\n}\r\n\r\nvolume slave {\r\n    device = \"pulse:1\"\r\n}\r\n```\r\n\r\nLog when running py3status with this configuration and clicking on the first block:\r\n```\r\nJan 29 18:13:13 genius /py3status[24905]: received event {'y': 7, 'instance': 'pulse:0.Master.0', 'x': 1061, 'name': 'volume', 'button': 1}\r\nJan 29 18:13:13 genius /py3status[24905]: trying to dispatch event to module \"volume master\"\r\n```\r\n\r\nClicking on the second block does not dispatch the event to the second module ```volume slave```, but again to the first one ```volume master```:\r\n```\r\nJan 29 18:13:37 genius /py3status[24905]: received event {'y': 12, 'instance': 'pulse:1.Master.0', 'x': 1108, 'name': 'volume', 'button': 1}\r\nJan 29 18:13:37 genius /py3status[24905]: trying to dispatch event to module \"volume master\"\r\n```\r\n\r\nThe instance in the reply does not correspond to the descriptor ```master/slave```, but is a concatenation of the ```device```, ```mixer``` and ```mixer_id```. [The guessing method for the module](https://github.com/ultrabug/py3status/blob/master/py3status/__init__.py#L806) takes this into account but relies on the presence of all three configuration parameters. If any of the three parameter is not set, the guessing will not work correctly. Instead, the check should just ignore unset parameters and get the closest match for device, mixer, and then mixer_id.\r\n\r\nAs a **workaround**, define all three configuration parameters explicitly:\r\n```\r\nvolume slave {\r\n    device = \"pulse:1\"\r\n    mixer = \"master\"\r\n    mixer_id = \"0\"\r\n}\r\n```\r\n\r\n\r\npy3status version 2.8"}}