initial commit

This commit is contained in:
John Lancaster
2024-02-21 21:23:05 -06:00
commit 7d4098ce79
12 changed files with 97 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
secrets.yaml
__pycache__
.python-version
dashboards/
compiled/
namespaces/
www/

14
appdaemon.code-workspace Normal file
View File

@@ -0,0 +1,14 @@
{
"folders": [
{
"path": "../../root/appdaemon"
},
{
"path": "../../root/appdaemon_dev"
},
{
"path": "."
}
],
"settings": {}
}

21
appdaemon.yaml Normal file
View File

@@ -0,0 +1,21 @@
appdaemon:
import_method: expert
# import_paths:
# - /conf/apps/my_repo
latitude: 0
longitude: 0
elevation: 30
time_zone: America/Chicago
plugins:
HASS:
type: hass
ha_url: http://192.168.1.82:8123
token: !secret long_lived_token
http:
url: http://0.0.0.0:5050
admin:
api:
hadashboard:
logs:
main_log:
level: DEBUG

11
apps/apps.yaml Normal file
View File

@@ -0,0 +1,11 @@
hello_world:
module: hello
class: HelloWorld
hello_sub:
module: my_pkg.my_sub_pkg.hello
class: HelloWorldSub
motion:
module: my_pkg
class: Motion

3
apps/apps.yaml.example Normal file
View File

@@ -0,0 +1,3 @@
hello_world:
module: hello
class: HelloWorld

7
apps/hello.py Executable file
View File

@@ -0,0 +1,7 @@
import appdaemon.adbase as ad
class HelloWorld(ad.ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.log = self.adapi.log
self.log(f'Initialized app from {__file__}')

View File

@@ -0,0 +1,2 @@
from .motion import Motion
from .my_sub_pkg.hello import HelloWorldSub

View File

@@ -0,0 +1,8 @@
import appdaemon.adbase as ad
class Motion(ad.ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.log = self.adapi.log
self.log(f'Initialized app from {__file__}')
# self.log(f'New log line asdfasdf')

View File

@@ -0,0 +1,8 @@
import appdaemon.adbase as ad
class HelloWorldSub(ad.ADBase):
def initialize(self):
self.adapi = self.get_ad_api()
self.log = self.adapi.log
self.log(f'Initialized app from {__file__}')
# self.log(f'CHANGED')

View File

14
docker-compose.yml Normal file
View File

@@ -0,0 +1,14 @@
version: '3.9'
services:
appdaemon:
container_name: appdaemon_dev
image: appdaemon:jsl-dev
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- ./:/conf
ports:
- 5051:5050
restart: unless-stopped
tty: true
# command: ["--debug", "DEBUG"]