Skip to content

pyrophone.mqtt

MQTT payload sources and sinks, backed by the optional mqtt extra.

Importing this module and declaring graphs needs no MQTT client installation. Install Pyrophone[mqtt] to execute these nodes. Payloads are bytes; decoding and encoding belong in application transforms.

Classes

NameDescription
SinkPublish raw payloads to an MQTT topic, without retaining messages.
SourceSubscribe to an MQTT topic and emit raw message payloads.

Sinkclass#

class Sink(_MQTTNode)

Bases: _MQTTNode

Publish raw payloads to an MQTT topic, without retaining messages.

in_portattributeclass attributeinstance attribute#

in_port = Input[bytes](description='Raw MQTT payloads to publish.')

runmethodasync#

async def run() -> None
Inherited from pyrophone.mqtt._MQTTNode

hostattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
host = Property[str](
  default='127.0.0.1',
  title='Broker host',
  description='Hostname or address of the MQTT broker.'
)

passwordattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
password = Property[str | None](default=None, description='MQTT password; None uses MQTT_PASSWORD at startup.')

portattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
port = Property[int](
  default=1883,
  title='Broker port',
  description='TCP port on which the MQTT broker is listening.',
  minimum=1,
  maximum=65535
)

qosattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
qos = Property[int](
  default=1,
  title='Quality of service',
  description="MQTT QoS level for this broker connection's messages.",
  minimum=0,
  maximum=2
)

topicattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
topic = Property[str](description='MQTT topic to subscribe to or publish on.')

usernameattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
username = Property[str | None](default=None, description='MQTT username; None uses MQTT_USERNAME at startup.')
Inherited from pyrophone._inspection.Printable

printmethod#

Inherited from pyrophone._inspection.PrintableView source
def print(file: TextIO | None = None) -> None

Write a pretty multiline description, followed by a newline.

Sourceclass#

class Source(_MQTTNode)

Bases: _MQTTNode

Subscribe to an MQTT topic and emit raw message payloads.

Broker disconnection fails the node; reconnection and application-level acknowledgement policies are not supplied by this node.

out_portattributeclass attributeinstance attribute#

out_port = Output[bytes](description='MQTT message payloads, without decoding.')

runmethodasync#

async def run() -> None
Inherited from pyrophone.mqtt._MQTTNode

hostattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
host = Property[str](
  default='127.0.0.1',
  title='Broker host',
  description='Hostname or address of the MQTT broker.'
)

passwordattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
password = Property[str | None](default=None, description='MQTT password; None uses MQTT_PASSWORD at startup.')

portattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
port = Property[int](
  default=1883,
  title='Broker port',
  description='TCP port on which the MQTT broker is listening.',
  minimum=1,
  maximum=65535
)

qosattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
qos = Property[int](
  default=1,
  title='Quality of service',
  description="MQTT QoS level for this broker connection's messages.",
  minimum=0,
  maximum=2
)

topicattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
topic = Property[str](description='MQTT topic to subscribe to or publish on.')

usernameattributeclass attributeinstance attribute#

Inherited from pyrophone.mqtt._MQTTNodeView source
username = Property[str | None](default=None, description='MQTT username; None uses MQTT_USERNAME at startup.')
Inherited from pyrophone._inspection.Printable

printmethod#

Inherited from pyrophone._inspection.PrintableView source
def print(file: TextIO | None = None) -> None

Write a pretty multiline description, followed by a newline.