delfick / photons

Python3.6+ asyncio framework for interacting with LIFX devices

Home Page:https://photons.delfick.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Interactor's transform command is ignoring transform_options

Djelibeybi opened this issue · comments

I've only recently realised that Interactor's transform command no longer seems to be enabling the transform_options array. Specifying the options via the lifx command-line tool works fine.

The following json works fine when passed to lifx:

{
  "power": "on",
  "color": "red",
  "brightness": 1,
  "duration": 9,
  "transform_options": {
    "transition_color": true
  }
}

However, if I send that json as the arguments to transform, it doesn't work:

{
  "command": "transform",
  "args": {
    "matcher": {
      "serial": "112233445566"
    },
    "transform": {
      "power": "on",
      "hue": 0, 
      "saturation": 0, 
      "brightness": 0.9, 
      "kelvin": 4500,
      "duration": 9,
      "transform_options": {
        "transition_color": true
      }
    }
  }
}

I even tried bringing transform_options up a level, but this doesn't work either:

{
  "command": "transform",
  "args": {
    "matcher": {
      "serial": "112233445566"
    },
    "transform": {
      "power": "on",
      "hue": 0,
      "saturation": 0,
      "brightness": 0.9,
      "kelvin": 4500,
      "duration": 9
    },
    "transform_options": {
      "transition_color": true
    }
  }
}

Yeah, it should be the second one where transform_options is separate to transform.

You sure you have a new enough interactor?

Should have this https://github.com/delfick/photons/blob/main/apps/interactor/interactor/commander/commands/control.py#L128

Let me double-check the Docker image.

Docker image is up-to-date and has that code. But I'll update it anyway and re-test.

Not sure if it was user error or the docker pull that did it, but it's working now. Sorry for the noise.