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:
-
(dataDeviceCreate) –The device creation data.
Returns:
-
str(str) –The DevEUI of the newly created device.
delete
Delete a device.
Parameters:
-
(deveuistr) –The device EUI (unique identifier) to delete.
Returns:
-
None–None
get
get(deveui: str) -> DeviceInstance
Retrieve a device by its DevEUI.
Parameters:
-
(deveuistr) –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:
-
list[DeviceInstance]–list[DeviceInstance]: List of all device instances.
get_health
get_health() -> DevicesHealthResponse
Retrieve devices grouped by health status.
Returns:
-
DevicesHealthResponse(DevicesHealthResponse) –Devices grouped by their health status.
get_health_count
get_health_count() -> DevicesHealthCountResponse
Retrieve device count grouped by health status.
Returns:
-
DevicesHealthCountResponse(DevicesHealthCountResponse) –Device counts grouped by health status.
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:
-
(deveuistr) –The device EUI (unique identifier).
-
(start_timedatetime | None, default:None) –Optional start time.
-
(end_timedatetime | None, default:None) –Optional end time.
Returns:
-
DevicePayloadResponse(list[DevicePayload]) –The device payloads within the specified time range.
patch
patch(deveui: str, data: DevicePatch) -> bool
Partially update a device.
Parameters:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDevicePatch) –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:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDeviceMessage) –The message data to send.
Returns:
-
bool(bool) –True if the message was queued. Exception otherwise.
update
update(deveui: str, data: DeviceUpdate) -> bool
Update a device (full replacement).
Parameters:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDeviceUpdate) –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:
-
(dataDeviceCreate) –The device creation data.
Returns:
-
str(str) –The DevEUI of the newly created device.
delete
async
Delete a device.
Parameters:
-
(deveuistr) –The device EUI (unique identifier) to delete.
Returns:
-
None–None
get
async
get(deveui: str) -> DeviceInstance
Retrieve a device by its DevEUI.
Parameters:
-
(deveuistr) –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:
-
DevicesHealthResponse(DevicesHealthResponse) –Devices grouped by their health status.
get_health_count
async
get_health_count() -> DevicesHealthCountResponse
Retrieve device count grouped by health status.
Returns:
-
DevicesHealthCountResponse(DevicesHealthCountResponse) –Device counts grouped by health status.
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:
-
(deveuistr) –The device EUI (unique identifier).
-
(start_timedatetime | None, default:None) –Optional start time.
-
(end_timedatetime | None, default:None) –Optional end time.
Returns:
-
list[DevicePayload]–list[DevicePayload]: The device payloads within the specified time range.
patch
async
patch(deveui: str, data: DevicePatch) -> bool
Partially update a device.
Parameters:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDevicePatch) –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:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDeviceMessage) –The message data to send.
Returns:
-
bool(bool) –True if the message was queued. Exception otherwise.
update
async
update(deveui: str, data: DeviceUpdate) -> bool
Update a device (full replacement).
Parameters:
-
(deveuistr) –The device EUI (unique identifier).
-
(dataDeviceUpdate) –The complete device data for replacement.
Returns:
-
bool(bool) –True if the update was successful, False otherwise.
Request and response types: Device models.