vaem_config
Holds all the different VAEM configurations for the different backends.
These are the supported client interface configurations for the VAEM valve control module
Typical usage examples
Factory usage — dispatches to the correct subclass automatically
vaem_config = VAEMConfig(interface="tcp/ip", ip=ip, port=502)
Explicit subclass usage — equivalent to the factory call above
vaem_config = VAEMTCPConfig(ip=ip, port=502)
vaem = VAEM(config=vaem_config)
VAEMConfig
dataclass
Generic VAEM config dataclass and factory for initialization.
When called directly, acts as a factory and returns the appropriate
subclass instance based on the interface argument.
Attributes:
| Name | Type | Description |
|---|---|---|
interface |
str
|
Interface to connect to VAEM. Ex: |
unit_id |
int
|
Modbus Unit ID of the VAEM (default: 1) |
Example
Factory usage returns a VAEMTCPConfig instance::
1 | |
Factory usage returns a VAEMSerialConfig instance::
1 | |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/vaem/vaem_config.py
__new__(*, interface=None, **kwargs)
Create and return the appropriate config subclass instance.
When called on VAEMConfig directly, dispatches to the correct
subclass based on interface. When called on a subclass,
delegates to object.__new__.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
interface
|
str | None
|
The communication interface. Supported values are
|
None
|
**kwargs
|
Additional keyword arguments forwarded to the
subclass |
{}
|
Returns:
| Type | Description |
|---|---|
VAEMConfig
|
A VAEMTCPConfig instance for |
VAEMConfig
|
VAEMSerialConfig instance for |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in src/vaem/vaem_config.py
VAEMSerialConfig
dataclass
Bases: VAEMConfig
Dataclass for VAEM Serial connection.
Attributes:
| Name | Type | Description |
|---|---|---|
com_port |
str
|
COM port to connect to VAEM |
baudrate |
int
|
Baudrate for the serial connection (default: 9600). Ex: 9600, 19200, 38400, 57600, 115200 |
Typical usage example
vaem_serial_config = VAEMSerialConfig(com_port = "COM3", baudrate = 9600)
vaem = VAEM(vaem_serial_config)
Source code in src/vaem/vaem_config.py
VAEMTCPConfig
dataclass
Bases: VAEMConfig
Datclass for VAEM TCP/IP connection.
Attributes:
| Name | Type | Description |
|---|---|---|
ip |
str
|
IP address of the VAEM # TODO: Make ipaddress.ip_address(...) |
port |
int
|
Port number of the VAEM (default: 502) |
Typical usage example
vaem_config = VAEMTCPConfig(ip=, port=502)
vaem = VAEM(config=vaem_config)