python-miio icon indicating copy to clipboard operation
python-miio copied to clipboard

set_rotate FanP10 sends the wrong command

Open BBPSBB opened this issue 5 years ago • 3 comments

Describe the bug

I wanted to ask if anyone has actually tested the set_rotate method in FanMiot. I'm using the FanP10 class with a P18 device as they have the same services definition. As far as I was able to test, everything works as expected except the set_rotate method.

This is the message that is being sent:

[{'did': 'set_move', 'siid': 2, 'piid': 9, 'value': ['right']}]

This is what I think should've been sent (it works):

[{'did': 'set_move', 'siid': 2, 'piid': 9, 'value': 2}]

the urn file for both p10 and p18 says value should be uint8 (if I understant that correctly)

               {
                    "iid": 9,
                    "description": "Motor Control",
                    "format": "uint8",
                    "access": [
                        "write"
                    ],
                    "unit": "none",
                    "value-list": [
                        {
                            "value": 0,
                            "description": "NO"
                        },
                        {
                            "value": 1,
                            "description": "LEFT"
                        },
                        {
                            "value": 2,
                            "description": "RIGHT"
                        }
                    ]
                },

Version information (please complete the following information):

  • OS: Linux,Windows
  • python-miio: 0.5.6

Device information: If the issue is specific to a device:

  • Model: P10 (I'm using it with P18 but hopefully that should not matter)
  • Hardware version: esp8266
  • Firmware version: 2.0.7

To Reproduce Steps to reproduce the behavior:

  1. try to send set_rotate command for an instance of FanP10 by: fan.set_rotate(MoveDirection("left"))
  2. the device beeps but nothing happens

Expected behavior device should turn 5°

Console output If applicable, add console output to help explain your problem. If the issue is about communication with a specific device, consider including the output using the --debug flag.

BBPSBB avatar Jun 20 '21 13:06 BBPSBB

Do you like to provide a PR?

syssi avatar Jun 20 '21 17:06 syssi

Do you like to provide a PR?

I submitted a possible fix for it. P9,P10,P11 (P15,P18) all should expect the same values.

BBPSBB avatar Jun 20 '21 19:06 BBPSBB

Closed with #1078.

rytilahti avatar Jun 25 '21 15:06 rytilahti