commit 7d4098ce7960c9fa4765379a214f2949048534c3 Author: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Wed Feb 21 21:23:05 2024 -0600 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..795afed --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +secrets.yaml + +__pycache__ +.python-version + +dashboards/ +compiled/ +namespaces/ +www/ \ No newline at end of file diff --git a/appdaemon.code-workspace b/appdaemon.code-workspace new file mode 100644 index 0000000..961bd52 --- /dev/null +++ b/appdaemon.code-workspace @@ -0,0 +1,14 @@ +{ + "folders": [ + { + "path": "../../root/appdaemon" + }, + { + "path": "../../root/appdaemon_dev" + }, + { + "path": "." + } + ], + "settings": {} +} \ No newline at end of file diff --git a/appdaemon.yaml b/appdaemon.yaml new file mode 100644 index 0000000..41103d6 --- /dev/null +++ b/appdaemon.yaml @@ -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 \ No newline at end of file diff --git a/apps/apps.yaml b/apps/apps.yaml new file mode 100644 index 0000000..8eb4550 --- /dev/null +++ b/apps/apps.yaml @@ -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 \ No newline at end of file diff --git a/apps/apps.yaml.example b/apps/apps.yaml.example new file mode 100644 index 0000000..4c84034 --- /dev/null +++ b/apps/apps.yaml.example @@ -0,0 +1,3 @@ +hello_world: + module: hello + class: HelloWorld diff --git a/apps/hello.py b/apps/hello.py new file mode 100755 index 0000000..011cb81 --- /dev/null +++ b/apps/hello.py @@ -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__}') diff --git a/apps/my_repo/my_pkg/__init__.py b/apps/my_repo/my_pkg/__init__.py new file mode 100644 index 0000000..0978d8e --- /dev/null +++ b/apps/my_repo/my_pkg/__init__.py @@ -0,0 +1,2 @@ +from .motion import Motion +from .my_sub_pkg.hello import HelloWorldSub \ No newline at end of file diff --git a/apps/my_repo/my_pkg/motion.py b/apps/my_repo/my_pkg/motion.py new file mode 100644 index 0000000..7cfd46d --- /dev/null +++ b/apps/my_repo/my_pkg/motion.py @@ -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') \ No newline at end of file diff --git a/apps/my_repo/my_pkg/my_sub_pkg/__init__.py b/apps/my_repo/my_pkg/my_sub_pkg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/apps/my_repo/my_pkg/my_sub_pkg/hello.py b/apps/my_repo/my_pkg/my_sub_pkg/hello.py new file mode 100644 index 0000000..1089417 --- /dev/null +++ b/apps/my_repo/my_pkg/my_sub_pkg/hello.py @@ -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') \ No newline at end of file diff --git a/apps/my_repo/pyproject.toml b/apps/my_repo/pyproject.toml new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..9177129 --- /dev/null +++ b/docker-compose.yml @@ -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"]