delfick / photons

Python3.6+ asyncio framework for interacting with LIFX devices
https://photons.delfick.com
MIT License
73 stars 6 forks source link

Beam "effects/run" question #105

Closed gabemunro closed 2 years ago

gabemunro commented 2 years ago

Hi there -

Again, thank you, this tool is 1000% the missing link in making my Beam more useful in my setup.

In a past version of interactor there was the ability to set the direction of an effect (again, on a Beam here, so it constitutes like 25% of my animation possibilities 😂) but I can not seem to find info on it anywhere. Did that go away when "effects/run" was introduced? I know that I could go the route of sending a series of commands and use "set" after applying a theme, but I'm not 100% sure I can send more than one command at once to Interactor.

For example, I'm sending this command:

{ "command": "effects/run", "args": { "matcher": { "product_identifier": "lifx_beam" }, "apply_theme": true, "theme_options": { "colors": [ {"kelvin": 1750, "brightness": 0.30}, {"kelvin": 8000, "brightness": 0.30} ], "theme": "HORIZONTAL_STRIPE" }, "linear_animation": "MOVE", "linear_options": { "speed": 90 } } }

Is it possible to control direction still within "effects/run"?

Also I feel like my usage of "HORIZONTAL_STRIPE" and "SPLOTCH" must be incorrect, as when I send it as above it just leverages the splotch.

You two are doing the lords work here. lol

Thank you in advance, and please forgive me if there is a glaringly obvious answer somewhere that I totally overlooked.

delfick commented 2 years ago

Again, thank you, this tool is 1000% the missing link in making my Beam more useful in my setup.

yay :)

and please forgive me if there is a glaringly obvious answer somewhere that I totally overlooked.

There's basically zero documentation for the interactor, and it won't be fixed anytime soon (or probs ever tbh), I will happily answer questions as a result hahha

Also I feel like my usage of "HORIZONTAL_STRIPE" and "SPLOTCH" must be incorrect, as when I send it as above it just leverages the splotch.

I deleted them when I did this https://github.com/delfick/photons-core/pull/17

Is it possible to control direction still within "effects/run"?

You want "linear_options": {"speed": 90, "speed_direction": "RIGHT"} (or "LEFT") - (long chain leads to here)

I can send more than one command at once to Interactor.

One command at a time, few commands do multiple things. Effects/run essentially does in that it can apply a theme first though!

You two are doing the lords work here. lol

:)

gabemunro commented 2 years ago

I genuinely do appreciate your responsiveness and willingness to help. It's not always common on GitHub lol

You want "linear_options": {"speed": 90, "speed_direction": "RIGHT"} (or "LEFT")

Strange. Gave that a shot, but it doesn't seem to want to obey. Tried both "RIGHT" and "LEFT" and they both flow from right to left.

{
    "command": "effects/run",
    "args": {
        "matcher": {
            "product_identifier": "lifx_beam"
        },
        "apply_theme": true,
        "theme_options": {
            "colors": [
                {"kelvin": 2000, "brightness": 0.30},
                {"kelvin": 5500, "brightness": 0.20},
                {"kelvin": 5500, "brightness": 0.10},
                {"kelvin": 5500, "brightness": 0.00}
            ]
        },
        "linear_animation": "MOVE",
        "linear_options": {
          "speed": 10, "speed_direction": "RIGHT"
        }

    }
}

Unless there's something wrong with the string I'm sending? Speed is obeyed, but speed_direction is ignored.

Anyway, I don't want to trouble you with bug hunting here. I can live without the direction control. Just being able to use this with HomeBridge to trigger animations vs. solid colors only is enough for me. :-)

Again, thank you for the timely response. Hope you're doing well!

Cheers

delfick commented 2 years ago

I genuinely do appreciate your responsiveness and willingness to help. It's not always common on GitHub lol

I know what you mean hehehe

Strange. Gave that a shot, but it doesn't seem to want to obey.

I brought out a beam and had a play and I now I remember how this works. You want this

{
    "command": "effects/run",
    "args": {
        "matcher": {
            "product_identifier": "lifx_beam"
        },
        "apply_theme": true,
        "theme_options": {
            "colors": [
                {"kelvin": 2000, "brightness": 0.30},
                {"kelvin": 5500, "brightness": 0.20},
                {"kelvin": 5500, "brightness": 0.10},
                {"kelvin": 5500, "brightness": 0.00}
            ]
        },
        "linear_animation": "MOVE",
        "linear_options": {
          "speed": 10, "parameters": {"speed_direction": "RIGHT"}
        }
    }
}

because photons doesn't inline the options when the field is "dynamic" so speed_direction should be in a "parameters" and then it works

Anyway, I don't want to trouble you with bug hunting here

Nah, this is fine. I don't have time or the mental space to work on photons so much, but very happy to help people figure out how to use it :)

Hope you're doing well!

2022 has been horrible but I'm starting to stabilise again, so that's nice :)

Just being able to use this with HomeBridge to trigger animations vs. solid colors only is enough for me. :-)

:)

gabemunro commented 2 years ago

Dope! Works like a charm. Thank you so much!