示例#1
0
    def __init__(self):

        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)

        self.URL_YOLP_WEATHER = 'https://map.yahooapis.jp/weather/V1/place'
        self.YAHOO_API_KEY = os.environ['YAHOO_API_KEY']
        self.LATITUDE = os.environ['GEO_LATITUDE']
        self.LONGITUDE = os.environ['GEO_LONGITUDE']
示例#2
0
    def __init__(self):

        self.NATURE_AUTH = os.environ["NATURE_AUTH"]
        self.NATURE_ID = os.environ["NATURE_ID"]
        self.NATURE_URL = "https://api.nature.global/"

        # Log Set.
        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)
示例#3
0
    def __init__(self):

        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)

        self.API_KEY = os.environ['ACCU_WEATHER_API_KEY']

        self.BASE_URL = 'https://dataservice.accuweather.com'
        self.GEO_LAT = os.environ['GEO_LATITUDE']
        self.GEO_LON = os.environ['GEO_LONGITUDE']
示例#4
0
    def testfunc():
        handleEnvironment.initialize()
        log = logging.getLogger('Test Func2')
        log.setLevel(LOG_LEVEL)

        log.info('test func2')
        print('test func')

        db = mariaDbAgent()
        db.selectCount([db.COL_TYPE], [db.TYPE_RECORD])

        return
示例#5
0
    def __init__(self, database='homeDB'):

        # Logset
        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)

        # DBset
        self.DB_HOST = 'localhost'
        self.DB_USER = '******'
        self.DB_DATABASE = database

        return
示例#6
0
    def __init__(self):

        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)

        self.API_KEY = os.environ['OPEN_WEATHER_API_KEY']

        self.GEO_LAT = os.environ['GEO_LATITUDE']
        self.GEO_LON = os.environ['GEO_LONGITUDE']

        self.BASE_URL_ONE_CALL = 'https://api.openweathermap.org/data/2.5/onecall?'
        self.BASE_URL_CURRENT_WEATHER = 'https://api.openweathermap.org/data/2.5/weather?'
示例#7
0
    def __init__(self):

        # Logset
        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)
        self.log.debug('environmentLogger start.')

        # default data.
        try:
            self.place = {
                'latitude': os.environ['GEO_LATITUDE'], 'longitude': os.environ['GEO_LONGITUDE']}

        except Exception as e:
            self.log.error('set place error.')
            self.log.debug(e)

        return
示例#8
0
                db.TYPE_ALARM_DONE,
                json.dumps(alarm_data, ensure_ascii=False)
            ]
            w_columns = [db.COL_ID]
            w_values = [str(alarm_id)]
            db.updateData(set_colmns, set_values, w_columns, w_values)

        log.info('-- google_Home_Notify end.')

        return


if __name__ == "__main__":

    # set Log
    handleEnvironment.initialize()
    log = logging.getLogger('homeScheduler')
    log.setLevel(LOG_LEVEL)
    log.info('scheduler start.')

    task = taskManager()
    el = environmentLogger()

    # 実行前処理
    task.checkTask()
    task.setRainCondition()

    # 毎時タスク
    if task.IS_EVERY_HOUR:
        log.info('every hour task start.')
示例#9
0
    def __init__(self):

        handleEnvironment.initialize()
        self.log = logging.getLogger(__name__)
        self.log.setLevel(LOG_LEVEL)