{"id":18607342,"url":"https://github.com/addono/teknibridge","last_synced_at":"2025-11-02T15:30:26.551Z","repository":{"id":82277194,"uuid":"228012044","full_name":"Addono/TekniBridge","owner":"Addono","description":"Mirror from the main repository hosted in Gitlab. Issues are handled there.","archived":false,"fork":false,"pushed_at":"2023-03-21T22:32:56.000Z","size":4164,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-12-27T00:27:26.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://gitlab.com/tekniot/teknibridge","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Addono.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-14T11:31:51.000Z","updated_at":"2020-02-20T14:18:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"09c120a3-883a-436a-87ee-62a802142ff8","html_url":"https://github.com/Addono/TekniBridge","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/Addono%2FTekniBridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FTekniBridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FTekniBridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Addono%2FTekniBridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Addono","download_url":"https://codeload.github.com/Addono/TekniBridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239395876,"owners_count":19631336,"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":[],"created_at":"2024-11-07T02:29:09.482Z","updated_at":"2025-11-02T15:30:26.507Z","avatar_url":"https://github.com/Addono.png","language":"Python","readme":"# TekniBridge\n\n[![GitLab pipeline](https://img.shields.io/gitlab/pipeline/ioteknikringen/teknibridge?style=for-the-badge)](https://gitlab.com/ioteknikringen/teknibridge/builds) [![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://img.shields.io/badge/Project%20Status-Active-brightgreen?style=for-the-badge)](https://www.repostatus.org/#active) [![Licence](https://img.shields.io/badge/Licence-BSD_2--Clause-black?style=for-the-badge)](./LICENCE)\n\n## Table of Contents\n+ [About](#about)\n+ [Getting Started](#getting_started)\n+ [Testing](#testing)\n+ [Usage](#usage)\n\n## About \u003ca name = \"about\"\u003e\u003c/a\u003e\nThis project is part of TekniIoT, a simple DIY IoT lighting project. Specifically, this is the bridge between [TekniFront](https://gitlab.com/ioteknikringen/teknifront) and the light controllers. Currently, two light controllers are supported: WS2811 LED strips and Yeelight WiFi bulbs.\n\n## Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\nThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See [usage](#usage) for notes on how to deploy the project on a Raspberry Pi.\n\n### Prerequisites\nThis project requires Python 3, currently only 3.7 is actively supported and tested.\n\nWe will be using a virtual environment for our Python installation. Install either [`virtualenv`](https://virtualenv.pypa.io/en/stable/installation.html) or [`direnv`](https://direnv.net/docs/installation.html) if you haven't already.\n\n### Installing\u003ca name = \"installing\"\u003e\u003c/a\u003e\nSetup `virtualenv`:\n```bash\n# Create a virtual Python environment.\nvirtualenv venv\n\n# Activate the virtual environment.\nsource venv/bin/activate\n```\n\nOr as an alternative to `virtualenv`, one can use `direnv`:\n```bash\necho \"layout_python3\" \u003e .envrc\ndirenv allow\n```\n\nInstall all `pip` dependencies.\n```bash\npip install -r requirements.txt\n\n# Optional dev dependencies, e.g. needed for static code analysis tools\npip install -r requirements-dev.txt\n```\n\nNow the application can be started with:\n```bash\npython src/cli.py\n```\n\nOr if you want to have the simulator enabled:\n```bash\nSIMULATE=1 python src/cli.py\n```\nWhich will look something like this:\n![Screenrecording](./docs/img/screenrecording_visualizer.gif)\n\n\n## Testing\u003ca name = \"testing\"\u003e\u003c/a\u003e\nIn order to run the tests, you have to have the optional development dependencies installed in [Installing](#installing)\n\nRun `pyre` to check the type hinting, the CI will fail when this check won't pass:\n```bash\npyre --source-directory src/ check\n```\n\n## Usage \u003ca name = \"usage\"\u003e\u003c/a\u003e\n### Deploy to Raspberry Pi\n\nIf you want to use this project to control an LED strip using PWM, then you will need to disable the audio output first. Run the following command to prevent audio from being enabled at startup, afterwards reboot for the changes to take effect.\n\n```bash\nsudo mkdir  /etc/modprobe.d \u0026\u0026 echo \"blacklist snd_bcm2835\" \u003e sudo tee -a /etc/modprobe.d/alsa-blacklist.conf\n\nsudo reboot now\n```\n\nThe default method of deploying to production environments is by using continious deployment, which can be found in [.gitlab-ci.yml](./.gitlab-ci.yml). To set this up:\n  1. Fork this repository on Gitlab, either Gitlab.com any other instance works. Alternatively, you can use any Git remote and use [Gitlab's mirroring](https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html) to handle the contrinious deployment for you.\n  2. [Install the Gitlab Runner](https://docs.gitlab.com/runner/install/linux-repository.html) on your Raspberry Pi.\n  3. Make the `gitlab-runner` user root. This is necessary, as we will need elevated rights when deploying this codebase as a Unix service.\n  4. Register the [Gitlab runner](https://docs.gitlab.com/runner/register/):\n     1. `sudo gitlab-runner register`\n     2. `Please enter the gitlab-ci coordinator URL (e.g. https://gitlab.com )` \n        Enter the hostname of your Gitlab instance, if you forked this project, then it will be `https://gitlab.com`.\n     3. `Please enter the gitlab-ci token for this runner` :\n        Go to the fork of this repository, under `Settings \u003e CI/CD \u003e Runners` you will find the registration token, add it here.\n     4. `Please enter the gitlab-ci description for this runner`\n        Give your runner a name, this can be whatever you like.\n     5. `Please enter the gitlab-ci tags for this runner (comma separated):`\n        Tag this instance, the pipeline will look for the `production` tag, hence this needs to be present to work. However, you're free to add other tags as well.\n     6. `Please enter the executor: ssh, docker+machine, docker-ssh+machine, kubernetes, docker, parallels, virtualbox, docker-ssh, shell:`\n        Enter `shell`.\n  5. If no pipeline is automatically started, go to your fork and under \"CI / CD\" you can initiate a new pipeline, which should provision your Raspberry Pi and deploy the project.\n\n### Prepare Yeelight\n\nUse the Yeelight app to enable LAN Control of all lights you want the bridge to control. After deployment, all lights on the local network are automatically picked up and \"bridged\". This will take at least 10 seconds after the bridge is started.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fteknibridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faddono%2Fteknibridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faddono%2Fteknibridge/lists"}