"""URL patterns for SSE realtime endpoints.

Include in your project urls.py::

    urlpatterns = [
        path("iot/", include("django_devicehub.urls")),
    ]

This provides:
    /iot/stream/{device_type}/               — SSE stream for all devices of a type
    /iot/stream/{device_type}/{device_id}/    — SSE stream for a specific device
    /iot/poll/{device_type}/                  — Polling fallback (all devices)
    /iot/poll/{device_type}/{device_id}/      — Polling fallback (specific device)
"""

from django.urls import path

from .sse import sse_poll, sse_stream

app_name = "django_devicehub_realtime"

urlpatterns = [
    # SSE streaming
    path(
        "stream/<str:device_type>/",
        sse_stream,
        name="sse-stream-type",
    ),
    path(
        "stream/<str:device_type>/<str:device_id>/",
        sse_stream,
        name="sse-stream-device",
    ),
    # Polling fallback
    path(
        "poll/<str:device_type>/",
        sse_poll,
        name="sse-poll-type",
    ),
    path(
        "poll/<str:device_type>/<str:device_id>/",
        sse_poll,
        name="sse-poll-device",
    ),
]
