Sources & Points
Sources
Returns all sources for the project. Optionally filter by ID or bound status.
sources(source_ids=None, bound_only=False)Arguments
| Argument | Default | Description |
|---|---|---|
source_ids |
None |
Optional list of source ID strings to filter |
bound_only |
False |
If True, return only bound sources |
Returns
SourceList with the following attributes per
Source:
| Attribute | Type | Description |
|---|---|---|
id |
str | Source ID |
name |
str | Source name |
type |
str | Protocol type (e.g. bacnet, modbus) |
addr |
str | Source address |
device_id |
int | Device ID if applicable |
vendor |
str | Vendor name |
model |
str | Model name |
enabled |
bool | Whether the source is enabled |
bound |
bool | Whether the source is bound |
parent_asset_id |
str | Parent asset ID if applicable |
Example
# All sources
for source in client.sources():
print(source.id, source.name, source.type)
# Bound sources only
for source in client.sources(bound_only=True):
print(source.id, source.bound)
# Lookup by ID
source = client.sources().source("s.2")
print(source.vendor, source.model)Points
Returns points for a source or asset. One of source_id
or asset_id is required.
points(source_id=None, asset_id=None, point_ids=None)Arguments
| Argument | Default | Description |
|---|---|---|
source_id |
None |
Parent source ID (required unless asset_id is set) |
asset_id |
None |
Parent asset ID (required unless source_id is set) |
point_ids |
None |
Optional list of point ID strings to filter |
Returns
PointList with the following attributes per
Point:
| Attribute | Type | Description |
|---|---|---|
id |
str |
Point ID |
name |
str |
Point name |
type |
str |
Point type |
addr |
str |
Point address |
kind |
str |
Data kind (e.g. number, bool) |
writable |
bool |
Whether the point supports writes |
unit |
str |
Engineering unit if applicable |
schedule |
str |
Schedule name if applicable |
mode |
str |
Point mode if applicable |
limit |
str |
Limit constraint if applicable |
enum |
str |
Enum type name if applicable |
enum_states |
list[EnumState] |
Enumeration states if applicable |
ontology |
Ontology |
Optional ontology classification |
Example
# points for a source
for point in client.points(source_id="s.2"):
print(point.id, point.name, point.kind)
# points for an asset
for point in client.points(asset_id="a.1"):
print(point.id, point.writable)
# lookup by ID
point = client.points(source_id="s.2").point("s.2.4")
print(point.unit)