__init__.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # -*- coding: utf-8 -*-
  2. """
  3. Scheduler Module - Flexibles Job-Scheduling-System.
  4. Unterstützt:
  5. - Cron-ähnliche Zeit-basierte Trigger
  6. - Event-basierte Trigger (EventManager)
  7. - Interval-Trigger
  8. - DateTime-Trigger (einmalig)
  9. - Conditions (Zeitfenster, Aktivität, Sensoren, Zustand)
  10. - Composite Triggers/Conditions (AND/OR/NOT/XOR)
  11. - Persistierung von Jobs in ./cron/*.json
  12. """
  13. from trixy_core.scheduler.job import (
  14. ScheduledJob,
  15. JobConfig,
  16. JobState,
  17. JobResult,
  18. )
  19. from trixy_core.scheduler.trigger import (
  20. Trigger,
  21. TriggerState,
  22. CronTrigger,
  23. IntervalTrigger,
  24. DateTimeTrigger,
  25. EventTrigger,
  26. AndTrigger,
  27. OrTrigger,
  28. )
  29. from trixy_core.scheduler.condition import (
  30. Condition,
  31. # Time
  32. TimeRangeCondition,
  33. DayOfWeekCondition,
  34. DateRangeCondition,
  35. # Activity
  36. RecentActivityCondition,
  37. ActivityCountCondition,
  38. # Sensor
  39. ComparisonOperator,
  40. SensorThresholdCondition,
  41. SensorChangeCondition,
  42. # State
  43. StateCondition,
  44. BooleanCondition,
  45. ExistsCondition,
  46. # Composite
  47. AndCondition,
  48. OrCondition,
  49. NotCondition,
  50. XorCondition,
  51. # Script
  52. ScriptCondition,
  53. AsyncScriptCondition,
  54. # File Value
  55. JsonValueCondition,
  56. IniValueCondition,
  57. YamlValueCondition,
  58. TomlValueCondition,
  59. EnvFileValueCondition,
  60. # Expression
  61. ExpressionCondition,
  62. LambdaCondition,
  63. satellites_connected,
  64. satellite_in_room,
  65. plugin_enabled,
  66. music_playing,
  67. music_stopped,
  68. conversation_active,
  69. no_conversation,
  70. )
  71. from trixy_core.scheduler.action import (
  72. Action,
  73. ActionResult,
  74. EmitEventAction,
  75. MultiEventAction,
  76. CallbackAction,
  77. MethodAction,
  78. CommandAction,
  79. ScriptAction,
  80. )
  81. from trixy_core.scheduler.scheduler import (
  82. Scheduler,
  83. SchedulerConfig,
  84. )
  85. from trixy_core.scheduler.service import (
  86. SchedulerService,
  87. )
  88. __all__ = [
  89. # Job
  90. "ScheduledJob",
  91. "JobConfig",
  92. "JobState",
  93. "JobResult",
  94. # Triggers
  95. "Trigger",
  96. "TriggerState",
  97. "CronTrigger",
  98. "IntervalTrigger",
  99. "DateTimeTrigger",
  100. "EventTrigger",
  101. "AndTrigger",
  102. "OrTrigger",
  103. # Conditions - Time
  104. "Condition",
  105. "TimeRangeCondition",
  106. "DayOfWeekCondition",
  107. "DateRangeCondition",
  108. # Conditions - Activity
  109. "RecentActivityCondition",
  110. "ActivityCountCondition",
  111. # Conditions - Sensor
  112. "ComparisonOperator",
  113. "SensorThresholdCondition",
  114. "SensorChangeCondition",
  115. # Conditions - State
  116. "StateCondition",
  117. "BooleanCondition",
  118. "ExistsCondition",
  119. # Conditions - Composite
  120. "AndCondition",
  121. "OrCondition",
  122. "NotCondition",
  123. "XorCondition",
  124. # Conditions - Script
  125. "ScriptCondition",
  126. "AsyncScriptCondition",
  127. # Conditions - File Value
  128. "JsonValueCondition",
  129. "IniValueCondition",
  130. "YamlValueCondition",
  131. "TomlValueCondition",
  132. "EnvFileValueCondition",
  133. # Conditions - Expression
  134. "ExpressionCondition",
  135. "LambdaCondition",
  136. "satellites_connected",
  137. "satellite_in_room",
  138. "plugin_enabled",
  139. "music_playing",
  140. "music_stopped",
  141. "conversation_active",
  142. "no_conversation",
  143. # Actions
  144. "Action",
  145. "ActionResult",
  146. "EmitEventAction",
  147. "MultiEventAction",
  148. "CallbackAction",
  149. "MethodAction",
  150. "CommandAction",
  151. "ScriptAction",
  152. # Scheduler
  153. "Scheduler",
  154. "SchedulerConfig",
  155. "SchedulerService",
  156. ]