Exemplo n.º 1
0
 def __init__(self):
     self.logger = logging.get_logger(__name__)
     self.__program_dir = os.path.dirname(
         os.path.dirname(os.path.abspath(__file__)))
     self.__config_file = '{0}/resources/config.json'.format(
         self.__program_dir)
     self.image_dir = '{0}/images'.format(self.__program_dir)
     self.__font_dir = '{0}/matrix/fonts'.format(self.__program_dir)
     self.log_dir = "{0}/resources/logs".format(self.__program_dir)
     self.__config = {}
     self.read_config()
Exemplo n.º 2
0
 def __init__(self):
     # Initialize logging with the standard/basic logger.
     self.logger = logging.get_logger(__name__)
#!/usr/bin/python3
"""
author: Tyler Thompson
date: October 26th 2019
"""
import netifaces
import datetime
from time import sleep
from resources.Displays import Frames
from resources.Displays.LEDMatrix import LEDMatrix
from resources.config import Config
from resources.DataStores.DataSync import DataSync
from resources import logging

logger = logging.get_logger(__name__)


def main():
    data_sync = DataSync()
    config = Config()
    display = LEDMatrix()

    show_network_status(display=display,
                        show_time_seconds=config.config['displays']
                        ['led_matrix']['net_info_show_seconds'])

    while True:
        config.read_config()
        display.update_brightness()
        sql_con = data_sync.connection_status()
        if sql_con: