29 lines
496 B
Python
29 lines
496 B
Python
import logging
|
|
from enum import Enum
|
|
|
|
LOGGER = logging.getLogger('AppDaemon._globals')
|
|
|
|
|
|
GLOBAL_VAR = 'Hello, World!'
|
|
|
|
|
|
def global_function() -> None:
|
|
LOGGER.info('This is a global function.')
|
|
|
|
|
|
class GlobalClass:
|
|
def __init__(self) -> None:
|
|
self.value = 'This is a global class instance.'
|
|
|
|
def display(self) -> None:
|
|
LOGGER.info(self.value)
|
|
|
|
|
|
class ModeSelect(Enum):
|
|
MODE_A = 'mode_a'
|
|
MODE_B = 'mode_b'
|
|
MODE_C = 'mode_c'
|
|
|
|
|
|
GLOBAL_MODE = ModeSelect.MODE_C
|