reorg and other stuff
This commit is contained in:
6
apps/app1/subdir/foo.py
Normal file
6
apps/app1/subdir/foo.py
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
from appdaemon.adapi import ADAPI
|
||||||
|
|
||||||
|
class Foo(ADAPI):
|
||||||
|
def initialize(self):
|
||||||
|
self.log(f'Initialized from {__file__}')
|
||||||
|
|
||||||
@@ -4,4 +4,8 @@ App1:
|
|||||||
|
|
||||||
App2:
|
App2:
|
||||||
module: app2.database
|
module: app2.database
|
||||||
class: OtherDatabaseApp
|
class: OtherDatabaseApp
|
||||||
|
|
||||||
|
App1Foo:
|
||||||
|
module: app1.subdir.foo
|
||||||
|
class: Foo
|
||||||
|
|||||||
@@ -1,27 +1,25 @@
|
|||||||
import logging
|
import logging
|
||||||
import logging.config
|
import logging.config
|
||||||
|
|
||||||
import appdaemon.adbase as ad
|
from appdaemon.adapi import ADAPI
|
||||||
|
|
||||||
|
|
||||||
class HelloWorld(ad.ADBase):
|
class HelloWorld(ADAPI):
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
self.adapi = self.get_ad_api()
|
|
||||||
self.log = self.adapi.log
|
|
||||||
self.log(f'Initialized app from {__file__}')
|
self.log(f'Initialized app from {__file__}')
|
||||||
|
|
||||||
logging.config.dictConfig(
|
# logging.config.dictConfig(
|
||||||
{
|
# {
|
||||||
'version': 1,
|
# 'version': 1,
|
||||||
'disable_existing_loggers': False,
|
# 'disable_existing_loggers': False,
|
||||||
'formatters': {'basic': {'style': '{', 'format': '{message}'}},
|
# 'formatters': {'basic': {'style': '{', 'format': '{message}'}},
|
||||||
'handlers': {'rich': {'()': 'rich.logging.RichHandler'}},
|
# 'handlers': {'rich': {'()': 'rich.logging.RichHandler'}},
|
||||||
'loggers': {
|
# 'loggers': {
|
||||||
'AppDaemon._app_management': {
|
# 'AppDaemon._app_management': {
|
||||||
'level': 'DEBUG',
|
# 'level': 'DEBUG',
|
||||||
'propagate': False,
|
# 'propagate': False,
|
||||||
'handlers': ['rich'],
|
# 'handlers': ['rich'],
|
||||||
}
|
# }
|
||||||
},
|
# },
|
||||||
}
|
# }
|
||||||
)
|
# )
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[project]
|
||||||
|
name = "my_pkg"
|
||||||
|
description="Config for AppDaemon testing"
|
||||||
|
version = "0.1.0"
|
||||||
@@ -1 +1,3 @@
|
|||||||
rich
|
rich
|
||||||
|
anyio
|
||||||
|
pydantic
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
version: '3.9'
|
|
||||||
services:
|
services:
|
||||||
appdaemon:
|
appdaemon:
|
||||||
container_name: appdaemon_dev
|
container_name: appdaemon_dev
|
||||||
image: appdaemon:jsl-dev
|
image: appdaemon:local-dev
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
|||||||
Reference in New Issue
Block a user