2.32.4.1. pycsamt.iot.core#
Functions
|
Return one row per device describing declared IoT capabilities. |
Classes
|
Survey-level IoT deployment metadata. |
|
Configuration for one field IoT node or recorder gateway. |
|
Role of an IoT device in a field deployment. |
|
IoT capability flags used in deployment reports. |
|
Telemetry packet categories used by pyCSAMT IoT workflows. |
|
A timestamped message emitted by an IoT-enabled field node. |
- class pycsamt.iot.core.IoTCapability(*values)[source]
-
IoT capability flags used in deployment reports.
- TELEMETRY = 'telemetry'
- EDGE_PROCESSING = 'edge_processing'
- SYNCHRONIZATION = 'synchronization'
- ENERGY_MANAGEMENT = 'energy_management'
- HEALTH_MONITORING = 'health_monitoring'
- class pycsamt.iot.core.DeviceRole(*values)[source]
-
Role of an IoT device in a field deployment.
- SENSOR_NODE = 'sensor_node'
- RECORDER = 'recorder'
- GATEWAY = 'gateway'
- BASE_STATION = 'base_station'
- REMOTE_REFERENCE = 'remote_reference'
- TRANSMITTER = 'transmitter'
- class pycsamt.iot.core.PacketKind(*values)[source]
-
Telemetry packet categories used by pyCSAMT IoT workflows.
- DATA = 'data'
- QC = 'qc'
- HEALTH = 'health'
- SYNC = 'sync'
- POWER = 'power'
- EVENT = 'event'
- SOURCE = 'source'
- class pycsamt.iot.core.DeviceConfig(device_id, station=None, protocol='mqtt', sample_rate_hz=None, channels=<factory>, role=DeviceRole.SENSOR_NODE, enabled=True, metadata=<factory>)[source]
Bases:
PyCSAMTObject,MetadataMixinConfiguration for one field IoT node or recorder gateway.
- Parameters:
- device_id: str
- protocol: str = 'mqtt'
- role: DeviceRole | str = 'sensor_node'
- enabled: bool = True
- validate()[source]
Validate and normalise device configuration.
- Return type:
None
- topic(kind, *, survey_id=None)[source]
Return a canonical telemetry topic for this device.
- Parameters:
kind (PacketKind | str)
survey_id (str | None)
- Return type:
- classmethod from_mapping(data)[source]
Build a device config from a mapping.
- Parameters:
- Return type:
- class pycsamt.iot.core.TelemetryPacket(device_id, timestamp, topic, payload, qos=0, kind=PacketKind.DATA, retained=False)[source]
Bases:
PyCSAMTObjectA timestamped message emitted by an IoT-enabled field node.
- Parameters:
- device_id: str
- timestamp: float
- topic: str
- qos: int = 0
- kind: PacketKind | str = 'data'
- retained: bool = False
- validate()[source]
Validate and normalise packet fields.
- Return type:
None
- classmethod from_device(device, *, timestamp, payload, kind=PacketKind.DATA, survey_id=None, qos=0, retained=False)[source]
Create a packet using a device’s canonical topic.
- Parameters:
device (DeviceConfig)
timestamp (float)
kind (PacketKind | str)
survey_id (str | None)
qos (int)
retained (bool)
- Return type:
- class pycsamt.iot.core.DeploymentConfig(survey_id, devices=<factory>, capabilities=<factory>, notes='', metadata=<factory>)[source]
Bases:
PyCSAMTObject,MetadataMixinSurvey-level IoT deployment metadata.
- Parameters:
survey_id (str)
devices (list[DeviceConfig])
capabilities (list[IoTCapability])
notes (str)
- survey_id: str
- devices: list[DeviceConfig]
- capabilities: list[IoTCapability]
- notes: str = ''
- validate()[source]
Validate and normalise deployment fields.
- Return type:
None
- add_device(device)[source]
Append a device and revalidate uniqueness.
- Parameters:
device (DeviceConfig | Mapping[str, Any])
- Return type:
None
- has_capability(capability)[source]
Return whether the deployment declares capability.
- Parameters:
capability (IoTCapability | str)
- Return type:
- pycsamt.iot.core.deployment_report(deployment, *, api=None)[source]
Return one row per device describing declared IoT capabilities.
- Parameters:
deployment (DeploymentConfig)
api (bool | None)
- Return type: