Devices¶
Manage devices in account.
create¶
Generates and retrieves a new action from the Device
Parameters:
deviceObj: DeviceCreateInfoObject data to create new device
delete¶
Deletes an device from the account
Parameters:
deviceID: GenericID: strDevice ID
edit¶
Modify any property of the device
Parameters:
deviceID: GenericID: strDevice IDdeviceObj: DeviceEditInfoDevice object with fields to replace
emptyDeviceData¶
Empty all data in a device.
Parameters:
deviceID: GenericID: strDevice ID
getDeviceData¶
Get data from all variables in the device.
Parameters:
deviceID: GenericID: strDevice IDOptional queryParams: DataQueryQuery parameters to filter the results.
from tagoio_sdk import Resources
resources = Resources()
resources.devices.getDeviceData("myDeviceId");
info¶
Get Info of the Device
Parameters:
deviceID: GenericID: strDevice ID
listDevice¶
Retrieves a list with all devices from the account
Parameters:
Optional queryObj: DeviceQuerySearch query params
queryObj: {
"page": 1,
"fields": ["id", "name"],
"filter": {},
"amount": 20,
"orderBy": "name,asc",
"resolveBucketName": false
}
paramSet¶
Create or edit param for the Device
Parameters:
deviceID: GenericID: strDevice IDconfigObj: ConfigurationParams or list[ConfigurationParams]Configuration DataparamID: Optional[GenericID: str]Parameter ID
paramList¶
List Params for the Device
Parameters:
deviceID: GenericID: strDevice IDOptional sentStatus: boolTrue return only sent=true, False return only sent=false
paramRemove¶
Remove param for the Device
Parameters:
deviceID: GenericID: strDevice IDparamID: GenericID: strParameter ID
tokenCreate¶
Generates and retrieves a new token
Parameters:
deviceID: GenericID: strDevice IDtokenParams: TokenDataParams for new token
tokenDelete¶
Delete a token
Parameters:
token: GenericToken: strDevice ID
tokenList¶
Retrieves a list of all tokens
Parameters:
token: GenericToken: strDevice IDOptional queryObj: ListDeviceTokenQuerySearch query params
queryObj: {
"page": 1,
"fields": ["name", "token", "permission"],
"filter": {},
"amount": 20,
"orderBy": "created_at,desc",
}
sendDeviceData¶
Send data to a device.
Parameters:
deviceID: GenericID: strDevice IDdata: Union[DataCreate, list[DataCreate]]An array or one object with data to be send to TagoIO.
from tagoio_sdk import Resources
resources = Resources()
resource.devices.sendDeviceData("myDeviceID", {
"variable": "temperature",
"unit": "F",
"value": 55,
"time": "2015-11-03 13:44:33",
"location": { "lat": 42.2974279, "lng": -85.628292 },
})
editDeviceData¶
Edit data in a device.
resources = Resource()
resource.devices.editDeviceData("myDeviceID", {
"id": "idOfTheRecord",
"value": "new value",
"unit": "new unit"
})
deleteDeviceData¶
Delete data from a device.
Parameters:
deviceID: GenericID: strDevice IDOptional queryParams: DataQueryQuery parameters to filter the results.
resources = Resource()
resource.devices.deleteDeviceData("myDeviceID", {
"ids": ["recordIdToDelete", "anotherRecordIdToDelete" ]
})