Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_rotate FanP10 sends the wrong command #1076

Closed
pooyashahidi opened this issue Jun 20, 2021 · 3 comments
Closed

set_rotate FanP10 sends the wrong command #1076

pooyashahidi opened this issue Jun 20, 2021 · 3 comments
Labels

Comments

@pooyashahidi
Copy link
Contributor

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.

@syssi
Copy link
Collaborator

syssi commented Jun 20, 2021

Do you like to provide a PR?

@pooyashahidi
Copy link
Contributor Author

pooyashahidi commented Jun 20, 2021

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.

rytilahti added a commit that referenced this issue Jun 24, 2021
* Fix set_rotate for fans

* Add suggestions from rytilahti

Co-authored-by: Teemu R. <[email protected]>

Co-authored-by: Teemu R. <[email protected]>
@rytilahti
Copy link
Owner

Closed with #1078.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants