Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/frontend.py: 0%
29 statements
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +0000
« prev ^ index » next coverage.py v7.6.4, created at 2024-11-14 02:13 +0000
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3from marshmallow import fields
5from daiquiri.core.hardware.abstract import HardwareObject
6from daiquiri.core.schema.hardware import HardwareSchema
7from daiquiri.core.schema.validators import RequireEmpty, OneOf
9import logging
11logger = logging.getLogger(__name__)
13FrontendStates = ["OPEN", "RUNNING", "STANDBY", "CLOSED", "UNKNOWN", "FAULT"]
14FrontendItlkStates = ["ON", "FAULT"]
17class FrontendPropertiesSchema(HardwareSchema):
18 state = OneOf(FrontendStates, metadata={"readOnly": True})
19 status = fields.Str(metadata={"readOnly": True})
21 automatic = fields.Bool(metadata={"readOnly": True})
22 frontend = fields.Str(metadata={"readOnly": True})
24 current = fields.Float(metadata={"readOnly": True})
25 refill = fields.Float(metadata={"readOnly": True})
26 mode = fields.Str(metadata={"readOnly": True})
27 message = fields.Str(metadata={"readOnly": True})
29 feitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True})
30 pssitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True})
31 expitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True})
34class FrontendCallablesSchema(HardwareSchema):
35 open = RequireEmpty()
36 close = RequireEmpty()
37 reset = RequireEmpty()
40class Frontend(HardwareObject):
41 _type = "frontend"
42 _state_ok = [FrontendStates[0], FrontendStates[1]]
44 _properties = FrontendPropertiesSchema()
45 _callables = FrontendCallablesSchema()