Device Component Manager

This module implements an abstract component manager for simple object components.

class DeviceComponentManager(fqdn, logger, communication_status_changed_callback, component_state_callback, health_changed_callback=None)

An abstract component manager for a Tango device component.

__init__(fqdn, logger, communication_status_changed_callback, component_state_callback, health_changed_callback=None)

Initialise a new instance.

Parameters:
  • fqdn (str) – the FQDN of the device

  • logger (Logger) – the logger to be used by this object.

  • communication_status_changed_callback (Callable[[CommunicationStatus], None]) – callback to be called when the status of the communications channel between the component manager and its component changes

  • component_state_callback (Callable) – callback to be called when the component faults (or stops faulting)

  • health_changed_callback (Optional[Callable[[Optional[HealthState]], None]]) – callback to be called when the health state of the device changes. The value it is called with will normally be a HealthState, but may be None if the admin mode of the device indicates that the device’s health should not be included in upstream health rollup.

property health: HealthState | None

Return the evaluated health state of the device.

This will be either the health state that the device reports, or None if the device is in an admin mode that indicates that its health should not be rolled up.

Returns:

the evaluated health state of the device.

start_communicating()

Establish communication with the component, then start monitoring.

This is a public method that enqueues the work to be done.

Return type:

None

stop_communicating()

Cease monitoring the component, and break off all communication with it.

Return type:

None