{"id":16015985,"url":"https://github.com/brentru/adafruit_circuitpython_lifx_api","last_synced_at":"2025-04-03T23:40:42.321Z","repository":{"id":55916198,"uuid":"178923156","full_name":"brentru/Adafruit_CircuitPython_LIFX_API","owner":"brentru","description":"LIFX Smart Lighting API Helper for CircuitPython","archived":false,"fork":false,"pushed_at":"2020-12-07T14:22:41.000Z","size":33,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-09T11:27:34.931Z","etag":null,"topics":["api","iot","lifx"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/brentru.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-01T18:29:57.000Z","updated_at":"2019-04-04T17:15:24.000Z","dependencies_parsed_at":"2022-08-15T09:20:43.346Z","dependency_job_id":null,"html_url":"https://github.com/brentru/Adafruit_CircuitPython_LIFX_API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentru%2FAdafruit_CircuitPython_LIFX_API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentru%2FAdafruit_CircuitPython_LIFX_API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentru%2FAdafruit_CircuitPython_LIFX_API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brentru%2FAdafruit_CircuitPython_LIFX_API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brentru","download_url":"https://codeload.github.com/brentru/Adafruit_CircuitPython_LIFX_API/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247097969,"owners_count":20883127,"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","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":["api","iot","lifx"],"created_at":"2024-10-08T15:44:18.831Z","updated_at":"2025-04-03T23:40:42.301Z","avatar_url":"https://github.com/brentru.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-lifx/badge/?version=latest\n    :target: https://circuitpython.readthedocs.io/projects/lifx/en/latest/\n    :alt: Documentation Status\n\n.. image:: https://img.shields.io/discord/327254708534116352.svg\n    :target: https://discord.gg/nBQh6qu\n    :alt: Discord\n\n.. image:: https://travis-ci.com/adafruit/Adafruit_CircuitPython_lifx.svg?branch=master\n    :target: https://travis-ci.com/adafruit/Adafruit_CircuitPython_lifx\n    :alt: Build Status\n\nControl `LIFX devices \u003chttps://www.lifx.com\u003e`_ over the internet using CircuitPython.\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n\nYou'll also need a library to communicate with an ESP32 as a coprocessor using a WiFiManager object. This library supports connecting an ESP32 using either SPI or UART.\n\n* SPI: `Adafruit CircuitPython ESP32SPI \u003chttps://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI\u003e`_\n\n* UART: `Adafruit CircuitPython ESP_ATcontrol \u003chttps://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://github.com/adafruit/Adafruit_CircuitPython_Bundle\u003e`_.\n\nInstalling from PyPI\n--------------------\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI \u003chttps://pypi.org/project/adafruit-circuitpython-lifx/\u003e`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-lifx\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install adafruit-circuitpython-lifx\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .env\n    source .env/bin/activate\n    pip3 install adafruit-circuitpython-lifx\n\nUsage Example\n=============\n\nInitialize the LIFX API Client with a WiFiManager object and a\n`LIFX Personal Access token \u003chttps://cloud.lifx.com/settings\u003e`_:\n\n.. code-block:: python\n\n    lifx = adafruit_lifx.LIFX(wifi, lifx_token)\n\nSet a `LIFX selector \u003chttps://api.developer.lifx.com/docs/selectors\u003e`_ label to identify the LIFX device to communicate with.\n\n.. code-block:: python\n\n    lifx_light = 'label:Lamp'\n\nList all connected LIFX devices:\n\n.. code-block:: python\n\n    lights = lifx.list_lights()\n\nToggle the state of a LIFX device:\n\n.. code-block:: python\n\n    lifx.toggle_light(lifx_light)\n\nSet the brightness of a LIFX device to 50%:\n\n.. code-block:: python\n\n    lifx.set_brightness(lifx_light, 0.5)\n\nSet the color of a LIFX device to blue and the brightness to 100%:\n\n.. code-block:: python\n\n    lifx.set_color(lifx_light, 'on', 'blue', brightness=1.0)\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/adafruit/Adafruit_CircuitPython_lifx/blob/master/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n\nBuilding locally\n================\n\nZip release files\n-----------------\n\nTo build this library locally you'll need to install the\n`circuitpython-build-tools \u003chttps://github.com/adafruit/circuitpython-build-tools\u003e`_ package.\n\n.. code-block:: shell\n\n    python3 -m venv .env\n    source .env/bin/activate\n    pip install circuitpython-build-tools\n\nOnce installed, make sure you are in the virtual environment:\n\n.. code-block:: shell\n\n    source .env/bin/activate\n\nThen run the build:\n\n.. code-block:: shell\n\n    circuitpython-build-bundles --filename_prefix adafruit-circuitpython-lifx --library_location .\n\nSphinx documentation\n-----------------------\n\nSphinx is used to build the documentation based on rST files and comments in the code. First,\ninstall dependencies (feel free to reuse the virtual environment from above):\n\n.. code-block:: shell\n\n    python3 -m venv .env\n    source .env/bin/activate\n    pip install Sphinx sphinx-rtd-theme\n\nNow, once you have the virtual environment activated:\n\n.. code-block:: shell\n\n    cd docs\n    sphinx-build -E -W -b html . _build/html\n\nThis will output the documentation to ``docs/_build/html``. Open the index.html in your browser to\nview them. It will also (due to -W) error out on any warning like Travis will. This is a good way to\nlocally verify it will pass.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentru%2Fadafruit_circuitpython_lifx_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrentru%2Fadafruit_circuitpython_lifx_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrentru%2Fadafruit_circuitpython_lifx_api/lists"}