esp_rainmaker_local_control

Last updated:

0 purchases

esp_rainmaker_local_control Image
esp_rainmaker_local_control Images
Add to Cart

Description:

esp rainmaker local control

Introduction #
This is a library for controlling ESP Rainmaker devices over a local network rather than through the Rainmaker servers. It gives access to overall node configuration as well as the state of each device.
It uses the multicast_dns package for device discovery. This service does not consistently discover Rainmaker devices on local networks, so a timer is used to regularly poll for the device IP and port information. The period of this timer can be set when contructing the LocalControl object, though it has a default value of 15 seconds.
Uses the isolate_json package for decoding/encoding JSONs. This allows this package to use the same isolate for decoding/encoding as this package's complement, esp_rainmaker.
Usage #
A simple usage example:
import 'package:esp_rainmaker_local_control/src/esp_local_control_base.dart';

Future<void> main() async {
final control = LocalControl('rainmaker device id');
Map<String,dynamic> nodeValues;
try{
nodeValues = await control.getParamsValues();
await control.updateParamValue({
'device': {
'deivce state': true,
}
});
} catch(e) {
print(e);

//Handle local control failure
//Use Rainmaker API as a backup
}

print(nodeValues);
control.dispose();
}
copied to clipboard
Features and bugs #
Please file feature requests and bugs at the issue tracker.

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.