Skip to content

Conversation

@duvholt
Copy link
Contributor

@duvholt duvholt commented May 28, 2025

Using timed_effects made it much easier to inspect the zigbee message output of running the sunrise effect, so I tweaked EffectDuration to be as accurate as possible. Unfortunately that revealed some edge cases that didn't fit the existing model which made the conversion function uglier.

To test "timed effects" send a PUT request with

{
  "on": {
    "on": true
  },
  "timed_effects": {
    "effect": "sunrise",
    "duration": 60000
  }
}

Duration is in milliseconds.

One thing that is missing is updating timed_effects.status. Since that can easily lead to concurrency issues I'll keep that out of the scope for now.

Oh, and as a bonus I added the sunset effect 🌆

{
  "on": {
    "on": true
  },
  "timed_effects": {
    "effect": "sunset",
    "duration": 60000
  }
}

@chrivers
Copy link
Owner

Hey - sorry I completely overlooked this somehow 😅

I'll take a look now!

@chrivers
Copy link
Owner

Do we know what timed_effects.status is supposed to contain? What's the expected value(s)?

@duvholt
Copy link
Contributor Author

duvholt commented Jun 2, 2025

Do we know what timed_effects.status is supposed to contain? What's the expected value(s)?

status is set to e.g. sunset while the sunset effect is still running from what I can remember. After that it goes back to no_effect.

@chrivers
Copy link
Owner

chrivers commented Jun 2, 2025

Fantastic work 👍

Let's get it merged :)

@chrivers chrivers merged commit 12d9e37 into chrivers:master Jun 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants