Skip to content
Snippets Groups Projects
Commit 613ec5ac authored by jkerdreu's avatar jkerdreu
Browse files

New run_package API

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/trunk@2070 b32b6428-25c9-4566-ad07-03861ab6144f
parent 34de0c0d
No related branches found
No related tags found
No related merge requests found
from .gw import setup
from . import gw
from xaal.lib import Engine
from xaal.lib import helpers
def main():
eng = Engine()
gw.setup(eng)
eng.run()
if __name__ == '__main__':
try:
main()
except KeyboardInterrupt:
print("Bye Bye..")
helpers.run_package(gw.PACKAGE_NAME,gw.setup)
import platform
import time
import atexit
import sys
import logging
import pyowm
from pyowm.exceptions import OWMError
......@@ -9,11 +8,11 @@ from xaal.lib import tools
from xaal.schemas import devices
PACKAGE_NAME = "xaal.owm"
logger = tools.get_logger(PACKAGE_NAME,'DEBUG')
RATE = 300 # update every 5 min
API_KEY = '3a5989bac31472cd41d69e92838bd454'
logger = logging.getLogger(PACKAGE_NAME)
def setup_dev(dev):
dev.vendor_id = "IHSEV"
dev.product_id = "OpenWeatherMap"
......@@ -100,7 +99,6 @@ class GW:
self.cfg.write()
def setup(engine):
gw = GW(engine)
return True
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment