Skip to content

Commit d0ce260

Browse files
committed
Formatted code with dartfmt
1 parent f1bf7bd commit d0ce260

111 files changed

Lines changed: 3094 additions & 2393 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ThingsBoard API client library for Dart developers. Provides model objects and services to communicate with ThingsBoard platform using RESTful APIs and WebSocket protocol.
2-
Current client version is compatible with ThingsBoard version 3.3+.
2+
Current client version is compatible with ThingsBoard starting from version 3.3.0.
33

44
## Usage
55

example/callbacks.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ Future<void> onUserLoaded() async {
4242
print('authUser: ${tbClient.getAuthUser()}');
4343
var currentUserDetails = await tbClient.getUserService().getUser();
4444
print('currentUserDetails: $currentUserDetails');
45-
await tbClient.logout(requestConfig: RequestConfig(ignoreLoading: true, ignoreErrors: true));
45+
await tbClient.logout(
46+
requestConfig:
47+
RequestConfig(ignoreLoading: true, ignoreErrors: true));
4648
exit(0);
4749
} else {
4850
await tbClient.login(LoginRequest('tenant@thingsboard.org', 'tenant'));
4951
}
50-
}
51-
catch (e, s) {
52+
} catch (e, s) {
5253
print('Error: $e');
5354
print('Stack: $s');
5455
}

example/device_api.dart

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,46 @@ void main() async {
1515

1616
await deviceApiExample();
1717

18-
await tbClient.logout(requestConfig: RequestConfig(ignoreLoading: true, ignoreErrors: true));
19-
18+
await tbClient.logout(
19+
requestConfig: RequestConfig(ignoreLoading: true, ignoreErrors: true));
2020
} catch (e, s) {
2121
print('Error: $e');
2222
print('Stack: $s');
2323
}
2424
}
2525

2626
Future<void> deviceApiExample() async {
27-
print('**********************************************************************');
28-
print('* DEVICE API EXAMPLE *');
29-
print('**********************************************************************');
27+
print(
28+
'**********************************************************************');
29+
print(
30+
'* DEVICE API EXAMPLE *');
31+
print(
32+
'**********************************************************************');
3033

3134
var deviceName = getRandomString(30);
3235

3336
var device = Device(deviceName, 'default');
3437
device.additionalInfo = {'description': 'My test device!'};
3538
var savedDevice = await tbClient.getDeviceService().saveDevice(device);
3639
print('savedDevice: $savedDevice');
37-
var foundDevice = await tbClient.getDeviceService().getDeviceInfo(savedDevice.id!.id!);
40+
var foundDevice =
41+
await tbClient.getDeviceService().getDeviceInfo(savedDevice.id!.id!);
3842
print('foundDevice: $foundDevice');
39-
var res = await tbClient.getAttributeService().saveEntityAttributesV2(foundDevice!.id!, AttributeScope.SHARED_SCOPE.toShortString(), {
40-
'targetTemperature': 22.4,
41-
'targetHumidity': 57.8
42-
});
43+
var res = await tbClient.getAttributeService().saveEntityAttributesV2(
44+
foundDevice!.id!,
45+
AttributeScope.SHARED_SCOPE.toShortString(),
46+
{'targetTemperature': 22.4, 'targetHumidity': 57.8});
4347
print('Save attributes result: $res');
44-
var attributes = await tbClient.getAttributeService().getAttributesByScope(foundDevice.id!, AttributeScope.SHARED_SCOPE.toShortString(), ['targetTemperature', 'targetHumidity']);
48+
var attributes = await tbClient.getAttributeService().getAttributesByScope(
49+
foundDevice.id!,
50+
AttributeScope.SHARED_SCOPE.toShortString(),
51+
['targetTemperature', 'targetHumidity']);
4552
print('Found device attributes: $attributes');
4653

4754
await tbClient.getDeviceService().deleteDevice(savedDevice.id!.id!);
48-
foundDevice = await tbClient.getDeviceService().getDeviceInfo(savedDevice.id!.id!);
55+
foundDevice =
56+
await tbClient.getDeviceService().getDeviceInfo(savedDevice.id!.id!);
4957
print('foundDevice: $foundDevice');
50-
print('**********************************************************************');
58+
print(
59+
'**********************************************************************');
5160
}

0 commit comments

Comments
 (0)