https://github.com/jimbobbennett/neopixel-holiday-lights-controller-function
An Azure Function to control the lights set up at using the code at aka.ms/NeopixelHolidayLights
https://github.com/jimbobbennett/neopixel-holiday-lights-controller-function
azure azure-functions flask iot neopixel python
Last synced: about 2 months ago
JSON representation
An Azure Function to control the lights set up at using the code at aka.ms/NeopixelHolidayLights
- Host: GitHub
- URL: https://github.com/jimbobbennett/neopixel-holiday-lights-controller-function
- Owner: jimbobbennett
- License: mit
- Created: 2020-12-11T01:56:11.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-11T03:09:53.000Z (over 5 years ago)
- Last Synced: 2025-04-05T02:25:05.926Z (about 1 year ago)
- Topics: azure, azure-functions, flask, iot, neopixel, python
- Language: Python
- Homepage: https://aka.ms/NeopixelHolidayLights
- Size: 146 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Neopixel holiday lights controller function
An Azure Function to control the lights set up at using the code at [aka.ms/NeopixelHolidayLights](https://aka.ms/NeopixelHolidayLights).
To use this function app:
1. Complete the lab at [aka.ms/NeopixelHolidayLights](https://aka.ms/NeopixelHolidayLights) to create the IoT powered holiday lights
1. Add the following entries to the `local.settings.json` file:
| Key | Value |
| --- | ----- |
| API_KEY | An IoT Central API key for your light controller app with at least operator permissions |
| IOT_CENTRAL_APP_URL_ROOT | Your IoT Central app name (the first part of the IoT Central URL before `.azureiotcentral.com`) |
| INTERFACE_IDENTITY_NAME | The name of the identity of your interface |
You can get the interface identity name by selecting the interface in the device templates, then selecting **View identity** and getting the value of the *Name* field.

1. Run the functions app locally or deploy to Azure
To use the `On` function, pass the colour requested as a query string:
> Note the English spelling of colour! 🏴
```sh
http://localhost:7071/api/LightsOn?colour=FF0000
```
To use the `Off` function, just call the API directly:
```sh
http://localhost:7071/api/LightsOff
```