Skip to content

Commit

Permalink
Fix examples
Browse files Browse the repository at this point in the history
  • Loading branch information
acockburn committed Dec 15, 2017
1 parent c92df22 commit 6f97b59
Show file tree
Hide file tree
Showing 30 changed files with 64 additions and 68 deletions.
15 changes: 6 additions & 9 deletions conf/appdaemon.yaml.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
AppDaemon:
log:
logfile: STDOUT
errorfile: STDERR
appdaeaemon:
threads: 10
HASS:
ha_url:
ha_key:
# Apps
hello_world:
module: hello
class: HelloWorld

plugins:
HASS:
ha_url:
ha_key:
5 changes: 2 additions & 3 deletions conf/apps/hello.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import appdaemon.appapi as appapi

import appdaemon.plugins.hass.hassapi as hass
#
# Hellow World App
#
# Args:
#

class HelloWorld(appapi.AppDaemon):
class HelloWorld(hass.Hass):

def initialize(self):
self.log("Hello from AppDaemon")
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/alexa.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import random
import globals

class Alexa(appapi.AppDaemon):
class Alexa(hass.Hass):

def initialize(self):
pass
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/battery.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import datetime
import globals

Expand All @@ -17,7 +17,7 @@
# Version 1.0:
# Initial Version

class Battery(appapi.AppDaemon):
class Battery(hass.Hass):

def initialize(self):
#self.check_batteries({"force": 1})
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/bysykkel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import requests
import json
from datetime import datetime
Expand All @@ -12,7 +12,7 @@
- interval: Update interval, in minutes
"""
class Bysykkel(appapi.AppDaemon):
class Bysykkel(hass.Hass):
def initialize(self):
self.apiUrl = "http://reisapi.ruter.no"
self.entity = self.args['event']
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/commute.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass

#
# App to send email alert if commute time is too long
Expand All @@ -17,7 +17,7 @@
# Version 1.0:
# Initial Version

class Commute(appapi.AppDaemon):
class Commute(hass.Hass):

def initialize(self):
time = self.parse_time(self.args["time"])
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/dark_day.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import datetime
import globals

Expand All @@ -19,7 +19,7 @@
# Initial Version


class DarkDay(appapi.AppDaemon):
class DarkDay(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/door_notification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -13,7 +13,7 @@
# Version 1.0:
# Initial Version

class DoorNotification(appapi.AppDaemon):
class DoorNotification(hass.Hass):

def initialize(self):
if "sensor" in self.args:
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/eventCache.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import os
import json

Expand All @@ -22,7 +22,7 @@
- evnets: List of events to monitor, and later publish
"""
class Cache(appapi.AppDaemon):
class Cache(hass.Hass):
def initialize(self):
self.cache = self.args['cache']
self.events = self.args['events']
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/eventMonitor.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass

"""
Expand All @@ -8,7 +8,7 @@
- events: List of events to monitor
"""
class Monitor(appapi.AppDaemon):
class Monitor(hass.Hass):
def initialize(self):
events = self.args['events']

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/grandfather.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
from queue import Queue
import threading
import time
Expand All @@ -22,7 +22,7 @@
# Version 1.0:
# Initial Version

class Grandfather(appapi.AppDaemon):
class Grandfather(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/hwcheck.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

class HWCheck(appapi.AppDaemon):
class HWCheck(hass.Hass):

def initialize(self):
self.listen_event(self.ha_event, "ha_started")
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/ical.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import requests
import ics
import arrow
Expand All @@ -18,7 +18,7 @@
- max_events: Maximum number of calendar events to include
"""
class Calendar(appapi.AppDaemon):
class Calendar(hass.Hass):
def initialize(self):
self.feed = self.args['feed']
self.entity = self.args['event']
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/minimote.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -22,7 +22,7 @@
# Version 1.0:
# Initial Version

class MiniMote(appapi.AppDaemon):
class MiniMote(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/modes.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import datetime
import appdaemon
import globals
Expand All @@ -21,7 +21,7 @@
# Version 1.0:
# Initial Version

class Modes(appapi.AppDaemon):
class Modes(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/momentary_switch.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -14,7 +14,7 @@
# Version 1.0:
# Initial Version

class MomentarySwitch(appapi.AppDaemon):
class MomentarySwitch(hass.Hass):

def initialize(self):
self.listen_state(self.state_change, self.args["switch"], new="on")
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/motion_lights.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -21,7 +21,7 @@
# Version 1.0:
# Initial Version

class MotionLights(appapi.AppDaemon):
class MotionLights(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/motion_notification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -13,7 +13,7 @@
# Version 1.0:
# Initial Version

class MotionNotification(appapi.AppDaemon):
class MotionNotification(hass.Hass):

def initialize(self):
if "sensor" in self.args:
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/occusim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import datetime
import re
import random
Expand All @@ -10,7 +10,7 @@

__version__ = "1.1.2"

class OccuSim(appapi.AppDaemon):
class OccuSim(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/outside_lights.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -9,7 +9,7 @@
# on_scene: scene to activate at sunset
# off_scene: scene to activate at sunrise

class OutsideLights(appapi.AppDaemon):
class OutsideLights(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/presence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -23,7 +23,7 @@
# Version 1.0:
# Initial Version

class Presence(appapi.AppDaemon):
class Presence(hass.Hass):

def initialize(self):

Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/ruter.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import requests
import json
from datetime import datetime
Expand All @@ -14,7 +14,7 @@
- x_min, x_max, y_min, y_max: Box coordinates for area to find stops in, in the UTM coordinate system
"""
class Ruter(appapi.AppDaemon):
class Ruter(hass.Hass):
def initialize(self):
self.apiUrl = "http://reisapi.ruter.no"
self.departures = self.args['departures']
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/secure.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import threading
import datetime
import time
Expand All @@ -14,7 +14,7 @@
# Version 1.0:
# Initial Version

class Secure(appapi.AppDaemon):
class Secure(hass.Hass):

def initialize(self):
self.action_lock = threading.RLock()
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/sensor_notification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals

#
Expand All @@ -14,7 +14,7 @@
# Version 1.0:
# Initial Version

class SensorNotification(appapi.AppDaemon):
class SensorNotification(hass.Hass):

def initialize(self):
if "sensor" in self.args:
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/sensor_notify.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass

#
# App to send notification when sensor values in specific ranges
Expand All @@ -16,7 +16,7 @@
# Version 1.0:
# Initial Version

class SensorNotification(appapi.AppDaemon):
class SensorNotification(hass.Hass):

def initialize(self):
self.listen_state(self.state, self.args["sensor"])
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/sequence.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import globals


Expand Down Expand Up @@ -29,7 +29,7 @@
Initial Version
"""

class Sequence(appapi.AppDaemon):
class Sequence(hass.Hass):
def initialize(self):
if "input" in self.args and "state" in self.args:
self.listen_state(self.state_change, self.args["input"], new = self.args["state"])
Expand Down
4 changes: 2 additions & 2 deletions conf/example_apps/smart_heat.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import appdaemon.appapi as appapi
import appdaemon.plugins.hass.hassapi as hass
import datetime
import globals

Expand Down Expand Up @@ -26,7 +26,7 @@
# Version 1.0:
# Initial Version

class SmartHeat(appapi.AppDaemon):
class SmartHeat(hass.Hass):

def initialize(self):

Expand Down

0 comments on commit 6f97b59

Please sign in to comment.