Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zozs/tuya-web
https://github.com/zozs/tuya-web
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zozs/tuya-web
- Owner: zozs
- License: agpl-3.0
- Created: 2024-02-20T16:08:31.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-28T10:23:24.000Z (9 months ago)
- Last Synced: 2024-05-02T06:15:56.967Z (8 months ago)
- Language: Rust
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tuya-web
tuya-web is a web service to toggle Tuya smart outlets on or off through a REST API.
It uses https://github.com/fruitiex/rust-async-tuyapi under the hood.
## Compile
Run `cargo build`
## Running
Run `cargo run -- --help` for a list of options.
An example for two different devices would be:
```sh
cargo run -- \
-d aaaaaa01234 -k 'SomeSecret' -d 10.0.5.50 \
-d bbbbbb56789 -k 'SecondCode' -d 10.0.5.51
```You can then turn on the first output by sending: `curl -X PUT "http://localhost:3000/outlet/0/true"`.
While turning off the second output with: `curl -X PUT "http://localhost:3000/outlet/1/false"`
Toggling an outlet is done with: `curl -X POST "http://localhost:3000/outlet/0"`
## License
tuya-web is licensed under GNU AGPL v3 or later, see the `LICENSE` file for the full license.
```
tuya-web - a web service for tuya outlets
Copyright (c) 2024, Linus KarlssonThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
```