added google calender

This commit is contained in:
bernhard.trinnes 2020-09-15 14:41:54 +02:00 committed by Michael Zanetti
parent 703cdebdc4
commit 6aa9256052
7 changed files with 165 additions and 0 deletions

15
debian/control vendored
View File

@ -278,6 +278,21 @@ Description: nymea integration plugin for Garadget
This package contains the nymea integration plugin for Garadget Garage Door Opener
Package: nymea-plugin-google
Architecture: any
Depends: ${misc:Depends},
nymea-plugins-translations,
python3-pip,
Description: nymea.io plugin for Google services
The nymea daemon is a plugin based IoT (Internet of Things) server. The
server works like a translator for devices, things and services and
allows them to interact.
With the powerful rule engine you are able to connect any device available
in the system and create individual scenes and behaviors for your environment.
.
This package will install the nymea.io plugin for Google services
Package: nymea-plugin-gpio
Architecture: any
Depends: ${shlibs:Depends},

3
debian/nymea-plugin-google.install.in vendored Normal file
View File

@ -0,0 +1,3 @@
google/integrationplugingoogle.json usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/google/
google/integrationplugingoogle.py usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/google/
google/requirements.txt usr/lib/@DEB_HOST_MULTIARCH@/nymea/plugins/google/

4
google/google.pro Normal file
View File

@ -0,0 +1,4 @@
TEMPLATE = aux
OTHER_FILES = integrationplugingoogle.py \
integrationplugingoogle.json

View File

@ -0,0 +1,50 @@
{
"id": "",
"name": "google",
"displayName": "Google services",
"vendors": [
{
"id": "",
"name": "google",
"displayName": "Google",
"thingClasses": [
{
"id": "",
"name": "account",
"displayName": "Account",
"createMethods": [""],
"setupMethod": "",
"interfaces": ["account"],
"stateTypes": [
{
"id": "",
"name": "connected",
"displayName": "Connected",
"displayNameEvent": "Connected changed",
"type": "bool",
"cached": false,
"defaultValue": false
},
{
"id": "",
"name": "username",
"displayName": "Username",
"displayNameEvent": "Username changed",
"type": "QString",
"defaultValue": "-"
},
{
"id": "",
"name": "loggedIn",
"displayName": "Logged in",
"displayNameEvent": "Logged in changed",
"type": "bool",
"defaultValue": false,
"cached": false
}
]
}
]
}
]
}

View File

@ -0,0 +1,77 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#
# Copyright 2013 - 2020, nymea GmbH
# Contact: contact@nymea.io
#
# This file is part of nymea.
# This project including source code and documentation is protected by
# copyright law, and remains the property of nymea GmbH. All rights, including
# reproduction, publication, editing and translation, are reserved. The use of
# this project is subject to the terms of a license agreement to be concluded
# with nymea GmbH in accordance with the terms of use of nymea GmbH, available
# under https://nymea.io/license
#
# GNU Lesser General Public License Usage
# Alternatively, this project may be redistributed and/or modified under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; version 3. This project is distributed in the hope that
# it will be useful, but WITHOUT ANY WARRANTY; without even the implied
# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this project. If not, see <https://www.gnu.org/licenses/>.
#
# For any further details and any questions please contact us under
# contact@nymea.io or see our FAQ/Licensing Information on
# https://nymea.io/license/faq
#
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
import nymea
import datetime
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
timers = {}
def init():
logger.log("google init")
def deinit():
for timer in timers:
timers[timer].cancel()
def discoverThings(info):
info.finish(nymea.ThingErrorNoError)
def setupThing(info):
logger.log("setupThing", info.thing.name)
info.thing.nameChangedHandler = nameChanged
timers[info.thing] = threading.Timer(10, runTestForever, [info.thing])
timers[info.thing].start()
info.finish(nymea.ThingErrorNoError)
def postSetupThing(thing):
logger.log("postSetupThing", thing)
def nameChanged(thing):
logger.log("Thing name changed:", thing.name)
def thingRemoved(thing):
logger.log("thingRemoved:", thing.name)
timers[thing].cancel()
del timers[thing]
def executeAction(info):
logger.log("executeAction")
if info.actionTypeId == speedtestRunTestActionTypeId:
info.finish(nymea.ThingErrorNoError)
runTest(info.thing, duration=info.paramValue(speedtestRunTestActionDurationParamTypeId))

15
google/requirements.txt Normal file
View File

@ -0,0 +1,15 @@
fastdotcom==0.0.3 \
--hash=sha256:84647d665119cfbef01bf785607b85d7a29353208605ca53a4155c331e407cd6 \
--hash=sha256:c77689b5595e0ef89d60d5d3a2f669ef2f158d2868fda65e1201d91b53e013b3
requests==2.24.0 \
--hash=sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b \
--hash=sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898
certifi==2017.4.17 \
--hash=sha256:f4318671072f030a33c7ca6acaef720ddd50ff124d1388e50c1bda4cbd6d7010
idna==2.10 \
--hash=sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0
chardet==3.0.4 \
--hash=sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691
urllib3==1.25.10 \
--hash=sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461

View File

@ -28,6 +28,7 @@ PLUGIN_DIRS = \
fronius \
garadget \
goecharger \
google \
gpio \
i2cdevices \
httpcommander \