Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/gauge.py: 0%
19 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 RequireEmpty, OneOf
9import logging
11logger = logging.getLogger(__name__)
13GaugeStates = ["ON", "OFF", "UNKNOWN", "ERROR"]
16class GaugePropertiesSchema(HardwareSchema):
17 state = OneOf(GaugeStates, metadata={"readOnly": True})
18 status = fields.Str(metadata={"readOnly": True})
19 pressure = fields.Float(metadata={"readOnly": True})
22class GaugeCallablesSchema(HardwareSchema):
23 on = RequireEmpty()
24 off = RequireEmpty()
27class Gauge(HardwareObject):
28 _type = "gauge"
29 _state_ok = [GaugeStates[0], GaugeStates[1]]
31 _properties = GaugePropertiesSchema()
32 _callables = GaugeCallablesSchema()