Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/release-1.5'
Browse files Browse the repository at this point in the history
* origin/release-1.5: (551 commits)
  wunderground: user_doc updated
  wunderground, darksky: user_doc updated
  wunderground: user_doc updated
  wunderground: user_doc updated
  wunderground: user_doc updated
  Darksky: added user_doc.rst
  Backend: added blur event to trigger enforce updates items on same value
  Darksky: added reload parameter
  Darksky: text correction in webif
  Logo for darksky plugin
  Darksky: first version of web interface
  wunderground: user_doc updated
  Added PLUGIN_VERSION back in
  Removed plugin attributes, not neccesary due to plugin.yaml
  ODLInfo, Tankerkoenig: updated minimum requirements for change in init method
  OLDInfo: updated to new plugin system
  Tankerkoenig: update to parameter free init method, reformatting, removed sh reference
  Darksky: added item for html string
  AVM: simplified init method
  Darksky: updated to new SmartPlugin features and corrected missing cycle in plugin.yaml
  ...

# Conflicts:
#	backend/BackendItems.py
#	backend/plugin.yaml
#	backend/webif/templates/items.html
#	backend/webif/templates/log_view.html
#	enigma2/README.md
#	mqtt/__init__.py
#	mqtt/plugin.yaml
#	rcswitch/README.md
  • Loading branch information
msinn committed Jul 8, 2018
2 parents 1e2920e + 4abccaf commit ef1c694
Show file tree
Hide file tree
Showing 3,077 changed files with 58,768 additions and 19,245 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ nosetests.xml
ehthumbs.db
Thumbs.db

# don't upload private plugins
/priv_*

# Pycharm settings
/.idea
109 changes: 109 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
#######################################################################
# Travis-CI script
#
# This script will checkout all required reqository to run the
# suite.
#
# The following configuration settings are available:
# * Environment settings:
# - REPOSITORY_ORIGIN: defines the current repos origin (e.g.
# "smarthome" or "plugins")
# * Script settings:
# - REPOSITORIES: List of repositories to checkout from smarthomeNG
# organization (e.g. "https://github.com/smarthomeNG/<repo-name>")
# - LINKS: Contains a list of links to create before running the
# suite (e.g. "<target-repo>/<target-dir>/<source-repo>")
# * Script variables:
# - REPOSITORY: The name of the current repository
# - REPOSITORY_ORIGIN: The origin repository from environment setting
# - REPOSITORY_BRANCH: The branch to use for checkouts

echo -e "travis_fold:start:Environment\nEnvironment dump"
set
export
echo "travis_fold:end:Environment"

#######################################################################
# Declare some common variables

REPOSITORIES="smarthome plugins"
LINKS="smarthome/plugins/plugins"

# Get the current repository which is processed
REPOSITORY="$(basename $TRAVIS_REPO_SLUG)"
REPOSITORY_ORIGIN="$REPOSITORY_ORIGIN"

# Find out on which branch to work
if [ "$TRAVIS_BRANCH" = "master" ] ; then
REPOSITORY_BRANCH="master"
else
REPOSITORY_BRANCH="develop"
fi


#######################################################################
# 1. Checkout all repositories

echo -e "travis_fold:start:Checkout\nChecking out repositories with $REPOSITORY_BRANCH branch"

# Change to root directory since script is started in checkout
cd $TRAVIS_BUILD_DIR/..

# Check out other repositories with develop version
for REPO in $REPOSITORIES ; do
if [ "$REPO" != "$REPOSITORY_ORIGIN" ] ; then
echo "Checking out $REPO ..."
git clone https://github.com/smarthomeNG/$REPO.git $REPO
cd $REPO
git checkout $REPOSITORY_BRANCH
cd ..
fi
done

echo "travis_fold:end:Checkout"


#######################################################################
# 2. Create symlinks in repositories

echo -e "travis_fold:start:Links\nCreating symlinks"

# Create symlinks in core repository
for LINK in $LINKS ; do
TARGET=$(dirname "$LINK")
TARGET_REPO=$(dirname "$TARGET")
TARGET_DIR=$(basename "$TARGET")
SOURCE_REPO=$(basename "$LINK")

echo "Create link from $SOURCE_REPO to $TARGET_REPO/$TARGET_DIR ..."
cd $TARGET_REPO
rm -rf $TARGET_DIR
ln -s ../$SOURCE_REPO $TARGET_DIR
cd ..
done

echo "travis_fold:end:Links"


#######################################################################
# 3. Run

echo -e "travis_fold:start:Suite\nRunning suite"

cd smarthome
tox
cd ..

echo "travis_fold:end:Suite"


