more complexity in the test cases

This commit is contained in:
John Lancaster
2024-08-09 17:54:20 -05:00
parent 03ebbcc1f0
commit 24dd2bfd3a
26 changed files with 140 additions and 507 deletions

View 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()

View File

@@ -0,0 +1,10 @@
automationlib:
module: automationlib
global: true
my_test_app:
module: test
class: Test
log_level: DEBUG
dependencies:
- automationlib

View File

@@ -0,0 +1 @@
arrow

View 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)