def __init__(self): # Instantiate Logger self.LOGGER = Debug.getLogger("energyathome.datalogger.serialcomm") self.COMM = serial.Serial() # Create Config manager self.CONFIG = ConfigManager()
def __init__(self): # Instantiate Logger self.LOGGER = Debug.getLogger("energyathome.datalogger.offlinehandler") # Configuration Manager self.CONFIG = ConfigManager() # Data validation class self.VALIDATOR = CheckLiveData() # Data trigger class self.TRIGGER = CheckLiveTriggers()
def __init__(self): # Instantiate logger self.LOGGER = Debug.getLogger("energyathome.datalogger.twitter") # Configuration Manager self.CONFIG = ConfigManager() self.LOGGER.debug("Adding to system path: " + os.path.dirname(os.path.abspath(__file__)) + os.sep + "python-twitter") sys.path.append(os.path.dirname(os.path.abspath(__file__)) + os.sep + "python-twitter") currentTime = datetime.now() self.LAST_HOURLY_POST = currentTime.strftime("%H") self.TWITTER = __import__("twitter")
def __init__(self): # Instantiate Logger self.LOGGER = Debug.getLogger("energyathome.datalogger.xmlparser")
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Energy@Home. If not, see <http://www.gnu.org/licenses/>. # __author__ = 'Danny Tsang <*****@*****.**>' import Debug from database.MySQL import MySQL from database.DatabaseException import ConnectionException # Instantiate Logger LOGGER = Debug.getLogger("energyathome.datalogger.historicaldata") # Instantiate DB DATABASE = MySQL() # Historical data class used to store device data class HistoricalData: def __init__(self): # CC name self.name = "" # Days Since Birth self.dsb = 0 # Time reported by device self.time = "" # In degrees celcius
def __init__(self): # Instantiate config manager self.CONFIG = ConfigManager() # Get logger instance self.LOGGER = Debug.getLogger("energyathome.datalogger.datatrigger")
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Energy@Home. If not, see <http://www.gnu.org/licenses/>. # __author__ = 'Danny Tsang <*****@*****.**>' import sys import Debug import Core # Instantiate Logger LOGGER = Debug.getLogger("energyathome.datalogger.main") def main(): """Main function which starts the program""" global LOGGER LOGGER.info("Starting energy@home") try: # initialise Core.init() while True: # Capture and store data Core.run()
import HistoricalData import Debug from database.MySQL import MySQL from database.DatabaseException import ConnectionException from config.Config import ConfigManager from xmlhandler.XMLParser import Parser from DataValidation import CheckLiveData from DataTrigger import CheckLiveTriggers from SerialComm import DeviceManager from OfflineHandler import BackupRestore # Configuration Manager CONFIG = ConfigManager() # Instantiate Logger LOGGER = Debug.getLogger("energyathome.datalogger.core") # Instantiate DB DATABASE = MySQL() SCHEDULER = None # Data validation VALIDATOR = None # Data trigger TRIGGER = None # Serial Devices DEVICE = None