Skip to content

Commit

Permalink
Merge pull request #14 from recoskyler/dev
Browse files Browse the repository at this point in the history
WebHook RGB Data, Tick WebHook, and Animations!
  • Loading branch information
recoskyler authored May 29, 2024
2 parents 03d1a15 + 95eda68 commit e7afebe
Show file tree
Hide file tree
Showing 18 changed files with 50,607 additions and 50,019 deletions.
57 changes: 49 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,54 @@ A simple, cross-platform Pomodoro timer app with WebHook support.

## 🌐 Using WebHooks

You can configure WebHooks from the **Settings** page.
You can configure WebHooks from the **Settings** page. When a webhook is triggered, RGB color data in JSON format will be sent along (check below). This RGB color data corresponds to the color of the circular progress indicator on the home page. You can see an example of this data below:

```json
{
"rgb": [
255, // RED Value
0, // GREEN Value
156, // BLUE Value
]
}
```

### Triggering multiple webhooks

If you would like to trigger multiple WebHook URLs from a single event, you can enter multiple URLs separated by a comma. e.g.:

`https://example.com/api/v1/webhooks/start,https://example2.com/api/v1/webhooks/toggle`

The main reason I created this application was to use these WebHooks to control my ambient light using HomeAssistant.
### HomeAssistant Integration

The main reason I created this application was to use these WebHooks to control my ambient light using HomeAssistant. If you have an RGB(W) LED bulb connected to HomeAssistant, you can [create a new WebHook automation](https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger), and use the sample configuration below to set your light bulb's color to the data provided by Pomo:

```yaml
alias: Timer Tick Webhook
description: "Runs every second, whenever Pomo ticks."
trigger:
- platform: webhook
allowed_methods:
- POST
- PUT
local_only: true
webhook_id: "-YOUR_WEBHOOK_ID"
condition:
- condition: device
type: is_on
device_id: REPLACE_WITH_DEVICE_ID
entity_id: REPLACE_WITH_ENTITY_ID
domain: light
action:
- service: light.turn_on
metadata: {}
data:
rgb_color: "{{ trigger.json['rgb'] }}"
transition: 1
target:
entity_id: light.192_168_1_3
mode: single
```
## Installing
Expand Down Expand Up @@ -125,14 +166,14 @@ Widget build(BuildContext context) {
Update the `CFBundleLocalizations` array in the `Info.plist` at `ios/Runner/Info.plist` to include the new locale.

```xml
...
...

<key>CFBundleLocalizations</key>
<array>
<string>en</string>
</array>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
</array>

...
...
```

### Adding Translations
Expand Down
34 changes: 34 additions & 0 deletions docs/assets/NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -5005,6 +5005,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
cross_file
flutter_plugin_android_lifecycle
flutter_shaders
path_provider
path_provider_android
path_provider_foundation
Expand Down Expand Up @@ -7679,6 +7680,39 @@ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
flutter_animate

BSD 3-Clause License

Copyright (c) 2022, Grant Skinner
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--------------------------------------------------------------------------------
flutter_launcher_icons

Expand Down
Binary file modified docs/assets/fonts/MaterialIcons-Regular.otf
Binary file not shown.
12 changes: 6 additions & 6 deletions docs/flutter_service_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';

const RESOURCES = {"index.html": "6aa23a302c1a52e178f3ab23f67d2a89",
"/": "6aa23a302c1a52e178f3ab23f67d2a89",
const RESOURCES = {"index.html": "6a2818d7c42df3826af0351852c5f6d5",
"/": "6a2818d7c42df3826af0351852c5f6d5",
"favicon.png": "97c30df063e615f531e285ddf9d1df05",
"main.dart.js": "fdc5fc0f12e08a42d7be53ede8713140",
"version.json": "089bdb81fac91ec19ed8adebe1e4445c",
"main.dart.js": "4f50b35e752a8dee228dfa12ba069fa0",
"version.json": "74a62abde735d40e7b9f7c831ddbdc4b",
"manifest.json": "223147f174feb2f5b573a1bed1c7b544",
"icons/favicon.png": "7a26ea9d4e61122fc023b84e5acdb148",
"icons/Icon-maskable-192.png": "cb962430065f58e762f952b986e04f11",
Expand All @@ -29,12 +29,12 @@ const RESOURCES = {"index.html": "6aa23a302c1a52e178f3ab23f67d2a89",
"assets/packages/window_manager/images/ic_chrome_close.png": "75f4b8ab3608a05461a31fc18d6b47c2",
"assets/packages/window_manager/images/ic_chrome_unmaximize.png": "4a90c1909cb74e8f0d35794e2f61d8bf",
"assets/packages/window_manager/images/ic_chrome_maximize.png": "af7499d7657c8b69d23b85156b60298c",
"assets/NOTICES": "6f2a5d46623fb9a07cec7495a43ea810",
"assets/NOTICES": "2f69342f189e6178f9c5327c40c842d5",
"assets/AssetManifest.bin.json": "69adac776f49f03f9acbf2699755148e",
"assets/AssetManifest.json": "b341fe4a83430400db3531f71f0c5884",
"assets/shaders/ink_sparkle.frag": "ecc85a2e95f5e9f53123dcaf8cb9b6ce",
"assets/AssetManifest.bin": "37cc1b6a3835bf435402adf00211b335",
"assets/fonts/MaterialIcons-Regular.otf": "eee07693718082a05f31462d0a8c07a9",
"assets/fonts/MaterialIcons-Regular.otf": "16e44d359f85efde241d05a66bd9790c",
"assets/fonts/RubikMonoOne-Regular.ttf": "f5486d33c22f837e905d600a5407da06",
"assets/fonts/LilitaOne-Regular.ttf": "ce83b4bfa37f53ea2a3fc97088af7181",
"assets/fonts/MajorMonoDisplay-Regular.ttf": "e7acc228230d22332855765872b0a3bf",
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
const serviceWorkerVersion = "3975294873";
const serviceWorkerVersion = "3454321290";
var scriptLoaded = false;
function loadMainDartJs() {
if (scriptLoaded) {
Expand Down
Loading

0 comments on commit e7afebe

Please sign in to comment.