Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/presetmanager.py: 0%

17 statements  

« 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 

4 

5from daiquiri.core.hardware.abstract import HardwareObject 

6from daiquiri.core.schema.hardware import HardwareSchema 

7from daiquiri.core.schema.validators import OneOf 

8 

9import logging 

10 

11logger = logging.getLogger(__name__) 

12 

13PresetmanagerStates = ["READY", "ERROR"] 

14 

15 

16class PresetmanagerPropertiesSchema(HardwareSchema): 

17 state = OneOf(PresetmanagerStates, metadata={"readOnly": True}) 

18 presets = fields.List(fields.Str()) 

19 

20 

21class PresetmanagerCallablesSchema(HardwareSchema): 

22 apply = fields.Str(required=True, metadata={"description": "The preset to apply"}) 

23 

24 

25class Presetmanager(HardwareObject): 

26 _type = "presetmanager" 

27 _state_ok = [PresetmanagerStates[0]] 

28 

29 _properties = PresetmanagerPropertiesSchema() 

30 _callables = PresetmanagerCallablesSchema()