{"id":32605671,"url":"https://github.com/gethiox/yeelight-go","last_synced_at":"2025-10-30T10:57:28.629Z","repository":{"id":57563788,"uuid":"202976533","full_name":"gethiox/yeelight-go","owner":"gethiox","description":"Go library to control YEELIGHT devices for dinosaurs with scary faces","archived":false,"fork":false,"pushed_at":"2022-08-21T17:33:27.000Z","size":2091,"stargazers_count":1,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-07-28T20:52:57.181Z","etag":null,"topics":["go","golang","gomodule","library","yee","yeelight"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gethiox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-18T08:05:58.000Z","updated_at":"2022-11-04T20:13:53.000Z","dependencies_parsed_at":"2022-08-31T13:42:33.889Z","dependency_job_id":null,"html_url":"https://github.com/gethiox/yeelight-go","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/gethiox/yeelight-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Fyeelight-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Fyeelight-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Fyeelight-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Fyeelight-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gethiox","download_url":"https://codeload.github.com/gethiox/yeelight-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gethiox%2Fyeelight-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281793985,"owners_count":26562617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","gomodule","library","yee","yeelight"],"created_at":"2025-10-30T10:57:27.736Z","updated_at":"2025-10-30T10:57:28.621Z","avatar_url":"https://github.com/gethiox.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yee Light\n\n[![dinosaur with bulb in paw](resources/yee.gif)](https://www.youtube.com/watch?v=q6EoRBvdVPQ)\n\nGo library to control [YEELIGHT](https://www.yeelight.com/) devices for dinosaurs with scary faces\n\n### Disclaimer\n- Library is not in stable state and not finished (few missing features)\n- User interface may be slightly changed before 1.0 release\n- Device auto-discovery are not implemented yet, You'll need to connect to them directly with IP address. \n- Tested only on one type of bulb ([Yeelight Smart LED Bulb (Color)](https://www.yeelight.com/en_US/product/lemon-color)),\n  I can't guarantee that everything will work correctly on other devices\n\n# Usage\n\n[![](https://godoc.org/github.com/gethiox/yeelight-go?status.svg)](http://godoc.org/github.com/gethiox/yeelight-go)\n\nmake sure LAN control is enabled in your device: \n![](resources/enabling_lan_control.png)\n\nDevice initialization:\n```go\nyl.NewBulb(\"192.168.0.123\")\n```\n\n### Available commands\n\nDevice functions:\n```go\n// commands for standard and background light:\nfunc Temperature(temp, duration int) error                                           {}\nfunc RGB(rgb, duration int) error                                                    {}\nfunc HSV(hue, saturation, duration int) error                                        {}\nfunc Brightness(brightness, duration int) error                                      {}\nfunc StartColorFlow(count int, action CfAction, flowExpression FlowExpression) error {}\nfunc StopColorFlow() error                                                           {}\nfunc SetDefault() error                                                              {}\nfunc PowerOn(duration int) error                                                     {}\nfunc PowerOnWithMode(duration int, mode Mode) error                                  {}\nfunc PowerOff(duration int) error                                                    {}\nfunc Toggle() error                                                                  {}\n\n// for background only:\nfunc DevToggle() error {} \n\n// for standard only:\nfunc CronAdd(jobType CronType, minutes int) error                 {}\nfunc CronDel(jobType CronType) error                              {}\nfunc SetAdjust(action Action, prop AdjustProp) error              {}\nfunc AdjustBright(percentage, duration int) error                 {}\nfunc AdjustTemperature(percentage, duration int) error            {}\nfunc AdjustColor(percentage, duration int) error                  {}\nfunc SetName(name string) error                                   {}\nfunc StartMusic(ifaceName string) (error, musicSupportedCommands) {}\n\n// commands available in music mode\nfunc Temperature(temp, duration int)                                           {}\nfunc RGB(rgb, duration int)                                                    {}\nfunc HSV(hue, saturation, duration int)                                        {}\nfunc Brightness(brightness, duration int)                                      {}\nfunc StartColorFlow(count int, action CfAction, flowExpression FlowExpression) {}\nfunc StopColorFlow()                                                           {}\n```\n\n### Example\n```go\npackage main\n\nimport ( \n    \"fmt\"\n    \"sync\"\n    \"time\"\n\n    yl \"github.com/gethiox/yeelight-go\"\n)\n\nfunc main() {\n\tvar bulbs []*yl.Bulb\n\n\tvar ipTemplate = \"192.168.10.%d\"\n\tvar octets = []int{220, 221, 222, 223}\n\n\t// Connecting to many bulbs at the same time\n\tfor _, octet := range octets {\n\t\tip := fmt.Sprintf(ipTemplate, octet)\n\t\tbulb := yl.NewBulb(ip) \n\t\terr := bulb.Connect()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t\tbulbs = append(bulbs, bulb)\n\t}\n\n\tjobs := sync.WaitGroup{}\n\tfor _, bulb := range bulbs {\n\t\tjobs.Add(1)\n\n\t\t// running goroutine for every bulb separately\n\t\tgo func(bulb *yl.Bulb) {\n\t\t\tvar err error\n\n\t\t\terr = bulb.PowerOn(0)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\t// trying to start music server on \"enp0s25\" interface\n\t\t\t// empty name (\"\") may be passed for starting music server on first found interface\n\t\t\tmusic, err := bulb.StartMusic(\"enp0s25\")\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\t// go through hue range ten times\n\t\t\tfor iterations := 0; iterations \u003c 10; iterations++ {\n\t\t\t\tfor i := 0; i \u003c 360; i++ {\n\t\t\t\t\tmusic.HSV(i, 100, 50)\n\t\t\t\t\ttime.Sleep(time.Millisecond * 50)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tjobs.Done()\n\t\t}(bulb)\n\t}\n\tjobs.Wait()\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethiox%2Fyeelight-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgethiox%2Fyeelight-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgethiox%2Fyeelight-go/lists"}