The submodule collapse was only half applied: .gitmodules was deleted but backend/ and frontend/ were still recorded as gitlinks, so none of their files were tracked. Replace the gitlinks with the real trees. Also untrack .env (it carried placeholder secrets) in favour of a tracked .env.example, drop the committed __pycache__, and narrow the blanket *.png ignore that would have swallowed design assets. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
31 lines
816 B
Python
31 lines
816 B
Python
from nodes import Node
|
|
from util import Message
|
|
|
|
import logging
|
|
|
|
logging.basicConfig(
|
|
level=logging.INFO,
|
|
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
|
|
)
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
|
def create_node(params: dict) -> Node:
|
|
def check_power(params, random_value_rec_rate_delayed: int, **kwargs):
|
|
threshold = params.get("alert_threshold", 1000.0)
|
|
|
|
if random_value_rec_rate_delayed > 50:
|
|
logger.info(f"[alert_node] ⚠️ Input >50")
|
|
else:
|
|
logger.info(f"[alert_node] ✓ Input < 50")
|
|
|
|
return Node(
|
|
f=check_power,
|
|
requires=[
|
|
Message(name="random_value_rec_rate_delayed", dtype=int),
|
|
],
|
|
provides=[], # Using object for optional string
|
|
params=params,
|
|
name="notify",
|
|
)
|