# `Jido.Messaging.Demo.HeartbeatSensor`
[🔗](https://github.com/agentjido/jido_messaging/blob/v1.0.0/lib/jido_messaging/demo/heartbeat_sensor.ex#L1)

A Jido Sensor that emits periodic heartbeat messages to a chat room.

This sensor demonstrates Jido's sensor capability for scheduling periodic
events. It fires every minute (60 seconds) and sends a thematic message
from Agent Jido to the chat room.

## Usage

Start the sensor with the messaging room context:

    {:ok, _pid} = Jido.Sensor.Runtime.start_link(
      sensor: Jido.Messaging.Demo.HeartbeatSensor,
      config: %{
        interval: 60_000,
        room_id: "demo:lobby",
        instance_module: Jido.Messaging.Demo.Messaging
      }
    )

## How It Works

1. On init, the sensor schedules an immediate tick (`{:schedule, 0}`)
2. On each `:tick` event, it sends a message to the chat room
3. After sending, it schedules the next tick (`{:schedule, interval}`)

The sensor uses the messaging system directly rather than emitting signals,
since it's a standalone demo component that writes to the chat room.

# `__sensor_metadata__`

```elixir
@spec __sensor_metadata__() :: map()
```

Returns metadata for Jido.Discovery integration.

This function is used by `Jido.Discovery` to index sensors
for fast lookup and filtering.

# `description`

```elixir
@spec description() :: String.t() | nil
```

Returns the sensor's description.

# `name`

```elixir
@spec name() :: String.t()
```

Returns the sensor's name.

# `schema`

```elixir
@spec schema() :: Zoi.schema() | nil
```

Returns the Zoi schema for sensor configuration.

# `spec`

```elixir
@spec spec() :: Jido.Sensor.Spec.t()
```

Returns the sensor specification.

The spec contains all metadata needed to configure and run the sensor.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
