Skip to content

Commit

Permalink
add scada2
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamillar committed Oct 19, 2024
1 parent bfb289e commit 6907af5
Show file tree
Hide file tree
Showing 12 changed files with 597 additions and 18 deletions.
2 changes: 2 additions & 0 deletions gw_spaceheat/actors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from actors.hubitat_poller import HubitatPoller
from actors.hubitat_tank_module import HubitatTankModule
from actors.multipurpose_sensor import MultipurposeSensor
from actors.parentless import Parentless
from actors.power_meter import PowerMeter
from actors.scada import Scada
from actors.scada_interface import ScadaInterface
Expand All @@ -20,6 +21,7 @@
"HubitatPoller",
"HubitatTankModule",
"MultipurposeSensor",
"Parentless",
"PowerMeter",
"Scada",
"ScadaInterface",
Expand Down
5 changes: 4 additions & 1 deletion gw_spaceheat/actors/api_tank_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def _report_post_error(self, exception: BaseException, text: str) -> None:
async def _handle_microvolts_post(self, request: Request) -> Response:
text = await self._get_text(request)
self.readings_text = text
print("Got to handle microvolts")
if isinstance(text, str):
try:
self.services.send_threadsafe(
Expand All @@ -152,6 +153,7 @@ async def _handle_microvolts_post(self, request: Request) -> Response:
return Response()

async def _handle_params_post(self, request: Request) -> Response:
print("Got to handle params")
text = await self._get_text(request)
self.params_text = text
try:
Expand All @@ -169,6 +171,7 @@ async def _handle_params_post(self, request: Request) -> Response:
return Response(text=self.params_by_hw_uid[params.HwUid].model_dump_json())

def _process_microvolts(self, data: MicroVolts) -> None:
"processing microvolts!"
self.latest_readings = data
about_node_list = []
value_list = []
Expand All @@ -192,7 +195,7 @@ def _process_microvolts(self, data: MicroVolts) -> None:
)
)
)

print("About to send from inside _process_microvolts")
self._send(
SyncedReadingsMessage(
src=self.name,
Expand Down
Loading

0 comments on commit 6907af5

Please sign in to comment.