Skip to content

Device

Devices resource for LoRaWAN device management.

SyncDevices

SyncDevices(client: SyncClient)

Bases: BaseResource['SyncClient']

Devices resource for LoRaWAN device management.

Methods:

  • create

    Create a new device.

  • delete

    Delete a device.

  • get

    Retrieve a device by its DevEUI.

  • get_all

    List all devices.

  • get_health

    Retrieve devices grouped by health status.

  • get_health_count

    Retrieve device count grouped by health status.

  • get_payloads

    Retrieve device payloads within a time range.

  • patch

    Partially update a device.

  • send_message

    Send a downstream message to a device.For class A device the message will be put in a

  • update

    Update a device (full replacement).

create

create(data: DeviceCreate) -> str

Create a new device.

Parameters:

Returns:

  • str ( str ) –

    The DevEUI of the newly created device.

delete

delete(deveui: str) -> None

Delete a device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier) to delete.

Returns:

  • None

    None

get

Retrieve a device by its DevEUI.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

Returns:

  • DeviceInstance ( DeviceInstance ) –

    The device instance matching the given DevEUI.

get_all

get_all() -> list[DeviceInstance]

List all devices.

Returns:

get_health

get_health() -> DevicesHealthResponse

Retrieve devices grouped by health status.

Returns:

get_health_count

get_health_count() -> DevicesHealthCountResponse

Retrieve device count grouped by health status.

Returns:

get_payloads

get_payloads(
    deveui: str,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
) -> list[DevicePayload]

Retrieve device payloads within a time range.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • start_time

    (datetime | None, default: None ) –

    Optional start time.

  • end_time

    (datetime | None, default: None ) –

    Optional end time.

Returns:

  • DevicePayloadResponse ( list[DevicePayload] ) –

    The device payloads within the specified time range.

patch

Partially update a device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DevicePatch) –

    The partial device data to update.

Returns:

  • DeviceInstance ( bool ) –

    The updated device instance.

send_message

send_message(deveui: str, data: DeviceMessage) -> bool

Send a downstream message to a device.For class A device the message will be put in a queue on the Network Server side and sent in the next downlink opportunity (after the next uplink). For class C device it's sent immediately to the device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DeviceMessage) –

    The message data to send.

Returns:

  • bool ( bool ) –

    True if the message was queued. Exception otherwise.

update

Update a device (full replacement).

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DeviceUpdate) –

    The complete device data for replacement.

Returns:

  • DeviceInstance ( bool ) –

    The updated device instance.

AsyncDevices

AsyncDevices(client: AsyncClient)

Bases: BaseResource['AsyncClient']

Async devices resource for LoRaWAN device management.

Methods:

  • create

    Create a new device.

  • delete

    Delete a device.

  • get

    Retrieve a device by its DevEUI.

  • get_all

    List all devices.

  • get_health

    Retrieve devices grouped by health status.

  • get_health_count

    Retrieve device count grouped by health status.

  • get_payloads

    Retrieve device payloads within a time range.

  • patch

    Partially update a device.

  • send_message

    Send a downstream message to a device.For class A device the message will be put in a

  • update

    Update a device (full replacement).

create async

create(data: DeviceCreate) -> str

Create a new device.

Parameters:

Returns:

  • str ( str ) –

    The DevEUI of the newly created device.

delete async

delete(deveui: str) -> None

Delete a device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier) to delete.

Returns:

  • None

    None

get async

Retrieve a device by its DevEUI.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

Returns:

  • DeviceInstance ( DeviceInstance ) –

    The device instance matching the given DevEUI.

get_all async

get_all() -> list[DeviceInstance]

List all devices.

Returns:

  • list[DeviceInstance]

    list[DeviceInstance]: All device instances with response metadata.

get_health async

get_health() -> DevicesHealthResponse

Retrieve devices grouped by health status.

Returns:

get_health_count async

get_health_count() -> DevicesHealthCountResponse

Retrieve device count grouped by health status.

Returns:

get_payloads async

get_payloads(
    deveui: str,
    start_time: datetime | None = None,
    end_time: datetime | None = None,
) -> list[DevicePayload]

Retrieve device payloads within a time range.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • start_time

    (datetime | None, default: None ) –

    Optional start time.

  • end_time

    (datetime | None, default: None ) –

    Optional end time.

Returns:

  • list[DevicePayload]

    list[DevicePayload]: The device payloads within the specified time range.

patch async

Partially update a device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DevicePatch) –

    The partial device data to update.

Returns:

  • bool ( bool ) –

    True if the update was successful, False otherwise.

send_message async

send_message(deveui: str, data: DeviceMessage) -> bool

Send a downstream message to a device.For class A device the message will be put in a queue on the Network Server side and sent in the next downlink opportunity (after the next uplink). For class C device it's sent immediately to the device.

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DeviceMessage) –

    The message data to send.

Returns:

  • bool ( bool ) –

    True if the message was queued. Exception otherwise.

update async

Update a device (full replacement).

Parameters:

  • deveui

    (str) –

    The device EUI (unique identifier).

  • data

    (DeviceUpdate) –

    The complete device data for replacement.

Returns:

  • bool ( bool ) –

    True if the update was successful, False otherwise.

Request and response types: Device models.