Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Issue] Method "getAttributeKeys" not working #25

Open
fabioafreitas opened this issue Jan 18, 2024 · 0 comments
Open

[Issue] Method "getAttributeKeys" not working #25

fabioafreitas opened this issue Jan 18, 2024 · 0 comments

Comments

@fabioafreitas
Copy link

Hello, i'm using the library version 1.0.8, fetching data from a account in https://thingsboard.cloud/.

I trying to fetch my device attributes using the following code:

var attrs = await tbClient
        .getAttributeService()
        .getAttributeKeys(DeviceId('4d1d43f0-a977-11ee-80a4-b9287a012345'));

Unfortunately it is not working and returning the following exception:

Error: ThingsboardError: message: [type 'List<dynamic>' is not a subtype of type 'List<String>?' in type cast], errorCode: 2, status: null
#0      toThingsboardError (package:thingsboard_pe_client/src/error/_thingsboard_error_handler_io.dart:89:18)
#1      ThingsboardClient.get (package:thingsboard_pe_client/src/thingsboard_client_base.dart:257:13)
<asynchronous suspension>
#2      AttributeService.getAttributeKeys (package:thingsboard_pe_client/src/service/attribute_service.dart:18:20)
<asynchronous suspension>
#3      main (file:///C:/Users/fbioa/Desktop/Personal%20Dev/Flutter_Estudos/thingsboard_client_tests/bin/thingsboard_client_tests.dart:56:9)
<asynchronous suspension>

I tested another method, the getLatestTimeseries, which receives the same EntityId as the first argument, to confirm if the problem was in there, but this method worked, therefore the arguments of the first method is correct. Here is the second method test:

var telemetry = await tbClient.getAttributeService().getLatestTimeseries(
        DeviceId('4d1d43f0-a977-11ee-80a4-b9287a012345'), ['temperature']);

Any clues for solving the first method problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant