Skip to content

Commit

Permalink
Updates to FsmEvent etc
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamillar committed Nov 10, 2024
1 parent f57e871 commit caaffb1
Show file tree
Hide file tree
Showing 35 changed files with 516 additions and 369 deletions.
20 changes: 13 additions & 7 deletions src/gwproto/data_classes/house_0_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,19 @@ class H0N:
store_charge_discharge_relay: Literal["relay3"] = (
f"relay{House0RelayIdx.store_charge_disharge}"
)
hp_failsafe_relay = f"relay{House0RelayIdx.hp_failsafe}"
hp_scada_ops_relay = f"relay{House0RelayIdx.hp_scada_ops}"
aquastat_ctrl_relay = f"relay{House0RelayIdx.aquastat_ctrl}"
store_pump_failsafe = f"relay{House0RelayIdx.store_pump_failsafe}"
boiler_scada_ops = f"relay{House0RelayIdx.boiler_scada_ops}"
primary_pump_scada_ops = f"relay{House0RelayIdx.primary_pump_ops}"
primary_pump_failsafe = f"relay{House0RelayIdx.primary_pump_failsafe}"
hp_failsafe_relay: Literal["relay5"] = f"relay{House0RelayIdx.hp_failsafe}"
hp_scada_ops_relay: Literal["relay6"] = f"relay{House0RelayIdx.hp_scada_ops}"
aquastat_ctrl_relay: Literal["relay8"] = f"relay{House0RelayIdx.aquastat_ctrl}"
store_pump_failsafe: Literal["relay9"] = (
f"relay{House0RelayIdx.store_pump_failsafe}"
)
boiler_scada_ops: Literal["relay10"] = f"relay{House0RelayIdx.boiler_scada_ops}"
primary_pump_scada_ops: Literal["relay11"] = (
f"relay{House0RelayIdx.primary_pump_ops}"
)
primary_pump_failsafe: Literal["relay12"] = (
f"relay{House0RelayIdx.primary_pump_failsafe}"
)
hubitat = "hubitat"

# finite state machines
Expand Down
20 changes: 14 additions & 6 deletions src/gwproto/enums/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,32 @@

