Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chmoore889/esp_local_control

Library for locally controlling ESP Rainmaker devices.
https://github.com/chmoore889/esp_local_control

esp-rainmaker esp32 espressif

Last synced: about 1 month ago
JSON representation

Library for locally controlling ESP Rainmaker devices.

Awesome Lists containing this project

README

        

## 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](https://pub.dev/packages/multicast_dns/versions/0.2.2) 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](https://pub.dev/packages/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](https://pub.dev/packages/esp_rainmaker).

## Usage

A simple usage example:

```dart
import 'package:esp_rainmaker_local_control/src/esp_local_control_base.dart';

Future main() async {
final control = LocalControl('rainmaker device id');
Map 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();
}
```

## Features and bugs

Please file feature requests and bugs at the [issue tracker][tracker].

[tracker]: https://github.com/chmoore889/esp_local_control/issues