#######################################################################
# 4. Docs

#echo -e "travis_fold:start:Docs\nBuilding documentation"

#cd smarthome/doc
#yes | bash build_doc.sh
#cd ../..

#echo "travis_fold:end:Docs"
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sudo: false
language: python
python:
- "3.3"
- "3.4"
- "3.5"
- "3.6"

env:
- REPOSITORY_ORIGIN=plugins

install:
- pip install tox-travis "virtualenv<14.0.0"

script:
- sh .travis.sh
15 changes: 14 additions & 1 deletion alexa/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,20 @@ plugin:

parameters:
# Definition of parameters to be configured in etc/plugin.yaml

service_host:
type: ip
description:
de: 'IP Adresse des service Hosts'
en: 'ip address of the service host'

service_port:
type: int
default: 9000
valid_min: 0
description:
de: 'Port Nummer des service Hosts'
en: 'port number of the service host'

item_attributes:
# Definition of item attributes defined by this plugin

9 changes: 8 additions & 1 deletion alexa/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/smart-home-skill-api-reference

from http.server import BaseHTTPRequestHandler, HTTPServer
import threading
import ssl
import json
import uuid


class AlexaService(object):
def __init__(self, logger, version, devices, actions, host, port, auth=None, https_certfile=None, https_keyfile=None):
self.logger = logger
Expand All @@ -23,13 +25,18 @@ def __init__(self, logger, version, devices, actions, host, port, auth=None, htt
# TODO: client-certificates can be handled here as well: https://docs.python.org/2/library/ssl.html
self.server.socket = ssl.wrap_socket(self.server.socket, server_side=True, certfile=https_certfile, keyfile=https_keyfile)

self._server_thread = threading.Thread(target=self.server.serve_forever)
self._server_thread.daemon = True

def start(self):
self.logger.info("Alexa: service starting")
self.server.serve_forever()
self._server_thread.start()

def stop(self):
self.logger.info("Alexa: service stopping")
self.server.shutdown()
self.server.server_close()


class AlexaRequestHandler(BaseHTTPRequestHandler):
def __init__(self, logger, version, devices, actions, *args):
Expand Down
37 changes: 2 additions & 35 deletions apcups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Should work on all APC UPS devices. Tested only on a "smartUPS".

## Configuration

### plugin.conf
### plugin.yaml

Add the following lines to activate the plugin:

Expand All @@ -31,24 +31,13 @@ ApcUps:
port: 3551
```
or the same for deprecated *.conf file format:
```ini
[apcups]
class_name = APCUPS
class_path = plugins.apcups
# host = localhost
# port = 3551
# cycle = 300
```

Description of the attributes:
* __host__: ip address of the NIS (optional, default: localhost)
* __port__: port of the NIS (optional, default: 3551)
* __cycle__: time to update the items with values from apcaccess
### items.conf
### items.yaml
There is only one attribute: **apcups**
Expand Down Expand Up @@ -138,28 +127,6 @@ serverroom:
apcups: timeleft
```
or in (deprecated) *.conf format:
```ini
# items/apcups.conf
[serverroom]
[[apcups]]
[[[linev]]]
visu_acl = ro
type = num
apcups = linev

[[[status]]]
# will be 'ONLINE', 'ONBATT', or in case of a problem simply empty
visu_acl = ro
type = str
apcups = status

[[[timeleft]]]
visu_acl = ro
type = num
apcups = timeleft
```
**type** depends on the values.
### Status Report Fields
Expand Down
29 changes: 27 additions & 2 deletions apcups/plugin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,32 @@ plugin:

parameters:
# Definition of parameters to be configured in etc/plugin.yaml

host:
type: ipv4
default: '127.0.0.1'
description:
de: 'IP Adresse bzw. Hostname der UPS'
en: 'ip address or hostname of the ups'

port:
type: int
default: 3551
valid_min: 0
description:
de: 'Port Nummer der UPS'
en: 'port number of the ups'

cycle:
type: int
valid_min: 0
description:
de: 'Zyklus-Zeit zum Update der Items mit Werten von APCaccess'
en: time to update the items with values from apcaccess

item_attributes:
# Definition of item attributes defined by this plugin

apcups:
type: str
description:
de: 'Für eine Liste gültiger Werte, "apcaccess" auf der Kommandozeile aufrufen. Dieser Befehl gibt einen Textblock zurück, der eine Liste von ``statusname : value`` Einträgen enthält'
en: 'For a list of values for this attribute call "apcaccess" on the command line. This command will give back a text block containing a list of ``statusname : value`` entries'
Loading

0 comments on commit ef1c694

Please sign in to comment.