{"id":569,"date":"2018-11-12T12:32:34","date_gmt":"2018-11-12T20:32:34","guid":{"rendered":"http:\/\/dragonwarz.net\/?p=569"},"modified":"2018-11-12T12:32:34","modified_gmt":"2018-11-12T20:32:34","slug":"stuff","status":"publish","type":"post","link":"https:\/\/dragonwarz.net\/?p=569","title":{"rendered":"Stuff"},"content":{"rendered":"\n<p>I spent some more time refactoring the Raspberry Pi Sensor code.\u00a0 For one, I have the import code for each sensor, in the init part of the sensor access class, that&#8217;s created per sensor.\u00a0 AKA, creating a class instance of a sensor, will then pull in the needed libraries at that time.\u00a0 I did this originally so unneeded sensor libraries would never be imported, saving time and resources.\u00a0 However, I then realized that I create the sensor object every time any sensor data is taken, which re-initializes the sensor every time!\u00a0 Long story short, I moved the sensor access object instance creations out of the sensor retrieval functions and into the primary python program before the main loop.\u00a0 It only initializes\u00a0sensor access for sensors specified in the &#8220;Installed Sensors&#8221; configuration file.\u00a0 This means sensor readings taken, will re-use the same sensor access instance that was created at the start of the program and only create access instances for installed sensors.\u00a0<\/p>\n\n\n\n<p>Doc strings have been added to all functions and classes in the raspberry pi sensor code, and I started to get pipenv working for the package management and virtual environments for my programs&#8230; but it keeps erroring out on pipenv install.\u00a0 It almost seems like its timing out on installing the packages, but I can&#8217;t be sure since I&#8217;m not sure where it stores the logs if it creates any.\u00a0 In theory, it sounds like it will simplify the install process and help keep a consistent base to run on, but it looks like it will take a bit more time to have it function as intended.\u00a0\u00a0<\/p>\n\n\n\n<p>I was hoping to get pipenv working before creating new Gnu\/Linux install scripts, and I was hoping to have the install scripts working before my next release.\u00a0 So I&#8217;ll continue to diagnose the pipenv issues, in hopes that I can use it for with the new installers.\u00a0\u00a0<\/p>\n\n\n\n<p>Hope everyone&#8217;s weekend went well!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I spent some more time refactoring the Raspberry Pi Sensor code.\u00a0 For one, I have the import code for each sensor, in the init part of the sensor access class, that&#8217;s created per sensor.\u00a0 AKA, creating a class instance of &hellip;<\/p>\n<p class=\"read-more\"><a href=\"https:\/\/dragonwarz.net\/?p=569\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-569","post","type-post","status-publish","format-standard","hentry","category-random"],"_links":{"self":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=569"}],"version-history":[{"count":1,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions"}],"predecessor-version":[{"id":571,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=\/wp\/v2\/posts\/569\/revisions\/571"}],"wp:attachment":[{"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dragonwarz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}