more complexity in the test cases
This commit is contained in:
13
apps/automationlib/automationlib.py
Normal file
13
apps/automationlib/automationlib.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import arrow
|
||||
from appdaemon.adapi import ADAPI
|
||||
|
||||
|
||||
class AutomationLib:
|
||||
"""This is the documentation for AutomationLib"""
|
||||
|
||||
def __init__(self, ad: ADAPI) -> None:
|
||||
self.ad = ad
|
||||
self.ad.log(f"AutomationLib initialised for app '{self.ad.name}'", level='DEBUG')
|
||||
|
||||
def dow(self):
|
||||
return arrow.now().isoweekday()
|
||||
10
apps/automationlib/automationlib.yaml
Normal file
10
apps/automationlib/automationlib.yaml
Normal file
@@ -0,0 +1,10 @@
|
||||
automationlib:
|
||||
module: automationlib
|
||||
global: true
|
||||
|
||||
my_test_app:
|
||||
module: test
|
||||
class: Test
|
||||
log_level: DEBUG
|
||||
dependencies:
|
||||
- automationlib
|
||||
1
apps/automationlib/requirements.txt
Normal file
1
apps/automationlib/requirements.txt
Normal file
@@ -0,0 +1 @@
|
||||
arrow
|
||||
14
apps/automationlib/test.py
Normal file
14
apps/automationlib/test.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from appdaemon.plugins.hass.hassapi import Hass
|
||||
from automationlib import AutomationLib
|
||||
|
||||
|
||||
class Test(Hass):
|
||||
"""This is the documentation for Test"""
|
||||
|
||||
def initialize(self):
|
||||
"""."""
|
||||
|
||||
self.lib = AutomationLib(self)
|
||||
self.log('-' * 72)
|
||||
self.log(f'Day of the week: {self.lib.dow()}')
|
||||
self.log('-' * 72)
|
||||
Reference in New Issue
Block a user