Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/attenuator.py: 0%
15 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 OneOf
9import logging
11logger = logging.getLogger(__name__)
13AttenuatorStates = ["ON", "ERROR"]
16class AttenuatorPropertiesSchema(HardwareSchema):
17 state = OneOf(AttenuatorStates, metadata={"readOnly": True})
18 factor = fields.Int(metadata={"readOnly": True})
19 thickness = fields.Float(metadata={"readOnly": True})
22class Attenuator(HardwareObject):
23 _type = "attenuator"
24 _state_ok = [AttenuatorStates[0]]
25 _properties = AttenuatorPropertiesSchema()