From 8214a02589713ae8e654d3feba5a2a1aaa96724f Mon Sep 17 00:00:00 2001 From: Jessica Millar Date: Sat, 21 Dec 2024 21:53:13 -0500 Subject: [PATCH] another --- gw_spaceheat/actors/scada.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gw_spaceheat/actors/scada.py b/gw_spaceheat/actors/scada.py index 17becf49..7eba6c7b 100644 --- a/gw_spaceheat/actors/scada.py +++ b/gw_spaceheat/actors/scada.py @@ -2,6 +2,7 @@ import asyncio import enum +from enum import auto import uuid import threading import time @@ -9,6 +10,7 @@ import dotenv from transitions import Machine +from gw.enums import GwStrEnum from gwproto.message import Header from gwproactor.external_watchdog import SystemDWatchdogCommandBuilder from gwproactor.links import LinkManagerTransition @@ -56,6 +58,29 @@ FsmEvent, GoDormant, LayoutLite, PicoMissing, ScadaParams, SendLayout, WakeUp) + +class DispatchContractState(GwStrEnum): + ContractSuspended = auto() + ScadaNotReady = auto() + ScadaReady = auto() + DispatchLive = auto() + + @classmethod + def enum_name(cls) -> str: + return "dispatch.contract.state" + + +class DispatchContractEvent(GwStrEnum): + SlaViolated = auto() + Reauthorized = auto() + WeatherAndTempsAvail = auto() + AtnWantsControl = auto() + + @classmethod + def enum_name(cls) -> str: + return "dispatch.contract.event" + + ScadaMessageDecoder = create_message_model( "ScadaMessageDecoder", [