Skip to content

temperature_controller_base

frog.hardware.plugins.temperature.temperature_controller_base ¤

Provides a base class for temperature controller devices or mock devices.

Attributes¤

Classes¤

TemperatureControllerBase(name) ¤

Bases: Device

The base class for temperature controller devices or mock devices.

Create a new TemperatureControllerBase object.

Subscribes to incoming requests.

Parameters:

Name Type Description Default
name str

The name of the device, to distinguish it from others

required
Source code in frog/hardware/plugins/temperature/temperature_controller_base.py
20
21
22
23
24
25
26
27
28
29
30
31
def __init__(self, name: str) -> None:
    """Create a new TemperatureControllerBase object.

    Subscribes to incoming requests.

    Args:
        name: The name of the device, to distinguish it from others
    """
    super().__init__(name)

    self.subscribe(self.get_properties, "request", "response", "properties")
    self.subscribe(self.change_set_point, "change_set_point")
Attributes¤
alarm_status abstractmethod property ¤

The current error status of the system.

A value of zero indicates that no error has occurred.

power abstractmethod property ¤

The current power output of the device.

set_point abstractmethod property writable ¤

The set point temperature (in degrees).

In other words, this indicates the temperature the device is aiming towards.

temperature abstractmethod property ¤

The current temperature reported by the device.

Functions¤
change_set_point(temperature) ¤

Change the set point to a new value.

Source code in frog/hardware/plugins/temperature/temperature_controller_base.py
40
41
42
def change_set_point(self, temperature: Decimal) -> None:
    """Change the set point to a new value."""
    self.set_point = temperature
get_properties() ¤

Get device properties.

Source code in frog/hardware/plugins/temperature/temperature_controller_base.py
33
34
35
36
37
38
def get_properties(self) -> dict[str, Any]:
    """Get device properties."""
    return {
        prop: getattr(self, prop)
        for prop in ("temperature", "power", "alarm_status", "set_point")
    }