Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/light.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__)
13LightStates = ["ON", "OFF", "STANDBY", "ERROR"]
16class LightPropertiesSchema(HardwareSchema):
17 state = OneOf(LightStates, metadata={"readOnly": True})
18 temperature = fields.Float(metadata={"readOnly": True})
19 intensity = fields.Float()
22class Light(HardwareObject):
23 _type = "light"
24 _state_ok = [LightStates[0], LightStates[1], LightStates[2]]
26 _properties = LightPropertiesSchema()