Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
JB-Wolf committed Nov 22, 2021
2 parents 3bb9500 + 7d8a0a8 commit 9af8620
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions flowchem/components/devices/Knauer/AzuraCompactPump.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"""
import asyncio
import warnings
from typing import List

from loguru import logger
from enum import Enum

Expand Down Expand Up @@ -101,7 +103,8 @@ async def initialize(self):
def error_present(reply: str) -> bool:
"""True if there are errors, False otherwise. Warns for errors."""

if not reply.startswith("ERROR"):
# ERRORS: is the expected answer to read_errors()
if not reply.startswith("ERROR") or reply.startswith("ERRORS:"):
return False

if "ERROR:1" in reply:
Expand Down Expand Up @@ -357,11 +360,12 @@ async def read_extflow(self) -> float:
logger.debug(f"Extflow reading returns {ext_flow}")
return float(ext_flow)

async def read_errors(self):
async def read_errors(self) -> List[int]:
"""Returns the last 5 errors."""
last_5_errors = await self.create_and_send_command(ERRORS)
logger.debug(f"Error reading returns {last_5_errors}")
return last_5_errors
parsed_errors = [int(err_code) for err_code in last_5_errors.split(",")]
return parsed_errors

async def read_motor_current(self):
"""Returns motor current, relative in percent 0-100."""
Expand Down
Empty file.

0 comments on commit 9af8620

Please sign in to comment.