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

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import fields 

4 

5from daiquiri.core.hardware.abstract import HardwareObject 

6from daiquiri.core.schema.hardware import HardwareSchema 

7from daiquiri.core.schema.validators import RequireEmpty, OneOf 

8 

9import logging 

10 

11logger = logging.getLogger(__name__) 

12 

13FrontendStates = ["OPEN", "RUNNING", "STANDBY", "CLOSED", "UNKNOWN", "FAULT"] 

14FrontendItlkStates = ["ON", "FAULT"] 

15 

16 

17class FrontendPropertiesSchema(HardwareSchema): 

18 state = OneOf(FrontendStates, metadata={"readOnly": True}) 

19 status = fields.Str(metadata={"readOnly": True}) 

20 

21 automatic = fields.Bool(metadata={"readOnly": True}) 

22 frontend = fields.Str(metadata={"readOnly": True}) 

23 

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}) 

28 

29 feitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True}) 

30 pssitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True}) 

31 expitlk = OneOf(FrontendItlkStates, metadata={"readOnly": True}) 

32 

33 

34class FrontendCallablesSchema(HardwareSchema): 

35 open = RequireEmpty() 

36 close = RequireEmpty() 

37 reset = RequireEmpty() 

38 

39 

40class Frontend(HardwareObject): 

41 _type = "frontend" 

42 _state_ok = [FrontendStates[0], FrontendStates[1]] 

43 

44 _properties = FrontendPropertiesSchema() 

45 _callables = FrontendCallablesSchema()