Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/tango/wago.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 tango import DevState 

4 

5from daiquiri.core.hardware.abstract import HardwareProperty 

6from daiquiri.core.hardware.abstract.generic import Generic as AbstractGeneric 

7from daiquiri.core.hardware.rtschemamixin import RTSchemaMixin 

8from daiquiri.core.hardware.tango.object import TangoObject 

9 

10import logging 

11 

12logger = logging.getLogger(__name__) 

13 

14 

15class WagoStateProperty(HardwareProperty): 

16 def translate_from(self, value): 

17 val_map = {DevState.ON: "ON", DevState.OFF: "OFF", DevState.UNKNOWN: "UNKNOWN"} 

18 for k, v in val_map.items(): 

19 if k == value: 

20 return v 

21 return "UNKNOWN" 

22 

23 

24class Wago(RTSchemaMixin, TangoObject, AbstractGeneric): 

25 _type = "wago" 

26 PROPERTY_MAP = {"state": WagoStateProperty("state")}