Example #1
0
  def __init__(self, zipcode, modes):
    self._modes=modes
    self._zipcode = zipcode
    self._isDark = True
    self._city = None

    self._a = Astral(GoogleGeocoder)
    self._a.solar_depression = 'civil'
    self._city = self._a[self._zipcode]
    self._latitude = self._city.latitude
    self._longitude = self._city.longitude

    self._mode = self._modes[0]
    self._last_mode = self.mode

    self._scheduler = Scheduler()

    self.setupScheduler()
Example #2
0
client = MongoClient()
ffDB = client.ff
appsDB = ffDB.apps
datalogDB = ffDB.datalog
deviceDB = ffDB.devices
messageDB = ffDB.message
routineDB = ffDB.routines

datalogDB.ensure_index("timestamp", expireAfterSeconds=(60*60*72))
messageDB.ensure_index("timestamp", expireAfterSeconds=(60*60*24*7))

configPath = '/opt/firefly_system/config/'

## SETUP SCHEDULER
from core.utils.scheduler import Scheduler
ffScheduler = Scheduler()

from core.models.routine import Routine

from core.database import getDeviceStatusDict
from core.database import getDeviceViewsList
from core.database import getRoutineList
from core.database import getRoutineViewsDict
from core.database import reinstallRoutinesFromConfig


from core.models.command import Command as ffCommand
from core.models.event import Event as ffEvent


from core.dispacher.command import sendCommand
Example #3
0
import logging

from astral import Astral
from astral import GoogleGeocoder
from datetime import datetime, timedelta

from core.models.command import Command as ffCommand
from core.models.event import Event as ffEvent
from core.scheduler import Scheduler as ffScheduler
from core.utils.notify import Notification as ffNotify

from core.utils.scheduler import Scheduler

l_scheduler = ffScheduler()

location_scheduler = Scheduler()


class Location(object):
    def __init__(self, config_file):
        logging.critical(
            '#####################################\n## THIS IS DEPRECATED - DO NOT USE ##\n#####################################'
        )
        self._config_file = config_file
        self._modes = []
        self._a = None
        self._city = None
        self._zipcode = None
        self._isDark = True
        self._weather = None