{"action":"created","issue":{"url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/85","labels_url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/85/comments","events_url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/85/events","html_url":"https://github.com/volkszaehler/vzlogger/issues/85","id":53017531,"number":85,"title":"request for comments: s0 meter, supporting different interfaces","user":{"login":"r00t-","id":2834981,"avatar_url":"https://avatars.githubusercontent.com/u/2834981?v=3","gravatar_id":"","url":"https://api.github.com/users/r00t-","html_url":"https://github.com/r00t-","followers_url":"https://api.github.com/users/r00t-/followers","following_url":"https://api.github.com/users/r00t-/following{/other_user}","gists_url":"https://api.github.com/users/r00t-/gists{/gist_id}","starred_url":"https://api.github.com/users/r00t-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r00t-/subscriptions","organizations_url":"https://api.github.com/users/r00t-/orgs","repos_url":"https://api.github.com/users/r00t-/repos","events_url":"https://api.github.com/users/r00t-/events{/privacy}","received_events_url":"https://api.github.com/users/r00t-/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/volkszaehler/vzlogger/labels/Enhancement","name":"Enhancement","color":"207de5"},{"url":"https://api.github.com/repos/volkszaehler/vzlogger/labels/Help+wanted","name":"Help wanted","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-12-29T03:18:27Z","updated_at":"2015-01-13T23:42:28Z","closed_at":null,"body":"it's not great to clone the whole S0 meter code for the raspberry pi version\\\r\nthere's lots of common code that would have to be maintained redunantly.\\\r\nwhat would be better?\r\n- implement a unified s0-meter and handle differences internally?\r\n- implement an abstract s0-meter class and have others inherit from it?\r\n  (it's C++ after all but not sure if i know enough C++)\r\n\r\n(for reference, my current code is here: https://github.com/r00t-/vzlogger/tree/raspis0 )"},"comment":{"url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/comments/69844159","html_url":"https://github.com/volkszaehler/vzlogger/issues/85#issuecomment-69844159","issue_url":"https://api.github.com/repos/volkszaehler/vzlogger/issues/85","id":69844159,"user":{"login":"r00t-","id":2834981,"avatar_url":"https://avatars.githubusercontent.com/u/2834981?v=3","gravatar_id":"","url":"https://api.github.com/users/r00t-","html_url":"https://github.com/r00t-","followers_url":"https://api.github.com/users/r00t-/followers","following_url":"https://api.github.com/users/r00t-/following{/other_user}","gists_url":"https://api.github.com/users/r00t-/gists{/gist_id}","starred_url":"https://api.github.com/users/r00t-/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/r00t-/subscriptions","organizations_url":"https://api.github.com/users/r00t-/orgs","repos_url":"https://api.github.com/users/r00t-/repos","events_url":"https://api.github.com/users/r00t-/events{/privacy}","received_events_url":"https://api.github.com/users/r00t-/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T23:42:28Z","updated_at":"2015-01-13T23:42:28Z","body":"i don't reallty like the idea of having the extra S0_Interface classes AND needing sub-protocol specific code in the base \"MeterS0\" class.\r\n\r\nthe solution i tried to suggest above was to have a partially abstract \"MeterS0\" base class,\r\nwhich leaves a few methods (open, close, wait for impulse, and specific setup in the constructor)\r\nto be implemented by a subclass. (\"MeterGPIOS0\", \"MeterUARTS0\", ...)\r\n\r\nthat way the specific meters will be independant meter-types from the user perspective,\r\nand we don't need a redundant meter-type selection logic in the base class.\r\n\r\ni have an implementation of that in the making."}}