lb_state_manager 1.0.1 lb_state_manager: ^1.0.1 copied to clipboard
Logbot State Manager service to return the state of the devices and device services
Logbot State Manager SDK for Flutter #
This is a package to manage the state of the devices and device services
Requirements #
Dart 2.17 or later
Installation & Usage #
Getting Started #
Add the dependencies from pub.dev:
dependencies:
lb_auth:
lb_discovery:
lb_auth
is always required to make authorized calls to the APIs.
To use the SDK on you application see the example below:
import 'package:lb_auth/lb_auth.dart';
import 'package:lb_state_manager/lb_state_manager.dart';
class Example {
Future<void> run() async {
/// Initialize Logbot SDK by logging in with Logbot Credentials
await LogbotAuth.init(LogbotCredentials(
username: username,
password: password,
clientId: clientId,
clientSecret: clientSecret,
));
/// Now you can use every API included on the SDK
/// for example:
await LogbotDiscovery.startDiscovery();
List<StateManagerDevice>? response = await LogbotStateManager.status.listDeviceStatuses();
}
}
Note that the user must be logged in with a Logbot account before using startDiscovery()
otherwise
it will throw an error. This is because the user can locally connect only to the IoTs that he actually owns.
Documentation for API Endpoints #
All URIs are relative to http://localhost
Class | Method | HTTP request | Description |
---|---|---|---|
StatusApi | getDeviceStatus | GET /status/{deviceId} | Get the status of a device |
StatusApi | getMultipleDevicesStatus | POST /status | List the status of many devices and their services |
StatusApi | listDeviceStatuses | GET /status | List all the devices and services status |
Documentation For Models #
Author #
Logbot SRL info@logbot.cloud