from gwproto.enums.actor_class import ActorClass
from gwproto.enums.alert_priority import AlertPriority
from gwproto.enums.aquastat_control import AquastatControl
from gwproto.enums.change_aquastat_control import ChangeAquastatControl
from gwproto.enums.change_heat_pump_control import ChangeHeatPumpControl
from gwproto.enums.change_heatcall_source import ChangeHeatcallSource
from gwproto.enums.change_primary_pump_control import ChangePrimaryPumpControl
from gwproto.enums.change_relay_pin import ChangeRelayPin
from gwproto.enums.change_relay_state import ChangeRelayState
from gwproto.enums.change_store_flow_direction import ChangeStoreFlowDirection
from gwproto.enums.change_store_flow_relay import ChangeStoreFlowRelay
from gwproto.enums.change_valve_state import ChangeValveState
from gwproto.enums.fsm_action_type import FsmActionType
from gwproto.enums.fsm_event_type import FsmEventType
from gwproto.enums.fsm_name import FsmName
from gwproto.enums.fsm_report_type import FsmReportType
from gwproto.enums.gpm_from_hz_method import GpmFromHzMethod
from gwproto.enums.heat_pump_control import HeatPumpControl
from gwproto.enums.heatcall_source import HeatcallSource
from gwproto.enums.hz_calc_method import HzCalcMethod
from gwproto.enums.kind_of_param import KindOfParam
from gwproto.enums.make_model import MakeModel
from gwproto.enums.pico_cycler_event import PicoCyclerEvent
from gwproto.enums.pico_cycler_state import PicoCyclerState
from gwproto.enums.primary_pump_control import PrimaryPumpControl
from gwproto.enums.relay_closed_or_open import RelayClosedOrOpen
from gwproto.enums.relay_energization_state import RelayEnergizationState
from gwproto.enums.relay_pin_set import RelayPinSet
from gwproto.enums.relay_wiring_config import RelayWiringConfig
from gwproto.enums.store_flow_direction import StoreFlowDirection
from gwproto.enums.store_flow_relay import StoreFlowRelay
from gwproto.enums.telemetry_name import TelemetryName
from gwproto.enums.temp_calc_method import TempCalcMethod
from gwproto.enums.thermistor_data_method import ThermistorDataMethod
Expand All @@ -62,28 +66,32 @@
__all__ = [
"ActorClass", # [sh.actor.class.002](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shactorclass)
"AlertPriority", # [alert.priority.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#alertpriority)
"AquastatControl", # [aquastat.control.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#aquastatcontrolstate)
"ChangeAquastatControl", # [change.aquastat.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changeaquastatcontrol)
"ChangeHeatPumpControl", # [change.heat.pump.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changeheatpumpcontrol)
"ChangeHeatcallSource", # [change.heatcall.source.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changeheatcallsource)
"ChangePrimaryPumpControl", # [change.primary.pump.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changeprimarypumpcontrol)
"ChangeRelayPin", # [change.relay.pin.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changerelaypin)
"ChangeRelayState", # [change.relay.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changerelaystate)
"ChangeStoreFlowDirection", # [change.store.flow.direction.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changestoreflowdirection)
"ChangeStoreFlowRelay", # [change.store.flow.relay.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changestoreflowrelay)
"ChangeValveState", # [change.valve.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changevalvestate)
"FsmActionType", # [sh.fsm.action.type.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shfsmactiontype)
"FsmEventType", # [sh.fsm.event.type.001](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shfsmeventtype)
"FsmName", # [sh.fsm.name.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#shfsmname)
"FsmReportType", # [fsm.report.type.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#fsmreporttype)
"GpmFromHzMethod", # [gpm.from.hz.method.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#gpmfromhzmethod)
"HeatPumpControl", # [heat.pump.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#heatpumpcontrol)
"HeatcallSource", # [heatcall.source.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#heatcallsource)
"HzCalcMethod", # [hz.calc.method.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#hzcalcmethod)
"KindOfParam", # [spaceheat.kind.of.param.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#spaceheatkindofparam)
"MakeModel", # [spaceheat.make.model.003](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#spaceheatmakemodel)
"PicoCyclerEvent", # [pico.cycler.event.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#picocyclerevent)
"PicoCyclerState", # [pico.cycler.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#picocyclerstate)
"PrimaryPumpControl", # [primary.pump.control.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#primarypumpcontrol)
"RelayClosedOrOpen", # [relay.closed.or.open.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relayclosedoropen)
"RelayEnergizationState", # [relay.energization.state.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relayenergizationstate)
"RelayPinSet", # [relay.pin.set.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relaypinset)
"RelayWiringConfig", # [relay.wiring.config.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#relaywiringconfig)
"StoreFlowDirection", # [store.flow.direction.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#storeflowdirection)
"StoreFlowRelay", # [store.flow.relay.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#storeflowrelay)
"TelemetryName", # [spaceheat.telemetry.name.001](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#spaceheattelemetryname)
"TempCalcMethod", # [temp.calc.method.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#tempcalcmethod)
"ThermistorDataMethod", # [thermistor.data.method.000](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#thermistordatamethod)
Expand Down
36 changes: 36 additions & 0 deletions src/gwproto/enums/aquastat_control.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from enum import auto
from typing import List

from gw.enums import GwStrEnum


class AquastatControl(GwStrEnum):
"""
Values:
- Boiler
- Scada
For more information:
- [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/)
- [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#aquastatcontrolstate)
"""

Boiler = auto()
Scada = auto()

@classmethod
def default(cls) -> "AquastatControl":
return cls.Boiler

@classmethod
def values(cls) -> List[str]:
return [elt.value for elt in cls]

@classmethod
def enum_name(cls) -> str:
return "aquastat.control.state"

@classmethod
def enum_version(cls) -> str:
return "000"
31 changes: 0 additions & 31 deletions src/gwproto/enums/change_store_flow_direction.py

This file was deleted.

36 changes: 36 additions & 0 deletions src/gwproto/enums/change_store_flow_relay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from enum import auto
from typing import List

from gw.enums import GwStrEnum


class ChangeStoreFlowRelay(GwStrEnum):
"""
Events that trigger changing StoreFlowDirection finite state machine
Values:
- DischargeStore
- ChargeStore
For more information:
- [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/)
- [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#changestoreflowrelay)
"""

DischargeStore = auto()
ChargeStore = auto()

@classmethod
def default(cls) -> "ChangeStoreFlowRelay":
return cls.DischargeStore

@classmethod
def values(cls) -> List[str]:
return [elt.value for elt in cls]

@classmethod
def enum_name(cls) -> str:
return "change.store.flow.relay"

@classmethod
def enum_version(cls) -> str:
return "000"
70 changes: 0 additions & 70 deletions src/gwproto/enums/fsm_event_type.py

This file was deleted.

36 changes: 36 additions & 0 deletions src/gwproto/enums/heat_pump_control.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from enum import auto
from typing import List

from gw.enums import GwStrEnum


class HeatPumpControl(GwStrEnum):
"""
Values:
- BufferTankAquastat
- Scada
For more information:
- [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/)
- [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#heatpumpcontrol)
"""

BufferTankAquastat = auto()
Scada = auto()

@classmethod
def default(cls) -> "HeatPumpControl":
return cls.BufferTankAquastat

@classmethod
def values(cls) -> List[str]:
return [elt.value for elt in cls]

@classmethod
def enum_name(cls) -> str:
return "heat.pump.control"

@classmethod
def enum_version(cls) -> str:
return "000"
38 changes: 38 additions & 0 deletions src/gwproto/enums/heatcall_source.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from enum import auto
from typing import List

from gw.enums import GwStrEnum


class HeatcallSource(GwStrEnum):
"""
Used for reflecting the state of a double-throw relay that can toggle between a failsafe
for providing a 24V heat call to a zone controller (aka Wall Thermostat) and the SCADA providing
that heat call
Values:
- WallThermostat
- Scada
For more information:
- [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/)
- [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#heatcallsource)
"""

WallThermostat = auto()
Scada = auto()

@classmethod
def default(cls) -> "HeatcallSource":
return cls.WallThermostat

@classmethod
def values(cls) -> List[str]:
return [elt.value for elt in cls]

@classmethod
def enum_name(cls) -> str:
return "heatcall.source"

@classmethod
def enum_version(cls) -> str:
return "000"
46 changes: 46 additions & 0 deletions src/gwproto/enums/pico_cycler_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
from enum import auto
from typing import List

from gw.enums import GwStrEnum


class PicoCyclerEvent(GwStrEnum):
"""
Values:
- PicoMissing
- ConfirmOpened
- StartClosing
- ConfirmClosed
- ConfirmRebooted
- AllZombies
- RebootDud
For more information:
- [ASLs](https://gridworks-type-registry.readthedocs.io/en/latest/)
- [Global Authority](https://gridworks-type-registry.readthedocs.io/en/latest/enums.html#picocyclerevent)
"""

PicoMissing = auto()
ConfirmOpened = auto()
StartClosing = auto()
ConfirmClosed = auto()
ConfirmRebooted = auto()
AllZombies = auto()
RebootDud = auto()

@classmethod
def default(cls) -> "PicoCyclerEvent":
return cls.ConfirmRebooted

@classmethod
def values(cls) -> List[str]:
return [elt.value for elt in cls]

@classmethod
def enum_name(cls) -> str:
return "pico.cycler.event"

@classmethod
def enum_version(cls) -> str:
return "000"
Loading

0 comments on commit caaffb1

Please sign in to comment.