Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/chmoore889/esp_local_control
- Owner: chmoore889
- License: gpl-3.0
- Created: 2021-01-24T18:49:57.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-06T23:17:33.000Z (about 2 years ago)
- Last Synced: 2024-11-15T09:47:07.333Z (about 1 month ago)
- Topics: esp-rainmaker, esp32, espressif
- Language: Dart
- Homepage: https://pub.dev/packages/esp_rainmaker_local_control
- Size: 56.6 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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