{"action":"created","issue":{"url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/330","repository_url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent","labels_url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/330/labels{/name}","comments_url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/330/comments","events_url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/330/events","html_url":"https://github.com/fusioninventory/fusioninventory-agent/pull/330","id":240404015,"number":330,"title":"Batteries (can be now in the plural, yeah !)","user":{"login":"devtom30","id":5585133,"avatar_url":"https://avatars0.githubusercontent.com/u/5585133?v=3","gravatar_id":"","url":"https://api.github.com/users/devtom30","html_url":"https://github.com/devtom30","followers_url":"https://api.github.com/users/devtom30/followers","following_url":"https://api.github.com/users/devtom30/following{/other_user}","gists_url":"https://api.github.com/users/devtom30/gists{/gist_id}","starred_url":"https://api.github.com/users/devtom30/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devtom30/subscriptions","organizations_url":"https://api.github.com/users/devtom30/orgs","repos_url":"https://api.github.com/users/devtom30/repos","events_url":"https://api.github.com/users/devtom30/events{/privacy}","received_events_url":"https://api.github.com/users/devtom30/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-04T12:18:58Z","updated_at":"2017-07-04T17:41:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/pulls/330","html_url":"https://github.com/fusioninventory/fusioninventory-agent/pull/330","diff_url":"https://github.com/fusioninventory/fusioninventory-agent/pull/330.diff","patch_url":"https://github.com/fusioninventory/fusioninventory-agent/pull/330.patch"},"body":"- correction of algorithm to extract all batteries and not only the first one found\r\n- priority to data provided by 'upower' (linux)\r\n- dmidecode data fills empty fields only\r\n- use of tools function getCanonicalManufacturer() to normalize batteries' manufacturer name\r\n- in tools function getCanonicalManufacturer() : 'lg' is a too short pattern, so changing it to 'lg(?:\\s|$)' and changing corresponding unit tests"},"comment":{"url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/comments/312925014","html_url":"https://github.com/fusioninventory/fusioninventory-agent/pull/330#issuecomment-312925014","issue_url":"https://api.github.com/repos/fusioninventory/fusioninventory-agent/issues/330","id":312925014,"user":{"login":"guillomovitch","id":293223,"avatar_url":"https://avatars3.githubusercontent.com/u/293223?v=3","gravatar_id":"","url":"https://api.github.com/users/guillomovitch","html_url":"https://github.com/guillomovitch","followers_url":"https://api.github.com/users/guillomovitch/followers","following_url":"https://api.github.com/users/guillomovitch/following{/other_user}","gists_url":"https://api.github.com/users/guillomovitch/gists{/gist_id}","starred_url":"https://api.github.com/users/guillomovitch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillomovitch/subscriptions","organizations_url":"https://api.github.com/users/guillomovitch/orgs","repos_url":"https://api.github.com/users/guillomovitch/repos","events_url":"https://api.github.com/users/guillomovitch/events{/privacy}","received_events_url":"https://api.github.com/users/guillomovitch/received_events","type":"User","site_admin":false},"created_at":"2017-07-04T17:41:08Z","updated_at":"2017-07-04T17:41:08Z","body":"Roughly half of the code comes from the fact than the upower-based code run first, add multiple items in the inventory, then the dmidecode code runs, and has to first retrieve stuff from the inventory before adding its own content itself. This looks a bit ugly, and adds a lot of specific code in Inventory class, whereas batteries are just one of multiple available items...\r\n\r\nWhat I'd rather do is to use a single battery-dedicated perl module, merging generic::dmidecode::battery and generic::upower::battery into a single generic::battery, so as to handle all this data processing internally, before adding multiple battery elements into the inventory."}}
{"actor":{"display_login":"guillomovitch"}}