https://github.com/vanyason/yeelight
My yeelight API implementation and GUI app
https://github.com/vanyason/yeelight
golang javascript react wails wails2 yeelight yeelight-api
Last synced: 5 months ago
JSON representation
My yeelight API implementation and GUI app
- Host: GitHub
- URL: https://github.com/vanyason/yeelight
- Owner: vanyason
- License: wtfpl
- Created: 2023-09-19T19:53:29.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-12-05T16:30:51.000Z (over 2 years ago)
- Last Synced: 2023-12-06T15:45:18.490Z (over 2 years ago)
- Topics: golang, javascript, react, wails, wails2, yeelight, yeelight-api
- Language: JavaScript
- Homepage:
- Size: 939 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 💡 Yeelight Controller
[](https://github.com/vanyason/yeelight/issues)
[](https://github.com/vanyason/yeelight/releases)
[](https://github.com/vanyason/yeelight/blob/master/LICENSE)
[](https://goreportcard.com/report/github.com/vanyason/yeelight)
[](https://github.com/vanyason/yeelight/actions/workflows/build.yml)

## 🤔 What and Why?
Some of you may had experience with this kind of devices : ([yeelight official website](https://en.yeelight.com/))

I have only one bulb, which I use as a background light for my working space. Most of the time **I just use one color** and sometimes have to **quickly switch** to the pure white during the calls. Feels like using mobile app is something I do not really want
> **Of course creating my own buggy app using whole bunch of fancy languages and frameworks is a simpler way 🤦!**
## 🕵️♂️ How does it work?
Yeelight has a [public API](https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf), so firstly I implemented it in [Golang](https://github.com/vanyason/yeelight/blob/master/yeelight/yeelight.go)
> My solution is not the only one and mainly inspired by **(check this repoes)** [Repo 1](https://github.com/avarabyeu/yeelight) , [Repo 2](https://github.com/akominch/yeelight)
I used interesting project called [Wails](https://wails.io/) which is considered to be an **Electron** alternative written in **GO**. With **Wails** project suddenly became a frontend task, so **React** has been chosen as main frontend framework. I used [this colorpicker](https://iro.js.org/color_api.html), since it has a kelvin temperature feature.
Shortly: frontend - **REACT**, backend - **Wails (Yeelight API part implemented in GO)**
## ⚒️ How to build locally?
To build locally `git clone ...` the repo, follow the [Wails installation guide](https://wails.io/docs/gettingstarted/installation/) and finally just execute `wails dev` for local development and `wails build` for production build.
## 💭 Interesting Files
- There is a [bash script](https://github.com/vanyason/yeelight/blob/master/build/linux/generate_deb.sh) that creates deb package. This file is **not generated by Wails**
- There is a [test script](https://github.com/vanyason/yeelight/blob/master/examples/test.go) that tests your lightbulb. It sends all kind of commands and restores bulb to its initial state (hopefully)
- Commented part in [this file](https://github.com/vanyason/yeelight/blob/master/frontend/src/components/BulbButton.jsx) relates to a component`s fancy blur. It is commented due to lags on Linux, but you can try it yourself
## 📜 Todo
- [ ] Tests
- [x] Automatic builds
- [ ] Fix bugs as they are discovered
- [ ] MacOS build
- [ ] Change UI to a more UX friendly one
- [ ] Rewrite in typescript
- [ ] Support multiple bulbs
**Estimation** : most likely never ⏳
---
##### 🧒 About ME and contact info