Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/laser.py: 0%
18 statements
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +0000
« prev ^ index » next coverage.py v7.6.5, created at 2024-11-15 02:12 +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, RequireEmpty
9import logging
11logger = logging.getLogger(__name__)
13LaserStates = ["ON", "OFF", "ERROR", "UNKNOWN"]
16class LaserPropertiesSchema(HardwareSchema):
17 state = OneOf(LaserStates, metadata={"readOnly": True})
18 power = fields.Float()
21class LaserCallablesSchema(HardwareSchema):
22 on = RequireEmpty()
23 off = RequireEmpty()
26class Laser(HardwareObject):
27 _type = "laser"
28 _state_ok = [LaserStates[0]]
30 _properties = LaserPropertiesSchema()
31 _callables = LaserCallablesSchema()