# Enumerations & other classes

## Enumerations

class tango.LockerLanguage(*values)

  An enumeration representing the programming language in which the client application who locked is written.

  New in PyTango 7.0.0

class tango.CmdArgType(*values)

  An enumeration representing the Tango data types.

class tango.MessBoxType(*values)

  An enumeration representing the MessBoxType

  New in PyTango 7.0.0

class tango.PollObjType(*values)

  An enumeration representing the PollObjType

  New in PyTango 7.0.0

class tango.PollCmdCode(*values)

  An enumeration representing the PollCmdCode

  New in PyTango 7.0.0

class tango.SerialModel(*values)

  An enumeration representing the type of serialization performed by the device server

class tango.AttReqType(*values)

  An enumeration representing the type of attribute request

class tango.LockCmdCode(*values)

  An enumeration representing the LockCmdCode

  New in PyTango 7.0.0

class tango.LogLevel(*values)

  An enumeration representing the LogLevel

  New in PyTango 7.0.0

class tango.LogTarget(*values)

  An enumeration representing the LogTarget

  New in PyTango 7.0.0

class tango.EventType(*values)

  An enumeration representing event type

  Changed in version 7.0.0: Added DATA_READY_EVENT

  Changed in version 9.2.2: Added INTERFACE_CHANGE_EVENTn

  Changed in version 10.0.0: Added ALARM_EVENT

  Changed in version 10.0.0: Removed QUALITY_EVENT

  Changed in version 10.1.0: Removed PIPE_EVENT

class tango.KeepAliveCmdCode(*values)

  An enumeration representing the KeepAliveCmdCode

  New in PyTango 7.1.0

class tango.AccessControlType(*values)

  An enumeration representing the AccessControlType

  New in PyTango 7.0.0

class tango.asyn_req_type(*values)

  An enumeration representing the asynchronous request type

class tango.cb_sub_model(*values)

  An enumeration representing callback sub model

class tango.AttrQuality(*values)

  An enumeration representing the attribute quality

class tango.AttrWriteType(*values)

  An enumeration representing the attribute type

class tango.AttrDataFormat(*values)

  An enumeration representing the attribute format

class tango.DevSource(*values)

  An enumeration representing the device source for data

class tango.ErrSeverity(*values)

  An enumeration representing the error severity

class tango.DevState(*values)

  An enumeration representing the device state

class tango.DispLevel(*values)

  An enumeration representing the display level

class tango.GreenMode(*values)

  An enumeration representing the GreenMode

  Added in version 8.1.0.

  Changed in version 8.1.9: Added Asyncio

## Other classes

class tango.Release

  Summarize release information as class attributes.

  Release information:

    - name: (`str`) package name

    - version_info: (`tuple`) The five components of the version number: major, minor, micro, releaselevel, and serial.

    - version: (`str`) package version in format <major>.<minor>.<micro>

    - release: (`str`) pre-release, post-release or development release; it is empty for final releases.

    - version_long: (`str`) package version in format <major>.<minor>.<micro><releaselevel><serial>

    - version_description: (`str`) short description for the current version

    - version_number: (`int`) <major>*100 + <minor>*10 + <micro>

    - description : (`str`) package description

    - long_description: (`str`) longer package description

    - authors: (dict<str(last name), tuple<str(full name),str(email)>>) package authors

    - url: (`str`) package url

    - download_url: (`str`) package download url

    - platform: (`seq`) list of available platforms

    - keywords: (`seq`) list of keywords

    - license: (`str`) the license

class tango.TimeVal(a=None, b=None, c=None)

  Time value structure with the following members:

  > - tv_sec : seconds

  > - tv_usec : microseconds

  > - tv_nsec : nanoseconds

  Constructors

  __init__(self)

    Default constructor; all fields set to 0.

  __init__(self, tv_sec: int, tv_usec: int, tv_nsec: int)

    Create a TimeVal by specifying all three members.

  __init__(self, time: float)

    Create a TimeVal from time in seconds since epoch (e.g. time.time()).

  __init__(self, time: datetime.datetime)

    Create a TimeVal from time in datetime.datetime format (e.g. datetime.datetime.now()).

  static fromdatetime(dt) → TimeVal

    A static method returning a `tango.TimeVal` object representing the given `datetime.datetime`

    Parameters:
      dt:

        (`datetime.datetime`) a datetime object

    Return:

      (`TimeVal`) representing the given timestamp

    Added in version 7.1.0.

    Added in version 7.1.2: Documented

  static fromtimestamp(ts) → TimeVal

    A static method returning a `tango.TimeVal` object representing the given timestamp

    Parameters:
      ts:

        (`float`) a timestamp

    Return:

      (`TimeVal`) representing the given timestamp

    Added in version 7.1.0.

  isoformat(self, sep='T') → str

    Returns a string in ISO 8601 format, YYYY-MM-DDTHH:MM:SS[.mmmmmm][+HH:MM]

    Parameters:

      sep : (str) sep is used to separate the year from the time, and defaults to ‘T’

    Return:

      (`str`) a string representing the time according to a format specification.

    Added in version 7.1.0.

    Added in version 7.1.2: Documented

    Changed in version 7.1.2: The sep parameter is not mandatory anymore and defaults to ‘T’ (same as `datetime.datetime.isoformat()`)

  static now() → TimeVal

    A static method returning a `tango.TimeVal` object representing the current time

    Parameters:

      None

    Return:

      (`TimeVal`) representing the current time

    Added in version 7.1.0.

    Added in version 7.1.2: Documented

  strftime(self, format) → str

    Convert a time value to a string according to a format specification.

    Parameters:

      format : (str) See the python library reference manual for formatting codes

    Return:

      (`str`) a string representing the time according to a format specification.

    Added in version 7.1.0.

    Added in version 7.1.2: Documented

  todatetime(self) → datetime.datetime

    Returns a `datetime.datetime` object representing the same time value

    Parameters:

      None

    Return:

      (`datetime.datetime`) the time value in datetime format

    Added in version 7.1.0.

  totime(self) → float

    Returns a float representing this time value

    Parameters:

      None

    Return:

      a float representing the time value

    Added in version 7.1.0.

class tango.TimedAttrData(value=None, quality=AttrQuality.ATTR_VALID, w_value=None, error=None, time_stamp=None)

  This is pure-Python class, which combines both TimedAttrData and AttributeData cppTango classes, for use with Util.fill_attr_polling_buffer

  Parameters:

    - value (any type compatible with the Tango attribute's dtype) – value to be inserted in polling history. Default: `None`

    - quality (`tango.AttrQuality`) – quality of value. Default: `tango.AttrQuality.ATTR_VALID`

    - w_value (any type compatible with the Tango attribute's dtype) – corresponding written value. Note: should be present only for writable attributes Default: `None`

    - error (`Exception` or `tango.DevFailed`) – if the error reading should be inserted. Note: error has a priority over value! Default: `None`

    - time_stamp (`float`) – value time stamp in seconds passed since epoch. If not provided, the current system time will be used Default: `None`

class tango.TimedCmdData(value=None, error=None, time_stamp=None)

  This is pure-Python class, which mimics the TimedCmdData cppTango class, for use with Util.fill_cmd_polling_buffer

  Parameters:

    - value (any type compatible with the Tango commands's dtype) – value to be inserted in polling history. Default: `None`

    - error (`Exception` or `tango.DevFailed`) – if the error reading should be inserted. Note: error has a priority over value! Default: `None`

    - time_stamp (`float`) – value time stamp in seconds passed since epoch. If not provided, the current system time will be used Default: `None`