# pyrophone.mqtt

*module*

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.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L1-L1)

## pyrophone.mqtt.Sink

*class*

```python
class Sink(_MQTTNode)
```

Bases: `pyrophone.mqtt._MQTTNode`

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

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L111-L122)

### pyrophone.mqtt.Sink.in_port

*attribute* · *class attribute* · *instance attribute*

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

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L115-L115)

### pyrophone.mqtt.Sink.host

*attribute* · *class attribute* · *instance attribute*

```python
host = Property[str](default='127.0.0.1', title='Broker host', description='Hostname or address of the MQTT broker.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L63-L67)

### pyrophone.mqtt.Sink.password

*attribute* · *class attribute* · *instance attribute*

```python
password = Property[str | None](default=None, description='MQTT password; None uses MQTT_PASSWORD at startup.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L78-L80)

### pyrophone.mqtt.Sink.port

*attribute* · *class attribute* · *instance attribute*

```python
port = Property[int](default=1883, title='Broker port', description='TCP port on which the MQTT broker is listening.', minimum=1, maximum=65535)
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L68-L74)

### pyrophone.mqtt.Sink.qos

*attribute* · *class attribute* · *instance attribute*

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

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L82-L88)

### pyrophone.mqtt.Sink.topic

*attribute* · *class attribute* · *instance attribute*

```python
topic = Property[str](description='MQTT topic to subscribe to or publish on.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L81-L81)

### pyrophone.mqtt.Sink.username

*attribute* · *class attribute* · *instance attribute*

```python
username = Property[str | None](default=None, description='MQTT username; None uses MQTT_USERNAME at startup.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L75-L77)

### pyrophone.mqtt.Sink.run

*method* · *async*

```python
async def run() -> None
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L117-L122)

### pyrophone.mqtt.Sink.print

*method*

```python
def print(file: TextIO | None = None) -> None
```

Inherited from: `pyrophone._inspection.Printable`

Write a pretty multiline description, followed by a newline.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/_inspection.py#L13-L15)

## pyrophone.mqtt.Source

*class*

```python
class Source(_MQTTNode)
```

Bases: `pyrophone.mqtt._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.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L91-L108)

### pyrophone.mqtt.Source.out_port

*attribute* · *class attribute* · *instance attribute*

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

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L99-L99)

### pyrophone.mqtt.Source.host

*attribute* · *class attribute* · *instance attribute*

```python
host = Property[str](default='127.0.0.1', title='Broker host', description='Hostname or address of the MQTT broker.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L63-L67)

### pyrophone.mqtt.Source.password

*attribute* · *class attribute* · *instance attribute*

```python
password = Property[str | None](default=None, description='MQTT password; None uses MQTT_PASSWORD at startup.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L78-L80)

### pyrophone.mqtt.Source.port

*attribute* · *class attribute* · *instance attribute*

```python
port = Property[int](default=1883, title='Broker port', description='TCP port on which the MQTT broker is listening.', minimum=1, maximum=65535)
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L68-L74)

### pyrophone.mqtt.Source.qos

*attribute* · *class attribute* · *instance attribute*

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

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L82-L88)

### pyrophone.mqtt.Source.topic

*attribute* · *class attribute* · *instance attribute*

```python
topic = Property[str](description='MQTT topic to subscribe to or publish on.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L81-L81)

### pyrophone.mqtt.Source.username

*attribute* · *class attribute* · *instance attribute*

```python
username = Property[str | None](default=None, description='MQTT username; None uses MQTT_USERNAME at startup.')
```

Inherited from: `pyrophone.mqtt._MQTTNode`

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L75-L77)

### pyrophone.mqtt.Source.run

*method* · *async*

```python
async def run() -> None
```

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/mqtt.py#L101-L108)

### pyrophone.mqtt.Source.print

*method*

```python
def print(file: TextIO | None = None) -> None
```

Inherited from: `pyrophone._inspection.Printable`

Write a pretty multiline description, followed by a newline.

[View source](https://github.com/messier-42/pyrophone/blob/f5e0987fb765db19a311f3cf3827e765495bdbb5/src/pyrophone/_inspection.py#L13-L15)
